/* ==========================================================================
   第一字体 · diyiziti.cn
   基础样式 / 响应式布局 / 字体在线生成器
   ========================================================================== */

:root {
    --ink: #1b1e25;
    --ink-2: #454b57;
    --muted: #8a909c;
    --paper: #f7f5f0;
    --paper-2: #f1ede4;
    --card: #ffffff;
    --line: #e7e2d7;
    --line-strong: #d8d2c4;
    --accent: #c0452d;
    --accent-dark: #9e3320;
    --accent-soft: #f8e9e4;
    --gold: #b98b4e;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow-sm: 0 2px 8px rgba(27, 30, 37, .04);
    --shadow: 0 10px 32px rgba(27, 30, 37, .07);
    --shadow-lg: 0 22px 60px rgba(27, 30, 37, .10);
    --container: 1180px;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    --font-serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "SimSun", Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.7;
    color: var(--ink);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; line-height: 1.35; font-weight: 700; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
svg { display: block; }

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
}

.muted { color: var(--muted); }
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- 按钮 ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: 999px;
    border: 1px solid transparent;
    background: var(--ink);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.4;
    transition: transform .15s ease, background .2s ease, box-shadow .2s ease, border-color .2s ease;
    white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--accent); box-shadow: 0 8px 22px rgba(192, 69, 45, .22); }
.btn-primary:hover { background: var(--accent-dark); }
.btn-ghost {
    background: transparent;
    color: var(--ink);
    border-color: var(--line-strong);
}
.btn-ghost:hover { background: #fff; border-color: var(--ink); }
.btn-light { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-light:hover { border-color: var(--ink); }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; pointer-events: none; }

/* ---------- 顶栏 ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(247, 245, 240, .88);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--line);
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 28px;
    min-height: 68px;
}
.logo { display: inline-flex; align-items: center; gap: 11px; flex-shrink: 0; }
.logo-mark {
    width: 38px; height: 38px;
    display: grid; place-items: center;
    border-radius: 11px;
    background: var(--ink);
    color: #f7f5f0;
    font-family: var(--font-serif);
    font-size: 21px;
    line-height: 1;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.14);
}
.logo-text {
    display: flex;
    flex-direction: column;
    font-weight: 800;
    font-size: 17px;
    letter-spacing: .5px;
    line-height: 1.15;
}
.logo-text small {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 2px;
    color: var(--muted);
    margin-top: 3px;
}
.main-nav { display: flex; align-items: center; gap: 4px; margin-left: 6px; }
.main-nav > a,
.nav-drop-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    border: 0;
    background: transparent;
    border-radius: 999px;
    font-size: 14.5px;
    color: var(--ink-2);
    transition: background .2s ease, color .2s ease;
}
.main-nav > a:hover, .nav-drop-toggle:hover, .main-nav > a.active { background: #fff; color: var(--ink); }
.nav-drop { position: relative; }
.nav-drop-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    min-width: 190px;
    padding: 8px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: all .18s ease;
}
.nav-drop:hover .nav-drop-menu,
.nav-drop:focus-within .nav-drop-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.nav-drop-menu a {
    display: block;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    color: var(--ink-2);
}
.nav-drop-menu a:hover { background: var(--paper); color: var(--accent); }

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.search-mini {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 210px;
    padding: 8px 14px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    transition: border-color .2s ease, box-shadow .2s ease;
}
.search-mini:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(27,30,37,.06); }
.search-mini input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 13.5px;
}
.search-mini input::placeholder { color: #a7acb6; }
.menu-toggle {
    display: none;
    width: 42px; height: 42px;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 12px;
    padding: 11px 10px;
    flex-direction: column;
    justify-content: space-between;
}
.menu-toggle span { display: block; height: 2px; background: var(--ink); border-radius: 2px; transition: .2s ease; }
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav {
    border-top: 1px solid var(--line);
    background: #fff;
    padding: 10px 24px 22px;
}
.mobile-nav > a {
    display: block;
    padding: 13px 4px;
    border-bottom: 1px solid var(--line);
    font-size: 15px;
}
.mobile-nav > a:last-of-type { border-bottom: 0; }
.search-mobile { display: flex; gap: 8px; margin-top: 12px; }
.search-mobile input {
    flex: 1;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--paper);
    outline: 0;
}
.search-mobile button {
    padding: 0 20px;
    border: 0;
    border-radius: 10px;
    background: var(--ink);
    color: #fff;
}

/* ---------- 广告位 ---------- */
.ad-slot {
    margin: 22px auto;
    max-width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    align-items: center;
}
.ad-item img {
    border-radius: var(--radius-sm);
    max-height: 140px;
    width: auto;
    margin: 0 auto;
}
.ad-html { width: 100%; text-align: center; }

/* ---------- 生成器 ---------- */
.generator-section { padding: 30px 0 46px; }
.fg {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: var(--shadow);
    overflow: hidden;
}
.fg-stage {
    padding: 18px 18px 0;
    background: #fdfcf9;
    border-bottom: 1px solid var(--line);
}
.fg-screen {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 300px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    background-color: #f4f1e9;
    background-image:
        linear-gradient(45deg, rgba(27,30,37,.034) 25%, transparent 25%, transparent 75%, rgba(27,30,37,.034) 75%),
        linear-gradient(45deg, rgba(27,30,37,.034) 25%, transparent 25%, transparent 75%, rgba(27,30,37,.034) 75%);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
}
.fg-screen img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 56vh;
}
.fg-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--muted);
    text-align: center;
}
.fg-empty strong { font-size: 15px; color: var(--ink-2); }
.fg-loading {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    font-size: 13px;
    color: var(--ink-2);
    background: rgba(244, 241, 233, .74);
}
.fg-loading[hidden] { display: none; }
.fg-spinner {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: 2px solid rgba(27, 30, 37, .16);
    border-top-color: var(--accent);
    animation: fg-spin .7s linear infinite;
}
@keyframes fg-spin { to { transform: rotate(360deg); } }
.fg-stage-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    padding: 14px 2px 16px;
}
.fg-meta {
    font-size: 13px;
    color: var(--ink-2);
    font-variant-numeric: tabular-nums;
}
.fg-downloads { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.fg-downloads .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }

