/* style.css — 家用咖啡首页
   视觉基准：03-ui/home-ui-desktop.png（1024×1536，等比到 1440 设计宽 = 2160 高）
   分区预算见 03-ui/compare-log.md；颜色与字阶从稿上读取。 */

:root {
  --bg: #f3ebe2;
  --bg-warm: #f3ebe2;
  --header-bg: #efdfcb;
  --surface: #eedcc5;
  --surface-alt: #f0e0cb;
  --sand: #e8d6c2;
  --line: #ddcebb;
  --line-soft: #e9ddcc;
  --ink: #2c1a0d;
  --ink-2: #4a3320;
  --muted: #6d5a46;
  --accent: #6c3c14;
  --accent-2: #8a5322;
  --dark: #44301e;
  --dark-2: #432309;
  --cream: #fbf3e8;
  --on-dark: rgba(251, 243, 232, 0.82);
  --on-dark-soft: rgba(251, 243, 232, 0.6);
  --on-dark-line: rgba(251, 243, 232, 0.18);

  --font-sans: 'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;
  --font-num: "Noto Sans CJK SC", "Helvetica Neue", Arial, sans-serif;

  --fs-1: 11.5px;
  --fs-2: 13px;
  --fs-3: 15px;
  --fs-4: 17px;
  --fs-5: 21px;
  --fs-6: 26px;
  --fs-7: 34px;
  --fs-8: 44px;
  --fs-9: 54px;

  --lh-tight: 1.18;
  --lh-body: 1.85;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 44px;
  --space-8: 60px;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  --wrap: 1386px;
  --shadow-card: 0 1px 2px rgba(66, 36, 15, 0.06), 0 8px 24px rgba(66, 36, 15, 0.05);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;
  font-size: var(--fs-3);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
  border-radius: 4px;
}
.hero a:focus-visible { outline-color: var(--cream); }
.footer-bar a:focus-visible { outline-color: var(--cream); }
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 700; line-height: var(--lh-tight); letter-spacing: -0.01em; }
p { margin: 0; }
ul, ol, dl, dd, dt { margin: 0; padding: 0; list-style: none; }

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

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

/* ---------------------------------------------------------------- header */
.site-header {
  background: var(--header-bg);
  border-bottom: 1px solid transparent;
  position: sticky;
  top: 0;
  z-index: 40;
}
.header-inner {
  height: 66px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  flex: 0 0 auto;
}
.brand-mark { color: var(--accent); display: inline-flex; }
.brand-name { font-size: 21px; font-weight: 700; letter-spacing: 0.01em; }
.brand-tag {
  font-size: 12px;
  color: var(--muted);
  padding-left: 10px;
  margin-left: 2px;
  border-left: 1px solid var(--line);
  letter-spacing: 0.02em;
}
.site-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0;
}
.site-nav a {
  font-size: 15px;
  color: var(--ink-2);
  padding: 4px 13px;
  position: relative;
  white-space: nowrap;
}
.site-nav a + a::before {
  content: "·";
  position: absolute;
  left: -2px;
  color: #b9a48c;
}
.site-nav a:hover { color: var(--accent); }
.site-nav a[aria-current="page"] { color: var(--accent); font-weight: 700; }
.nav-toggle {
  display: none;
  margin-left: auto;
  width: 44px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 0;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 18px;
  height: 1.6px;
  margin: 3.5px auto;
  background: var(--ink);
}

