/* ========【漢化專區變數】 設定 - 延續 L1nG 首頁並使用低飽和紫色識別 ======== */
:root {
    --bg:#f7f8fb;
    --surface:#ffffff;
    --surface-soft:#fbfafc;
    --ink:#24292f;
    --sub:#66707a;
    --muted:#98a1aa;
    --line:#dfe4e9;
    --line-soft:#edf0f3;
    --translation:#7f73b4;
    --translation-dark:#62578f;
    --translation-soft:#f2eff9;
    --translation-border:#d9d2ed;
    --warning:#9b7042;
    --warning-soft:#fbf6ee;
    --max-width:1180px;
}

* {
    box-sizing:border-box;
}

html {
    scroll-behavior:smooth;
}

body {
    /* 靜態文字與一般介面使用標準箭頭 */ cursor: default;
    margin:0;
    color:var(--ink);
    background:
        radial-gradient(circle at 15% 0%, rgba(127,115,180,.09), transparent 28rem),
        var(--bg);
    font-family:
        "PingFang TC",
        "Microsoft JhengHei",
        "Noto Sans TC",
        sans-serif;
    font-size:15px;
    line-height:1.75;
}

/* ========【全站游標】 設定 - 只有文字輸入區使用 I 形游標 ======== */
a[href],
button,
summary,
select,
label[for],
[role="button"],
[role="link"],
input[type="button"],
input[type="submit"],
input[type="reset"],
input[type="checkbox"],
input[type="radio"],
input[type="range"],
input[type="color"],
input[type="file"] {
    /* 可操作項目使用手指游標 */ cursor: pointer;
}

input:not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]),
textarea,
[contenteditable="true"] {
    /* 只有真正可輸入文字的區域使用 I 形游標 */ cursor: text;
}

button:disabled,
select:disabled,
input:disabled,
[aria-disabled="true"] {
    /* 停用控制項使用禁止操作游標 */ cursor: not-allowed;
}


a {
    color:inherit;
}

section[id] {
    scroll-margin-top:90px;
}


/* ========【漢化專區頂部導覽】 設定 - 固定導覽列 ======== */
.site-header {
    position:sticky;
    top:0;
    z-index:100;
    min-height:68px;
    border-bottom:1px solid rgba(216,222,228,.82);
    background:rgba(247,248,251,.9);
    backdrop-filter:blur(18px);
    -webkit-backdrop-filter:blur(18px);
}

.site-header.scrolled {
    background:rgba(255,255,255,.94);
    box-shadow:0 8px 28px rgba(47,48,64,.05);
}

.site-header-inner {
    width:min(calc(100% - 40px),var(--max-width));
    min-height:68px;
    margin:0 auto;
    display:grid;
    grid-template-columns:auto minmax(0,1fr) auto;
    align-items:center;
    gap:28px;
}

.site-brand-group {
    display:flex;
    align-items:center;
    gap:9px;
    white-space:nowrap;
}

.creator-link,
.translations-brand {
    text-decoration:none;
}

.creator-link {
    color:var(--muted);
    font-size:12px;
    letter-spacing:1.4px;
}

.creator-link:hover {
    color:var(--translation);
}

.brand-divider {
    color:#c8c8ce;
}

.translations-brand {
    color:var(--ink);
    font-size:13px;
    font-weight:700;
    letter-spacing:1.4px;
}

.main-nav {
    justify-self:end;
    display:flex;
    align-items:center;
    gap:22px;
}

.main-nav a {
    color:var(--sub);
    text-decoration:none;
    font-size:13px;
}

.main-nav a:hover {
    color:var(--translation);
}

.nav-toggle {
    display:none;
    width:40px;
    height:40px;
    padding:0;
    border:0;
    border-radius:8px;
    background:transparent;
    cursor:pointer;
}

.nav-toggle span {
    display:block;
    width:18px;
    height:1px;
    margin:5px auto;
    background:var(--ink);
    transition:transform .18s ease,opacity .18s ease;
}

.nav-toggle.active span:first-child {
    transform:translateY(3px) rotate(45deg);
}

.nav-toggle.active span:last-child {
    transform:translateY(-3px) rotate(-45deg);
}


/* ========【共用文字】 設定 - 小標與按鈕 ======== */
.eyebrow,
.section-kicker {
    color:var(--translation);
    font-size:11px;
    font-weight:700;
    letter-spacing:2px;
}

