/* ===== 全局重置 ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --red:      #c0392b;
    --red-dark: #962d22;
    --navy:     #1a2b4a;
    --green:    #1b5e2e;
    --green-dark: #144820;
    --gray-1:   #f4f4f4;
    --gray-2:   #e8e8e8;
    --gray-3:   #999;
    --text:     #333;
    --text-light: #666;
    --white:    #fff;
    --border:   #ddd;
    --font:     'Microsoft JhengHei', 'Noto Sans TC', 'PingFang TC', 'Segoe UI', sans-serif;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.7;
    color: var(--text);
    background: var(--white);
}

a { color: inherit; text-decoration: none; }

img { display: block; max-width: 100%; }

.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== 頂部條 ===== */
.topbar {
    background: var(--navy);
    color: rgba(255,255,255,0.75);
    font-size: 0.82rem;
    padding: 6px 0;
    border-bottom: 2px solid var(--red);
}

.topbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topbar-links a {
    color: rgba(255,255,255,0.75);
    margin-left: 16px;
}

.topbar-links a:hover { color: #fff; }

/* ===== 導航 ===== */
.navbar {
    background: var(--white);
    border-bottom: 3px solid var(--red);
    position: sticky;
    top: 0;
    z-index: 200;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #000;
    text-decoration: none !important;
}

.logo svg {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.logo-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: #000;
    letter-spacing: 0.02em;
}

.logo-sub {
    font-size: 0.75rem;
    color: var(--gray-3);
    font-weight: 400;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 4px;
}

.nav-menu a {
    display: block;
    padding: 8px 16px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--navy);
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
}

.nav-menu a:hover,
.nav-menu a.active {
    background: var(--red);
    color: var(--white);
}

/* ===== Hero 欄 ===== */
.hero {
    background: #1b5e2e;
    color: var(--white);
    padding: 60px 0;
    border-bottom: 4px solid var(--red);
}

.hero-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.hero-label {
    display: inline-block;
    background: var(--red);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 4px 12px;
    border-radius: 2px;
    margin-bottom: 14px;
    text-transform: uppercase;
}

.hero h1 {
    font-size: 2rem;
    font-weight: 900;
    line-height: 1.3;
    margin-bottom: 14px;
}

.hero-desc {
    color: rgba(255,255,255,0.75);
    font-size: 1rem;
    margin-bottom: 22px;
}

.hero-btn {
    display: inline-block;
    background: var(--red);
    color: #fff;
    padding: 12px 28px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.95rem;
    transition: background 0.2s;
}

.hero-btn:hover { background: var(--red-dark); }

.hero-img {
    border-radius: 6px;
    overflow: hidden;
    height: 280px;
}

.hero-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ===== 版塊標題 ===== */
.section-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--gray-2);
}

.section-head h2 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--navy);
}

.section-head .marker {
    display: inline-block;
    width: 5px;
    height: 22px;
    background: var(--red);
    border-radius: 2px;
    flex-shrink: 0;
}

/* ===== 首頁主體佈局 ===== */
.home-main {
    padding: 40px 0;
}

.home-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 40px;
    align-items: start;
}

/* ===== 文章卡片 ===== */
.articles-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.article-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
}

.article-card:hover {
    box-shadow: 0 4px 18px rgba(0,0,0,0.1);
    transform: translateY(-3px);
}

.card-img {
    height: 180px;
    overflow: hidden;
    background: var(--gray-2);
}

.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.article-card:hover .card-img img {
    transform: scale(1.04);
}

.card-body {
    padding: 16px;
}

.card-cat {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--red);
    border: 1px solid var(--red);
    padding: 2px 8px;
    border-radius: 2px;
    letter-spacing: 0.04em;
    margin-bottom: 8px;
}

.card-body h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--navy);
    line-height: 1.45;
    margin-bottom: 8px;
}

.card-body h3 a:hover { color: var(--red); }

.card-body p {
    font-size: 0.88rem;
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--gray-3);
    padding-top: 10px;
    border-top: 1px solid var(--gray-2);
}

.card-score {
    font-weight: 700;
    color: var(--red);
}

/* ===== 側欄 ===== */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.sidebar-widget {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}

.widget-head {
    background: var(--navy);
    color: #fff;
    padding: 10px 16px;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.widget-body { padding: 14px 16px; }

/* 分類側欄 */
.cat-list { list-style: none; }

.cat-list li {
    border-bottom: 1px solid var(--gray-2);
}

.cat-list li:last-child { border-bottom: none; }

.cat-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 0;
    font-size: 0.9rem;
    color: var(--text);
    transition: color 0.2s;
}

.cat-list a:hover { color: var(--red); }

.cat-count {
    background: var(--gray-1);
    color: var(--gray-3);
    font-size: 0.78rem;
    padding: 2px 8px;
    border-radius: 10px;
}