/* ------------------------------------------------------------------ hero */
.hero {
  background: var(--dark);
  color: var(--cream);
  position: relative;
  overflow: hidden;
}
.hero-grid {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  min-height: 398px;
  padding-top: 26px;
  padding-bottom: 32px;
}
.hero-copy { max-width: 700px; }
.hero-eyebrow {
  font-size: 42px;
  font-weight: 700;
  line-height: 1.2;
  color: #e8c9a4;
  letter-spacing: 0.005em;
}
.hero h1 {
  font-size: 46px;
  margin-top: 6px;
  color: #fdf7f1;
  letter-spacing: 0.005em;
}
.hero-lead {
  margin-top: 14px;
  font-size: 15.5px;
  line-height: 1.85;
  color: var(--on-dark);
  max-width: 600px;
}
.hero-actions {
  margin-top: 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-3);
  font-weight: 700;
  line-height: 1.4;
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn::after { content: "→"; font-weight: 400; }
.btn:hover { transform: translateY(-1px); }
.btn-light { background: var(--cream); color: var(--dark); }
.btn-light:hover { background: #fff; }
.hero-alt { font-size: var(--fs-2); color: var(--on-dark); border-bottom: 1px solid var(--on-dark-line); padding-bottom: 2px; }
.hero-alt:hover { color: #fff; }
.hero-meta {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: var(--fs-2);
  color: var(--on-dark-soft);
}
.hero-meta > * + *::before { content: "·"; margin-right: 14px; }
.hero-media {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 47%;
  max-width: 700px;
  z-index: 1;
}
.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-media::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(90deg, var(--dark) 0%, rgba(66, 36, 15, 0.82) 16%, rgba(66, 36, 15, 0.18) 52%, rgba(66, 36, 15, 0) 78%);
  pointer-events: none;
}

/* ------------------------------------------------------- shared section */
.section-lead h2 {
  font-size: 30px;
  color: var(--ink);
  letter-spacing: 0.005em;
}
.section-lead p {
  margin-top: 12px;
  font-size: var(--fs-1);
  line-height: 1.85;
  color: var(--muted);
  max-width: 250px;
}

/* --------------------------------------------------------------- journey */
.journey {
  padding: 35px 0 33px;
  border-bottom: 1px solid var(--line-soft);
}
.journey-grid {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
.journey-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}
.step { text-align: left; position: relative; }
.step-thumb {
  display: block;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--sand);
}
.step-thumb img { width: 100%; height: 100%; object-fit: cover; }
.step-no {
  font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--accent-2);
  font-weight: 700;
  margin-right: 7px;
}
.step h3 { font-size: var(--fs-4); margin-top: 12px; color: var(--ink); display: flex; align-items: baseline; }
.step p { margin-top: 6px; font-size: 11px; line-height: 1.62; color: var(--muted); }
.step:not(:last-child)::after {
  content: "";
  position: absolute;
  right: -12px;
  top: 37px;
  width: 11px;
  height: 11px;
  border-top: 2px solid #b8a184;
  border-right: 2px solid #b8a184;
  transform: rotate(45deg);
}
.step-link {
  display: inline-block;
  margin-top: 12px;
  padding: 5px 15px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--cream);
  font-size: 11px;
  line-height: 1.6;
  font-weight: 700;
}
.step-link:hover { background: var(--accent-2); }

