/* ============================================
   志愿填报系统 — 通用样式（优志愿风格）
   ============================================ */

/* ===== CSS 变量 ===== */
:root {
    --primary: #ff5053;
    --primary-hover: #e84245;
    --primary-light: rgba(255,80,83,0.08);
    --accent: #3399cc;
    --accent-hover: #2680b5;
    --accent-light: rgba(51,153,204,0.08);
    --accent-cyan: #3399cc;
    --success: #20c05c;
    --success-light: rgba(32,192,92,0.08);
    --danger: #ff5053;
    --danger-hover: #e84245;
    --warning: #f7ba00;
    --warning-light: rgba(247,186,0,0.1);
    --bg-page: #f5f7fa;
    --bg-card: #ffffff;
    --bg-nav: #ffffff;
    --bg-input: #ffffff;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-muted: #999999;
    --border-color: #e8e8e8;
    --border-light: #f0f0f0;
    --shadow-sm: 0 1px 4px rgba(0,0,0,0.06);
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 20px rgba(0,0,0,0.12);
    --radius: 4px;
    --radius-sm: 2px;
    --radius-lg: 8px;
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
    --transition: 0.2s ease;
}

/* ===== 基础重置 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; -webkit-font-smoothing: antialiased; }

body {
    font-family: var(--font-family);
    background: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }

ul, ol { list-style: none; }

img { max-width: 100%; vertical-align: middle; }

/* ===== 布局 ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ===== 导航栏 ===== */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-nav);
    padding: 0 24px;
    height: 56px;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .logo { font-size: 20px; font-weight: 700; }
.navbar .logo a { color: var(--text-primary); }
.navbar .logo a:hover { color: var(--primary); }

.nav-links { display: flex; align-items: center; gap: 4px; }

.nav-links a {
    display: inline-flex;
    align-items: center;
    height: 56px;
    padding: 0 16px;
    font-size: 14px;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    transition: color var(--transition), border-color var(--transition);
    text-decoration: none;
}
.nav-links a:hover { color: var(--primary); text-decoration: none; }
.nav-links a.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.nav-exit {
    display: inline-flex;
    align-items: center;
    height: 56px;
    padding: 0 16px;
    font-size: 14px;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    transition: color var(--transition), border-color var(--transition);
    text-decoration: none;
    margin-left: 8px;
}
.nav-exit:hover { color: var(--primary); text-decoration: none; }

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-secondary);
}

/* ===== 卡片 ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    margin-bottom: 16px;
}
.card-header {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    padding-bottom: 14px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ===== 表格 ===== */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead { background: #f8f9fb; }
th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}
td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
}
tbody tr:hover { background: #f8fafd; }
.text-center { text-align: center; }

.table-wrapper { overflow-x: auto; }

/* ===== 表单 ===== */
.form-group { margin-bottom: 14px; }
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}
.form-control {
    display: block;
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
    font-family: var(--font-family);
}
.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(51,153,204,0.15);
}
.form-control::placeholder { color: #c0c0c0; }

select.form-control { cursor: pointer; appearance: auto; }

textarea.form-control { resize: vertical; min-height: 80px; }

.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 180px; }

/* ===== 按钮 ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1.4;
    white-space: nowrap;
    user-select: none;
    font-family: var(--font-family);
}
.btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    color: #fff;
}

.btn-danger {
    background: #fff;
    color: var(--danger);
    border-color: var(--danger);
}
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

.btn-success {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}
.btn-success:hover { background: #1da84f; border-color: #1da84f; color: #fff; }

.btn-sm { padding: 5px 14px; font-size: 12px; }
.btn-lg { padding: 12px 28px; font-size: 16px; }
.btn-block { display: flex; width: 100%; }

.btn:disabled, .btn[disabled] {
    opacity: 0.55;
    pointer-events: none;
}

/* ===== 提示信息 ===== */
.alert {
    padding: 12px 18px;
    border-radius: var(--radius);
    font-size: 14px;
    margin-bottom: 16px;
    border-left: 3px solid transparent;
}
.alert-success {
    background: rgba(32,192,92,0.08);
    color: #17803e;
    border-left-color: var(--success);
}
.alert-danger {
    background: rgba(255,80,83,0.08);
    color: #c0392b;
    border-left-color: var(--danger);
}
.alert-warning {
    background: rgba(247,186,0,0.1);
    color: #8a6d00;
    border-left-color: var(--warning);
}
.alert-info {
    background: rgba(51,153,204,0.08);
    color: #1a6d91;
    border-left-color: var(--accent);
}

