/* 折闻 · 正式预览样式（对照 design/visual-spec.md） */

:root {
  --page: #F5F6F7;
  --paper: #FFFFFF;
  --ink: #1A1A1A;
  --ink-muted: #5C5C5C;
  --ink-faint: #8A8A8A;
  --rule: #E6E6E6;
  --border: #E6E6E6;
  --link: #1A1A1A;
  --link-hover: #D7141A;
  --accent: #D7141A;
  --accent-soft: #FDECEC;
  --price-old: #8A8A8A;
  --focus: #D7141A;

  --font-sans: "Noto Sans CJK SC", "Source Han Sans SC", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: "Noto Sans Mono CJK SC", "SF Mono", "Cascadia Mono", "Consolas",
    ui-monospace, monospace;

  --type-logo: 22px;
  --type-nav: 15px;
  --type-hero: clamp(24px, 2.6vw, 32px);
  --type-h1: clamp(24px, 2.4vw, 30px);
  --type-h2: 20px;
  --type-list: 18px;
  --type-body: 17px;
  --type-dek: 16px;
  --type-meta: 12px;
  --type-price: 16px;
  --type-price-lg: 24px;
  --type-caption: 13px;

  --page-max: 1120px;
  --measure: 40rem;
  --margin: clamp(16px, 4vw, 32px);
  --gutter: 24px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --space-6: 48px;
  --nav-h: 56px;
  --thumb-w: 168px;
  --radius: 6px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --duration: 180ms;
}

* { box-sizing: border-box; }

html { background: var(--page); scroll-padding-top: calc(var(--nav-h) + 24px); }

h1, h2, h3, .hero, .row, [id] {
  scroll-margin-top: calc(var(--nav-h) + 24px);
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--type-body);
  line-height: 1.7;
  -webkit-text-size-adjust: 100%;
}

img {
  display: block;
  max-width: 100%;
  object-fit: cover;
  object-position: center;
}

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); }
a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.wrap {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 var(--margin);
}

h1 {
  font-size: var(--type-h2);
  font-weight: 700;
  line-height: 1.35;
  margin: 0 0 var(--space-4);
}

/* ---------- 顶部声明条 ---------- */
.notice {
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  font-size: var(--type-meta);
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  padding: 6px 0;
}
.notice .wrap {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.topbar .wrap {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: var(--space-4);
}
.logo {
  font-size: var(--type-logo);
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
  letter-spacing: 0;
}
.nav {
  display: flex;
  gap: 20px;
  font-size: var(--type-nav);
  line-height: 1;
}
.nav a { color: var(--ink-muted); padding: 4px 0; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 2px;
}

/* ---------- 区块 ---------- */
main { background: var(--page); }
.container { padding: var(--space-5) var(--margin) var(--space-6); }
.section { padding: var(--space-4) 0 var(--space-1); }

.kicker {
  font-size: var(--type-meta);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent);
  margin: 0 0 12px;
}

/* 栏目头：kicker 左，more-link 右；下接一行栏目说明 */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
.section-head .kicker { margin: 0; }
.section-head .more-link { margin: 0; white-space: nowrap; }
.section-dek {
  font-size: var(--type-caption);
  line-height: 1.5;
  color: var(--ink-muted);
  margin: 8px 0 var(--space-3);
}

.meta {
  font-size: var(--type-meta);
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  line-height: 1.4;
}

/* ---------- 摘要 ---------- */
.summary-line {
  font-size: var(--type-meta);
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  margin: 0 0 var(--space-4);
}
.summary-line strong { color: var(--ink-muted); font-weight: 600; }