.fg-panel {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 22px;
}
.fg-row { display: flex; align-items: flex-end; gap: 12px; }
.fg-text-field { flex: 1; min-width: 0; }
.fg-text-field .input { height: 46px; font-size: 16px; font-weight: 500; }
.fg-count { font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.fg-size .val { font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.fg-reset { flex-shrink: 0; height: 46px; padding: 0 22px; border-radius: 12px; }

.fg-block { display: flex; flex-direction: column; gap: 12px; }
.fg-block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.fg-block-head h3 { font-size: 14px; letter-spacing: .4px; }
.fg-block-head span { font-size: 12px; color: var(--muted); }

.fg-fonts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
    padding: 2px;
}
.fg-font {
    display: flex;
    flex-direction: column;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
    text-align: left;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.fg-font:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.fg-font:focus-visible { outline: 0; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(27, 30, 37, .10); }
.fg-font.is-active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.fg-font-thumb {
    display: grid;
    place-items: center;
    height: 58px;
    overflow: hidden;
    background: var(--paper);
}
.fg-font-thumb img { width: 100%; height: 100%; object-fit: contain; }
.fg-font-fallback { font-family: var(--font-serif); font-size: 26px; color: var(--ink); }
.fg-font-name {
    padding: 7px 10px 8px;
    border-top: 1px solid var(--line);
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.fg-font.is-active .fg-font-name { color: var(--accent); }
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label, .field-label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink-2);
    letter-spacing: .3px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.field-label .val { font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.input, .select, .textarea {
    width: 100%;
    padding: 10px 13px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: #fff;
    font-size: 14px;
    outline: 0;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(27,30,37,.06); }
.textarea { resize: vertical; min-height: 78px; line-height: 1.6; }
.select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4.5 6 8.5l4-4' fill='none' stroke='%238a909c' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 13px center;
    padding-right: 34px;
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.range-row { display: flex; align-items: center; gap: 12px; }
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    border-radius: 4px;
    background: var(--line-strong);
    outline: 0;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: var(--ink);
    border: 3px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.25);
    cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
    width: 14px; height: 14px;
    border-radius: 50%;
    background: var(--ink);
    border: 3px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.25);
    cursor: pointer;
}
.swatches { display: flex; align-items: center; gap: 8px; }
input[type="color"] {
    -webkit-appearance: none;
    appearance: none;
    width: 40px; height: 34px;
    padding: 0;
    border: 1px solid var(--line-strong);
    border-radius: 9px;
    background: #fff;
    cursor: pointer;
    overflow: hidden;
}
input[type="color"]::-webkit-color-swatch-wrapper { padding: 3px; }
input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 6px; }
.hex-input { flex: 1; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; text-transform: uppercase; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 2px 0; }
.switch { position: relative; width: 40px; height: 22px; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 2; }
.switch .track { position: absolute; inset: 0; border-radius: 999px; background: var(--line-strong); transition: .2s ease; }
.switch .track::after {
    content: "";
    position: absolute;
    left: 3px; top: 3px;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
    transition: .2s ease;
}
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(18px); }
.fg-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px 22px;
    padding: 18px;
    border: 1px dashed var(--line-strong);
    border-radius: 14px;
    background: #fdfcf9;
}
.fg-inline { display: flex; align-items: center; gap: 9px; margin-top: 7px; }
.fg-inline input[type="range"] { flex: 1; min-width: 0; }
.fg-hex {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}
.fg-seg { display: flex; align-items: center; gap: 8px; }
.fg-seg-item { position: relative; }
.fg-seg-item input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}
.fg-seg-item span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    padding: 0 16px;
    border: 1px solid var(--line-strong);
    border-radius: 9px;
    background: #fff;
    font-size: 13px;
    color: var(--ink-2);
    transition: background .18s ease, border-color .18s ease, color .18s ease;
}
.fg-seg-item input:hover + span { border-color: var(--ink); color: var(--ink); }
.fg-seg-item input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.fg-seg-item input:focus-visible + span { box-shadow: 0 0 0 3px rgba(27, 30, 37, .12); }
.fg-seg input[type="color"] { width: 42px; height: 34px; flex-shrink: 0; }
.fg-seg input[type="color"][disabled] { opacity: .38; cursor: not-allowed; }
.fg-flags .switch-row + .switch-row { border-top: 1px dashed var(--line); padding-top: 8px; margin-top: 2px; }