/* ===== 徽章 ===== */
.badge {
    display: inline-block;
    padding: 2px 10px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 12px;
    background: var(--accent-light);
    color: var(--accent);
}
.badge-success { background: var(--success-light); color: var(--success); }
.badge-danger { background: var(--primary-light); color: var(--primary); }
.badge-warning { background: var(--warning-light); color: #b88900; }

/* ===== 页脚 ===== */
.footer {
    text-align: center;
    padding: 24px;
    font-size: 12px;
    color: var(--text-muted);
}

/* ===== 登录/注册页 ===== */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #fff;
}

.auth-card {
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 40px 36px;
    width: 400px;
    max-width: 94vw;
}
.auth-card h2 {
    font-size: 22px;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 6px;
}
.auth-card .subtitle {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 24px;
}
.auth-card .footer-link {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: var(--text-muted);
}
.auth-card .footer-link a { color: var(--accent); }
.auth-card .footer-link a:hover { color: var(--primary); }

/* ===== 验证码 ===== */
.captcha-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.captcha-input {
    width: 110px !important;
    flex-shrink: 0;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 2px;
}
.captcha-img {
    height: 38px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    cursor: pointer;
    flex-shrink: 0;
}
.captcha-refresh {
    font-size: 12px;
    color: var(--accent);
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
}
.captcha-refresh:hover { color: var(--primary); text-decoration: underline; }

/* ===== 统计卡片 ===== */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 20px; }

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: box-shadow var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow); }

.stat-icon {
    width: 48px; height: 48px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}
.stat-icon.blue { background: rgba(51,153,204,0.12); }
.stat-icon.green { background: rgba(32,192,92,0.12); }
.stat-icon.orange { background: rgba(255,80,83,0.12); }
.stat-icon.purple { background: rgba(136,51,204,0.12); }

.stat-info .stat-num {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}
.stat-info .stat-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ===== 学员信息网格 ===== */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}
.info-grid form { display: contents; }

.info-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px;
    transition: all var(--transition);
}
.info-item .info-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 5px;
}
.info-item .info-value {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
}
.info-display { display: flex; align-items: center; gap: 8px; }
.info-edit { margin-top: 6px; }
.info-edit input, .info-edit select {
    padding: 6px 10px;
    border: 2px solid var(--accent);
    border-radius: var(--radius);
    font-size: 14px;
    width: 100%;
    outline: none;
    font-family: var(--font-family);
}
.info-age { font-size: 12px; color: var(--success); margin-left: 8px; font-weight: 400; }
.btn-edit-info {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    padding: 2px 6px;
    opacity: 0.4;
    transition: opacity var(--transition);
    vertical-align: middle;
}
.btn-edit-info:hover { opacity: 1; }

/* ===== 快捷操作卡片 ===== */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
}
.quick-action {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 22px 18px;
    text-align: center;
    text-decoration: none !important;
    transition: all var(--transition);
    color: var(--text-primary);
}
.quick-action:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
    color: var(--text-primary);
}
.quick-action .qa-icon { font-size: 32px; margin-bottom: 10px; }
.quick-action .qa-title { font-size: 15px; font-weight: 600; margin-bottom: 5px; }
.quick-action .qa-desc { font-size: 12px; color: var(--text-muted); }

/* ===== 弹窗 ===== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
}
.modal-box {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 28px;
    width: 440px;
    max-width: 92vw;
    box-shadow: var(--shadow-lg);
}
.modal-box h3 { margin-bottom: 18px; font-size: 17px; color: var(--text-primary); }

/* ===== 打印样式（志愿表） ===== */
.summary-header {
    text-align: center;
    padding: 16px 0;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 16px;
}
.summary-header h2 { margin-bottom: 6px; font-size: 20px; color: var(--text-primary); }
.summary-header .meta { font-size: 13px; color: var(--text-secondary); }

