/* 云却梦的家 - 管理后台样式 */
/* 浅色调设计，清新自然 */

:root {
    --primary: #4a6fa5;
    --primary-light: #6b8fc5;
    --bg: #f8f6f3;
    --bg-card: #ffffff;
    --bg-hover: #f0ece8;
    --text: #2d3436;
    --text-light: #636e72;
    --border: #e0dbd5;
    --success: #00b894;
    --warning: #f39c12;
    --error: #e74c3c;
    --shadow: 0 2px 12px rgba(0,0,0,0.06);
    --shadow-hover: 0 8px 24px rgba(0,0,0,0.1);
    --radius: 10px;
    --radius-lg: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

.page {
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

/* ========== 登录页面 ========== */
.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg-card);
    padding: 24px;
}

.login-container h1 {
    color: var(--text);
    font-size: 2rem;
    margin-bottom: 4px;
}

.login-container h2 {
    color: var(--text-light);
    font-weight: 400;
    margin-bottom: 32px;
    font-size: 1.1rem;
}

#login-form {
    background: var(--bg-card);
    padding: 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-hover);
    width: 100%;
    max-width: 380px;
    border: 1px solid var(--border);
}

#login-form input {
    width: 100%;
    padding: 12px 14px;
    margin-bottom: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    background: var(--bg);
    color: var(--text);
}

#login-form input:focus {
    outline: none;
    border-color: var(--primary);
}

#login-form button {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

#login-form button:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
}

#login-error {
    color: var(--error);
    text-align: center;
    margin-top: 12px;
    font-size: 0.9rem;
}

/* ========== 管理后台布局 ========== */
.navbar {
    background: var(--bg-card);
    padding: 0 20px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border);
}

.nav-brand {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
}

.nav-menu {
    display: flex;
    gap: 4px;
}

.nav-menu a {
    padding: 8px 14px;
    text-decoration: none;
    color: var(--text-light);
    border-radius: var(--radius);
    font-size: 0.9rem;
    transition: all 0.2s;
}

.nav-menu a:hover,
.nav-menu a.active {
    background: var(--bg-hover);
    color: var(--text);
}

#logout-btn {
    color: var(--error) !important;
    font-weight: 500;
}

/* ========== 视图 ========== */
.view {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.view h2 {
    margin-bottom: 16px;
    font-weight: 600;
    font-size: 1.3rem;
}

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

/* ========== 按钮 ========== */
.btn-primary, .btn-secondary, .btn-small {
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-hover);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-small {
    padding: 5px 10px;
    font-size: 0.8rem;
    background: var(--primary);
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--error);
    color: white;
}

/* ========== 统计卡片 ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--bg-card);
    padding: 20px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.stat-icon {
    font-size: 2rem;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    color: var(--text-light);
    font-size: 0.85rem;
}

.quick-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

/* ========== 筛选栏 ========== */
.filter-bar {
    background: var(--bg-card);
    padding: 12px 16px;
    border-radius: var(--radius);
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.filter-bar select {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    background: var(--bg);
    color: var(--text);
}

/* ========== 作品列表 ========== */
.works-list {
    display: grid;
    gap: 12px;
}

.work-item {
    background: var(--bg-card);
    padding: 16px;
    border-radius: var(--radius-lg);
    display: flex;
    gap: 14px;
    align-items: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.work-item:hover {
    box-shadow: var(--shadow-hover);
}

.work-item img {
    width: 100px;
    height: 70px;
    object-fit: cover;
    border-radius: var(--radius);
    background: var(--bg-hover);
}

.work-info {
    flex: 1;
}

.work-info h3 {
    font-size: 1rem;
    margin-bottom: 2px;
}

.work-meta {
    display: flex;
    gap: 12px;
    color: var(--text-light);
    font-size: 0.8rem;
    margin: 4px 0;
}

.status-badge {
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-published {
    background: #d4edda;
    color: #155724;
}

.status-draft {
    background: #fff3cd;
    color: #856404;
}

.status-private {
    background: #e2e3e5;
    color: #383d41;
}

.work-actions {
    display: flex;
    gap: 6px;
}

/* ========== 模态框 ========== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 16px;
}

.modal-content {
    background: var(--bg-card);
    padding: 24px;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border);
}

.modal-content h3 {
    margin-bottom: 16px;
    font-size: 1.2rem;
}

/* ========== 表单 ========== */
.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: inherit;
    background: var(--bg);
    color: var(--text);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 16px;
}

.loading {
    text-align: center;
    padding: 32px;
    color: var(--text-light);
}

/* ========== 评论列表 ========== */
.comments-list {
    display: grid;
    gap: 12px;
}

.comment-item {
    background: var(--bg-card);
    padding: 14px 16px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.comment-author {
    font-weight: 600;
}

.comment-time {
    color: var(--text-light);
    font-size: 0.8rem;
}

.comment-content {
    padding: 10px 12px;
    background: var(--bg-hover);
    border-radius: var(--radius);
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.comment-actions {
    display: flex;
    gap: 6px;
}

/* ========== ASR列表 ========== */
.asr-list {
    display: grid;
    gap: 12px;
}

.asr-item {
    background: var(--bg-card);
    padding: 14px 16px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.asr-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.asr-text {
    padding: 12px;
    background: var(--bg-hover);
    border-radius: var(--radius);
    font-size: 0.9rem;
    white-space: pre-wrap;
    max-height: 150px;
    overflow-y: auto;
    font-family: monospace;
}

.asr-status {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
}

.asr-processing {
    background: #fff3cd;
    color: #856404;
}

.asr-completed {
    background: #d4edda;
    color: #155724;
}

.asr-failed {
    background: #f8d7da;
    color: #721c24;
}

/* ========== 修改密码 ========== */
.settings-form {
    background: var(--bg-card);
    padding: 24px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    max-width: 450px;
}

.settings-form .message {
    margin-top: 12px;
    font-size: 0.9rem;
}

/* ========== 响应式 ========== */
@media (max-width: 640px) {
    .navbar {
        flex-direction: column;
        height: auto;
        padding: 10px 12px;
    }
    
    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
        margin-top: 8px;
    }
    
    .view {
        padding: 12px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .work-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .work-item img {
        width: 100%;
        height: 120px;
    }
    
    .work-actions {
        flex-wrap: wrap;
        width: 100%;
    }
    
    .work-actions button {
        flex: 1;
        min-width: 60px;
    }
    
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-bar select,
    .filter-bar button {
        width: 100%;
    }
}