:root {
    --bg: #f5f6f8;
    --panel: #ffffff;
    --panel-2: #f0f3f7;
    --text: #17202b;
    --text-dim: #4b5868;
    --muted: #768394;
    --line: #dde3ec;
    --accent: #b3740a;
    --accent-dark: #8a5a05;
    --blue: #1f5f8b;
    --green: #1d6b45;
    --red: #9b2c2c;
    --radius: 10px;
    --shadow: 0 2px 10px rgba(23, 32, 43, 0.06);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 0.9em;
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 0.05em 0.35em;
}
h1, h2, h3 { line-height: 1.35; color: #0b0f14; }
h1 { font-size: clamp(1.6rem, 3vw, 2.25rem); margin: 0 0 0.7rem; }
h2 { font-size: 1.35rem; margin: 0 0 0.6rem; }
h3 { font-size: 1.08rem; margin: 0 0 0.4rem; }
p { margin: 0 0 1rem; }
ul { margin: 0 0 1rem; padding-left: 1.3rem; }

.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;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: #fff;
    padding: 0.6rem 1rem;
    z-index: 100;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* ---------- header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(8px);
}
.header-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0.7rem 1.2rem;
    display: grid;
    grid-template-columns: auto minmax(260px, 1fr) auto;
    gap: 1rem;
    align-items: center;
}
.brand {
    display: flex;
    flex-direction: column;
    color: var(--text);
    line-height: 1.2;
    white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand-name { font-weight: 800; font-size: 1.05rem; letter-spacing: 0.02em; }
.brand-sub { font-size: 0.72rem; color: var(--muted); letter-spacing: 0.08em; }

.search { position: relative; }
.search input {
    width: 100%;
    height: 2.5rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--text);
    padding: 0 1rem;
    font: inherit;
    font-size: 0.92rem;
    outline: none;
}
.search input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(179, 116, 10, 0.12);
}
.search-results {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 0.4rem);
    max-height: 62vh;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 12px 30px rgba(23, 32, 43, 0.16);
    padding: 0.35rem;
    z-index: 60;
}
.search-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
    padding: 0.55rem 0.7rem;
    border-radius: 7px;
    color: var(--text);
    cursor: pointer;
}
.search-item:hover,
.search-item.active { background: #fdf3df; text-decoration: none; }
.search-item-main { display: flex; align-items: center; gap: 0.45rem; min-width: 0; }
.search-item-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-item-meta { color: var(--muted); font-size: 0.78rem; white-space: nowrap; }
.search-type {
    flex: 0 0 auto;
    font-size: 0.68rem;
    color: var(--blue);
    background: #e8f2f9;
    border-radius: 4px;
    padding: 0.05rem 0.35rem;
}
.search-empty { padding: 0.9rem; color: var(--muted); font-size: 0.9rem; }
.search-hint { padding: 0.45rem 0.7rem; color: var(--muted); font-size: 0.76rem; }

.top-nav { display: flex; gap: 0.7rem; align-items: center; white-space: nowrap; font-size: 0.86rem; }
.top-nav a { color: var(--text-dim); }
.top-nav a:hover { color: var(--accent); text-decoration: none; }

/* ---------- layout ---------- */
.container { max-width: 1180px; margin: 0 auto; padding: 1.5rem 1.2rem 3rem; }
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
    color: var(--muted);
    font-size: 0.82rem;
    margin: 0.2rem 0 1rem;
}
.breadcrumb a { color: var(--accent); }
.breadcrumb .sep { color: #b8c1cd; }

.hero {
    background: linear-gradient(135deg, #fffaf1 0%, #ffffff 55%, #eef5fb 100%);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: clamp(1.4rem, 4vw, 2.6rem);
    box-shadow: var(--shadow);
    margin-bottom: 1.6rem;
}
.eyebrow {
    margin: 0 0 0.5rem;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.lead { color: var(--text-dim); font-size: 1rem; max-width: 58rem; }
.hero-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.7rem;
    margin: 1.2rem 0;
}
.hero-stats > div {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.7rem 0.8rem;
}
.hero-stats strong { display: block; font-size: 1.15rem; color: var(--text); }
.hero-stats span { color: var(--muted); font-size: 0.78rem; }
.hot-row { display: flex; flex-wrap: wrap; gap: 0.45rem; align-items: center; font-size: 0.86rem; color: var(--muted); }
.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.22rem 0.65rem;
    color: var(--text-dim);
}
.chip:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.chip code { background: transparent; border: 0; padding: 0; color: var(--muted); }
.hero-help { margin: 1rem 0 0; color: var(--muted); font-size: 0.84rem; }

.page-head { margin: 0 0 1.2rem; }
.meta-line { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; color: var(--muted); font-size: 0.82rem; }
.meta-line span::before { content: "·"; color: #b8c1cd; margin-right: 0.5rem; }
.meta-line span:first-child::before { content: none; margin: 0; }

.section {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.2rem 1.3rem;
    margin: 1.1rem 0;
    box-shadow: var(--shadow);
}
.section-head { margin-bottom: 0.8rem; }
.section-head p { color: var(--muted); font-size: 0.88rem; margin: 0; }
.exchange-block { margin: 1.2rem 0 1.5rem; }
.exchange-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 0.6rem; }
.exchange-head h3 { margin: 0; font-size: 1.05rem; }
.exchange-head span { color: var(--muted); font-size: 0.8rem; }
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 0.7rem;
}
.product-card {
    display: block;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 0.8rem 0.9rem;
    color: var(--text);
    transition: border-color 0.15s, transform 0.15s;
}
.product-card:hover { border-color: var(--accent); transform: translateY(-1px); text-decoration: none; }
.card-top { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.card-top strong { font-size: 1rem; }
.card-top code { color: var(--muted); }
.card-numbers { display: flex; flex-wrap: wrap; gap: 0.4rem 0.9rem; margin-top: 0.45rem; font-size: 0.8rem; color: var(--text-dim); }
.card-numbers b { color: var(--text); }
.card-foot { margin-top: 0.35rem; color: var(--muted); font-size: 0.76rem; }

.badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.5;
    color: var(--green);
    background: #e8f5ee;
    border-radius: 4px;
    padding: 0 0.35rem;
    vertical-align: middle;
}
.badge-small { margin-left: 0.25rem; }

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.7rem;
    margin: 1rem 0;
}
.summary-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.8rem 0.9rem;
    box-shadow: var(--shadow);
}
.summary-label { display: block; color: var(--muted); font-size: 0.76rem; }
.summary-card strong { display: block; font-size: 1.25rem; margin: 0.15rem 0; }
.summary-card small { color: var(--muted); font-size: 0.76rem; }