/* 品牌評分側欄 */
.brand-rank-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }

.brand-rank-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.88rem;
}

.rank-num {
    width: 22px;
    height: 22px;
    background: var(--gray-2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
    color: var(--navy);
}

.rank-num.gold   { background: #f0c040; color: #7a5e00; }
.rank-num.silver { background: #c8d0d8; color: #444; }
.rank-num.bronze { background: #d4956a; color: #5c2a00; }

.rank-name { flex: 1; font-weight: 600; color: var(--navy); }
.rank-score { color: var(--red); font-weight: 700; font-size: 0.85rem; }

/* ===== 分類頁 ===== */
.page-banner {
    background: #1b5e2e;
    color: #fff;
    padding: 40px 0;
    border-bottom: 4px solid var(--red);
}

.page-banner h1 {
    font-size: 1.8rem;
    font-weight: 900;
    margin-bottom: 6px;
}

.page-banner p {
    color: rgba(255,255,255,0.7);
    font-size: 0.95rem;
}

.cat-filter-bar {
    background: var(--gray-1);
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
}

.filter-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-btn {
    padding: 7px 20px;
    border: 1px solid var(--border);
    background: var(--white);
    color: var(--navy);
    border-radius: 3px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font);
}

.filter-btn:hover { border-color: var(--red); color: var(--red); }
.filter-btn.active { background: var(--red); color: #fff; border-color: var(--red); }

.categories-section { padding: 36px 0; }

.categories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* ===== 搜索頁 ===== */
.search-banner {
    background: #1b5e2e;
    padding: 50px 0;
    text-align: center;
    border-bottom: 4px solid var(--red);
}

.search-banner h1 {
    color: #fff;
    font-size: 1.8rem;
    margin-bottom: 20px;
}

.search-form {
    display: flex;
    max-width: 560px;
    margin: 0 auto;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.25);
}

#searchInput {
    flex: 1;
    padding: 14px 18px;
    border: none;
    font-size: 1rem;
    font-family: var(--font);
    outline: none;
}

#searchBtn {
    padding: 14px 24px;
    background: var(--red);
    color: #fff;
    border: none;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font);
    transition: background 0.2s;
}

#searchBtn:hover { background: var(--red-dark); }

.search-section { padding: 36px 0; }

.search-hint {
    text-align: center;
    color: var(--gray-3);
    padding: 50px 0;
    font-size: 1rem;
}

/* ===== 文章詳情頁 ===== */
.article-page { padding: 36px 0; }

.article-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
    align-items: start;
}

.article-main {}

.article-badge-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.article-cat-badge {
    display: inline-block;
    background: var(--red);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 2px;
    letter-spacing: 0.04em;
}

.article-meta-info {
    font-size: 0.82rem;
    color: var(--gray-3);
}

.article-main h1 {
    font-size: 2rem;
    font-weight: 900;
    color: var(--navy);
    line-height: 1.3;
    margin-bottom: 20px;
}

.article-cover {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 30px;
}

.article-body { max-width: 720px; }

.article-body h2 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--navy);
    margin: 36px 0 14px;
    padding-left: 12px;
    border-left: 4px solid var(--red);
}

.article-body h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--navy);
    margin: 24px 0 10px;
}

.article-body p {
    color: var(--text);
    margin-bottom: 16px;
    line-height: 1.85;
    font-size: 0.97rem;
}

.article-body ul,
.article-body ol {
    margin: 14px 0 20px 22px;
    line-height: 1.85;
}

.article-body li { margin-bottom: 7px; font-size: 0.95rem; color: var(--text); }

.article-body strong { color: var(--navy); }

.answer-box {
    margin: 0 0 24px;
    padding: 22px 24px;
    border-radius: 8px;
    border: 1px solid rgba(186, 38, 43, 0.18);
    border-left: 5px solid var(--red);
    background: linear-gradient(135deg, rgba(186, 38, 43, 0.05), rgba(11, 31, 58, 0.02));
}

.answer-kicker {
    display: inline-block;
    margin-bottom: 10px;
    color: var(--red);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.06em;
}

.answer-box p {
    margin-bottom: 12px;
    color: var(--text);
    line-height: 1.85;
}

.answer-points {
    margin: 0 0 0 18px;
    line-height: 1.8;
}

.answer-points li {
    margin-bottom: 6px;
    color: var(--text);
}

.editorial-note {
    margin-bottom: 30px;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 12px 26px rgba(11,31,58,0.05);
}

.editorial-note h2 {
    font-size: 1.12rem;
    font-weight: 800;
    color: var(--navy);
    margin-bottom: 8px;
}