/* ========【主視覺】 設定 - 漢化專區定位 ======== */
.hero {
    position:relative;
    overflow:hidden;
    border-bottom:1px solid var(--line);
    background:
        linear-gradient(180deg,rgba(255,255,255,.7),rgba(247,248,251,.4));
}

.hero-inner {
    position:relative;
    z-index:1;
    width:min(calc(100% - 40px),var(--max-width));
    min-height:620px;
    margin:0 auto;
    padding:96px 0;
    display:grid;
    grid-template-columns:minmax(0,1.2fr) minmax(330px,.8fr);
    align-items:center;
    gap:72px;
}

.hero-title-row {
    margin-top:15px;
    display:flex;
    align-items:center;
    gap:22px;
}

.translation-mark {
    width:78px;
    height:78px;
    border:1px solid var(--translation-border);
    border-radius:20px;
    display:grid;
    place-items:center;
    flex:0 0 auto;
    color:var(--translation-dark);
    background:var(--translation-soft);
    font-size:36px;
    font-weight:700;
}

.hero h1 {
    margin:0;
    font-size:clamp(58px,8vw,96px);
    font-weight:300;
    line-height:1;
    letter-spacing:-.05em;
}

.hero-lead {
    max-width:720px;
    margin:34px 0 0;
    color:var(--ink);
    font-size:clamp(21px,2.4vw,29px);
    line-height:1.55;
}

.hero-description {
    max-width:700px;
    margin:16px 0 0;
    color:var(--sub);
}

.hero-summary {
    padding:34px;
    border:1px solid var(--translation-border);
    border-radius:22px;
    background:rgba(255,255,255,.82);
    box-shadow:0 22px 60px rgba(72,61,107,.06);
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:1px;
    overflow:hidden;
}

.summary-item {
    min-height:110px;
    padding:18px;
    background:var(--surface-soft);
    display:flex;
    flex-direction:column;
    justify-content:center;
}

.summary-item-wide {
    grid-column:1 / -1;
}

.summary-item strong {
    color:var(--translation-dark);
    font-size:32px;
    font-weight:500;
}

.summary-item span {
    color:var(--muted);
    font-size:12px;
}

.hero-summary p {
    grid-column:1 / -1;
    margin:18px 4px 0;
    color:var(--sub);
    font-size:12px;
}

.hero-decoration {
    position:absolute;
    border-radius:50%;
    pointer-events:none;
}

.hero-decoration-left {
    width:300px;
    height:300px;
    left:-180px;
    top:90px;
    background:rgba(127,115,180,.06);
}

.hero-decoration-right {
    width:380px;
    height:380px;
    right:-230px;
    bottom:-100px;
    background:rgba(127,115,180,.05);
}


/* ========【共用區塊】 設定 - 內容寬度與標題 ======== */
.section {
    width:min(calc(100% - 40px),var(--max-width));
    margin:0 auto;
    padding:100px 0;
}

.section-heading {
    margin-bottom:34px;
    display:flex;
    align-items:flex-end;
    justify-content:space-between;
    gap:36px;
}

.section-heading h2 {
    margin:9px 0 0;
    font-size:clamp(34px,4.5vw,52px);
    font-weight:350;
    line-height:1.2;
    letter-spacing:-.035em;
}

.section-heading > p {
    max-width:480px;
    margin:0;
    color:var(--sub);
    font-size:13px;
}


/* ========【漢化列表工具列】 設定 - 搜尋與篩選 ======== */
.translation-toolbar {
    margin-bottom:26px;
    padding:16px;
    border:1px solid var(--line);
    border-radius:14px;
    background:rgba(255,255,255,.75);
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:18px;
}

.search-field {
    min-width:min(330px,100%);
    display:flex;
    align-items:center;
    gap:10px;
}

.search-label {
    color:var(--muted);
    font-size:11px;
}

.search-field input {
    width:100%;
    min-height:40px;
    padding:0 12px;
    border:1px solid var(--line);
    border-radius:9px;
    outline:none;
    background:#fff;
    color:var(--ink);
    font:inherit;
    font-size:13px;
}

.search-field input:focus {
    border-color:var(--translation-border);
    box-shadow:0 0 0 3px rgba(127,115,180,.08);
}

.filter-group {
    display:flex;
    flex-wrap:wrap;
    justify-content:flex-end;
    gap:6px;
}

