:root {
    --hk-red: #de2910;
    --hk-red-dark: #b91c0c;
    --bg: #f5f5f5;
    --card-bg: #fff;
    --text: #1a1a1a;
    --text-light: #666;
    --border: #e0e0e0;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --radius: 8px;
}

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

body {
    font-family: "PingFang TC", "Microsoft JhengHei", "Noto Sans TC",
                 "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
}

a {
    color: var(--hk-red);
    text-decoration: none;
    transition: color 0.2s;
}
a:hover { color: var(--hk-red-dark); text-decoration: underline; }

/* ── Navbar ──────────────────────────────── */

.navbar {
    background: var(--hk-red);
    color: #fff;
    box-shadow: 0 2px 12px rgba(222,41,16,0.3);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.7rem 1.5rem;
    flex-wrap: wrap;
}

.nav-logo { color: #fff; }
.nav-logo:hover { text-decoration: none; }

.logo-main {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 0.05em;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.nav-links a {
    color: rgba(255,255,255,0.9);
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s;
}
.nav-links a:hover {
    color: #fff;
    background: rgba(255,255,255,0.15);
    text-decoration: none;
}

/* ── Container ───────────────────────────── */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* ── Hero ────────────────────────────────── */

.hero {
    text-align: center;
    padding: 3rem 1rem 2rem;
    background: linear-gradient(135deg, #de2910 0%, #c41e3a 100%);
    color: #fff;
    border-radius: var(--radius);
    margin-bottom: 2.5rem;
}

.hero h1 {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.hero-sub {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.stat-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-num {
    font-size: 2.5rem;
    font-weight: 800;
}

.stat-label {
    font-size: 0.95rem;
    opacity: 0.85;
}

.hero-search {
    display: flex;
    max-width: 500px;
    margin: 0 auto;
    gap: 0.5rem;
}

.search-input {
    flex: 1;
    padding: 0.8rem 1.2rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    outline: none;
}

.search-btn {
    padding: 0.8rem 1.8rem;
    background: var(--text);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    font-weight: 600;
    transition: opacity 0.2s;
}
.search-btn:hover { opacity: 0.85; }

/* ── Section ─────────────────────────────── */

.section { margin-bottom: 2.5rem; }

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--hk-red);
    display: inline-block;
}

.section-desc {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
}
.section-header .section-title { margin-bottom: 0; }

.see-all {
    font-size: 0.95rem;
    font-weight: 600;
}

/* ── Source Grid ─────────────────────────── */

.source-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

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

.source-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    text-decoration: none;
    color: var(--text);
}

.source-name {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
}

.source-count {
    color: var(--hk-red);
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

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

/* ── Article Grid ────────────────────────── */

.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.2rem;
}

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

.article-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    text-decoration: none;
    color: var(--text);
}

.article-category {
    display: inline-block;
    background: rgba(222,41,16,0.1);
    color: var(--hk-red);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.15rem 0.6rem;
    border-radius: 3px;
    margin-bottom: 0.5rem;
}

.article-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.article-summary {
    font-size: 0.88rem;
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 0.8rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-meta {
    display: flex;
    gap: 0.8rem;
    font-size: 0.78rem;
    color: var(--text-light);
    flex-wrap: wrap;
}

.article-source {
    color: var(--hk-red);
    font-weight: 600;
}

/* ── Category Tags ───────────────────────── */

.category-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.category-tag {
    background: var(--card-bg);
    padding: 0.5rem 1.2rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid var(--border);
    color: var(--text);
    transition: all 0.2s;
}

.category-tag:hover {
    background: var(--hk-red);
    color: #fff;
    border-color: var(--hk-red);
    text-decoration: none;
}

.tag-count {
    background: rgba(222,41,16,0.1);
    color: var(--hk-red);
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-size: 0.8rem;
    margin-left: 0.3rem;
}

/* ── Filter Bar ──────────────────────────── */

.filter-bar {
    background: var(--card-bg);
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.filter-form {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.filter-select, .filter-input {
    padding: 0.5rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 0.9rem;
    outline: none;
}

.filter-select { min-width: 130px; }
.filter-input { min-width: 200px; }

.filter-btn {
    padding: 0.5rem 1.5rem;
    background: var(--hk-red);
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
}
.filter-btn:hover { background: var(--hk-red-dark); }

.result-count {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* ── Article List ────────────────────────── */

.article-list { display: flex; flex-direction: column; gap: 0.8rem; }

.list-item {
    background: var(--card-bg);
    padding: 1.2rem 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border-left: 4px solid var(--hk-red);
    transition: transform 0.15s;
}

.list-item:hover { transform: translateX(4px); }
.list-item a { color: var(--text); }
.list-item a:hover { text-decoration: none; }
.list-item h3 { font-size: 1.1rem; margin-bottom: 0.3rem; }

.list-summary {
    font-size: 0.88rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.list-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.78rem;
    color: var(--text-light);
    flex-wrap: wrap;
    align-items: center;
}

.list-source { color: var(--hk-red); font-weight: 600; }
.list-cat {
    background: rgba(222,41,16,0.1);
    color: var(--hk-red);
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
}
.list-url {
    color: #999;
    font-size: 0.72rem;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Pagination ──────────────────────────── */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
}

.page-btn {
    padding: 0.5rem 1.2rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 5px;
    color: var(--text);
    font-weight: 500;
}

.page-btn:hover {
    background: var(--hk-red);
    color: #fff;
    border-color: var(--hk-red);
    text-decoration: none;
}

.page-info { color: var(--text-light); font-size: 0.9rem; }

/* ── Article Detail ──────────────────────── */

.article-detail {
    background: var(--card-bg);
    padding: 2rem 2.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.back-link {
    display: inline-block;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.detail-header { margin-bottom: 1.5rem; }
.detail-header h1 {
    font-size: 1.8rem;
    line-height: 1.4;
    margin: 0.5rem 0;
}

.detail-meta {
    display: flex;
    gap: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-light);
    flex-wrap: wrap;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}

.detail-source { color: var(--hk-red); font-weight: 600; }

.detail-summary {
    background: rgba(222,41,16,0.05);
    padding: 1rem 1.5rem;
    border-radius: 6px;
    font-size: 1.05rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--hk-red);
}

.detail-content { line-height: 2; font-size: 1rem; }
.detail-content p { margin-bottom: 1rem; text-indent: 2em; }

.source-info {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--border);
}

.source-info h3 {
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
}

.source-box {
    background: var(--bg);
    padding: 1rem 1.5rem;
    border-radius: 6px;
    line-height: 2;
}

.source-label {
    font-weight: 600;
    color: var(--text);
    margin-right: 0.5rem;
}

.source-url {
    word-break: break-all;
    font-size: 0.9rem;
}

.article-tags {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.tag {
    background: rgba(222,41,16,0.1);
    color: var(--hk-red);
    padding: 0.2rem 0.8rem;
    border-radius: 3px;
    font-size: 0.82rem;
}

.related {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--border);
}

.related h3 { margin-bottom: 1rem; }

.related-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.related-item {
    padding: 0.6rem 1rem;
    background: var(--bg);
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.related-item:hover { background: rgba(222,41,16,0.08); text-decoration: none; }
.related-date { font-size: 0.8rem; color: var(--text-light); }

/* ── Sources Page ────────────────────────── */

.source-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.2rem;
}

.source-detail-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.source-detail-card h3 {
    color: var(--hk-red);
    margin-bottom: 0.5rem;
}

.source-url-text { font-size: 0.85rem; margin-bottom: 0.8rem; }

.source-description {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 0.8rem;
}

.source-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.8rem;
}

.source-stat {
    background: rgba(222,41,16,0.1);
    color: var(--hk-red);
    padding: 0.2rem 0.6rem;
    border-radius: 3px;
    font-size: 0.82rem;
    font-weight: 600;
}

.source-link { font-weight: 600; font-size: 0.9rem; }

/* ── Search Page ─────────────────────────── */

.search-page {
    text-align: center;
    padding: 4rem 1rem;
}

.search-page h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
}

.big-search {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
    gap: 0.5rem;
}

.big-search-input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1.1rem;
    outline: none;
    transition: border-color 0.2s;
}

.big-search-input:focus { border-color: var(--hk-red); }

.big-search-btn {
    padding: 1rem 2rem;
    background: var(--hk-red);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.05rem;
    cursor: pointer;
    font-weight: 600;
}
.big-search-btn:hover { background: var(--hk-red-dark); }

/* ── 404 ─────────────────────────────────── */

.not-found {
    text-align: center;
    padding: 4rem 1rem;
}
.not-found h1 { font-size: 5rem; color: var(--hk-red); }
.not-found p { font-size: 1.2rem; margin-bottom: 1rem; }

/* ── Footer ──────────────────────────────── */

.footer {
    background: var(--text);
    color: rgba(255,255,255,0.8);
    padding: 2rem 1.5rem;
    margin-top: 3rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer-content p { margin-bottom: 0.5rem; }

.footer-note {
    font-size: 0.82rem;
    opacity: 0.6;
    line-height: 1.6;
}

/* ── Empty ───────────────────────────────── */

.empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-light);
    font-size: 1.1rem;
}

