:root {
    --primary: #4A90E2;
    --primary-dark: #3A7BC8;
    --secondary: #50C878;
    --accent: #FF9500;
    --bg: #F5F7FA;
    --surface: #FFFFFF;
    --text: #333333;
    --text-light: #666666;
    --text-muted: #999999;
    --border: #E8ECF0;
    --shadow: 0 4px 12px rgba(0,0,0,0.08);
    --radius: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

body {
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

.page {
    display: none;
    min-height: 100vh;
}

.page.active {
    display: block;
}

/* 登录页 */
#page-login {
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.page.active#page-login {
    display: flex;
}

.login-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 40px 24px;
    width: 100%;
    max-width: 360px;
    text-align: center;
    box-shadow: var(--shadow);
}

.logo {
    font-size: 56px;
    margin-bottom: 12px;
}

.login-card h1 {
    font-size: 22px;
    margin-bottom: 4px;
}

.subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 24px;
}

.login-card input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 15px;
    margin-bottom: 16px;
    outline: none;
}

.login-card input:focus {
    border-color: var(--primary);
}

.login-card button {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    background: var(--primary);
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.error {
    color: #E53935;
    font-size: 13px;
    margin-top: 12px;
    min-height: 18px;
}

/* 后台页头 */
.page-header {
    background: var(--surface);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 10;
}

.page-header h1 {
    font-size: 18px;
    font-weight: 600;
}

.btn-back {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text);
    cursor: pointer;
    padding: 4px;
}

.btn-logout {
    background: none;
    border: 1px solid var(--border);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-light);
    cursor: pointer;
}

/* 容器 */
.admin-container {
    padding: 20px;
    max-width: 1000px;
    margin: 0 auto;
}

/* 概览卡片 */
.stats-overview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 20px 12px;
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-value {
    font-size: 26px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
}

/* 日期选择 */
.date-picker {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.date-picker input {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
}

/* 区块 */
.section {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.section h2 {
    font-size: 16px;
    margin-bottom: 16px;
    font-weight: 600;
}

/* 用户列表 */
.user-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.user-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-radius: 12px;
    background: var(--bg);
    cursor: pointer;
    transition: transform 0.2s;
}

.user-item:hover {
    transform: translateY(-2px);
}

.user-info {
    flex: 1;
}

.user-name {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 4px;
}

.user-meta {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.6;
}

.user-stats-multiple {
    display: flex;
    gap: 16px;
    text-align: right;
}

.user-stat .value {
    font-size: 16px;
    font-weight: 700;
    color: var(--secondary);
}

.user-stat .label {
    font-size: 11px;
    color: var(--text-muted);
}

/* 用户画像 */
.profile-section {
    margin-bottom: 20px;
}

.profile-section:last-child {
    margin-bottom: 0;
}

.profile-section-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--border);
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0 16px;
}

.profile-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.profile-item .label {
    color: var(--text-muted);
    flex-shrink: 0;
    margin-right: 12px;
}

.profile-item .value {
    color: var(--text);
    text-align: right;
    word-break: break-all;
    max-width: 70%;
}

/* 表格 */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th {
    text-align: left;
    padding: 12px 8px;
    border-bottom: 1px solid var(--border);
    color: var(--text-light);
    font-weight: 600;
    font-size: 12px;
    white-space: nowrap;
}

.data-table td {
    padding: 12px 8px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    white-space: nowrap;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-passed {
    background: #E8F5E9;
    color: var(--secondary);
}

.badge-failed {
    background: #FFF3E0;
    color: var(--accent);
}

.score-value {
    font-weight: 700;
    color: var(--primary);
    margin-right: 8px;
}

.loading, .empty {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-size: 14px;
}

#trend-chart {
    width: 100%;
    height: 250px;
}

/* 响应式 */
@media (max-width: 600px) {
    .stats-overview {
        grid-template-columns: repeat(2, 1fr);
    }

    .user-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .user-stats-multiple {
        width: 100%;
        justify-content: space-between;
        text-align: left;
    }

    .profile-grid {
        grid-template-columns: 1fr;
    }
}