/* ===== 成绩样式 ===== */
.score-good { color: #17803e; }
.score-mid { color: #8a6d00; }
.score-low { color: var(--primary); }

/* ===== 搜索栏 ===== */
.search-bar { display: flex; gap: 10px; flex-wrap: wrap; }
.search-bar input {
    flex: 1;
    min-width: 200px;
    padding: 8px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    outline: none;
    transition: border-color var(--transition);
    font-family: var(--font-family);
}
.search-bar input:focus { border-color: var(--accent); }

/* ===== 年级筛选按钮 ===== */
.btn-grade {
    display: inline-block;
    padding: 6px 18px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    background: var(--bg-card);
}
.btn-grade:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.btn-grade.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* ===== 空状态 ===== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* ===== 绑定类型标签 ===== */
.bind-type {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}
.bind-type.type-create { background: var(--accent-light); color: var(--accent); }
.bind-type.type-bind { background: var(--success-light); color: var(--success); }

/* ===== 分页 ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 16px;
    flex-wrap: wrap;
}
.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    background: var(--bg-card);
    transition: all var(--transition);
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); }
.pagination span.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.pagination span.disabled {
    color: var(--text-muted);
    opacity: 0.5;
}

/* ===== 图表容器 ===== */
.chart-box {
    width: 100%;
    height: 380px;
    margin: 8px 0;
}

/* ===== 机构端样式 ===== */
.agency-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-nav);
    padding: 0 24px;
    height: 56px;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.agency-header .logo {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
}
.agency-header .user-area {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: var(--text-secondary);
}
.agency-header .user-area a {
    color: var(--accent);
    text-decoration: none;
}
.agency-header .user-area a:hover { color: var(--primary); }

.agency-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.agency-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}
.agency-stat {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 18px;
    text-align: center;
}
.agency-stat .label {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.agency-stat .value {
    font-size: 30px;
    font-weight: 700;
}
.agency-stat .value.cyan { color: var(--accent); }
.agency-stat .value.default { color: var(--text-primary); }
.agency-stat .code {
    font-size: 22px;
    font-weight: 700;
    font-family: "SF Mono", "Consolas", "Monaco", monospace;
    color: var(--accent);
}

.nav-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}
.nav-card {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 22px 18px;
    text-decoration: none !important;
    transition: all var(--transition);
    color: var(--text-primary);
}
.nav-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
    color: var(--text-primary);
}
.nav-card .icon { font-size: 32px; margin-bottom: 10px; }
.nav-card .title { font-size: 15px; font-weight: 600; margin-bottom: 5px; }
.nav-card .desc { font-size: 12px; color: var(--text-muted); }

/* ===== 打印媒体样式 ===== */
@media print {
    nav, .no-print, .navbar, .agency-header, .btn,
    .search-bar, .pagination, .modal-overlay { display: none !important; }
    .container, .agency-container { max-width: 100%; padding: 10px; }
    .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
    body { background: #fff; color: #000; }
    .summary-header { border-bottom-color: #000; }
    table { font-size: 11px; }
    th, td { padding: 5px 8px; }
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .navbar { flex-wrap: wrap; height: auto; padding: 8px 12px; }
    .nav-links { flex-wrap: wrap; gap: 2px; }
    .nav-links a { height: 40px; padding: 0 10px; font-size: 12px; }
    .user-info { font-size: 12px; flex-wrap: wrap; }
    .container, .agency-container { padding: 12px; }
    .form-row { flex-direction: column; gap: 0; }
    .form-row .form-group { min-width: 100%; }
    .info-grid { grid-template-columns: 1fr; }
    .stats-row { grid-template-columns: 1fr 1fr; }
    .quick-actions { grid-template-columns: 1fr; }
    .agency-stats { grid-template-columns: 1fr 1fr; }
    .nav-cards { grid-template-columns: 1fr; }
    .auth-card { padding: 28px 20px; }
}

@media (max-width: 480px) {
    .stats-row { grid-template-columns: 1fr; }
    .agency-stats { grid-template-columns: 1fr; }
}
