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

:root {
    --primary: #4f6ef7;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #06b6d4;
    --gray: #6b7280;
    --bg: #f3f4f6;
    --card-bg: #fff;
    --text: #1f2937;
    --text-muted: #9ca3af;
    --border: #e5e7eb;
    --radius: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Login */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    background: #fff;
    padding: 40px 32px;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    width: 100%;
    max-width: 400px;
    margin: 16px;
}

.login-title {
    text-align: center;
    font-size: 22px;
    color: var(--text);
    margin-bottom: 24px;
}

.login-form .form-group { margin-bottom: 16px; }
.login-form label { display: block; margin-bottom: 6px; font-weight: 500; color: var(--text); }
.login-form input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 15px;
    transition: border-color 0.2s;
}
.login-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,110,247,0.15);
}

.captcha-row {
    display: flex;
    gap: 10px;
    align-items: center;
}
.captcha-input {
    flex: 1;
    min-width: 0;
}
.captcha-img {
    height: 42px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    flex-shrink: 0;
}

.login-footer {
    text-align: center;
    padding-top: 20px;
    margin-top: 20px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.login-footer a {
    color: var(--text-muted);
}

/* Navbar */
.navbar {
    background: #fff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}
.nav-brand {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
}
.nav-brand:hover { text-decoration: none; color: var(--primary); }
.nav-menu {
    display: flex;
    align-items: center;
    gap: 4px;
}
.nav-link {
    padding: 8px 14px;
    border-radius: var(--radius);
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s;
}
.nav-link:hover { background: var(--bg); text-decoration: none; }
.nav-link.active { background: var(--primary); color: #fff; }
.nav-link.active:hover { background: var(--primary); }
.nav-toggle { display: none; background: none; border: none; font-size: 24px; cursor: pointer; padding: 4px 8px; color: var(--text); }

/* Main */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 16px 40px;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text);
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}
.page-header .page-title { margin-bottom: 0; }
.page-actions { display: flex; gap: 8px; }

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border-left: 4px solid var(--primary);
}
.stat-card.stat-blue { border-left-color: #4f6ef7; }
.stat-card.stat-green { border-left-color: #22c55e; }
.stat-card.stat-orange { border-left-color: #f59e0b; }
.stat-card.stat-red { border-left-color: #ef4444; }
.stat-card.stat-purple { border-left-color: #a855f7; }
.stat-card.stat-cyan { border-left-color: #06b6d4; }
.stat-number {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 4px;
    word-break: break-all;
}
.stat-label { font-size: 13px; color: var(--text-muted); }

/* Card */
.card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    margin-bottom: 20px;
    overflow: hidden;
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 15px;
}
.card-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    font-size: 13px;
}

/* Toolbar */
.year-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.year-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 6px;
    background: #f1f5f9;
    color: #475569;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s;
    border: 1px solid transparent;
}
.year-tab:hover {
    background: #e2e8f0;
    color: #1e293b;
}
.year-tab.active {
    background: #1e40af;
    color: #fff;
    border-color: #1e40af;
}
.year-tab.active .year-badge {
    background: rgba(255,255,255,0.25);
    color: #fff;
}
.year-badge {
    background: #cbd5e1;
    color: #475569;
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}
.search-form {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.search-form .form-input {
    width: 280px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
}

/* Table */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.table th, .table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.table th {
    background: #f9fafb;
    font-weight: 600;
    font-size: 13px;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.table tbody tr:hover { background: #f9fafb; }
.table tbody tr:last-child td { border-bottom: none; }
.table td:last-child { white-space: nowrap; }

/* Info Table */
.info-table { width: 100%; border-collapse: collapse; }
.info-table th, .info-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}
.info-table th {
    width: 100px;
    color: var(--gray);
    font-weight: 500;
    font-size: 13px;
    background: #f9fafb;
}
.info-table tr:last-child th, .info-table tr:last-child td { border-bottom: none; }

/* Progress Bar */
.progress-bar {
    width: 80px;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
    display: inline-block;
    vertical-align: middle;
    margin-right: 6px;
}
.progress-fill {
    height: 100%;
    background: var(--success);
    border-radius: 3px;
    transition: width 0.3s ease;
}
.progress-text { font-size: 12px; color: var(--text-muted); }

/* Detail Grid */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
    align-items: start;
}
.detail-grid .card:last-child {
    grid-column: 1 / -1;
}

/* Form */
.form { padding: 16px; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: 500; font-size: 14px; }
.form-input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
    background: #fff;
}
.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,110,247,0.12);
}
select.form-input { appearance: auto; }
textarea.form-input { resize: vertical; }
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.form-actions {
    display: flex;
    gap: 10px;
    padding: 16px;
    border-top: 1px solid var(--border);
    justify-content: flex-end;
}
.required { color: var(--danger); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 18px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    white-space: nowrap;
}
.btn:hover { text-decoration: none; opacity: 0.9; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-secondary { background: #e5e7eb; color: var(--text); }
.btn-warning { background: #f59e0b; color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-xs { padding: 3px 10px; font-size: 12px; }
.btn-block { width: 100%; }

/* Badge */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}
.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-gray { background: #f3f4f6; color: #6b7280; }

/* Alert */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin: 12px 16px;
    font-size: 14px;
}
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }

/* Utilities */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-bold { font-weight: 600; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-sm { font-size: 12px; }

/* Footer */
.site-footer {
    text-align: center;
    padding: 16px;
    color: var(--text-muted);
    font-size: 13px;
    border-top: 1px solid var(--border);
    background: #fff;
}
.site-footer .footer-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}
.site-footer a {
    color: var(--text-muted);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .nav-toggle { display: block; }
    .nav-menu {
        display: none;
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        background: #fff;
        flex-direction: column;
        padding: 8px 16px;
        border-bottom: 1px solid var(--border);
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }
    .nav-menu.show { display: flex; }
    .nav-link { width: 100%; padding: 10px 12px; }

    .main-container { padding: 12px 10px 24px; }
    .page-title { font-size: 20px; }

    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .stat-card { padding: 14px 10px; }
    .stat-number { font-size: 20px; }

    .detail-grid { grid-template-columns: 1fr; }
    .detail-grid .card:last-child { grid-column: 1; }

    .form-row { grid-template-columns: 1fr; }

    .toolbar { flex-direction: column; align-items: stretch; }
    .search-form { flex-direction: column; }
    .search-form .form-input { width: 100%; }

    .table th, .table td { padding: 8px 10px; font-size: 13px; }
    .info-table th { width: 75px; }

    .page-header { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .stat-number { font-size: 18px; }
    .stat-label { font-size: 11px; }
    .login-container { padding: 28px 20px; }
    .btn { padding: 7px 14px; font-size: 13px; }
}
