/* ============ 通用样式 ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: "Microsoft YaHei", "微软雅黑", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    background: #f5f6fa;
    color: #333;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
input, button, textarea, select { font-family: inherit; font-size: inherit; }

/* ============ 政府风格首页 ============ */
.gov-header {
    background: linear-gradient(135deg, #b71c1c 0%, #c62828 100%);
    color: #fff;
    padding: 28px 20px 22px;
    text-align: center;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.gov-header .ribbon {
    font-size: 13px;
    letter-spacing: 4px;
    opacity: 0.85;
    margin-bottom: 8px;
}
.gov-header h1 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 2px;
}
.gov-header .subtitle {
    font-size: 14px;
    opacity: 0.9;
    margin-top: 8px;
}

.container {
    max-width: 820px;
    margin: 0 auto;
    padding: 24px 18px 60px;
}

.notice-card {
    background: #fff;
    border-radius: 10px;
    padding: 28px 26px;
    box-shadow: 0 2px 14px rgba(0,0,0,0.06);
    margin-bottom: 26px;
    border-top: 4px solid #b71c1c;
}
.notice-card h2 {
    color: #b71c1c;
    font-size: 20px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px dashed #e8c4c4;
}
.notice-card .notice-body {
    color: #444;
    font-size: 15px;
}
.notice-card .notice-body p { margin-bottom: 12px; }
.notice-card .notice-body .highlight { color: #b71c1c; font-weight: 600; }

.entry-section h3.section-title {
    color: #b71c1c;
    font-size: 18px;
    margin: 10px 4px 18px;
    padding-left: 12px;
    border-left: 4px solid #b71c1c;
}

.entry-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}
.entry-card {
    display: block;
    background: #fff;
    border-radius: 10px;
    padding: 26px 22px;
    box-shadow: 0 2px 14px rgba(0,0,0,0.06);
    transition: transform .2s, box-shadow .2s;
    border: 1px solid #eee;
}
.entry-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(183,28,28,0.18);
    border-color: #b71c1c;
}
.entry-card .icon {
    width: 54px; height: 54px;
    border-radius: 50%;
    background: linear-gradient(135deg,#b71c1c,#e53935);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; font-weight: 700;
    margin-bottom: 14px;
}
.entry-card .title { font-size: 17px; font-weight: 700; color: #222; margin-bottom: 6px; }
.entry-card .desc { font-size: 13px; color: #888; }
.entry-card .go {
    margin-top: 14px;
    color: #b71c1c;
    font-size: 14px;
    font-weight: 600;
}

.gov-footer {
    text-align: center;
    color: #888;
    font-size: 12px;
    padding: 26px 16px 40px;
    line-height: 1.8;
}

/* ============ 登录页 ============ */
.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg,#b71c1c 0%, #8e1414 100%);
    padding: 24px;
}
.auth-card {
    width: 100%;
    max-width: 380px;
    background: #fff;
    border-radius: 12px;
    padding: 32px 28px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.25);
}
.auth-card .auth-title {
    text-align: center;
    color: #b71c1c;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 6px;
}
.auth-card .auth-sub {
    text-align: center;
    color: #999;
    font-size: 13px;
    margin-bottom: 26px;
}
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-size: 14px;
    color: #555;
    margin-bottom: 6px;
    font-weight: 600;
}
.form-control {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    outline: none;
    transition: border-color .2s;
}
.form-control:focus { border-color: #b71c1c; }
.code-row { display: flex; gap: 10px; }
.code-row .form-control { flex: 1; }
.btn {
    display: inline-block;
    border: none;
    border-radius: 8px;
    padding: 11px 18px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .2s, background .2s;
    text-align: center;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary { background: #b71c1c; color: #fff; }
.btn-primary:hover:not(:disabled) { background: #9e1717; }
.btn-block { width: 100%; display: block; }
.btn-code {
    background: #fff;
    color: #b71c1c;
    border: 1px solid #b71c1c;
    white-space: nowrap;
    min-width: 120px;
}
.btn-code:disabled { color: #999; border-color: #ddd; background:#f5f5f5; }

.form-tip {
    font-size: 12px;
    color: #999;
    margin-top: 10px;
    text-align: center;
}
.form-msg {
    font-size: 13px;
    margin: 12px 0;
    padding: 8px 12px;
    border-radius: 6px;
    display: none;
}
.form-msg.error { display:block; background:#fdecea; color:#b71c1c; }
.form-msg.ok { display:block; background:#e8f5e9; color:#2e7d32; }

.demo-code-hint {
    margin-top: 14px;
    padding: 10px;
    background: #fff8e1;
    border: 1px dashed #ffb300;
    border-radius: 6px;
    font-size: 12px;
    color: #8d6e00;
    text-align: center;
}

/* ============ 问卷填报 ============ */
.q-header {
    background: linear-gradient(135deg,#b71c1c,#c62828);
    color: #fff;
    padding: 22px 20px;
    text-align: center;
}
.q-header h1 { font-size: 20px; letter-spacing: 1px; }
.q-header p { font-size: 13px; opacity: 0.9; margin-top: 6px; }

.q-wrap {
    max-width: 720px;
    margin: 0 auto;
    padding: 20px 16px 60px;
}
.q-progress {
    background: #fff;
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 18px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    font-size: 13px;
    color: #666;
}
.q-progress b { color: #b71c1c; }

.q-card {
    background: #fff;
    border-radius: 10px;
    padding: 26px 22px;
    margin-bottom: 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.q-card .q-num {
    display: inline-block;
    background: #b71c1c;
    color: #fff;
    width: 26px; height: 26px;
    border-radius: 50%;
    text-align: center;
    line-height: 26px;
    font-size: 13px;
    font-weight: 700;
    margin-right: 8px;
}
.q-card .q-title {
    font-size: 16px;
    font-weight: 600;
    color: #222;
    margin-bottom: 14px;
}
.q-card .q-required { color: #b71c1c; margin-left: 4px; }

.radio-group, .check-group { display: flex; flex-direction: column; gap: 10px; }
.radio-item, .check-item {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    border: 1px solid #eee;
    border-radius: 8px;
    cursor: pointer;
    transition: all .15s;
}
.radio-item:hover, .check-item:hover { border-color: #b71c1c; background: #fdf3f3; }
.radio-item input, .check-item input { margin-right: 10px; accent-color: #b71c1c; }
.radio-item.selected, .check-item.selected { border-color: #b71c1c; background: #fdf3f3; }

textarea.form-control { resize: vertical; min-height: 90px; }

.q-actions {
    margin-top: 8px;
    display: flex;
    gap: 12px;
}
.btn-secondary {
    background: #f0f0f0;
    color: #555;
    flex: 1;
}
.btn-secondary:hover:not(:disabled){ background:#e0e0e0; }

/* 提交成功页 */
.success-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f6fa;
    padding: 20px;
}
.success-box {
    background: #fff;
    border-radius: 12px;
    padding: 40px 30px;
    text-align: center;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}
.success-box .check-icon {
    width: 70px; height: 70px;
    border-radius: 50%;
    background: #4caf50;
    color: #fff;
    margin: 0 auto 18px;
    display: flex; align-items: center; justify-content: center;
    font-size: 36px;
}
.success-box h2 { color: #2e7d32; margin-bottom: 10px; }
.success-box p { color: #666; font-size: 14px; margin-bottom: 22px; }

/* ============ 后台 ============ */
.admin-login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg,#1a237e,#283593);
    padding: 20px;
}
.admin-login-card {
    width: 100%;
    max-width: 360px;
    background: #fff;
    border-radius: 12px;
    padding: 34px 30px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}
.admin-login-card h2 {
    text-align: center;
    color: #1a237e;
    margin-bottom: 24px;
    font-size: 20px;
}
.admin-login-card .btn-primary { background:#1a237e; }
.admin-login-card .btn-primary:hover:not(:disabled){ background:#151960; }
.admin-login-card .form-control:focus { border-color:#1a237e; }

.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
    width: 220px;
    background: #1a237e;
    color: #fff;
    flex-shrink: 0;
}
.admin-sidebar .brand {
    padding: 22px 20px;
    font-size: 17px;
    font-weight: 700;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.admin-sidebar .nav-item {
    display: block;
    padding: 14px 20px;
    color: rgba(255,255,255,0.8);
    font-size: 14px;
    border-left: 3px solid transparent;
}
.admin-sidebar .nav-item:hover { background: rgba(255,255,255,0.08); color:#fff; }
.admin-sidebar .nav-item.active {
    background: rgba(255,255,255,0.12);
    color: #fff;
    border-left-color: #ffd54f;
}
.admin-main { flex: 1; background: #f5f6fa; overflow: auto; }
.admin-topbar {
    background: #fff;
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.admin-topbar .page-title { font-size: 17px; font-weight: 600; color:#333; }
.admin-topbar .user-info { font-size: 13px; color: #666; }
.admin-topbar .logout-link { color: #1a237e; margin-left: 14px; font-size:13px; }

.admin-content { padding: 22px 24px; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}
.stat-card {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border-left: 4px solid #1a237e;
}
.stat-card .stat-label { font-size: 13px; color: #888; }
.stat-card .stat-value { font-size: 28px; font-weight: 700; color: #1a237e; margin-top: 4px; }
.stat-card.q1 { border-left-color:#b71c1c; }
.stat-card.q1 .stat-value { color:#b71c1c; }

.filter-bar {
    background: #fff;
    border-radius: 10px;
    padding: 18px;
    margin-bottom: 18px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}
.filter-bar .fg { display:flex; flex-direction:column; gap:5px; }
.filter-bar label { font-size:12px; color:#666; }
.filter-bar .form-control { padding: 8px 12px; font-size: 14px; }
.filter-bar .btn { padding: 9px 16px; }
.btn-admin { background:#1a237e; color:#fff; }
.btn-admin:hover:not(:disabled){ background:#151960; }
.btn-export { background:#2e7d32; color:#fff; }
.btn-export:hover:not(:disabled){ background:#1b5e20; }

.data-table {
    width: 100%;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border-collapse: collapse;
}
.data-table th, .data-table td {
    padding: 12px 14px;
    text-align: left;
    font-size: 13px;
    border-bottom: 1px solid #eee;
}
.data-table th {
    background: #f5f6fa;
    color: #555;
    font-weight: 600;
    white-space: nowrap;
}
.data-table tr:hover { background: #fafbfc; }
.data-table td { color: #444; }
.table-wrap { overflow-x: auto; background:#fff; border-radius:10px; box-shadow:0 2px 10px rgba(0,0,0,0.05); }

.empty-row { text-align:center; color:#999; padding: 40px !important; }

/* ============ 响应式 ============ */
@media (max-width: 768px) {
    .gov-header h1 { font-size: 20px; }
    .gov-header .ribbon { font-size: 11px; letter-spacing: 2px; }
    .entry-grid { grid-template-columns: 1fr; }
    .container { padding: 18px 14px 40px; }
    .notice-card { padding: 22px 18px; }
    .notice-card h2 { font-size: 18px; }

    .q-header h1 { font-size: 17px; }
    .q-card { padding: 20px 16px; }

    .admin-sidebar { width: 60px; }
    .admin-sidebar .brand { font-size: 0; padding: 20px 0; text-align:center; }
    .admin-sidebar .brand::after { content:'管'; font-size:18px; }
    .admin-sidebar .nav-item { padding: 14px 0; text-align:center; font-size:0; }
    .admin-sidebar .nav-item::first-letter { font-size:14px; }
    .admin-content { padding: 14px; }
    .admin-topbar { padding: 12px 14px; }
    .admin-topbar .page-title { font-size: 15px; }

    .filter-bar { flex-direction: column; align-items: stretch; }
    .filter-bar .fg { width: 100%; }
    .filter-bar .btn { width: 100%; }

    .data-table th, .data-table td { padding: 9px 10px; font-size: 12px; }
}
@media (max-width: 480px) {
    .auth-card, .admin-login-card { padding: 26px 22px; }
    .entry-card { padding: 22px 18px; }
}