.filter-button {
    min-height:36px;
    padding:0 11px;
    border:1px solid transparent;
    border-radius:8px;
    background:transparent;
    color:var(--sub);
    font:inherit;
    font-size:12px;
    cursor:pointer;
}

.filter-button:hover {
    background:var(--translation-soft);
}

.filter-button.active {
    border-color:var(--translation-border);
    background:var(--translation-soft);
    color:var(--translation-dark);
    font-weight:650;
}


/* ========【漢化卡片】 設定 - 自漢化列表 ======== */
.translation-grid {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:16px;
}

.translation-card {
    min-height:470px;
    padding:27px;
    border:1px solid var(--line);
    border-radius:18px;
    background:rgba(255,255,255,.92);
    display:flex;
    flex-direction:column;
}

.translation-card[hidden] {
    display:none;
}

.translation-card-attention {
    border-color:#eadbc7;
}

/* ========【模組整理深層連結提示】 設定 - 對應卡片使用專區紫色，避免與警告狀態混淆 ======== */
.translation-card.is-linked-target {
    position:relative;
    scroll-margin-top:94px;
    animation:translation-target-flash 1.6s ease-in-out 1;
}

.translation-target-hint {
    position:absolute;
    top:-13px;
    right:19px;
    display:inline-flex;
    align-items:center;
    min-height:25px;
    padding:4px 10px;
    border-radius:999px;
    background:var(--translation-dark);
    color:#fff;
    font-size:11px;
    font-weight:650;
    letter-spacing:.02em;
    line-height:1.25;
    pointer-events:none;
    animation:translation-target-hint-flash 1.6s ease-in-out 1 both;
}

@keyframes translation-target-flash {
    0%,100% { box-shadow:0 0 0 0 rgba(127,115,180,0); }
    20%,48% {
        border-color:var(--translation);
        background-color:rgba(244,240,252,.98);
        box-shadow:0 0 0 5px rgba(127,115,180,.22), 0 12px 30px rgba(98,87,143,.13);
    }
}

@keyframes translation-target-hint-flash {
    0%,100% { opacity:0; transform:translateY(-5px); }
    18%,52% { opacity:1; transform:translateY(0); }
}

@media (prefers-reduced-motion:reduce) {
    .translation-card.is-linked-target {
        animation:none;
        border-color:var(--translation);
        box-shadow:0 0 0 3px rgba(127,115,180,.17);
    }
    .translation-target-hint { animation:none; }
}

.card-top,
.card-actions {
    display:flex;
    align-items:center;
}

.card-top {
    justify-content:space-between;
    gap:12px;
}

.category-chip,
.translation-state {
    font-size:10px;
    font-weight:700;
}

.category-chip {
    padding:5px 8px;
    border-radius:999px;
    background:var(--translation-soft);
    color:var(--translation-dark);
}

.category-chip-adult {
    background:#f6eeee;
    color:#855d5d;
}

.translation-state {
    color:var(--muted);
}

.translation-state-attention {
    color:var(--warning);
}

.card-visual {
    margin:34px 0 28px;
    display:flex;
    align-items:center;
    justify-content:space-between;
}

.card-index {
    color:#b4bac1;
    font-size:11px;
    letter-spacing:1px;
}

.card-mark {
    width:68px;
    height:68px;
    border:1px solid var(--translation-border);
    border-radius:16px;
    display:grid;
    place-items:center;
    color:var(--translation-dark);
    background:var(--translation-soft);
    font-size:30px;
    font-weight:700;
}

.card-content {
    margin-top:auto;
}

.card-content h3 {
    margin:0;
    font-size:24px;
    line-height:1.28;
    letter-spacing:-.025em;
}

.card-title-zh {
    margin:5px 0 0;
    color:var(--translation-dark);
    font-size:16px;
    font-weight:650;
}

.card-author {
    margin:9px 0 0;
    color:var(--sub);
    font-size:12px;
}

.card-author a {
    color:inherit;
    text-decoration:none;
    border-bottom:1px solid rgba(127,115,180,.28);
}

.card-author a:hover {
    color:var(--translation-dark);
    border-bottom-color:var(--translation);
}

.card-facts {
    margin-top:18px;
    padding-top:14px;
    border-top:1px solid var(--line-soft);
    display:flex;
    flex-wrap:wrap;
    gap:8px 18px;
}

