/* 共用版面 — cases/meetings/stats/sections/index 五頁引用。
   取代各頁內嵌 <style> 裡 ~140 行重複區塊。視覺與舊版完全一致。
   頁面專屬規則（modal/mt-*/sec-*/sections 的 nav hero override 等）
   仍留在各頁 inline <style>。 */

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif; background: #f5f5f5; color: #333; }
a { color: #9d261f; text-decoration: none; }
a:hover { text-decoration: underline; }

/* Nav */
nav { background: #111; padding: 0 20px; display: flex; align-items: center; gap: 0; position: sticky; top: 0; z-index: 100; }
nav .logo { color: #fff; font-weight: 900; font-size: 18px; padding: 14px 20px 14px 0; white-space: nowrap; }
nav a { color: #ccc; padding: 14px 16px; font-size: 14px; text-decoration: none; transition: background .2s; min-height: 48px; display: inline-flex; align-items: center; }
nav a:hover, nav a.active { color: #fff; background: #c9342b; text-decoration: none; }
nav .spacer { flex: 1; }

/* Header */
.hero { background: #111; color: #fff; padding: 50px 20px; text-align: center; }
.hero h1 { font-size: 32px; margin-bottom: 12px; }
.hero p { color: #bbb; font-size: 16px; max-width: 700px; margin: 0 auto; line-height: 1.7; }
.hero .nums { display: flex; justify-content: center; gap: 40px; margin-top: 30px; }
.hero .num { text-align: center; }
.hero .num strong { display: block; font-size: 36px; color: #F1C40F; }
.hero .num span { font-size: 13px; color: #bbb; }

/* Container */
.container { max-width: 1200px; margin: 0 auto; padding: 20px; }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin: 30px 0; }
.card { background: #fff; border: 1px solid #ddd; padding: 24px; }
.card h3 { font-size: 18px; margin-bottom: 8px; color: #111; }
.card p { font-size: 14px; color: #555; line-height: 1.6; }
.card .count { font-size: 28px; font-weight: 900; color: #E63946; margin-bottom: 4px; }
.card a.btn { display: inline-block; margin-top: 12px; background: #111; color: #fff; padding: 10px 20px; font-size: 14px; min-height: 44px; line-height: 24px; }
.card a.btn:hover { background: #c9342b; text-decoration: none; }

/* Search */
.search-box { width: 100%; padding: 12px 16px; font-size: 16px; border: 2px solid #333; margin-bottom: 15px; }

/* Tags - touch target >= 44px */
.tags { margin: 10px 0 15px; display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-block; background: #fff; color: #111; padding: 8px 16px; font-size: 13px; cursor: pointer; border: 2px solid #111; min-height: 44px; line-height: 28px; font-weight: 900; }
.tag:hover, .tag.active { background: #c0392b; color: #fff; }

/* Stats */
.stat-row { display: flex; align-items: center; padding: 8px 0; border-bottom: 1px solid #eee; }
.stat-row .label { flex: 1; font-size: 14px; }
.stat-row .bar { height: 20px; background: #111; margin: 0 12px; transition: width .3s; }
.stat-row .val { font-size: 14px; font-weight: 700; min-width: 40px; text-align: right; }

/* Table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th { background: #333; color: #fff; padding: 10px 12px; text-align: left; position: sticky; top: 0; z-index: 1; }
td { padding: 8px 12px; border-bottom: 1px solid #eee; font-size: 14px; }
tr:hover { background: #fff8d8; }
.case-no { font-family: monospace; color: #555; font-size: 13px; white-space: nowrap; }
.pdf-btn { background: #fff; color: #111; border: 2px solid #111; padding: 8px 14px; cursor: pointer; font-size: 13px; margin: 2px; border-radius: 0; min-height: 44px; font-weight: 900; }
.pdf-btn:hover { background: #111; color: #fff; }
.pdf-btn.plan { background: #fff; color: #111; }
.pdf-btn.plan:hover { background: #111; color: #fff; }
.pdf-btn.persp { background: #fff; color: #111; }
.pdf-btn.persp:hover { background: #111; color: #fff; }
.pdf-btn.map-btn { background: #fff8d8; color: #111; }
.pdf-btn.map-btn:hover { background: #111; color: #fff; }
.meeting-type { display: inline-block; background: #eee; padding: 2px 8px; font-size: 12px; border-radius: 2px; }

/* Pagination (cases/meetings/sections 共用) */
.pager { display: flex; justify-content: center; align-items: center; gap: 4px; margin: 20px 0; flex-wrap: wrap; }
.pager button { min-width: 40px; min-height: 44px; padding: 8px 12px; border: 2px solid #333; background: #fff; cursor: pointer; font-size: 14px; font-weight: 600; }
.pager button:hover { background: #f0f0f0; }
.pager button.active { background: #333; color: #fff; }
.pager button:disabled { opacity: .4; cursor: default; }
.pager .info { font-size: 13px; color: #888; margin: 0 8px; }

/* Meeting text preview */
.preview { font-size: 13px; color: #555; line-height: 1.6; max-height: 80px; overflow: hidden; position: relative; }
.preview.open { max-height: none; }
.preview-toggle { color: #9d261f; cursor: pointer; font-size: 13px; padding: 4px 0; display: inline-block; }

/* Ad - fixed height to prevent CLS */
.ad-slot { background: #fff; border: 1px solid #ddd; padding: 10px; margin: 20px 0; text-align: center; min-height: 100px; overflow: hidden; contain: layout; }

/* Footer */
footer { background: #111; color: #ddd; padding: 36px 7vw; margin-top: 40px; font-size: 13px; line-height: 1.8; min-height: 150px; border-top: 3px solid #111; }
footer .container { display: flex; gap: 40px; flex-wrap: wrap; max-width: none; margin: 0; padding: 0; }
footer .col { flex: 1; min-width: 200px; }
footer h4 { color: #fffdf6; margin: 0 0 12px; font-size: 14px; font-weight: 950; letter-spacing: .06em; text-transform: uppercase; }
footer p { margin: 4px 0; }
footer a { color: #f2c230; }
footer a:hover { color: #fff; }
footer a[style] { color: #f2c230 !important; }
footer .container[style] { border-top-color: #4a4128 !important; }
footer strong[style] { color: #fffdf6 !important; }

/* SEO content */
.seo-content { background: #fff; padding: 24px 28px; margin: 20px 0; border: 1px solid #d9d9d9; }
.seo-content h2 { font-size: 20px; margin-bottom: 12px; color: #111; font-weight: 900; }
.seo-content h3 { font-size: 15px; margin: 14px 0 6px; color: #111; font-weight: 900; }
.seo-content p { font-size: 14px; color: #333; line-height: 1.75; margin-bottom: 8px; font-weight: 650; }
.seo-content ul { padding-left: 20px; margin: 8px 0; }
.seo-content li { font-size: 14px; color: #333; line-height: 1.7; }
.seo-content a { color: #9d261f; font-weight: 800; text-decoration: underline; text-underline-offset: 2px; }

/* Layout */
.layout { display: flex; gap: 20px; }
.main { flex: 1; min-width: 0; }
.sidebar { width: 300px; flex-shrink: 0; }
.sidebar .ad-slot { position: sticky; top: 20px; min-height: 250px; }

/* RWD: 平板 */
@media (max-width: 960px) {
    .layout { flex-direction: column; }
    .sidebar { width: 100%; }
    .sidebar .ad-slot { position: static; min-height: 100px; }
}

/* RWD: 手機 */
@media (max-width: 768px) {
    body { font-size: 15px; }
    nav { flex-wrap: wrap; padding: 0 10px; }
    nav .logo { width: 100%; padding: 12px 10px 4px; font-size: 16px; }
    nav a { padding: 10px 12px; font-size: 13px; min-height: 44px; }
    .hero { padding: 30px 16px; }
    .hero h1 { font-size: 22px; line-height: 1.4; }
    .hero p { font-size: 14px; }
    .hero .nums { flex-wrap: wrap; gap: 16px; }
    .hero .num strong { font-size: 26px; }
    .hero .num span { font-size: 12px; }
    .container { padding: 12px; }
    .cards { grid-template-columns: 1fr; gap: 12px; margin: 16px 0; }
    .card { padding: 16px; }
    .card .count { font-size: 24px; }
    .card h3 { font-size: 16px; }
    .search-box { font-size: 15px; padding: 10px 12px; }
    .tags { gap: 4px; }
    .tag { padding: 6px 12px; font-size: 12px; min-height: 40px; line-height: 28px; }

    /* 表格：手機卡片化 */
    .table-wrap { overflow-x: visible; }
    table, thead, tbody, th, td, tr { display: block; }
    thead { display: none; }
    tr { background: #fff; border: 1px solid #eee; margin-bottom: 8px; padding: 10px 12px; }
    tr:hover { background: #fff8d8; }
    td { padding: 4px 0; border: none; font-size: 13px; }
    td.case-no { font-size: 12px; color: #777; margin-bottom: 4px; }
    td:last-child { margin-top: 6px; }
    .pdf-btn { padding: 8px 14px; font-size: 12px; min-height: 44px; }

    /* 分頁 */
    .pager { gap: 2px; }
    .pager button { min-width: 36px; padding: 6px 8px; font-size: 13px; }
    .pager .info { font-size: 12px; margin: 0 4px; }

    /* 會議卡片 */
    .card div[style*="flex"] { flex-direction: column !important; align-items: flex-start !important; }

    /* SEO 內容 */
    .seo-content { padding: 16px; margin: 12px 0; }
    .seo-content h2 { font-size: 18px; }
    .seo-content h3 { font-size: 14px; }
    .seo-content p, .seo-content li { font-size: 13px; }

    /* 統計長條圖 */
    .stat-row .label { font-size: 13px; min-width: 60px; }
    .stat-row .bar { margin: 0 6px; }
    .stat-row .val { font-size: 13px; min-width: 30px; }

    /* 廣告 */
    .ad-slot { margin: 12px 0; min-height: 60px; padding: 5px; }

    /* Footer */
    footer { padding: 24px 18px; }
    footer .container { flex-direction: column; gap: 16px; }
    footer .col { min-width: auto; }

    /* 頁面標題 */
    h1 { font-size: 20px !important; }
}