/* ---------- 头条 ---------- */
.hero { padding: var(--space-4) 0 var(--space-2); }
.hero-link { display: block; color: inherit; text-decoration: none; }
.hero-media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius);
  background: #F5F6F7;
}
.hero-media img {
  width: 100%; height: 100%; object-fit: cover; object-position: center; display: block;
}
.hero h2 {
  font-size: var(--type-hero);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: var(--space-3) 0 10px;
}
.hero .dek {
  font-size: var(--type-dek);
  line-height: 1.55;
  color: var(--ink-muted);
  margin: 0 0 10px;
  max-width: 46rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hero .meta { margin: 0; }
.hero-empty {
  color: var(--ink-faint);
  font-size: var(--type-caption);
  background: var(--paper);
  border: 1px dashed var(--rule);
  border-radius: var(--radius);
  padding: var(--space-5) var(--space-3);
  text-align: center;
}
a.hero-link:hover h2 { color: var(--link-hover); }

@media (min-width: 1000px) {
  .hero-link {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    gap: var(--gutter);
    align-items: center;
  }
  .hero-link h2 { margin-top: 0; }
}

/* ---------- 列表行 ---------- */
.list { border-top: 1px solid var(--rule); }
.row h3,
.row h3 a,
.row .dek,
.row .meta,
.row .deadline-note,
.row .verification-note,
.article .source-link { overflow-wrap: anywhere; }
.row {
  display: flex;
  align-items: flex-start;
  gap: var(--gutter);
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
}
.row .body { flex: 1 1 auto; min-width: 0; }
.row h3 {
  font-size: var(--type-list);
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 var(--space-1);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.row .dek {
  font-size: var(--type-dek);
  line-height: 1.55;
  color: var(--ink-muted);
  margin: 0 0 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.row .meta {
  font-size: var(--type-meta);
  color: var(--ink-faint);
}
.row .thumb {
  flex: 0 0 var(--thumb-w);
  width: var(--thumb-w);
}
.row .thumb .frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: #F5F6F7;
}
.row .thumb img {
  width: 100%; height: 100%; object-fit: cover; object-position: center; display: block;
}
a.row-link {
  display: flex;
  color: inherit;
  text-decoration: none;
}
a.row-link:hover h3 { color: var(--link-hover); }

/* 行内元信息与价格 */
.row .badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 4px;
}
.row .meta-line {
  font-size: var(--type-meta);
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  line-height: 1.5;
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}
.row .meta-line .src {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* 来源全名 / 短名：桌面显示全名，手机显示短名（同一位置只显示一个） */
.src-short { display: none; }
@media (max-width: 719px) {
  .row .meta-line .src-full { display: none; }
  .row .meta-line .src-short { display: inline; }
}
.row .meta-line .date {
  flex-shrink: 0;
  white-space: nowrap;
}
.row .meta-line .date::before {
  content: "·";
  margin-right: 6px;
  flex-shrink: 0;
}
.row .deal-price,
.row .deal-deadline {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row .deal-deadline {
  font-size: var(--type-meta);
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  margin: 4px 0 0;
}
.row .deal-price {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--type-price);
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
  margin: 6px 0 0;
}
.row .deal-price .row-label {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: var(--type-meta);
  color: var(--ink-faint);
}
.price-note {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: var(--type-caption);
  color: var(--ink-faint);
}
.price-sale { color: var(--ink); }
.price-original {
  font-weight: 400;
  color: var(--price-old);
  text-decoration: line-through;
  margin-left: 8px;
}
.price-original-only { color: var(--ink); }
.price-sale-missing {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: var(--type-caption);
  color: var(--ink-faint);
  margin-left: 8px;
}

/* 核实徽标：小字，不做大色块 */
.badge {
  display: inline-block;
  font-size: var(--type-meta);
  line-height: 1.4;
  letter-spacing: 0.02em;
  padding: 1px 6px;
  border-radius: 3px;
  border: 1px solid var(--rule);
  color: var(--ink-faint);
}
.badge-verified { color: var(--ink-muted); border-color: var(--rule); }
.badge-partial { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-soft); }
.badge-unverified { color: var(--accent); border-color: var(--accent-soft); }
.badge-cat,
.badge-source { color: var(--ink-faint); border-color: var(--rule); }

.row.partial h3::before,
.row.unverified h3::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 6px;
  background: var(--accent);
  vertical-align: 4px;
}
.row.verified h3::before { display: none; }

.verification-note {
  margin: 4px 0 6px;
  font-size: var(--type-caption);
  color: var(--ink-faint);
}