.overview p { margin: 0 0 0.6rem; }
.overview p:last-child { margin-bottom: 0; }
.overview code { white-space: nowrap; }

.table-wrap { overflow-x: auto; margin: 0.7rem 0; }
table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
th, td { border-bottom: 1px solid var(--line); padding: 0.55rem 0.6rem; text-align: left; vertical-align: top; }
th { background: var(--panel-2); color: var(--text-dim); font-weight: 700; white-space: nowrap; }
tbody tr:hover { background: #fbfcfe; }
.main-row { background: #fffaf0; }
.main-row:hover { background: #fff5e2; }
.contract-id { font-family: "SFMono-Regular", Consolas, monospace; font-weight: 700; }
.fee-cell strong { display: block; font-weight: 700; white-space: nowrap; }
.fee-rate { display: block; margin-top: 0.1rem; color: var(--muted); font-size: 0.72rem; line-height: 1.4; }
.fee-mode {
    display: inline-block;
    margin-right: 0.3rem;
    padding: 0 0.3rem;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--panel-2);
    color: var(--text-dim);
    font-size: 0.68rem;
    line-height: 1.5;
    white-space: nowrap;
}
.mode-ratio { border-color: #cfe3ec; background: #f2f9fc; color: var(--blue); }
.mode-fixed { border-color: #f0e0bd; background: #fffaf0; color: var(--accent-dark); }
.mode-free { border-color: #d6e8dc; background: #f4fbf7; color: var(--green); }
.table-note, .muted { color: var(--muted); font-size: 0.8rem; }
.empty { padding: 1rem; color: var(--muted); background: var(--panel-2); border-radius: 7px; }

.spec-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.7rem;
    margin: 0.7rem 0;
}
.spec-grid > div { background: var(--panel-2); border-radius: 7px; padding: 0.65rem 0.75rem; }
.spec-grid span { display: block; color: var(--muted); font-size: 0.76rem; }
.spec-grid strong { display: block; font-size: 0.95rem; margin-top: 0.1rem; }
.hours { margin-top: 1rem; }
.hours p { margin: 0 0 0.35rem; }
.hours-list { list-style: none; margin: 0 0 0.4rem; padding: 0; display: grid; gap: 0.3rem; }
.hours-list li { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: baseline; }
.hours-list span {
    flex: none;
    min-width: 2.6rem;
    color: var(--muted);
    font-size: 0.8rem;
}
.hours-list strong { font-size: 0.9rem; font-weight: 600; }

.month-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.6rem; }
.month-card {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.7rem 0.8rem;
    color: var(--text);
}
.month-card:hover { border-color: var(--accent); text-decoration: none; }
.month-card strong { font-size: 1.05rem; }
.month-card span { color: var(--text-dim); font-size: 0.8rem; }
.month-card small { color: var(--muted); font-size: 0.74rem; }

.calc-box, .formula {
    background: #eef5fb;
    border: 1px solid #cfe1ef;
    border-radius: 8px;
    padding: 0.9rem 1rem;
    margin: 0.7rem 0;
}
.calc-box p:last-child, .formula p:last-child { margin-bottom: 0; }
.warning-box { background: #fff8e5; border-color: #efd9a9; }

.faq h3 { margin-top: 1rem; }
.faq h3:first-of-type { margin-top: 0; }
.related .link-grid { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.related .link-grid a {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.25rem 0.7rem;
    font-size: 0.84rem;
    color: var(--text-dim);
}
.related .link-grid a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

.archived-banner {
    background: #fff4e0;
    border: 1px solid #efd0a0;
    border-radius: 8px;
    padding: 0.8rem 1rem;
    margin: 1rem 0;
    font-size: 0.9rem;
}
.archived-banner a { margin-left: 0.3rem; }
.back-line { margin: 1.2rem 0 0; }
.button {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    border-radius: 999px;
    padding: 0.5rem 1rem;
    font-weight: 700;
}
.button:hover { background: var(--accent-dark); color: #fff; text-decoration: none; }
.error-page { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 2rem; margin-top: 1rem; }

.note-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.8rem; }
.note-grid > div { background: var(--panel-2); border-radius: 8px; padding: 0.8rem 0.9rem; }
.note-grid p { margin: 0; color: var(--text-dim); font-size: 0.88rem; }
.more-link { margin: 1rem 0 0; }

.site-reminder {
    margin: 1.5rem 0 0;
    background: #fffaf0;
    border: 1px solid #efd9a9;
    border-left: 4px solid var(--accent);
    border-radius: var(--radius);
    padding: 0.9rem 1.1rem;
    color: var(--text-dim);
    font-size: 0.88rem;
}
.site-reminder h2 { margin: 0 0 0.45rem; font-size: 1rem; color: var(--accent-dark); }
.site-reminder ul { margin: 0; padding-left: 1.2rem; }
.site-reminder li { margin: 0.25rem 0; }
.site-reminder li:last-child { margin-bottom: 0; }
.site-reminder strong { color: var(--text); }
.site-reminder code { white-space: nowrap; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: #fff; }
.footer-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 1.2rem;
    color: var(--muted);
    font-size: 0.8rem;
}
.footer-inner p { margin: 0 0 0.3rem; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
    .header-inner { grid-template-columns: auto 1fr; }
    .top-nav { grid-column: 1 / -1; justify-content: flex-start; overflow-x: auto; padding-bottom: 0.1rem; }
    .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .spec-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .header-inner { padding: 0.6rem 0.8rem; gap: 0.6rem; }
    .brand-name { font-size: 0.95rem; }
    .brand-sub { font-size: 0.66rem; }
    .search { grid-column: 1 / -1; grid-row: 2; }
    .top-nav { grid-row: 3; font-size: 0.8rem; }
    .container { padding: 1rem 0.8rem 2rem; }
    .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .summary-grid { grid-template-columns: 1fr 1fr; }
    .spec-grid { grid-template-columns: 1fr; }
    .note-grid { grid-template-columns: 1fr; }
    .product-grid { grid-template-columns: 1fr; }
    .section { padding: 1rem; }
    table { font-size: 0.8rem; }
    th, td { padding: 0.45rem 0.45rem; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .product-card { transition: none; }
}