/* ---------- 区块标题 ---------- */
.section { padding: 44px 0; }
.section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}
.section-head h2 { font-size: clamp(22px, 2.4vw, 28px); letter-spacing: -.3px; }
.section-head p { color: var(--muted); font-size: 13.5px; margin-top: 6px; }
.section-head .more { font-size: 13.5px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }
.section-head .more:hover { color: var(--accent); }

/* ---------- 分类 chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fff;
    font-size: 13.5px;
    color: var(--ink-2);
    transition: all .18s ease;
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- 字体网格 ---------- */
.font-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
    gap: 20px;
}
.font-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.font-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.font-card-link { display: block; }
.font-thumb {
    position: relative;
    aspect-ratio: 3 / 1;
    background: #fbfaf6;
    border-bottom: 1px solid var(--line);
    display: grid;
    place-items: center;
    overflow: hidden;
}
.font-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 12px; }
.font-thumb-fallback {
    font-family: var(--font-serif);
    font-size: 64px;
    color: #c9c2b2;
}
.font-thumb-tag {
    position: absolute;
    left: 10px;
    top: 10px;
    padding: 2px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,.9);
    border: 1px solid var(--line);
    font-size: 11px;
    color: var(--ink-2);
    backdrop-filter: blur(4px);
}
.font-card-body { padding: 14px 16px 16px; }
.font-card-name {
    font-size: 15.5px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 6px;
}
.font-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--muted);
}
.font-card-go { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-weight: 600; }
.font-card:hover .font-card-go svg { transform: translateX(3px); }
.font-card-go svg { transition: transform .2s ease; }