/* ── Responsive ──────────────────────────── */

/* ── Archive Items ───────────────────────── */

.archive-item { border-left: 4px solid #8B4513; }
.archive-item:hover { border-left-color: #A0522D; }

.archive-meta {
    display: flex;
    gap: 0.8rem;
    font-size: 0.82rem;
    margin: 0.5rem 0;
    flex-wrap: wrap;
}

.archive-ref {
    font-family: "Courier New", monospace;
    color: #8B4513;
    font-weight: 600;
}
.archive-date { color: var(--text-light); }
.archive-level {
    background: rgba(139,69,19,0.1);
    color: #8B4513;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
}
.archive-access {
    background: rgba(255,165,0,0.15);
    color: #B8860B;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-size: 0.75rem;
}
.archive-match {
    background: rgba(46,134,193,0.12);
    color: #2471A3;
    padding: 0.1rem 0.5rem;
    border-radius: 3px;
    font-size: 0.78rem;
    font-weight: 600;
}

/* ── Question Items ──────────────────────── */

.question-item { border-left: 4px solid #2E86C1; }
.question-item:hover { border-left-color: #1B4F72; }
.question-item h3 { font-size: 1rem; font-weight: 500; }

.question-list { display: flex; flex-direction: column; gap: 0.5rem; }

/* ── Breadcrumb ──────────────────────────── */

.breadcrumb-nav {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 1.2rem;
    padding: 0.3rem 0;
}
.breadcrumb-nav a { color: var(--hk-red); }
.breadcrumb-nav .sep { margin: 0 0.4rem; opacity: 0.5; }
.breadcrumb-nav .current { color: var(--text); font-weight: 500; }

/* ── E-E-A-T Badge ───────────────────────── */

.eeat-badge {
    display: inline-block;
    background: linear-gradient(135deg, #1b5e20, #2e7d32);
    color: #fff;
    padding: 0.15rem 0.7rem;
    border-radius: 3px;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* ── Knowledge Graph ─────────────────────── */

.kg-section {
    margin-top: 2rem;
    padding: 1.2rem;
    background: linear-gradient(135deg, rgba(46,134,193,0.05), rgba(222,41,16,0.03));
    border-radius: var(--radius);
    border: 1px solid rgba(46,134,193,0.15);
}
.kg-section h3 { font-size: 1rem; color: #2471A3; margin-bottom: 0.8rem; }
.kg-link { display: flex !important; align-items: center; gap: 0.5rem; }
.kg-ref {
    font-family: "Courier New", monospace;
    background: rgba(46,134,193,0.12);
    color: #2471A3;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-size: 0.78rem;
    font-weight: 600;
    flex-shrink: 0;
}

.footer-links { margin-top: 0.5rem; font-size: 0.8rem; }
.footer-links a { color: rgba(255,255,255,0.5); text-decoration: underline; }

@media (max-width: 768px) {
    .hero h1 { font-size: 2rem; }
    .hero-stats { gap: 1.5rem; }
    .stat-num { font-size: 1.8rem; }
    .nav-links { gap: 1rem; }
    .article-detail { padding: 1.5rem; }
    .detail-header h1 { font-size: 1.4rem; }
    .filter-bar { flex-direction: column; align-items: stretch; }
    .filter-form { flex-direction: column; }
    .filter-select, .filter-input { min-width: unset; }
    .big-search { flex-direction: column; }
}