/* ---------- 文字封面（无本地图时，品牌色背景 + 白字） ---------- */
.cover {
  width: 100%;
  height: 100%;
  min-height: 0;
  border-radius: var(--radius);
  color: #FFFFFF;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 12px 16px;
  overflow: hidden;
}
.cover-kicker {
  font-size: 12px;
  line-height: 1.3;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.8);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cover-main {
  font-size: 13px;
  line-height: 1.35;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
/* 分隔细线：40×2，白 50%，上下各 12px 间距（仅优惠大封面显示，thumb 隐藏） */
.cover-rule {
  display: none;
}
/* 截止行 */
.cover-sub {
  display: none;
}
.hero-media .cover,
.figure .cover { height: auto; }
.cover--hero,
.cover--figure { aspect-ratio: 16 / 9; }
.cover--hero,
.cover--figure {
  padding: 28px 32px;
  gap: 0;
}
.cover--hero .cover-main,
.cover--figure .cover-main {
  font-size: 28px; line-height: 1.25;
  -webkit-line-clamp: 3;
}
.cover--hero .cover-kicker,
.cover--figure .cover-kicker { font-size: 13px; }
.cover--hero .cover-rule,
.cover--figure .cover-rule {
  display: block;
  width: 40px;
  height: 2px;
  margin: 12px 0;
  background: rgba(255, 255, 255, 0.5);
}
.cover--hero .cover-sub,
.cover--figure .cover-sub {
  display: block;
  font-size: 14px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.9);
}
.row .thumb .frame .cover { position: absolute; inset: 0; height: auto; }
.row .thumb .frame .cover-main { font-size: 13px; }
@media (max-width: 719px) {
  .cover--hero .cover-main,
  .cover--figure .cover-main { font-size: 20px; }
  .cover--hero,
  .cover--figure { padding: 18px 20px; }
  .cover--hero .cover-sub,
  .cover--figure .cover-sub { font-size: 13px; }
  .cover { padding: 10px 12px; }
}

/* 新闻行：原标题小字 */
.orig-title {
  font-size: 12px;
  line-height: 1.4;
  color: var(--ink-muted);
  margin: 0 0 var(--space-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.article .orig-title {
  font-size: 13px;
  color: var(--ink-faint);
  white-space: normal;
  overflow-wrap: anywhere;
  margin: 0 0 var(--space-3);
}

/* ---------- 筛选 ---------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  /* 不做 sticky，避免遮挡与位移 */
  position: static;
}
.filter-bar label {
  font-size: 14px;
  color: var(--ink-muted);
}
.filter-bar select {
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 10px;
  background: var(--paper);
  min-height: 44px;
}
.filter-bar button {
  font: inherit;
  font-size: 14px;
  color: var(--ink-muted);
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 16px;
  min-height: 44px;
  min-width: 96px;
  cursor: pointer;
  pointer-events: auto;
  /* 不加 transform/transition，避免位置变化与点击问题 */
}
.filter-bar button:hover { color: var(--accent); border-color: var(--accent); }

#deal-count {
  margin: 0 0 14px;
  font-size: var(--type-caption);
  color: var(--ink-faint);
}

/* ---------- 空态 / 加载 / 更多 ---------- */
.loading,
.empty {
  margin: 0;
  padding: var(--space-5) var(--space-3);
  border: 1px dashed var(--rule);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--ink-faint);
  text-align: center;
  background: var(--paper);
}
.more-link {
  margin: var(--space-3) 0 0;
  font-size: 14px;
}
.more-link a { color: var(--ink-muted); }
.more-link a:hover { color: var(--accent); }
/* section-head 内的 more-link 由 .section-head .more-link 收零边距 */