.empty-state {
    padding: 60px 20px;
    text-align: center;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    background: #fff;
    color: var(--muted);
}
.empty-state strong { display: block; color: var(--ink); font-size: 16px; margin-bottom: 6px; }

/* ---------- 分页 ---------- */
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin-top: 34px; }
.pager-link {
    min-width: 40px;
    height: 40px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #fff;
    font-size: 13.5px;
    color: var(--ink-2);
    transition: all .18s ease;
}
.pager-link:hover { border-color: var(--ink); color: var(--ink); }
.pager-link.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.pager-link.disabled { opacity: .45; pointer-events: none; }
.pager-gap { color: var(--muted); padding: 0 2px; }
.pager-info { width: 100%; text-align: center; font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ---------- 字体详情 ---------- */
.page-head { padding: 26px 0 8px; }
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { color: #c9c2b2; }
.font-hero {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 28px;
    padding: 30px 0 8px;
}
.font-preview-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: var(--shadow);
    overflow: hidden;
}
.font-preview-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 16px 22px;
    border-bottom: 1px solid var(--line);
    background: #fdfcf9;
    font-size: 12px;
    color: var(--muted);
}
.font-preview-top .tag {
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--paper);
    border: 1px solid var(--line);
    color: var(--ink-2);
}
.font-preview-stage {
    padding: 26px;
    background-color: #f7f4ec;
    background-image:
        linear-gradient(45deg, rgba(27,30,37,.025) 25%, transparent 25%, transparent 75%, rgba(27,30,37,.025) 75%),
        linear-gradient(45deg, rgba(27,30,37,.025) 25%, transparent 25%, transparent 75%, rgba(27,30,37,.025) 75%);
    background-size: 22px 22px;
    background-position: 0 0, 11px 11px;
    min-height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
}
#detailCanvas { max-width: 100%; height: auto; border-radius: 6px; box-shadow: 0 12px 40px rgba(27,30,37,.12); }
.font-preview-input { padding: 16px 22px; border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: center; background: #fff; }
.font-preview-input label { font-size: 12.5px; color: var(--muted); flex-shrink: 0; }
.font-preview-input .input { flex: 1; }
.font-info { display: flex; flex-direction: column; gap: 16px; }
.info-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
}
.info-card h1 { font-size: clamp(24px, 2.6vw, 32px); letter-spacing: -.4px; margin-bottom: 8px; }
.info-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.info-tags a { font-size: 12px; color: var(--accent); background: var(--accent-soft); padding: 3px 10px; border-radius: 999px; }
.info-list { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 14px; display: grid; gap: 9px; }
.info-list div { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.info-list dt { color: var(--muted); }
.info-list dd { margin: 0; color: var(--ink-2); text-align: right; }
.info-actions { display: grid; gap: 10px; margin-top: 16px; }
.info-note { font-size: 12px; color: var(--muted); line-height: 1.7; }

.related-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

/* ---------- 内容页 / 关于 ---------- */
.page-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: clamp(24px, 4vw, 44px);
    box-shadow: var(--shadow-sm);
    margin-bottom: 40px;
}
.page-card h1 { font-size: clamp(24px, 3vw, 32px); margin-bottom: 18px; }
.prose { color: var(--ink-2); font-size: 15px; line-height: 1.95; }
.prose h2 { font-size: 19px; margin: 26px 0 10px; color: var(--ink); }
.prose h3 { font-size: 16px; margin: 20px 0 8px; color: var(--ink); }
.prose p { margin: 0 0 14px; }
.prose ul { list-style: disc; padding-left: 22px; margin-bottom: 14px; }
.prose li { margin-bottom: 6px; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.prose img { border-radius: 10px; margin: 10px 0; }
.prose blockquote {
    margin: 16px 0;
    padding: 12px 18px;
    border-left: 3px solid var(--accent);
    background: var(--paper);
    border-radius: 0 8px 8px 0;
    color: var(--ink-2);
}
.prose pre, .prose code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    background: var(--paper);
    border-radius: 6px;
}
.prose code { padding: 2px 6px; font-size: 13px; }
.prose pre { padding: 14px; overflow: auto; }

