/* ============================================================
   /guide ｜ 新手上路（文章頁）
   沿用 village.css 的設計變數、頂欄與頁尾，這裡只補文章版式。
   文章採「主文 + 目錄側欄」兩欄，與地圖頁同一條 1120px 基準線。
   ============================================================ */

body.g-body {
    margin: 0;
    background: var(--v-cream);
    color: var(--v-ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC",
        "PingFang TC", "Microsoft JhengHei", Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.75;
    letter-spacing: 0.002em;
    font-variant-numeric: tabular-nums;
}

/* 文章頁需要整頁捲動，頂欄改為黏在頂端 */
.g-body .v-topbar {
    position: sticky;
    top: 0;
}

.g-topnav {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1 1 auto;
    min-width: 0;
}
.g-topnav a {
    padding: 3px 8px;
    border-radius: 6px;
    color: var(--v-ink-2);
    font-size: 0.84rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}
.g-topnav a:hover {
    background: var(--v-sand);
    color: var(--v-forest-2);
    text-decoration: none;
}

/* ---------------------------------------------------------------
   版面
   --------------------------------------------------------------- */

.g-layout {
    max-width: var(--v-max);
    margin: 0 auto;
    padding: 16px var(--v-gutter) 32px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 268px;
    gap: 24px;
    align-items: start;
}

.g-main {
    min-width: 0;
}

/* 目錄：跟著捲動 */
.g-toc {
    position: sticky;
    top: calc(var(--v-topbar) + 12px);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.g-toc ol {
    list-style: none;
    margin: 0;
    padding: 5px;
    counter-reset: toc;
}
.g-toc li {
    counter-increment: toc;
}
.g-toc a {
    display: flex;
    gap: 7px;
    padding: 3px 6px;
    border-radius: 6px;
    border-left: 3px solid transparent;
    color: var(--v-ink-2);
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.5;
    text-decoration: none;
}
.g-toc a::before {
    content: counter(toc);
    flex: 0 0 auto;
    width: 15px;
    color: var(--v-ink-3);
    font-size: 0.72rem;
    font-weight: 700;
    text-align: right;
    padding-top: 1px;
}
.g-toc a:hover {
    background: var(--v-sand);
    color: var(--v-forest-2);
    text-decoration: none;
}

/* ---------------------------------------------------------------
   標題與段落
   --------------------------------------------------------------- */

.g-main h1 {
    font-family: var(--v-serif);
    font-weight: 600;
    font-size: clamp(1.4rem, 3.2vw, 1.85rem);
    line-height: 1.3;
    letter-spacing: -0.01em;
    margin: 4px 0 6px;
}

.g-kicker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--v-forest-2);
    background: var(--v-forest-soft);
    border: 1px solid #cfe3d6;
    padding: 2px 9px;
    border-radius: 999px;
    margin-bottom: 8px;
}

.g-lead {
    color: var(--v-ink-2);
    font-size: 0.95rem;
    line-height: 1.75;
    margin: 0 0 10px;
}

.g-main h2 {
    font-family: var(--v-serif);
    font-weight: 600;
    font-size: 1.15rem;
    line-height: 1.4;
    margin: 26px 0 8px;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--v-line);
    scroll-margin-top: calc(var(--v-topbar) + 10px);
}
.g-main h2 .num {
    display: inline-block;
    min-width: 1.5em;
    color: var(--v-forest);
    font-family: -apple-system, BlinkMacSystemFont, "Noto Sans TC", sans-serif;
    font-size: 0.86em;
    font-weight: 800;
}

.g-main h3 {
    font-size: 0.95rem;
    font-weight: 750;
    margin: 16px 0 5px;
    color: var(--v-ink);
}

.g-main p {
    margin: 0 0 9px;
    color: var(--v-ink-2);
}

.g-main ul,
.g-main ol {
    margin: 6px 0 10px;
    padding-left: 1.35em;
    color: var(--v-ink-2);
}
.g-main li {
    margin: 3px 0;
}
.g-main li::marker {
    color: var(--v-ink-3);
}

.g-main b,
.g-main strong {
    color: var(--v-ink);
    font-weight: 750;
}

.g-main a {
    color: var(--v-forest-2);
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-color: rgba(49, 108, 77, 0.35);
}
.g-main a:hover {
    text-decoration-color: currentColor;
}

code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.87em;
    background: var(--v-sand);
    border: 1px solid var(--v-line-2);
    border-radius: 4px;
    padding: 0 4px;
    color: var(--v-ink);
    word-break: break-word;
}

/* ---------------------------------------------------------------
   卡片與表格
   --------------------------------------------------------------- */

.g-card {
    background: #fff;
    border: 1px solid var(--v-line);
    border-radius: var(--v-radius);
    box-shadow: var(--v-shadow);
    padding: 10px 13px;
    margin: 10px 0;
    color: var(--v-ink-2);
    font-size: 0.9rem;
}
.g-card > :last-child {
    margin-bottom: 0;
}
.g-card--ok {
    background: #f4faf6;
    border-color: #cfe3d6;
}
.g-card--warn {
    background: #fdf7ef;
    border-color: #ecd9bd;
}
.g-card--note {
    background: #f4f7fa;
    border-color: #d3dfe9;
}