.editorial-note > p {
    color: var(--text);
    margin-bottom: 16px;
    line-height: 1.8;
    font-size: 0.94rem;
}

.editorial-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.editorial-item {
    padding: 14px 16px;
    border-radius: 6px;
    background: var(--gray-1);
    border: 1px solid rgba(11,31,58,0.06);
}

.editorial-item h3 {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--navy);
    margin-bottom: 6px;
}

.editorial-item p {
    margin: 0;
    color: var(--text);
    line-height: 1.75;
    font-size: 0.9rem;
}

.faq-list {
    display: grid;
    gap: 12px;
    margin: 16px 0 0;
}

.faq-item {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    padding: 0 18px;
}

.faq-item summary {
    cursor: pointer;
    list-style: none;
    padding: 16px 0;
    font-size: 0.96rem;
    font-weight: 800;
    color: var(--navy);
}

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

.faq-item p {
    margin: 0 0 16px;
    color: var(--text);
    line-height: 1.8;
    font-size: 0.94rem;
}

.inline-links {
    margin-top: 18px;
    padding: 18px 20px;
    border-radius: 8px;
    background: #faf7f1;
    border: 1px solid rgba(11,31,58,0.08);
}

.inline-links p {
    margin-bottom: 10px;
    color: var(--text);
}

.inline-links ul {
    margin: 0 0 0 18px;
    line-height: 1.8;
}

.inline-links li { margin-bottom: 6px; }

/* 評分框 */
.rating-box {
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    margin: 24px 0;
}

.rating-box-head {
    background: var(--navy);
    color: #fff;
    padding: 10px 18px;
    font-size: 0.9rem;
    font-weight: 700;
}

.rating-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 18px;
    border-bottom: 1px solid var(--gray-2);
}

.rating-item:last-child { border-bottom: none; }

.rating-item .label { font-size: 0.92rem; color: var(--text); }

.rating-item .score {
    font-weight: 800;
    font-size: 1rem;
    color: var(--red);
}

/* 對比表格 */
.compare-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 0.92rem;
}

.compare-table th {
    background: var(--navy);
    color: #fff;
    padding: 12px 14px;
    text-align: left;
    font-weight: 700;
}

.compare-table td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--gray-2);
    color: var(--text);
    vertical-align: top;
}

.compare-table tr:nth-child(even) td { background: var(--gray-1); }

.compare-table .win { color: var(--red); font-weight: 700; }

/* 文章底部 */
.article-footer-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 2px solid var(--gray-2);
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 22px;
    background: var(--navy);
    color: #fff;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.btn-back:hover { background: var(--red); }

.btn-back svg { width: 14px; height: 14px; }

/* 文章側欄 */
.article-sidebar { display: flex; flex-direction: column; gap: 24px; }

/* ===== 頁尾 ===== */
footer {
    background: var(--navy);
    color: rgba(255,255,255,0.65);
    padding: 36px 0 20px;
    margin-top: 60px;
    border-top: 4px solid var(--red);
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 30px;
    margin-bottom: 24px;
}

.footer-brand .logo-title { color: #fff; }
.footer-brand .logo-sub { color: rgba(255,255,255,0.5); }
.footer-brand p {
    font-size: 0.82rem;
    margin-top: 10px;
    color: rgba(255,255,255,0.55);
    line-height: 1.6;
    max-width: 280px;
}

.footer-links h4 {
    color: #fff;
    font-size: 0.88rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.footer-links ul { list-style: none; }
.footer-links li { margin-bottom: 6px; }
.footer-links a {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
    transition: color 0.2s;
}
.footer-links a:hover { color: #fff; }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 16px;
    font-size: 0.8rem;
    text-align: center;
    color: rgba(255,255,255,0.4);
}

/* ===== 通用工具類 ===== */
.hidden { display: none !important; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
}

/* ===== 響應式 ===== */
@media (max-width: 900px) {
    .home-layout { grid-template-columns: 1fr; }
    .sidebar { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
    .articles-grid { grid-template-columns: 1fr; }
    .categories-grid { grid-template-columns: 1fr 1fr; }
    .article-layout { grid-template-columns: 1fr; }
    .hero-inner { grid-template-columns: 1fr; }
    .hero-img { display: none; }
    .footer-inner { flex-direction: column; gap: 20px; }
}

@media (max-width: 600px) {
    .navbar .container { flex-direction: column; gap: 12px; }
    .nav-menu { gap: 0; }
    .sidebar { grid-template-columns: 1fr; }
    .categories-grid { grid-template-columns: 1fr; }
    .hero h1 { font-size: 1.5rem; }
    .article-main h1 { font-size: 1.5rem; }
    .answer-box,
    .editorial-note,
    .inline-links { padding: 18px; }
    .editorial-grid { grid-template-columns: 1fr; }
}