/* ---------- 页脚 ---------- */
.site-footer {
    margin-top: 60px;
    background: #1b1e25;
    color: #c4c8d0;
    padding: 52px 0 26px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
    gap: 40px;
    padding-bottom: 36px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.site-footer .logo-mark { background: #f7f5f0; color: #1b1e25; }
.site-footer .logo-text { color: #f7f5f0; }
.footer-brand p { margin-top: 16px; font-size: 13px; line-height: 1.9; color: #9198a4; max-width: 320px; }
.footer-col h3 { font-size: 13px; letter-spacing: 1.5px; color: #f7f5f0; margin-bottom: 16px; font-weight: 600; }
.footer-col li { margin-bottom: 9px; }
.footer-col a { font-size: 13.5px; color: #a2a8b3; transition: color .2s ease; }
.footer-col a:hover { color: #fff; }
.friend-links { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.friend-links a { font-size: 13px; color: #a2a8b3; }
.friend-links a:hover { color: #fff; }
.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 22px;
    font-size: 12px;
    color: #7d8490;
}
.footer-bottom a { color: #a2a8b3; }
.footer-bottom a:hover { color: #fff; }
.site-footer .muted { color: #6f7682; }

.to-top {
    position: fixed;
    right: 22px;
    bottom: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.2);
    background: rgba(27,30,37,.82);
    color: #fff;
    font-size: 18px;
    backdrop-filter: blur(6px);
    z-index: 40;
    box-shadow: var(--shadow);
}

/* ---------- 提示 toast ---------- */
.toast {
    position: fixed;
    left: 50%;
    bottom: 32px;
    transform: translate(-50%, 14px);
    padding: 11px 20px;
    background: var(--ink);
    color: #fff;
    border-radius: 999px;
    font-size: 13.5px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    pointer-events: none;
    transition: all .25s ease;
    z-index: 90;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 字体库列表页 ---------- */
.list-title { margin: 12px 0 18px; }
.list-title h1 { font-size: clamp(26px, 3vw, 34px); letter-spacing: -.4px; }
.list-title p { font-size: 13.5px; margin-top: 6px; }
.list-search { display: flex; gap: 10px; max-width: 560px; margin-bottom: 8px; }
.list-search .input { flex: 1; }
.list-layout { display: grid; grid-template-columns: 1fr 290px; gap: 32px; align-items: start; margin-top: 10px; }
.list-main { min-width: 0; }
.list-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 22px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}
.sort-tabs { display: inline-flex; padding: 3px; background: #fff; border: 1px solid var(--line); border-radius: 999px; }
.sort-tab { padding: 6px 14px; border-radius: 999px; font-size: 13px; color: var(--muted); }
.sort-tab.active { background: var(--ink); color: #fff; }
.list-side { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 88px; }
.side-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.side-card h3 { font-size: 14px; letter-spacing: 1px; margin-bottom: 12px; }
.side-list li + li { border-top: 1px dashed var(--line); }
.side-list a { display: flex; align-items: center; gap: 10px; padding: 9px 0; font-size: 13.5px; }
.side-list a:hover .side-name { color: var(--accent); }
.side-rank {
    width: 22px; height: 22px;
    display: grid; place-items: center;
    border-radius: 6px;
    background: var(--paper);
    color: var(--muted);
    font-size: 11px;
    flex-shrink: 0;
}
.side-list li:nth-child(-n+3) .side-rank { background: var(--accent-soft); color: var(--accent); }
.side-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-count { font-size: 11.5px; color: var(--muted); }
.side-cats { display: flex; flex-wrap: wrap; gap: 6px; }
.side-cats a { padding: 5px 11px; border-radius: 8px; background: var(--paper); font-size: 12.5px; color: var(--ink-2); }
.side-cats a:hover { background: var(--ink); color: #fff; }
.font-grid .ad-slot { grid-column: 1 / -1; margin: 6px 0; }

/* ---------- 字体详情页 ---------- */
.detail-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin: 14px 0 18px;
}
.detail-head-main { max-width: 720px; }
.detail-head h1 { font-size: clamp(28px, 3.6vw, 40px); letter-spacing: -.6px; margin-bottom: 10px; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.detail-tags a { font-size: 12px; color: var(--accent); background: var(--accent-soft); padding: 3px 11px; border-radius: 999px; }
.detail-desc { color: var(--ink-2); font-size: 14px; line-height: 1.8; }
.detail-head-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.detail-size { font-size: 12px; color: var(--muted); }
.detail-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 24px;
}
.detail-stats div { background: #fff; padding: 14px 18px; display: flex; flex-direction: column; gap: 3px; }
.detail-stats span { font-size: 11.5px; color: var(--muted); letter-spacing: .5px; }
.detail-stats strong { font-size: 15px; font-weight: 700; }
[hidden] { display: none !important; }

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
    .fg-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .font-hero { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 30px; }
    .search-mini { width: 170px; }
    .list-layout { grid-template-columns: 1fr; }
    .list-side { position: static; display: grid; grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
    .main-nav { display: none; }
    .search-mini { display: none; }
    .menu-toggle { display: flex; }
    .mobile-nav[hidden] { display: none; }
    .header-inner { min-height: 62px; }
    .section { padding: 34px 0; }
}

@media (max-width: 640px) {
    .container { padding: 0 18px; }
    .fg-stage { padding: 12px 12px 0; }
    .fg-screen { min-height: 200px; padding: 12px; }
    .fg-stage-bar { padding: 12px 0 14px; }
    .fg-meta { width: 100%; }
    .fg-downloads { width: 100%; margin-left: 0; }
    .fg-downloads .btn { flex: 1; }
    .fg-panel { padding: 16px; gap: 20px; }
    .fg-row { flex-direction: column; align-items: stretch; }
    .fg-reset { width: 100%; }
    .fg-fonts { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: 270px; }
    .fg-options { grid-template-columns: 1fr; padding: 14px; }
    .field-row { grid-template-columns: 1fr; }
    .font-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
    .font-thumb-fallback { font-size: 48px; }
    .font-card-body { padding: 11px 12px 13px; }
    .font-card-name { font-size: 14px; }
    .font-card-meta { font-size: 11px; }
    .font-card-go { font-size: 11px; }
    .font-card-go svg { display: none; }
    .footer-grid { grid-template-columns: 1fr; gap: 26px; }
    .footer-bottom { font-size: 11.5px; }
    .font-preview-stage { padding: 16px; min-height: 240px; }
    .font-preview-input { flex-wrap: wrap; }
    .font-preview-input .btn { width: 100%; }
    .to-top { right: 14px; bottom: 16px; width: 40px; height: 40px; }
    .ad-item img { max-height: 110px; }
    .pager-info { font-size: 11px; }
    .pager-link { min-width: 36px; height: 36px; padding: 0 11px; }
    .list-side { grid-template-columns: 1fr; }
    .detail-stats { grid-template-columns: 1fr 1fr; }
    .detail-head-actions { align-items: flex-start; width: 100%; }
    .detail-head-actions .btn { width: 100%; }
    .list-search { flex-wrap: wrap; }
    .list-search .btn { width: 100%; }
}
