/* ========================================
   公需科目网 - 全站统一样式表
   版本: 1.0
   更新: 2026-08-13
======================================== */

/* --- Reset & Base --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #1a73e8;
    --primary-dark: #1557b0;
    --primary-light: #e8f0fe;
    --secondary: #34a853;
    --accent: #fbbc04;
    --danger: #ea4335;
    --text: #1a1a2e;
    --text-secondary: #555;
    --text-muted: #888;
    --bg: #f8f9fa;
    --bg-card: #ffffff;
    --border: #e0e0e0;
    --border-light: #f0f0f0;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.12);
    --radius: 8px;
    --radius-sm: 4px;
    --max-width: 960px;
    --header-h: 56px;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    color: var(--text);
    background: var(--bg);
    line-height: 1.8;
    font-size: 15px;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

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

img {
    max-width: 100%;
    height: auto;
}

ul,
ol {
    padding-left: 1.5em;
}

/* --- Header --- */
.site-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    padding: 0 20px;
    height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.site-header .logo {
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
}

.site-header .logo:hover {
    text-decoration: none;
    opacity: 0.9;
}

.site-header nav {
    display: flex;
    gap: 18px;
}

.site-header nav a {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    text-decoration: none;
    padding: 6px 0;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s;
}

.site-header nav a:hover {
    color: #fff;
    border-bottom-color: var(--accent);
    text-decoration: none;
}

@media (max-width: 640px) {
    .site-header nav {
        gap: 10px;
    }
    .site-header nav a {
        font-size: 0.8rem;
    }
}

/* --- Breadcrumb --- */
.breadcrumb {
    max-width: var(--max-width);
    margin: 16px auto 0;
    padding: 0 20px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.breadcrumb a {
    color: var(--text-secondary);
}

.breadcrumb span.sep {
    margin: 0 6px;
    color: var(--text-muted);
}

/* --- Main Container --- */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 16px 20px 48px;
}

/* --- Article --- */
article {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 36px 40px;
    box-shadow: var(--shadow);
}

@media (max-width: 640px) {
    article {
        padding: 20px 16px;
    }
}

article h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.4;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--primary-light);
}

article h1 .label {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-light);
    padding: 2px 10px;
    border-radius: 20px;
    margin-right: 8px;
    vertical-align: middle;
}

article > p:first-of-type {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

article h2 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text);
    margin-top: 36px;
    margin-bottom: 14px;
    padding-left: 12px;
    border-left: 4px solid var(--primary);
}

article h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin-top: 24px;
    margin-bottom: 10px;
}

article p {
    margin-bottom: 14px;
    color: var(--text-secondary);
}

article ul,
article ol {
    margin-bottom: 16px;
}

article li {
    margin-bottom: 6px;
    color: var(--text-secondary);
}

article strong {
    color: var(--text);
    font-weight: 600;
}

/* --- Table --- */
article table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 0.9rem;
    overflow: hidden;
    border-radius: var(--radius-sm);
}

article table thead {
    background: var(--primary);
    color: #fff;
}

article table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

article table td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
}

article table tbody tr:nth-child(even) {
    background: #fafbfc;
}

article table tbody tr:hover {
    background: var(--primary-light);
}

article table td a {
    font-weight: 500;
}

/* --- Cards Grid --- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin: 20px 0;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: box-shadow 0.2s, transform 0.2s;
    text-decoration: none;
    color: var(--text);
    display: block;
}

.card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
    text-decoration: none;
    border-color: var(--primary);
}

.card .card-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 6px;
}

.card .card-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* --- Platform Badge --- */
.platform-badge {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary-dark);
    font-size: 0.8rem;
    font-weight: 500;
    padding: 3px 12px;
    border-radius: 20px;
    margin: 2px;
}

/* --- Info Box --- */
.info-box {
    background: var(--primary-light);
    border-left: 4px solid var(--primary);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 16px 20px;
    margin: 20px 0;
}

.info-box p {
    margin-bottom: 0;
    color: var(--text);
}

.info-box strong {
    color: var(--primary-dark);
}

/* --- Warning Box --- */
.warning-box {
    background: #fef7e0;
    border-left: 4px solid var(--accent);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 16px 20px;
    margin: 20px 0;
}

.warning-box p {
    margin-bottom: 0;
    color: #5f4b00;
}

/* --- FAQ Section --- */
.faq-section {
    margin-top: 36px;
}

.faq-section h2 {
    margin-bottom: 20px;
}

.faq-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.faq-item:hover {
    border-color: var(--primary);
}

.faq-item summary {
    padding: 14px 20px;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    font-size: 1.3rem;
    color: var(--primary);
    font-weight: 400;
    transition: transform 0.2s;
}

.faq-item[open] summary::after {
    transform: rotate(45deg);
}

.faq-item[open] summary {
    border-bottom: 1px solid var(--border-light);
}

.faq-item .faq-answer {
    padding: 14px 20px;
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.7;
}

/* --- Related Links --- */
.related-links {
    margin-top: 36px;
    padding-top: 24px;
    border-top: 1px solid var(--border-light);
}

.related-links h2 {
    font-size: 1.1rem;
    border-left: none;
    padding-left: 0;
    margin-bottom: 14px;
}

.related-links ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.related-links li a {
    display: inline-block;
    padding: 6px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.related-links li a:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary-dark);
    text-decoration: none;
}

/* --- Article Footer --- */
article footer {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* --- Site Footer --- */
.site-footer {
    background: #1a1a2e;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    padding: 24px 20px;
    font-size: 0.82rem;
}

.site-footer a {
    color: rgba(255, 255, 255, 0.8);
}

.site-footer p {
    margin-bottom: 4px;
}

/* --- Province Grid (Index) --- */
.province-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    margin: 20px 0;
}

.province-grid a {
    display: block;
    text-align: center;
    padding: 12px 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.province-grid a:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    text-decoration: none;
    transform: translateY(-1px);
}

/* --- Region Group --- */
.region-group {
    margin-bottom: 28px;
}

.region-group h3 {
    font-size: 1rem;
    color: var(--text);
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--primary-light);
}

/* --- Quick Stats --- */
.stats-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin: 20px 0;
}

.stat-item {
    flex: 1;
    min-width: 120px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    text-align: center;
}

.stat-item .stat-num {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-item .stat-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* --- TOC (Table of Contents) --- */
.toc {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    margin: 20px 0;
}

.toc h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 600;
}

.toc ul {
    list-style: none;
    padding: 0;
    columns: 2;
    column-gap: 20px;
}

@media (max-width: 640px) {
    .toc ul {
        columns: 1;
    }
}

.toc li {
    margin-bottom: 4px;
}

.toc a {
    font-size: 0.88rem;
}

/* --- Steps List --- */
.steps {
    counter-reset: step;
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.steps li {
    counter-increment: step;
    position: relative;
    padding-left: 40px;
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.steps li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    width: 28px;
    height: 28px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
}

/* --- Mobile Adjustments --- */
@media (max-width: 640px) {
    body {
        font-size: 14px;
    }
    article h1 {
        font-size: 1.3rem;
    }
    article h2 {
        font-size: 1.15rem;
    }
    .card-grid {
        grid-template-columns: 1fr;
    }
    .stats-row {
        flex-direction: column;
    }
    article table {
        font-size: 0.82rem;
    }
    article table th,
    article table td {
        padding: 8px 10px;
    }
}