.card-facts span {
    color:var(--sub);
    font-size:11px;
}

.card-facts strong {
    margin-right:5px;
    color:var(--ink);
    font-weight:650;
}

.card-note {
    margin:13px 0 0;
    padding:11px 12px;
    border-radius:9px;
    background:var(--warning-soft);
    color:#7c6549;
    font-size:11px;
}

.card-actions {
    margin-top:24px;
    flex-wrap:wrap;
    gap:8px;
}

.card-action {
    min-height:38px;
    padding:0 11px;
    border:1px solid var(--line);
    border-radius:8px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    color:var(--sub);
    background:#fff;
    text-decoration:none;
    font-size:11px;
    font-weight:650;
}

.card-action:hover {
    border-color:var(--translation-border);
    color:var(--translation-dark);
}

.card-action.primary {
    border-color:var(--translation);
    color:#fff;
    background:var(--translation);
}

.card-action.primary:hover {
    background:var(--translation-dark);
}

.empty-state {
    margin-top:20px;
    padding:34px;
    border:1px dashed var(--line);
    border-radius:14px;
    color:var(--muted);
    text-align:center;
}


/* ========【安裝方式】 設定 - 三步驟說明 ======== */
.guide-section {
    border-top:1px solid var(--line);
    border-bottom:1px solid var(--line);
    background:
        linear-gradient(135deg,#f4f1fa,#fbfafc);
}

.guide-inner {
    width:min(calc(100% - 40px),var(--max-width));
    margin:0 auto;
    padding:100px 0;
}

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

.step-card,
.note-card {
    padding:27px;
    border:1px solid rgba(217,210,237,.8);
    border-radius:16px;
    background:rgba(255,255,255,.76);
}

.step-number,
.note-label {
    color:var(--translation);
    font-size:10px;
    font-weight:700;
    letter-spacing:1px;
}

.step-card h3,
.note-card h3 {
    margin:30px 0 8px;
    font-size:18px;
}

.step-card p,
.note-card p {
    margin:0;
    color:var(--sub);
    font-size:13px;
}

.step-card code {
    color:var(--translation-dark);
    font-family:"SFMono-Regular",Consolas,monospace;
    font-size:12px;
}


/* ========【注意事項】 設定 - 下載前提醒 ======== */
.notes-section {
    padding-bottom:110px;
}

.note-card {
    border-color:var(--line);
    background:var(--surface);
}


/* ========【頁腳】 設定 - 專區入口 ======== */
.site-footer {
    border-top:1px solid var(--line);
    background:var(--surface);
}

.footer-inner {
    width:min(calc(100% - 40px),var(--max-width));
    margin:0 auto;
    padding:34px 0;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:25px;
}

.footer-brand {
    display:flex;
    flex-direction:column;
}

.footer-brand strong {
    font-size:13px;
    letter-spacing:1.2px;
}

.footer-brand span {
    color:var(--muted);
    font-size:10px;
}

.footer-links {
    display:flex;
    flex-wrap:wrap;
    justify-content:flex-end;
    gap:15px;
}

.footer-links a {
    color:var(--sub);
    text-decoration:none;
    font-size:11px;
}

.footer-links a:hover {
    color:var(--translation);
}


/* ========【進場動畫】 設定 - 輕量淡入 ======== */
.js .reveal {
    opacity:0;
    transform:translateY(12px);
    transition:opacity .45s ease,transform .45s ease;
}

.js .reveal.visible {
    opacity:1;
    transform:none;
}


/* ========【響應式】 設定 - 平板 ======== */
@media (max-width:900px) {

    .site-header-inner {
        position:relative;
        grid-template-columns:minmax(0,1fr) auto;
        gap:12px;
    }

    .nav-toggle {
        display:block;
        justify-self:end;
    }

    .main-nav {
        position:absolute;
        top:calc(100% + 8px);
        right:0;
        min-width:210px;
        padding:9px;
        border:1px solid var(--line);
        border-radius:12px;
        display:none;
        flex-direction:column;
        align-items:stretch;
        gap:3px;
        background:#fff;
        box-shadow:0 16px 38px rgba(47,48,64,.1);
    }

    .main-nav.open {
        display:flex;
    }

    .main-nav a {
        padding:9px 10px;
        border-radius:8px;
    }

    .main-nav a:hover {
        background:var(--translation-soft);
    }

    .hero-inner {
        min-height:auto;
        grid-template-columns:1fr;
        padding:78px 0;
    }

    .hero-summary {
        max-width:560px;
    }

    .section-heading {
        align-items:flex-start;
        flex-direction:column;
        gap:10px;
    }

    .translation-toolbar {
        align-items:stretch;
        flex-direction:column;
    }

    .filter-group {
        justify-content:flex-start;
    }

    .step-grid,
    .notes-grid {
        grid-template-columns:1fr;
    }
}


/* ========【響應式】 設定 - 手機 ======== */
@media (max-width:640px) {

    .site-header-inner,
    .hero-inner,
    .section,
    .guide-inner,
    .footer-inner {
        width:min(calc(100% - 28px),var(--max-width));
    }

    .site-brand-group {
        gap:9px;
    }

    .creator-link {
        font-size:12px;
        letter-spacing:1.4px;
    }

    .translations-brand {
        font-size:13px;
        letter-spacing:1.4px;
    }

    .hero-title-row {
        align-items:flex-start;
        flex-direction:column;
        gap:16px;
    }

    .translation-mark {
        width:62px;
        height:62px;
        border-radius:16px;
        font-size:29px;
    }

    .hero h1 {
        font-size:54px;
    }

    .hero-lead {
        font-size:20px;
    }

    .hero-summary {
        padding:20px;
    }

    .translation-grid {
        grid-template-columns:1fr;
    }

    .translation-card {
        min-height:0;
        padding:23px;
    }

    .search-field {
        min-width:0;
    }

    .footer-inner {
        align-items:flex-start;
        flex-direction:column;
    }

    .footer-links {
        justify-content:flex-start;
    }
}


@media (prefers-reduced-motion:reduce) {
    html {
        scroll-behavior:auto;
    }

    *,
    *::before,
    *::after {
        transition-duration:.01ms !important;
    }

    .js .reveal {
        opacity:1;
        transform:none;
    }
}


/* ========【搜尋欄】 設定 - 共用 SVG 與自訂清除鈕 ======== */
.search-input-wrap {position:relative;min-width:0;flex:1 1 auto;color:var(--muted)}
.search-input-wrap input {width:100%;padding-left:36px;padding-right:40px}
.search-input-wrap::before {content:"";position:absolute;left:12px;top:50%;transform:translateY(-50%);width:15px;height:15px;background:currentColor;opacity:.7;pointer-events:none;-webkit-mask:url("icons/ui-search.svg") center/contain no-repeat;mask:url("icons/ui-search.svg") center/contain no-repeat}
.search-input-wrap input::-webkit-search-cancel-button {-webkit-appearance:none;display:none}
.search-input-wrap .l1ng-search-clear {position:absolute;right:4px;top:50%;transform:translateY(-50%);height:32px;width:32px;border:0;border-radius:7px;background:transparent;color:var(--muted);display:flex;align-items:center;justify-content:center;cursor:pointer}
.search-input-wrap .l1ng-search-clear::before {content:"";height:14px;width:14px;background:currentColor;-webkit-mask:url("icons/ui-clear.svg") center/contain no-repeat;mask:url("icons/ui-clear.svg") center/contain no-repeat}
.search-input-wrap .l1ng-search-clear[hidden]{display:none}
.search-input-wrap .l1ng-search-clear:hover,.search-input-wrap .l1ng-search-clear:focus-visible {background:var(--line);color:var(--ink)}
@media(pointer:coarse){.search-input-wrap .l1ng-search-clear{width:40px;height:40px;right:0}}
@media(hover:hover) and (pointer:fine){.translation-grid,.translation-list{scrollbar-width:thin;scrollbar-color:var(--line) transparent}}

/* ========【共用捲軸】 A 款細線 - 所有可捲動容器 ======== */
html,body,body *{scrollbar-width:thin;scrollbar-color:var(--line) transparent}
html::-webkit-scrollbar,body::-webkit-scrollbar,body *::-webkit-scrollbar{width:6px;height:6px}
html::-webkit-scrollbar-track,body::-webkit-scrollbar-track,body *::-webkit-scrollbar-track{background:transparent}
html::-webkit-scrollbar-thumb,body::-webkit-scrollbar-thumb,body *::-webkit-scrollbar-thumb{background:var(--line);border-radius:999px}