/* ------------------------------------------------------------ categories */
.categories {
  padding: 37px 0 39px;
  border-bottom: 1px solid var(--line-soft);
}
.categories-grid {
  display: grid;
  grid-template-columns: 332px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.cat-list {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}
.cat-card {
  display: block;
  height: 100%;
  padding: 16px 12px 15px;
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  transition: box-shadow 0.15s ease, transform 0.15s ease, background 0.15s ease;
}
.cat-card:hover { box-shadow: var(--shadow-card); transform: translateY(-2px); background: var(--surface-alt); }
.cat-icon { display: inline-flex; color: var(--accent-2); }
.cat-card h3 { font-size: 13.5px; margin-top: 8px; color: var(--ink); line-height: 1.35; }
.cat-card p { margin-top: 5px; font-size: 10.5px; line-height: 1.6; color: var(--muted); }

/* -------------------------------------------------------------- featured */
.featured {
  padding: 39px 0 41px;
  border-bottom: 1px solid var(--line-soft);
}
.featured-grid {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
.featured-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.feature-card {
  display: grid;
  grid-template-columns: 106px minmax(0, 1fr);
  gap: 13px;
  height: 100%;
  padding: 14px;
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.feature-card:hover { box-shadow: var(--shadow-card); transform: translateY(-2px); background: var(--surface-alt); }
.feature-thumb {
  display: block;
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: var(--sand);
}
.feature-thumb img { width: 100%; height: 100%; object-fit: cover; }
.feature-body { display: flex; flex-direction: column; }
.feature-body h3 { font-size: 14.5px; line-height: 1.5; color: var(--ink); }
.card-text {
  margin-top: 7px;
  font-size: 11px;
  line-height: 1.75;
  color: var(--muted);
}
.card-link {
  margin-top: auto;
  padding-top: 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--cream);
  background: var(--accent);
  border-radius: var(--radius-pill);
  padding: 4px 12px;
  align-self: flex-start;
  display: inline-block;
}

/* ----------------------------------------------------------------- table */
.params {
  padding: 28px 0 30px;
  border-bottom: 1px solid var(--line-soft);
}
.params-grid {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
.table-scroll { overflow-x: auto; }
.param-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface);
}
.param-table th,
.param-table td {
  text-align: left;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-2);
  vertical-align: middle;
}
.param-table thead th {
  background: var(--sand);
  color: var(--ink);
  font-size: var(--fs-2);
  font-weight: 700;
  border-bottom: 1px solid var(--line);
}
.param-table tbody tr:nth-child(even) { background: #f7efe4; }
.param-table tbody tr:last-child th,
.param-table tbody tr:last-child td { border-bottom: 0; }
.param-table tbody th { font-weight: 700; color: var(--ink); }

/* ----------------------------------------------------------------- roast */
.roast {
  padding: 40px 0 39px;
  border-bottom: 1px solid var(--line-soft);
}
.roast-grid {
  display: grid;
  grid-template-columns: 262px minmax(0, 1fr);
  gap: 26px;
  align-items: start;
}
.roast-scale {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  position: relative;
}
.roast-scale::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: 20px;
  height: 1px;
  background: var(--line);
}
.roast-scale li { position: relative; text-align: center; }
.bean {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin: 0 auto;
  position: relative;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.35), transparent 60%), #a9743f;
  box-shadow: 0 2px 6px rgba(66, 36, 15, 0.18);
}
.bean::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 12%;
  width: 2px;
  height: 76%;
  border-radius: 50%;
  transform: translateX(-50%) rotate(8deg);
  background: rgba(60, 30, 10, 0.35);
}
.bean-1 { background-color: #c79a63; }
.bean-2 { background-color: #b07c46; }
.bean-3 { background-color: #8d5a2d; }
.bean-4 { background-color: #603415; }
.bean-5 { background-color: #3a1d09; }
.roast-scale h3 { font-size: 13.5px; margin-top: 8px; color: var(--ink); }
.roast-scale p { margin-top: 4px; font-size: 10.5px; line-height: 1.58; color: var(--muted); }

/* ----------------------------------------------------------------- myths */
.myths {
  padding: 40px 0 42px;
  border-bottom: 1px solid var(--line-soft);
}
.myths-grid {
  display: grid;
  grid-template-columns: 332px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.myth-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
  counter-reset: myth;
}
.myth-list li { counter-increment: myth; position: relative; padding-left: 40px; }
.myth-list li::before {
  content: counter(myth, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 2px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--cream);
  font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
  line-height: 1;
}
.myth-list h3 { font-size: 13.5px; color: var(--ink); }
.myth-list p { margin-top: 5px; font-size: 10.5px; line-height: 1.62; color: var(--muted); }

/* ------------------------------------------------- closing / footer */
.site-footer {
  background: var(--bg-warm);
  border-top: 1px solid var(--line-soft);
}
.closing-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) 200px minmax(0, 1fr);
  grid-template-areas: "editorial brand nav";
  gap: 32px;
  padding-top: 26px;
  padding-bottom: 26px;
  align-items: start;
}
.editorial { grid-area: editorial; }
.editorial-title { display: flex; align-items: center; gap: 12px; color: var(--accent); }
.editorial-title h2 { font-size: var(--fs-5); color: var(--ink); }
.editorial-list { margin-top: 16px; display: grid; gap: 11px; }
.editorial-list > div { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 10px; }
.editorial-list dt {
  font-size: var(--fs-1);
  font-weight: 700;
  color: var(--accent);
  padding-top: 2px;
}
.editorial-list dd { font-size: var(--fs-1); line-height: 1.72; color: var(--ink-2); max-width: 560px; }

.footer-col { min-width: 0; }
.footer-brand { grid-area: brand; }
.footer-name { font-size: var(--fs-4); font-weight: 700; color: var(--ink); }
.footer-tagline { margin-top: 6px; font-size: var(--fs-1); line-height: 1.7; color: var(--muted); max-width: 210px; }
.footer-nav { grid-area: nav; }
.footer-heading { font-size: var(--fs-2); font-weight: 700; color: var(--ink); margin-bottom: 9px; }
.footer-nav ul { display: flex; flex-wrap: wrap; gap: 7px; }
.footer-nav a {
  display: inline-block;
  padding: 4px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  color: var(--ink-2);
  background: var(--surface);
}
.footer-nav a:hover { border-color: var(--accent); color: var(--accent); }

.footer-bar { background: var(--dark-2); color: var(--cream); }
.footer-bar-inner {
  min-height: 93px;
  padding-top: 18px;
  padding-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.footer-about { max-width: 720px; }
.footer-about .footer-heading { color: var(--cream); font-size: 12px; margin-bottom: 2px; }
.footer-about p:last-child { font-size: 11.5px; line-height: 1.65; color: var(--on-dark); }
.footer-logo { order: -1; font-size: var(--fs-5); font-weight: 700; color: #fdf7f1; white-space: nowrap; }
.footer-note { font-size: 11px; color: var(--on-dark-soft); white-space: nowrap; }

/* ----------------------------------------------------------- responsive */
@media (max-width: 1180px) {
  .brand-tag { display: none; }
  .site-nav a { padding: 4px 9px; font-size: 14px; }
  .journey-grid, .featured-grid, .params-grid, .roast-grid { grid-template-columns: 200px minmax(0, 1fr); gap: 24px; }
  .categories-grid, .myths-grid { grid-template-columns: 180px minmax(0, 1fr); gap: 22px; }
  .closing-grid { grid-template-columns: minmax(0, 1fr) 180px 200px; gap: 22px; }
  .cat-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .header-inner { height: auto; flex-wrap: wrap; gap: 4px 16px; padding: 10px 0 6px; }
  .site-nav {
    position: static;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
    margin-left: 0;
    padding: 0 0 4px;
    background: transparent;
    border: 0;
    box-shadow: none;
    gap: 0;
  }
  .site-nav a { padding: 4px 8px; border-bottom: 0; font-size: 13.5px; }
  .site-nav a + a::before { content: "·"; }
  .hero-grid { min-height: 0; padding-top: 26px; padding-bottom: 34px; }
  .hero-media { position: static; order: -1; width: auto; max-width: none; margin-bottom: 24px; height: 230px; }
  .hero-media img { height: 230px; border-radius: 0; }
  .hero-media::before { background: linear-gradient(180deg, rgba(66, 36, 15, 0) 55%, rgba(66, 36, 15, 0.55) 100%); }
  .hero-eyebrow { font-size: var(--fs-5); }
  .hero h1 { font-size: var(--fs-8); }
  .journey-grid, .featured-grid, .params-grid, .roast-grid,
  .categories-grid, .myths-grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .closing-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-areas: "editorial editorial" "brand nav";
    gap: 20px;
  }
  .section-lead p { max-width: none; }
  .journey-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .step:not(:last-child)::after { display: none; }
  .cat-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .featured-cards { grid-template-columns: 1fr; }
  .myth-list { grid-template-columns: 1fr; }
  .roast-scale { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bean { width: 36px; height: 36px; }
}

@media (max-width: 560px) {
  .wrap { padding: 0 18px; }
  .hero h1 { font-size: var(--fs-7); }
  .hero-eyebrow { font-size: var(--fs-5); }
  .hero-meta { flex-wrap: wrap; row-gap: 6px; }
  .journey-steps { grid-template-columns: 1fr; }
  .cat-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .roast-scale { grid-template-columns: 1fr; }
  .roast-scale::before { display: none; }
  .roast-scale li { text-align: left; display: grid; grid-template-columns: 44px 1fr; column-gap: 12px; }
  .roast-scale .bean { grid-row: span 2; margin: 0; }
  .closing-grid { grid-template-columns: 1fr; grid-template-areas: "editorial" "brand" "nav"; }
  .footer-bar-inner { flex-direction: column; align-items: flex-start; gap: 6px; padding-top: 16px; padding-bottom: 16px; }
  .param-table { font-size: 11.5px; }
  .param-table th, .param-table td { padding: 9px 10px; }
}

/* 详情页正文配图 */
.article figure { margin: 18px 0 22px; }
.article figure img { width: 100%; border-radius: var(--radius-md); object-fit: cover; }
/* 无目录时的单栏详情 */
.article-layout--single { grid-template-columns: minmax(0, 1fr); }
/* 首页分类卡篇数 */
.cat-card .cat-count { margin-left: 6px; font-size: 10.5px; font-weight: 400; color: var(--muted-alt); }
/* 首页底部全部条目入口 */
.home-all { padding-bottom: 36px; }
