/* swatch-deck · 色卡 —— 涂料色卡：实色色块 + 色号贯穿全站，分类决定色系 */
:root {
    --sw-paper: #ffffff;
    --sw-counter: #f3f4f6;
    --sw-ink: #1b1b1f;
    --sw-soft: #555761;
    --sw-line: #e2e4e9;
    --sw-cobalt: #1f45d6;
    --sw-display: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
    --sw-body: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
    --pagination-accent: #1f45d6;
}

body.theme-swatch { margin: 0; background: var(--sw-counter); color: var(--sw-ink); font-family: var(--sw-body); font-size: 16px; }
:where(.theme-swatch) a { color: inherit; text-decoration: none; }
.theme-swatch :focus-visible { outline: 3px solid var(--sw-cobalt); outline-offset: 3px; }
.sw-skip { position: absolute; left: -9999px; }
.sw-skip:focus { left: 12px; top: 12px; z-index: 50; padding: 10px 14px; background: var(--sw-paper); font-weight: 600; }
.sw-counter:focus { outline: none; }

/* ---------- 母题：五个色系，每个色系五个色阶 ---------- */
.sw-family-0 { --sw-c1: #ffe1dc; --sw-c2: #ffb8ad; --sw-c3: #ff8a7a; --sw-c4: #e8604f; --sw-c5: #b83d2f; }
.sw-family-1 { --sw-c1: #fff3cf; --sw-c2: #ffe39a; --sw-c3: #ffd166; --sw-c4: #e8ae2b; --sw-c5: #a87812; }
.sw-family-2 { --sw-c1: #dcf6eb; --sw-c2: #b0ecd3; --sw-c3: #7ddcb5; --sw-c4: #3fb98a; --sw-c5: #217d5b; }
.sw-family-3 { --sw-c1: #dff2fb; --sw-c2: #b7e3f7; --sw-c3: #8ccff0; --sw-c4: #47a8d8; --sw-c5: #1f6f9a; }
.sw-family-4 { --sw-c1: #efe6fc; --sw-c2: #dccbf7; --sw-c3: #c3a8f0; --sw-c4: #9a76d9; --sw-c5: #6745a8; }
.sw-chip-code, .sw-strip-code, .sw-sheet-code { font-family: var(--sw-display); font-weight: 700; letter-spacing: .06em; }
.sw-chip-family { font-size: .84rem; font-weight: 600; }

/* ---------- 页眉 ---------- */
.sw-header { background: var(--sw-paper); border-bottom: 1px solid var(--sw-line); }
.sw-header-inner { display: flex; align-items: center; gap: 20px; max-width: 1280px; margin: 0 auto; padding: 12px 24px; }
.sw-brand { display: inline-flex; align-items: center; gap: 12px; margin-right: auto; min-width: 0; }
.sw-brand-chips { display: inline-grid; grid-template-columns: repeat(5, 8px); height: 32px; border-radius: 4px; overflow: hidden; }
.sw-brand-chips i:nth-child(1) { background: #ff8a7a; }
.sw-brand-chips i:nth-child(2) { background: #ffd166; }
.sw-brand-chips i:nth-child(3) { background: #7ddcb5; }
.sw-brand-chips i:nth-child(4) { background: #8ccff0; }
.sw-brand-chips i:nth-child(5) { background: #c3a8f0; }
.sw-brand-name { font-family: var(--sw-display); font-weight: 700; font-size: 1.5rem; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sw-nav { display: flex; gap: 6px; }
.sw-nav a { padding: 8px 14px; border-radius: 6px; font-weight: 600; font-size: .95rem; }
.sw-nav a:hover { background: var(--sw-counter); }
.sw-nav a.is-on { background: var(--sw-ink); color: #fff; }
.sw-menu-toggle { display: none; color: inherit; }

/* ---------- 版心 ---------- */
.sw-counter { min-height: 60vh; padding-bottom: 48px; }
.sw-wrap { max-width: 1280px; margin: 0 auto; padding: 24px 24px 0; }
.sw-crumb { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 0 8px; font-size: .9rem; color: var(--sw-soft); }
.sw-crumb a { color: var(--sw-cobalt); font-weight: 600; }
.sw-empty { margin: 32px 0; text-align: center; color: var(--sw-soft); }
.sw-pager { margin-top: 32px; }

/* ---------- 首页头条：大样卡 ---------- */
.sw-sample { margin-bottom: 24px; }
.sw-sample-link { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); background: var(--sw-paper); border-radius: 6px; overflow: hidden; box-shadow: 0 1px 3px rgba(27, 27, 31, .1); }
.sw-sample-link img { display: block; width: 100%; height: 100%; aspect-ratio: 8 / 3; object-fit: cover; background: var(--sw-c1); }
.sw-sample-card { display: grid; gap: 14px; align-content: start; padding: 0 0 24px; background: var(--sw-c1); }
.sw-sample-card > :not(.sw-sample-tones) { margin: 0 24px; }
.sw-sample-tones { display: grid; grid-template-columns: repeat(5, 1fr); height: 56px; }
.sw-sample-tones i:nth-child(1), .sw-gradient i:nth-child(1), .sw-fan-block i:nth-child(1) { background: var(--sw-c1); }
.sw-sample-tones i:nth-child(2), .sw-gradient i:nth-child(2) { background: var(--sw-c2); }
.sw-sample-tones i:nth-child(3), .sw-gradient i:nth-child(3), .sw-fan-block i:nth-child(2) { background: var(--sw-c3); }
.sw-sample-tones i:nth-child(4), .sw-gradient i:nth-child(4) { background: var(--sw-c4); }
.sw-sample-tones i:nth-child(5), .sw-gradient i:nth-child(5), .sw-fan-block i:nth-child(3) { background: var(--sw-c5); }
.sw-sample-title { font-family: var(--sw-display); font-weight: 700; font-size: clamp(1.6rem, 2.6vw, 2.4rem); line-height: 1.1; letter-spacing: -.02em; }
.sw-sample-link:hover .sw-sample-title { text-decoration: underline; text-decoration-thickness: 3px; text-decoration-color: var(--sw-c5); }
.sw-sample-excerpt { color: #3c3d44; line-height: 1.6; }

/* ---------- 色卡：图片 + 实色色块 + 色号 ---------- */
.sw-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.sw-rack { margin-top: 8px; }
.sw-rack-title { margin: 0 0 16px; font-family: var(--sw-display); font-weight: 700; font-size: 1.5rem; letter-spacing: -.01em; }
.sw-rack-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.sw-chip { min-width: 0; }
.sw-chip-link { display: grid; grid-template-rows: auto auto 1fr auto; height: 100%; background: var(--sw-paper); border-radius: 6px; overflow: hidden; box-shadow: 0 1px 3px rgba(27, 27, 31, .1); }
.sw-chip-link img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; background: var(--sw-c1); }
.sw-chip-block { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 18px 16px 10px; background: var(--sw-c3); color: var(--sw-ink); }
.sw-chip-code { font-size: 1.05rem; }
.sw-chip-title { padding: 14px 16px 6px; font-family: var(--sw-display); font-weight: 700; font-size: 1.12rem; line-height: 1.25; }
.sw-chip-link:hover .sw-chip-title { color: var(--sw-cobalt); }
.sw-chip-date { padding: 0 16px 14px; font-size: .84rem; color: var(--sw-soft); }

/* ---------- 分类页：一条色卡带 ---------- */
.sw-cat-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.sw-strip { min-width: 0; }
.sw-strip-link { display: grid; grid-template-rows: auto auto 1fr; height: 100%; background: var(--sw-paper); border-radius: 6px; overflow: hidden; box-shadow: 0 1px 3px rgba(27, 27, 31, .1); }
.sw-strip-tone { display: block; height: 18px; }
.sw-tone-0 { background: var(--sw-c1); }
.sw-tone-1 { background: var(--sw-c2); }
.sw-tone-2 { background: var(--sw-c3); }
.sw-tone-3 { background: var(--sw-c4); }
.sw-tone-4 { background: var(--sw-c5); }
.sw-strip-link img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; background: var(--sw-c1); }
.sw-strip-text { display: grid; gap: 8px; align-content: start; padding: 14px 16px 16px; border-top: 6px solid var(--sw-c3); }
.sw-strip-code { font-size: .8rem; color: var(--sw-soft); }
.sw-strip-title { font-family: var(--sw-display); font-weight: 700; font-size: 1.2rem; line-height: 1.22; }
.sw-strip-link:hover .sw-strip-title { color: var(--sw-cobalt); }
.sw-strip-excerpt { color: var(--sw-soft); font-size: .94rem; line-height: 1.55; }
.sw-strip-meta { font-size: .84rem; font-weight: 600; color: var(--sw-ink); }
.sw-cat-list > .sw-ad:not(:has(.ad)) { display: none; }

/* ---------- 色系索引：扇形色卡 ---------- */
.sw-fan-title { margin: 8px 0 24px; font-family: var(--sw-display); font-weight: 700; font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -.02em; }
.sw-fan { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.sw-fan-card { display: grid; grid-template-rows: auto auto 1fr; background: var(--sw-paper); border-radius: 6px; overflow: hidden; box-shadow: 0 1px 3px rgba(27, 27, 31, .1); transition: transform .2s ease; }
.sw-fan-card:nth-child(odd) { transform: rotate(-1.2deg); }
.sw-fan-card:nth-child(even) { transform: rotate(1.2deg); }
.sw-fan-card:hover { transform: rotate(0) translateY(-4px); }
.sw-fan-block { display: grid; grid-template-rows: repeat(3, 40px); }
.sw-fan-name { padding: 14px 16px 4px; font-family: var(--sw-display); font-weight: 700; font-size: 1.2rem; }
.sw-fan-desc { padding: 0 16px 16px; color: var(--sw-soft); font-size: .9rem; line-height: 1.45; }

/* ---------- 广告壳：无广告时塌陷 ---------- */
.sw-ad:has(.ad) { margin: 24px 0; }
.sw-ad:has(.ad) .ad { min-height: 250px; margin: 0 !important; }

/* ---------- 页脚：色阶条 + 规格说明 ---------- */
.sw-footer { background: var(--sw-paper); border-top: 1px solid var(--sw-line); }
.sw-footer-tones { display: grid; grid-template-columns: repeat(5, 1fr); height: 12px; }
.sw-footer-tones span:nth-child(1) { background: #ff8a7a; }
.sw-footer-tones span:nth-child(2) { background: #ffd166; }
.sw-footer-tones span:nth-child(3) { background: #7ddcb5; }
.sw-footer-tones span:nth-child(4) { background: #8ccff0; }
.sw-footer-tones span:nth-child(5) { background: #c3a8f0; }
.sw-footer-body { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px 40px; align-items: center; max-width: 1280px; margin: 0 auto; padding: 24px 24px 96px; }
.sw-footer-spec { display: grid; grid-template-columns: auto auto; gap: 2px 16px; margin: 0; }
.sw-footer-spec dt { font-size: .76rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--sw-soft); }
.sw-footer-spec dd { margin: 0; font-family: var(--sw-display); font-weight: 700; }
.sw-footer-nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 20px; }
.sw-footer-nav a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; color: var(--sw-cobalt); }
.sw-footer-note { grid-column: 1 / -1; margin: 0; font-size: .85rem; color: var(--sw-soft); }

/* ---------- 共享页面调色 ---------- */
.theme-swatch .site-menu, .theme-swatch .site-search, .theme-swatch .static-page { --menu-accent: var(--sw-cobalt); }

/* ---------- 断点 ---------- */
@media (min-width: 1600px) {
    .sw-wrap, .sw-header-inner, .sw-footer-body { max-width: 1520px; }
    .sw-rack-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@media (max-width: 1023px) {
    .sw-sample-link { grid-template-columns: minmax(0, 1fr); }
    .sw-sample-link img { aspect-ratio: 16 / 7; }
    .sw-sample-tones { height: 28px; }
    .sw-rack-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .sw-strip-excerpt { display: none; }
    .sw-footer-body { grid-template-columns: minmax(0, 1fr); }
    .sw-footer-nav { justify-content: flex-start; }
}

@media (max-width: 767px) {
    .sw-header-inner { min-height: 56px; padding: 4px 12px; gap: 10px; }
    .sw-brand-chips { grid-template-columns: repeat(5, 6px); height: 26px; }
    .sw-brand-name { font-size: 1.25rem; }
    .sw-menu-toggle { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 6px; background: var(--sw-counter); }
    .sw-wrap { padding: 12px 12px 0; }
    .sw-sample { margin-bottom: 16px; }
    .sw-sample-link img { aspect-ratio: 16 / 9; }
    .sw-sample-card { gap: 10px; padding-bottom: 16px; }
    .sw-sample-card > :not(.sw-sample-tones) { margin: 0 14px; }
    .sw-sample-tones { height: 16px; }
    .sw-sample-title { font-size: 1.45rem; }
    .sw-sample-excerpt { display: none; }
    .sw-row, .sw-rack-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .sw-chip-link { grid-template-columns: 112px minmax(0, 1fr); grid-template-rows: auto 1fr auto; }
    .sw-chip-link img { grid-row: 1 / span 3; height: 100%; aspect-ratio: auto; }
    .sw-chip-block { flex-wrap: wrap; gap: 2px 8px; padding: 6px 12px; }
    .sw-chip-code { font-size: .92rem; }
    .sw-chip-block .sw-chip-family { font-size: .76rem; }
    .sw-chip-title { padding: 8px 12px 4px; font-size: 1.02rem; }
    .sw-chip-date { padding: 0 12px 10px; }
    .sw-cat-list { grid-template-columns: minmax(0, 1fr); gap: 10px; }
    .sw-strip-link { grid-template-columns: 10px 96px minmax(0, 1fr); grid-template-rows: auto; }
    .sw-strip-tone { height: auto; }
    .sw-strip-link img { width: 96px; height: 100%; min-height: 96px; aspect-ratio: auto; }
    .sw-strip-text { padding: 10px 12px; gap: 4px; border-top: 0; }
    .sw-strip-title { font-size: 1.02rem; }
    .sw-fan { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .sw-fan-card:nth-child(n) { transform: none; }
    .sw-fan-block { grid-template-rows: repeat(3, 20px); }
    .sw-fan-desc { display: none; }
    .sw-footer-body { padding: 20px 12px 96px; }
}

/* 移动端：色系导航只在 /menu 出现，隐藏规则放在全局规则之后 */
@media (max-width: 767px) {
    .sw-nav { display: none; }
}

/* 浏览器闸门（2026-10-21）：色号是编码，不能被全站 overflow-wrap: anywhere 拆成竖排 */
.sw-chip-code, .sw-strip-code { white-space: nowrap; }