/* ---------- 条目页 ---------- */
.article {
  background: var(--paper);
  padding: var(--space-5) 0 40px;
  border-bottom: 1px solid var(--rule);
}
.article .inner {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--margin);
}
.back {
  font-size: var(--type-caption);
  color: var(--ink-faint);
  display: inline-block;
  margin-bottom: var(--space-3);
}
.back:hover { color: var(--accent); }
.article h1 {
  font-size: var(--type-h1);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
}
.article .dek {
  font-size: var(--type-dek);
  line-height: 1.55;
  color: var(--ink-muted);
  margin: 0 0 12px;
}
.article .meta { margin: 0 0 var(--space-4); }
.figure {
  position: relative;
  margin: 0 0 var(--space-4);
}
/* 详情主图：固定 16:9 容器，图片 cover 填满（Logo 类由 JS 加 is-contain 走 contain + 填底色） */
.figure-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
}
.figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
/* Logo / 特殊比例：容器内 contain 居中，背景色由 JS 依图片边缘色设置 */
.hero-media.is-contain img,
.row .thumb .frame.is-contain img,
.figure-frame.is-contain img {
  object-fit: contain;
}
.figure figcaption {
  font-size: var(--type-caption);
  line-height: 1.5;
  color: var(--ink-faint);
  margin-top: var(--space-2);
}
.article .detail-list {
  margin: var(--space-4) 0 0;
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink-muted);
}
.article .detail-list div { margin: 0 0 6px; }
.article .detail-list .row-label {
  color: var(--ink-faint);
  font-size: var(--type-meta);
  margin-right: 6px;
}
.article .source-link { color: var(--ink-muted); }
.article .source-link:hover { color: var(--accent); }

/* 价格块 */
.price-block {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 20px;
  margin: 0 0 28px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-muted);
}
.price-block .now {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--type-price-lg);
  font-weight: 600;
  line-height: 1.1;
  color: var(--ink);
  margin: 0 0 6px;
}
.price-block .now .price-original {
  font-family: var(--font-mono);
  font-size: var(--type-price);
  font-weight: 400;
  color: var(--price-old);
  text-decoration: line-through;
  margin-left: 10px;
}
.price-block .price-note { display: block; margin-top: 6px; }
.price-block,
.price-block dd,
.article .inner { min-width: 0; }
.price-block dl {
  margin: 12px 0 0;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 4px 16px;
}
.price-block dt { color: var(--ink-faint); font-size: var(--type-meta); }
.price-block dd { margin: 0; overflow-wrap: anywhere; }
.price-block dd a,
.price-block .deadline-note,
.price-block .verification-note,
.article .source-link { overflow-wrap: anywhere; }
.price-block .deadline-note,
.price-block .verification-note { display: block; margin-top: 4px; }

/* 外链阅读原文 */
.read-origin {
  display: inline-block;
  margin: var(--space-4) 0 0;
  font-size: 14px;
  color: var(--ink-muted);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 2px;
}
.read-origin:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* 相关阅读 */
.related { padding: var(--space-4) 0 var(--space-1); }
.related h2 {
  font-size: var(--type-h2);
  font-weight: 700;
  line-height: 1.35;
  margin: 0 0 var(--space-3);
}

/* ---------- 页脚 ---------- */
footer.site {
  background: var(--paper);
  border-top: 1px solid var(--rule);
  margin-top: var(--space-5);
  padding: var(--space-3) 0 40px;
  font-size: var(--type-caption);
  line-height: 1.7;
  color: var(--ink-faint);
}
footer.site .name { color: var(--ink-muted); font-weight: 600; }

/* ---------- 响应式 ---------- */
@media (min-width: 720px) {
  :root { --type-dek: 17px; }
}
@media (max-width: 719px) {
  :root { --gutter: 16px; --thumb-w: 110px; }
  .logo { font-size: 20px; }
  .nav { gap: 14px; font-size: 14px; }
  .hero .dek {
    font-size: var(--type-dek);
    -webkit-line-clamp: 2;
  }
  .row .dek {
    -webkit-line-clamp: 1;
  }
  .row { padding: 13px 0; }
  .row h3 { font-size: 16px; }
  .notice .wrap { justify-content: flex-start; }
  .summary-line { line-height: 1.7; }
  .container { padding: var(--space-4) var(--margin) var(--space-5); }

  /* 手机：more-link / back 可点区域 ≥ 44px（不改颜色与字号档位） */
  .more-link a,
  .back {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  /* 手机端列表缩略图文字封面：只显示主文字（11px / 3 行），不裁字 */
  .row .thumb .frame .cover {
    padding: 6px 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
  }
  .row .thumb .frame .cover .cover-kicker { display: none; }
  .row .thumb .frame .cover .cover-rule,
  .row .thumb .frame .cover .cover-sub { display: none; }
  .row .thumb .frame .cover .cover-main {
    font-size: 11px;
    line-height: 1.3;
    word-break: break-all;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}

a, h2, h3 { transition: color var(--duration) var(--ease); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