.g-card-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 800;
    color: var(--v-ink);
    font-size: 0.88rem;
    margin-bottom: 4px;
}

.g-table-wrap {
    overflow-x: auto;
    margin: 10px 0;
    border: 1px solid var(--v-line);
    border-radius: var(--v-radius);
    background: #fff;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
    min-width: 440px;
}
th,
td {
    text-align: left;
    padding: 6px 10px;
    border-bottom: 1px solid var(--v-line-2);
    vertical-align: top;
    color: var(--v-ink-2);
}
th {
    background: var(--v-sand);
    color: var(--v-ink);
    font-weight: 750;
    white-space: nowrap;
    font-size: 0.82rem;
}
tr:last-child td {
    border-bottom: 0;
}
td.num,
th.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* 熱門機型長條 */
.g-bar {
    display: block;
    height: 5px;
    border-radius: 3px;
    background: var(--v-forest);
    opacity: 0.75;
    min-width: 3px;
}

/* 熱門機型：縮圖 + 廠商官網連結 */
.hw-name-cell {
    padding: 5px 10px;
    vertical-align: middle;
}
.hw-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--v-ink);
    text-decoration: none;
    max-width: 100%;
}
.hw-link:hover .hw-name {
    color: var(--v-forest-2);
    text-decoration: underline;
}
.hw-thumb {
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    object-fit: contain;
    background: #fff;
    border: 1px solid var(--v-line-2);
    border-radius: 6px;
    padding: 2px;
}
/* 沒有官方產品照的機型：用字樣標籤佔同一格，欄位才不會歪 */
.hw-thumb--badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--v-serif);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: var(--v-ink-3);
    background: var(--v-sand);
}
.hw-link-text {
    display: inline-flex;
    align-items: baseline;
    gap: 3px;
    min-width: 0;
}
.hw-name {
    font-weight: 700;
    color: var(--v-ink);
    font-size: 0.86rem;
    overflow: hidden;
    text-overflow: ellipsis;
}
.hw-arrow {
    font-size: 0.72rem;
    color: var(--v-ink-3);
    flex: 0 0 auto;
}
.hw-link:hover .hw-arrow {
    color: var(--v-forest);
}

/* 表格下方的小字說明 */
.g-note {
    margin: 6px 0 12px;
    font-size: 0.78rem;
    line-height: 1.6;
    color: var(--v-ink-3);
}

/* 步驟 */
.g-steps {
    list-style: none;
    margin: 10px 0;
    padding: 0;
    counter-reset: step;
}
.g-steps > li {
    counter-increment: step;
    position: relative;
    padding: 0 0 0 30px;
    margin: 0 0 10px;
    color: var(--v-ink-2);
}
.g-steps > li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 1px;
    width: 20px;
    height: 20px;
    border-radius: 5px;
    background: var(--v-forest);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}
.g-steps > li > b:first-child {
    display: block;
    color: var(--v-ink);
    font-size: 0.9rem;
    margin-bottom: 1px;
}

/* 常見問題 */
.g-faq {
    margin: 10px 0;
    border: 1px solid var(--v-line);
    border-radius: var(--v-radius);
    background: #fff;
    overflow: hidden;
}
.g-faq details {
    border-bottom: 1px solid var(--v-line-2);
}
.g-faq details:last-child {
    border-bottom: 0;
}
.g-faq summary {
    cursor: pointer;
    padding: 8px 12px;
    font-weight: 700;
    font-size: 0.87rem;
    color: var(--v-ink);
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
}
.g-faq summary::-webkit-details-marker {
    display: none;
}
.g-faq summary::before {
    content: "＋";
    color: var(--v-forest);
    font-weight: 800;
    font-size: 0.9rem;
    flex: 0 0 auto;
}
.g-faq details[open] summary::before {
    content: "－";
}
.g-faq summary:hover {
    background: var(--v-sand);
}
.g-faq .g-faq-body {
    padding: 0 12px 10px 30px;
    font-size: 0.87rem;
    color: var(--v-ink-2);
}
.g-faq .g-faq-body > :last-child {
    margin-bottom: 0;
}

/* 頁尾回到地圖 */
.g-back {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 22px;
    padding: 6px 13px;
    border: 1px solid var(--v-forest);
    border-radius: 7px;
    background: var(--v-forest);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
}
.g-back:hover {
    background: var(--v-forest-2);
    color: #fff;
    text-decoration: none;
}

/* ---------------------------------------------------------------
   響應式
   --------------------------------------------------------------- */

@media (max-width: 980px) {
    .g-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
        padding-top: 12px;
    }
    /* 目錄先出現，用手機的人才知道這頁有什麼 */
    .g-toc {
        position: static;
        order: -1;
        margin-bottom: 12px;
    }
    .g-toc ol {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 0 4px;
    }
    .g-topnav {
        display: none;
    }
}

@media (max-width: 560px) {
    .g-main h2 {
        font-size: 1.06rem;
    }
    .g-main ul,
    .g-main ol {
        padding-left: 1.15em;
    }
}
