/* =====================================================================
   方寸菜园 — 视觉系统「种子站 · 农事手账」v2
   墨绿墨色 · 燕麦纸 · 万寿菊黄 · 甜菜红
   标题=宋体 / 正文=无衬线 / 数据=等宽
   层次三级线规范：粗题线 1.5-2px 实线 · 正文 1px 细线 · 注释 1px 点线
   ===================================================================== */
:root {
  color-scheme: light;
  /* —— 沿用旧变量名（内联 var() 自动换肤），值全部重定 —— */
  --primary:        #3C7A43;   /* 园圃绿：主操作 */
  --primary-light:  #5A9A55;
  --primary-dark:   #2A5A33;
  --accent:         #E0A21B;   /* 万寿菊黄：阳光/光照 */
  --accent2:        #B23A5E;   /* 甜菜红：警示/农残 */
  --bg:             #E8E4D5;   /* 燕麦纸：页面 */
  --bg2:            #DEDAC8;   /* 深一档纸：内嵌轨道 */
  --surface:        #F4F1E6;   /* 种子包纸面：卡片 */
  --ink:            #20312A;   /* 松墨：正文/结构 */
  --muted:          #525E53;   /* 淡墨（对纸面 ≥4.5:1） */
  --rule:           #C7C0AC;   /* 纸上发丝线 */
  --shadow:         2px 3px 0 rgba(32,49,42,0.10);
  --radius:         6px;
  --radius-sm:      4px;
  --font:           "PingFang SC","HarmonyOS Sans SC","Microsoft YaHei","Segoe UI",system-ui,sans-serif;

  /* —— 新增 —— */
  --paper:   #E8E4D5;
  --card:    #F4F1E6;
  --gold:    #E0A21B;
  --gold-ink:#7D590B;          /* 金字加深（对纸面 ≥4.5:1） */
  --beet:    #B23A5E;
  --green:   #3C7A43;
  --line:    #C7C0AC;
  --display: "Songti SC","STSong","Noto Serif SC","Noto Serif CJK SC","Source Han Serif SC","Source Han Serif CN",STZhongsong,SimSun,serif;
  --sans:    var(--font);
  --mono:    "DM Mono","Roboto Mono",ui-monospace,SFMono-Regular,"JetBrains Mono",Menlo,Consolas,monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { font-size: 16px; }
body {
  font-family: var(--sans);
  color: var(--ink);
  line-height: 1.62;
  min-height: 100vh;
  background-color: var(--paper);
  /* 纸的牙口：feTurbulence 噪点 + 极淡纸纹点阵 */
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.13 0 0 0 0 0.19 0 0 0 0 0.16 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E"),
    radial-gradient(rgba(32,49,42,0.022) 1px, transparent 1.2px);
  background-size: 160px 160px, 5px 5px;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--gold); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
  border-radius: 2px;
}

fieldset { border: 0; min-width: 0; }
legend { padding: 0; }

/* ===== 数据=等宽 的通用约定 ===== */
.mono, .stat-value, .stepper-count, .season-count, .utilization,
.cal-months span, .cal-label-times, .enc-risk-fill { font-family: var(--mono); }

/* ===== 页面容器 ===== */
.page {
  display: none;
  max-width: 920px;
  margin: 0 auto;
  padding: 2.25rem 1.5rem 4rem;
  animation: fadeIn 0.5s ease;
}
.page.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== 导航栏（账册抬头） ===== */
.navbar {
  background: rgba(244,241,230,0.86);
  backdrop-filter: blur(6px);
  border-bottom: 1.5px solid var(--ink);
  padding: 0.85rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo {
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.logo-icon {
  width: 1.9rem; height: 1.9rem;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--green);
  color: #fff;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,0.35);
}
.logo-icon svg { width: 1.1rem; height: 1.1rem; }
.nav-back {
  background: none;
  border: 1.5px solid var(--ink);
  color: var(--ink);
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  font-family: var(--mono);
  transition: background .15s, color .15s;
}
.nav-back:hover { background: var(--ink); color: var(--paper); }

/* ===== 按钮（油印按压感，非渐变） ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.7rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--ink);
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--sans);
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .15s;
}
.btn-primary {
  background: var(--green);
  color: #FCFBF4;
  box-shadow: 3px 3px 0 var(--ink);
}
.btn-primary:hover { transform: translate(-1px,-1px); box-shadow: 4px 4px 0 var(--ink); }
.btn-primary:active { transform: translate(2px,2px); box-shadow: 1px 1px 0 var(--ink); }
.btn-primary:disabled {
  background: var(--bg2); color: var(--muted);
  border-color: var(--rule); box-shadow: none; cursor: not-allowed;
}
.btn-secondary {
  background: var(--card); color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
}
.btn-secondary:hover { transform: translate(-1px,-1px); box-shadow: 4px 4px 0 var(--ink); }
.btn-large { padding: 0.95rem 2.4rem; font-size: 1.08rem; }
.btn-small { padding: 0.42rem 0.9rem; font-size: 0.82rem; font-family: var(--mono); box-shadow: 2px 2px 0 var(--ink); }

/* ===== 首页 / 报头 ===== */
.hero {
  text-align: center;
  padding: 2.5rem 1rem 1rem;
  position: relative;
}
.hero-eyebrow {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.22em;
  color: var(--gold-ink);
  text-transform: uppercase;
  margin-bottom: 1.1rem;
  display: flex; align-items: center; justify-content: center; gap: 0.7rem;
}
.hero-eyebrow::before, .hero-eyebrow::after {
  content: ""; height: 1px; width: 38px; background: var(--rule);
}
/* 报头右缘竖排节气候应（线装书书脊） */
.hero-vterm {
  position: absolute;
  top: 4.6rem; right: 0.2rem;
  writing-mode: vertical-rl;
  text-orientation: upright;
  font-family: var(--display);
  font-size: 0.88rem;
  letter-spacing: 0.32em;
  color: var(--muted);
  border-left: 1px solid var(--rule);
  padding-left: 0.55rem;
  max-height: 17rem;
}
.hero-icon {
  width: 3.2rem; height: 3.2rem; margin: 0 auto 0.8rem;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--ink); border-radius: 50%;
  background: var(--gold);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.hero-icon svg { width: 1.7rem; height: 1.7rem; }
.hero h1 {
  font-family: var(--display);
  font-size: clamp(2.4rem, 7vw, 3.6rem);
  font-weight: 800;
  letter-spacing: 0.2em;
  text-indent: 0.2em; /* 抵消末字字距，保持视觉居中 */
  color: var(--ink);
  line-height: 1.05;
}
/* 报头文武线 */
.hero h1::after {
  content: "";
  display: block;
  width: min(360px, 70%);
  height: 0; margin: 0.9rem auto 0;
  border-top: 1.5px solid var(--ink);
  border-bottom: 4px double var(--ink);
  padding-top: 4px;
}
.hero-slogan {
  font-family: var(--display);
  font-size: 1.12rem;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  color: var(--gold-ink);
  margin-top: 1rem;
}
.hero .subtitle {
  margin: 0.7rem auto 1.6rem;
  max-width: 30rem;
  color: var(--muted);
  font-size: 0.97rem;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.8rem; justify-content: center; align-items: center; }
.hero-features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.9rem;
  margin-top: 3rem;
  text-align: left;
}
.feature-card {
  background: var(--card);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  padding: 1.1rem 1rem 1.2rem;
  box-shadow: var(--shadow);
  position: relative;
}
.feature-icon {
  display: inline-flex; width: 2.1rem; height: 2.1rem; margin-bottom: 0.55rem;
  color: var(--gold-ink);
}
.feature-icon svg { width: 100%; height: 100%; }
.feature-card h3 {
  font-family: var(--display);
  font-size: 1.02rem; font-weight: 700; letter-spacing: 0.04em;
  color: var(--ink); margin-bottom: 0.3rem;
}
.feature-card p { font-size: 0.82rem; color: var(--muted); line-height: 1.5; }

/* ===== 表单（账册字段） ===== */
.form-section {
  background: var(--card);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  padding: 1.8rem 1.6rem 2rem;
  margin-top: 1.5rem;
  box-shadow: var(--shadow);
}
.form-section h2 {
  font-family: var(--display);
  font-size: 1.5rem; font-weight: 700; letter-spacing: 0.05em;
  color: var(--ink);
}
.form-section .form-desc { color: var(--muted); font-size: 0.9rem; margin: 0.4rem 0 1.6rem; }

.form-group { margin-bottom: 1.6rem; }
.form-group > label, .form-group > legend {
  display: block;
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  color: var(--ink);
  font-weight: 600;
  margin-bottom: 0.6rem;
  padding-left: 0.9rem;
  position: relative;
}
.form-group > label::before, .form-group > legend::before {
  content: "▪"; position: absolute; left: 0; top: -1px; color: var(--gold-ink);
}
.form-group .hint {
  font-size: 0.78rem; color: var(--muted); margin-top: 0.55rem; line-height: 1.45;
}
.field-error {
  font-size: 0.8rem; color: var(--beet); font-weight: 600; margin-top: 0.45rem;
}
input.invalid, select.invalid { border-color: var(--beet); box-shadow: 0 0 0 1px var(--beet); }

input[type="number"], select {
  font-family: var(--mono);
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.7rem;
}
select { cursor: pointer; }
.dimension-inputs {
  display: flex; align-items: center; gap: 0.7rem;
}
.dimension-inputs input { width: 100%; }
.dimension-inputs span { color: var(--muted); font-weight: 700; font-family: var(--mono); }
/* 长/宽持久标签 + 单位 */
.dim-field {
  position: relative; display: inline-flex; align-items: center; flex: 1;
}
.dim-field input { width: 100%; padding-left: 2.1rem; padding-right: 2.1rem; }
.dim-field .dim-label {
  position: absolute; left: 0.7rem; font-size: 0.78rem; color: var(--muted);
  font-family: var(--sans); font-weight: 600; pointer-events: none;
}
.dim-field .dim-unit {
  position: absolute; right: 0.7rem; font-size: 0.78rem; color: var(--muted);
  font-family: var(--sans); pointer-events: none;
}

.radio-group { display: flex; flex-wrap: wrap; gap: 0.55rem; }
.radio-option { position: relative; }
.radio-option input { position: absolute; opacity: 0; pointer-events: none; }
.radio-option label {
  display: inline-block;
  padding: 0.5rem 0.95rem;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--ink);
  font-size: 0.9rem;
  cursor: pointer;
  transition: background .12s, color .12s, box-shadow .12s;
}
.radio-option label:hover { box-shadow: 2px 2px 0 var(--ink); }
.radio-option input:checked + label {
  background: var(--ink);
  color: var(--paper);
  box-shadow: 2px 2px 0 var(--gold);
}
.radio-option input:focus-visible + label { outline: 2px solid var(--green); outline-offset: 2px; }

/* 不可选的窗（背靠建筑侧） */
.radio-option input:disabled + label {
  opacity: 0.38; cursor: not-allowed; text-decoration: line-through;
  border-style: dashed; box-shadow: none;
}

/* ===== 光照精调折叠区 ===== */
.form-advanced {
  border: 1px dashed var(--rule);
  border-radius: var(--radius-sm);
  margin-bottom: 1.6rem;
  background: rgba(232,228,213,0.45);
}
.form-advanced > summary {
  cursor: pointer;
  list-style: none;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.7rem;
  padding: 0.75rem 0.95rem;
  font-family: var(--mono); font-size: 0.82rem; font-weight: 600;
  letter-spacing: 0.08em; color: var(--ink);
}
.form-advanced > summary::-webkit-details-marker { display: none; }
.form-advanced > summary::before { content: "▸"; color: var(--gold-ink); margin-right: 0.15rem; transition: transform .15s; display: inline-block; }
.form-advanced[open] > summary::before { transform: rotate(90deg); }
.form-advanced .adv-title small { font-weight: 400; color: var(--muted); letter-spacing: 0.04em; }
.form-advanced .adv-preview { font-weight: 400; color: var(--muted); font-size: 0.76rem; letter-spacing: 0.03em; }
.form-advanced .adv-body { padding: 0.4rem 0.95rem 0.2rem; border-top: 1px dashed var(--rule); }
.form-advanced .adv-body .form-group { margin-bottom: 1.2rem; }

/* ===== 选择页：顶栏 ===== */
.select-topbar {
  display: flex; flex-wrap: wrap; gap: 0.6rem;
  justify-content: space-between; align-items: center;
  border-top: 1.5px solid var(--ink);
  border-bottom: 1.5px solid var(--ink);
  padding: 0.7rem 0.2rem;
  margin-top: 0.5rem;
}
.select-topbar-info {
  font-family: var(--mono); font-size: 0.85rem; letter-spacing: 0.04em; color: var(--ink);
}
.select-topbar-slots { display: flex; gap: 1rem; align-items: baseline; }
.slot-count, .utilization { font-family: var(--mono); font-size: 0.85rem; color: var(--muted); }
.utilization { color: var(--gold-ink); font-weight: 600; }

/* ===== 四季占用条（账册条） ===== */
.season-bars {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem 1.4rem;
  margin: 1rem 0 0.4rem;
}
.season-bar-item { display: flex; align-items: center; gap: 0.6rem; }
.season-label {
  font-family: var(--display); font-weight: 700; font-size: 0.95rem;
  width: 1.4rem; text-align: center; color: var(--ink);
}
.season-bar-track {
  flex: 1; height: 12px; background: var(--bg2);
  border: 1px solid var(--ink); border-radius: 2px; overflow: hidden;
}
.season-bar-fill {
  height: 100%; background: var(--green);
  background-image: repeating-linear-gradient(45deg, rgba(255,255,255,0.18) 0 4px, transparent 4px 8px);
  transition: width .35s ease;
}
.season-bar-fill.over { background: var(--beet); }
.season-count { font-size: 0.78rem; color: var(--muted); width: 3rem; text-align: right; }
.season-warning {
  color: var(--beet); font-size: 0.82rem; margin: 0.3rem 0 0.6rem;
  font-weight: 600; min-height: 1rem;
}

/* ===== 推荐网格头 ===== */
.select-grid-header { margin: 1.4rem 0 0.9rem; }
.select-grid-header h3 {
  font-family: var(--display); font-size: 1.3rem; font-weight: 700; letter-spacing: 0.04em; color: var(--ink);
}
.select-subtitle { font-family: var(--sans); font-size: 0.82rem; font-weight: 400; color: var(--muted); letter-spacing: 0; }

.select-crop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1rem;
}

/* ===== 种子包卡片（signature：双线框 + 油印阴影 + 红章） ===== */
.select-card {
  position: relative;
  background: var(--card);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  padding: 1.3rem 1rem 0.9rem;   /* 顶部留白给右上角章 + 左上角旗 */
  box-shadow:
    inset 0 0 0 3px var(--card),
    inset 0 0 0 4px var(--rule),
    var(--shadow);
  transition: transform .14s ease, box-shadow .14s ease;
}
.select-card:hover {
  transform: translate(-1px,-2px);
  box-shadow:
    inset 0 0 0 3px var(--card),
    inset 0 0 0 4px var(--rule),
    4px 5px 0 rgba(32,49,42,0.14);
}
.select-card.selected {
  border-color: var(--green);
  box-shadow:
    inset 0 0 0 3px var(--card),
    inset 0 0 0 4px rgba(60,122,67,0.4),
    3px 4px 0 var(--green);
  background:
    linear-gradient(0deg, rgba(60,122,67,0.05), rgba(60,122,67,0.05)), var(--card);
}
/* 已选择小旗：贴在卡片内框角上，不悬浮出卡片 */
.select-card.selected::after {
  content: "已选择";
  position: absolute; top: 4px; left: 4px;
  font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.1em;
  background: var(--green); color: #fff;
  padding: 2px 7px; border-radius: 3px 0 var(--radius-sm) 0;
  z-index: 0;
}
.select-card-header { margin-bottom: 0.5rem; padding-right: 74px; }
.card-toggle {
  display: flex; align-items: center; gap: 0.5rem; width: 100%;
  background: none; border: none; padding: 0; cursor: pointer;
  text-align: left; font: inherit; color: inherit;
}
.card-check {
  flex: 0 0 auto;
  width: 1.15rem; height: 1.15rem;
  border: 1.5px solid var(--ink); border-radius: 3px;
  background: var(--paper);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.8rem; color: #fff; line-height: 1;
}
.select-card.selected .card-check { background: var(--green); border-color: var(--green); }
.select-card.selected .card-check::before { content: "✓"; }
.select-card-name {
  font-family: var(--display); font-size: 1.18rem; font-weight: 700; letter-spacing: 0.03em; color: var(--ink);
}
.select-card-name small { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.04em; }

.select-card-badges { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.55rem; }
.select-badge {
  font-family: var(--mono);
  font-size: 0.72rem; letter-spacing: 0.03em;
  padding: 2px 6px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  color: var(--muted);
  background: var(--paper);
  white-space: nowrap;
}
.select-badge.kid { border-color: var(--green); color: var(--green); }
.select-badge.perennial { border-color: var(--gold-ink); color: var(--gold-ink); }
.select-badge.trellis { border-color: var(--ink); color: var(--ink); }

/* —— 农残红印章：把风险徽章拽到卡片右上角，盖章感（手绘不齐边） —— */
.select-card .select-badge.risk-high,
.select-card .select-badge.risk-medium,
.select-card .select-badge.risk-low {
  position: absolute;
  top: 12px; right: 12px;
  transform: rotate(7deg);
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 3px 6px;
  border-radius: 4px 7px 5px 8px / 7px 5px 8px 4px;
  border: 1.5px solid currentColor;
  background: transparent;
  box-shadow: inset 0 0 0 1px currentColor;
  text-align: center;
  line-height: 1.1;
}
.select-card:nth-child(3n) .select-badge.risk-high,
.select-card:nth-child(3n) .select-badge.risk-medium,
.select-card:nth-child(3n) .select-badge.risk-low { transform: rotate(-5deg); border-radius: 7px 4px 8px 5px / 5px 8px 4px 7px; }
.select-badge.risk-high   { color: var(--beet); }
.select-badge.risk-medium { color: var(--gold-ink); }
.select-badge.risk-low    { color: var(--green); }

.select-card-info, .select-card-yield {
  font-family: var(--mono); font-size: 0.72rem; color: var(--muted); line-height: 1.55;
}
.select-card-yield { color: var(--gold-ink); margin: 0.25rem 0 0.55rem; min-height: 0.9rem; }

.select-card-row {
  display: flex; justify-content: space-between; align-items: center; gap: 0.6rem;
  margin-top: 0.4rem; font-size: 0.8rem;
}
.pot-select { font-size: 0.78rem; padding: 0.35rem 0.4rem; max-width: 100%; }

.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--ink); border-radius: var(--radius-sm); overflow: hidden; }
.stepper-btn {
  width: 2.4rem; height: 2.4rem; border: none; background: var(--paper);
  color: var(--ink); font-size: 1.15rem; cursor: pointer; line-height: 1;
}
.stepper-btn:hover:not(:disabled) { background: var(--ink); color: var(--paper); }
.stepper-btn:disabled { color: var(--rule); cursor: not-allowed; }
.stepper-count {
  width: 2.1rem; text-align: center; font-weight: 700; font-size: 0.95rem;
  border-left: 1.5px solid var(--ink); border-right: 1.5px solid var(--ink);
}

/* 盆型明细折叠 */
.select-details { margin-top: 0.7rem; border-top: 1px dashed var(--rule); padding-top: 0.5rem; }
.select-details > summary {
  cursor: pointer; list-style: none;
  font-family: var(--mono); font-size: 0.72rem; color: var(--muted);
}
.select-details > summary::-webkit-details-marker { display: none; }
.select-details > summary::after { content: " ▾"; }
.select-details[open] > summary::after { content: " ▴"; }
.select-details table { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 0.72rem; margin-top: 0.35rem; }
.select-details td { padding: 1.5px 0; color: var(--ink); }
.select-details td:nth-child(2) { text-align: right; }
.select-details td:nth-child(3) { text-align: right; color: var(--muted); }
.pot-recommended { color: var(--green); font-weight: 700; }
.pot-zero { color: var(--muted); opacity: 0.75; }
.pot-zero-note { color: var(--muted); }

/* ===== 底部资材汇总条 ===== */
.materials-bar {
  position: sticky; bottom: 0;
  display: flex; flex-wrap: wrap; gap: 0.7rem;
  justify-content: space-between; align-items: center;
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius);
  padding: 0.85rem 1.1rem;
  margin-top: 1.4rem;
  box-shadow: 0 -2px 14px rgba(32,49,42,0.18);
  border: 1.5px solid var(--ink);
}
.materials-bar.warn { border-color: var(--beet); box-shadow: 0 -2px 14px rgba(178,58,94,0.35); }
.materials-bar-warning {
  flex-basis: 100%;
  font-family: var(--mono); font-size: 0.78rem; font-weight: 600;
  color: #F4C6D4;
  border-bottom: 1px dashed rgba(244,198,212,0.4);
  padding-bottom: 0.4rem;
}
.materials-bar-content { font-family: var(--mono); font-size: 0.82rem; line-height: 1.5; }
.materials-bar-content strong { color: var(--gold); font-weight: 700; }
.materials-bar .btn { padding: 0.6rem 1.3rem; border-color: var(--gold); background: var(--gold); color: var(--ink); box-shadow: none; }
.materials-bar .btn:hover:not(:disabled) { background: #EBB23B; transform: translateY(-1px); }
.materials-bar .btn:disabled { background: transparent; color: var(--rule); border-color: var(--muted); }

/* ===== 规划结果页 ===== */
.plan-header { text-align: center; margin-bottom: 1.6rem; }
.plan-header h2 {
  font-family: var(--display); font-size: 1.7rem; font-weight: 800; letter-spacing: 0.05em; color: var(--ink);
}
.plan-header .plan-meta { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); margin-top: 0.5rem; }
.plan-meta .meta-seg { white-space: nowrap; }
.plan-actions {
  display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; margin-top: 0.9rem;
}

.plan-stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border: 1.5px solid var(--ink); border-radius: var(--radius);
  background: var(--card); overflow: hidden; box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}
.stat-card { padding: 1.1rem 0.6rem; text-align: center; border-right: 1px solid var(--rule); }
.stat-card:last-child { border-right: none; }
.stat-card .stat-value {
  font-family: var(--mono); font-size: 1.7rem; font-weight: 700; color: var(--ink); line-height: 1.1;
}
.stat-card .stat-label { font-size: 0.74rem; color: var(--muted); margin-top: 0.3rem; letter-spacing: 0.03em; }
.stat-card .stat-note { display: block; font-size: 0.62rem; color: var(--muted); opacity: 0.8; font-family: var(--mono); }

/* ===== 容器卡（日历/可行性/方案） ===== */
.calendar-container {
  background: var(--card);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  padding: 1.3rem 1.3rem 1.5rem;
  box-shadow: var(--shadow);
}
.calendar-container h3 {
  font-family: var(--display); font-size: 1.2rem; font-weight: 700; letter-spacing: 0.04em;
  color: var(--ink); margin-bottom: 0.9rem;
}
#feasibility-score { font-family: var(--mono); white-space: nowrap; }
.feas-check { display: flex; align-items: baseline; gap: 0.5rem; margin-bottom: 0.5rem; font-size: 0.9rem; }
.feas-check .feas-mark { font-weight: 700; flex: 0 0 auto; }
.feas-check.pass .feas-mark { color: var(--green); }
.feas-check.fail .feas-mark { color: var(--beet); }
.feas-check .feas-delta {
  font-family: var(--mono); font-size: 0.72rem; color: var(--muted);
  border: 1px solid var(--rule); border-radius: 3px; padding: 0 4px; flex: 0 0 auto;
}

/* ===== 标签页（账册书口） ===== */
.tabs {
  display: flex; flex-wrap: wrap; gap: 0.3rem;
  border-bottom: 1.5px solid var(--ink);
  margin-bottom: 1.3rem;
}
.tab {
  background: none; border: none;
  padding: 0.6rem 0.9rem;
  font-family: var(--sans); font-size: 0.9rem; color: var(--muted);
  cursor: pointer; position: relative; border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: color .15s, background .15s;
  white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); font-weight: 700; background: var(--card); }
.tab.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1.5px; height: 3px; background: var(--gold);
}
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.35s ease; }

/* ===== 甘特图 ===== */
.cal-scroll-hint {
  font-family: var(--mono); font-size: 0.72rem; color: var(--muted);
  text-align: center; margin: -0.3rem 0 0.5rem;
}
.cal-wrap { overflow-x: auto; position: relative; }
.cal-wrap.scrollable {
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 22px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 22px), transparent 100%);
}
.cal-inner { min-width: 680px; }
.cal-head, .cal-row { display: flex; align-items: center; }
.cal-head { margin-bottom: 0.6rem; position: relative; }
.cal-months { flex: 1; display: flex; position: relative; }
.cal-months span {
  flex: 1; text-align: center; font-size: 0.72rem; color: var(--muted);
  border-left: 1px dotted var(--rule);
}
.cal-rows { position: relative; }
.cal-row { margin-bottom: 0.55rem; }
.cal-label {
  width: 120px; flex-shrink: 0; padding-right: 0.6rem;
  position: sticky; left: 0; z-index: 3;
  background: var(--card);
}
.cal-label > div:first-child { font-size: 0.86rem; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 0.3rem; }
.cal-label-times { display: flex; flex-direction: column; font-size: 0.7rem; margin-top: 1px; }
.cal-label-times span { white-space: nowrap; }
.cal-time-sow { color: var(--green); }
.cal-time-harvest { color: var(--gold-ink); }
.cal-mini-thumb {
  width: 20px; height: 20px; border-radius: 50%; overflow: hidden; flex: 0 0 auto;
  background: #EAE3D2; border: 1px solid var(--rule); position: relative;
}
.cal-mini-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cal-track {
  position: relative; flex: 1; height: 30px;
  background: var(--bg2);
  border: 1px solid var(--rule); border-radius: 3px;
  background-image: repeating-linear-gradient(90deg, transparent 0 calc(8.333% - 1px), rgba(32,49,42,0.06) calc(8.333% - 1px) 8.333%);
}
.bar {
  position: absolute; top: 3px; height: 24px;
  border-radius: 3px; cursor: pointer; overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.25);
  transition: filter .15s;
}
.bar:hover { filter: brightness(1.08); }
.bar.past { filter: saturate(0.35) brightness(0.96); }
.seg-grow { position: absolute; left: 0; top: 0; height: 100%; }
.seg-harvest { position: absolute; top: 0; right: 0; height: 100%; }
.seg-harvest.continuous { background-image: repeating-linear-gradient(45deg, rgba(255,255,255,0.55) 0 3px, transparent 3px 6px); }
.seg-harvest.single { background: rgba(255,255,255,0.4); }
.bar-label {
  position: relative; z-index: 2;
  display: block; height: 100%; line-height: 24px;
  color: #fff; font-size: 0.68rem; font-weight: 600; white-space: nowrap;
  padding: 0 5px; overflow: hidden; text-overflow: ellipsis;
  text-shadow: 0 1px 1px rgba(32,49,42,0.35);
}
.seg-single-end { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); font-size: 0.7rem; z-index: 2; }
/* 全图仅一条今天线 */
.now-line-global {
  position: absolute; top: 0; bottom: 0; width: 2px; background: var(--beet); z-index: 2; pointer-events: none;
}
.cal-months .now-flag {
  position: absolute; top: -2px; transform: translateX(-50%);
  flex: none; border-left: none; text-align: center;
  font-size: 0.7rem; font-weight: 700; color: #fff; background: var(--beet);
  padding: 0 4px; border-radius: 2px; font-family: var(--mono); z-index: 4; pointer-events: none;
}

.cal-legend {
  margin-top: 1rem; padding-top: 0.8rem; border-top: 1px dashed var(--rule);
  display: flex; flex-direction: column; gap: 0.5rem;
}
.legend-families, .legend-symbols { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: center; }
.legend-item { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.72rem; color: var(--muted); }
.legend-dot { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.legend-seg.grow { color: var(--green); font-weight: 700; }
.legend-harvest-tex { width: 22px; height: 11px; display: inline-block; border-radius: 2px; border: 1px solid var(--rule); }
.legend-harvest-tex.continuous { background-image: repeating-linear-gradient(45deg, var(--muted) 0 2px, transparent 2px 4px); }
.legend-harvest-tex.single { background: var(--bg2); }
.legend-line { width: 2px; height: 13px; background: var(--beet); display: inline-block; }
.legend-note { font-size: 0.72rem; color: var(--muted); font-style: italic; }

/* ===== 排序栏 ===== */
.sort-bar { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin-bottom: 1.1rem; }
.sort-btn {
  font-family: var(--mono); font-size: 0.78rem;
  padding: 0.35rem 0.75rem; border: 1.5px solid var(--ink); border-radius: var(--radius-sm);
  background: var(--card); color: var(--ink); cursor: pointer; transition: background .12s, color .12s;
}
.sort-btn:hover { box-shadow: 2px 2px 0 var(--ink); }
.sort-btn.active { background: var(--ink); color: var(--paper); }

/* ===== 作物方案卡 ===== */
.crop-section { margin-bottom: 1.8rem; }
.crop-section h3 {
  font-family: var(--display); font-size: 1.15rem; font-weight: 700; letter-spacing: 0.03em; color: var(--ink);
  margin-bottom: 0.9rem; padding-bottom: 0.4rem; border-bottom: 1.5px solid var(--ink);
  display: flex; align-items: baseline; gap: 0.6rem;
}
.season-current-badge {
  font-family: var(--mono); font-size: 0.66rem; font-weight: 700; letter-spacing: 0.08em;
  color: var(--gold-ink); border: 1.5px solid currentColor; border-radius: 3px; padding: 1px 6px;
  transform: rotate(-3deg);
}
.crop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 0.9rem; }
.crop-card {
  background: var(--card); border: 1.5px solid var(--ink); border-radius: var(--radius);
  padding: 0.95rem 1rem; box-shadow: var(--shadow); transition: transform .14s, box-shadow .14s;
}
.crop-card.clickable { cursor: pointer; }
.crop-card.clickable:hover, .crop-card.clickable:focus-visible { transform: translate(-1px,-2px); box-shadow: 4px 5px 0 rgba(32,49,42,0.14); }
.crop-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.5rem; margin-bottom: 0.5rem; }
.crop-name { font-family: var(--display); font-size: 1.1rem; font-weight: 700; color: var(--ink); }
.crop-badge {
  font-family: var(--mono); font-size: 0.68rem; font-weight: 700; letter-spacing: 0.04em;
  padding: 2px 7px; border-radius: 3px; border: 1.5px solid currentColor;
  box-shadow: inset 0 0 0 1px currentColor; transform: rotate(4deg); white-space: nowrap;
}
.crop-detail { font-family: var(--mono); font-size: 0.74rem; color: var(--muted); line-height: 1.7; }
.crop-detail strong { color: var(--ink); font-weight: 600; }

/* ===== 立体摆放 ===== */
#layout-section h3 { font-family: var(--display); font-size: 1.2rem; font-weight: 700; color: var(--ink); }
#layout-section svg { border: 1.5px solid var(--ink); border-radius: var(--radius); background: var(--card); padding: 0.5rem; box-shadow: var(--shadow); }

/* ===== 资材清单 / 提示框 ===== */
.tip-box {
  display: flex; gap: 0.7rem; align-items: flex-start;
  background: var(--card); border: 1.5px solid var(--ink); border-left-width: 5px;
  border-radius: var(--radius); padding: 0.9rem 1.1rem; margin-top: 1rem;
}
.tip-icon { font-size: 1.2rem; line-height: 1.4; }
.tip-box p { font-size: 0.85rem; color: var(--ink); }

/* 账册合计栏（替代橙渐变） */
.ledger-total {
  margin-top: 1.2rem;
  border-top: 1.5px solid var(--ink);
  border-bottom: 4px double var(--ink);
  padding: 0.75rem 0.3rem 0.8rem;
  display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; align-items: baseline;
}
.ledger-total .lt-label { font-family: var(--display); font-weight: 700; font-size: 1rem; letter-spacing: 0.1em; }
.ledger-total .lt-amount { font-family: var(--mono); font-size: 1.25rem; font-weight: 700; color: var(--gold-ink); }
.ledger-total .lt-note { font-size: 0.76rem; color: var(--muted); }
.materials-actions { margin-top: 0.9rem; display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ===== 农事月历 ===== */
.task-list { display: flex; flex-direction: column; gap: 1.1rem; }
.task-month {
  background: var(--card); border: 1.5px solid var(--ink); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.task-month-head {
  display: flex; align-items: baseline; gap: 0.7rem; flex-wrap: wrap;
  padding: 0.65rem 1rem;
  border-bottom: 1.5px solid var(--ink);
  background: rgba(232,228,213,0.5);
}
.task-month-head .tm-title {
  font-family: var(--display); font-size: 1.08rem; font-weight: 700; letter-spacing: 0.06em; color: var(--ink);
}
.task-month-head .tm-term { font-family: var(--mono); font-size: 0.74rem; color: var(--gold-ink); letter-spacing: 0.08em; }
.task-month-head .tm-now {
  font-family: var(--mono); font-size: 0.66rem; font-weight: 700; letter-spacing: 0.08em;
  color: var(--beet); border: 1.5px solid currentColor; border-radius: 3px; padding: 1px 6px;
  transform: rotate(-3deg); margin-left: auto;
}
.task-month.current { border-color: var(--gold-ink); box-shadow: 3px 4px 0 rgba(224,162,27,0.4); }
.task-item {
  display: flex; align-items: center; gap: 0.8rem;
  padding: 0.6rem 1rem;
  border-bottom: 1px dotted var(--rule);
}
.task-item:last-child { border-bottom: none; }
.task-check {
  position: relative; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem; margin: -0.3rem; padding: 0.3rem; cursor: pointer;
}
.task-check input {
  appearance: none; -webkit-appearance: none;
  width: 1.3rem; height: 1.3rem; margin: 0;
  border: 1.5px solid var(--ink); border-radius: 4px; cursor: pointer;
  background: var(--paper);
  display: inline-flex; align-items: center; justify-content: center;
}
.task-check input:checked { background: var(--green); border-color: var(--green); }
.task-check input:checked::before { content: "✓"; color: #fff; font-size: 0.85rem; line-height: 1; }
.task-content { flex: 1; }
.task-title { font-size: 0.9rem; color: var(--ink); display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.task-item.done .task-title { text-decoration: line-through; color: var(--muted); }
.task-tag {
  font-family: var(--mono); font-size: 0.7rem; padding: 2px 8px; border-radius: 3px;
  border: 1px solid currentColor; white-space: nowrap; flex: 0 0 auto;
}
.tag-sow { color: var(--green); }
.tag-water { color: var(--gold-ink); }
.tag-harvest { color: var(--beet); }

/* ===== 图鉴弹窗（种子包说明书） ===== */
.modal { display: none; position: fixed; inset: 0; z-index: 1000; }
.modal.active { display: block; }
.modal-overlay { position: absolute; inset: 0; background: rgba(32,49,42,0.55); backdrop-filter: blur(2px); }
.modal-content {
  position: relative; z-index: 1; max-width: 560px; width: calc(100% - 2rem);
  margin: 5vh auto; max-height: 90vh; overflow-y: auto;
  background: var(--card); border: 1.5px solid var(--ink); border-radius: var(--radius);
  padding: 0 1.6rem 1.8rem; box-shadow: 8px 10px 0 rgba(32,49,42,0.25);
}
.modal-head {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 0.6rem;
  background: var(--card);
  margin: 0 -1.6rem 0.6rem; padding: 0.7rem 0.7rem 0.5rem 1.6rem;
  border-bottom: 1px solid var(--rule);
}
.modal-head-title { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.14em; color: var(--muted); }
.modal-close {
  background: none; border: 1.5px solid transparent; font-size: 1.5rem; line-height: 1;
  color: var(--ink); cursor: pointer;
  width: 2.75rem; height: 2.75rem; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
}
.modal-close:hover { color: var(--beet); border-color: var(--ink); }
.enc-header { display: flex; align-items: center; gap: 0.9rem; padding-bottom: 0.9rem; border-bottom: 4px double var(--ink); margin-bottom: 1rem; }
.enc-icon {
  position: relative; width: 64px; height: 64px; border-radius: 50%; overflow: hidden;
  flex: 0 0 auto; display: inline-flex; background: rgba(60,122,67,0.1);
  box-shadow: inset 0 0 0 1.5px rgba(32,49,42,0.25);
}
.enc-icon .st-emoji { font-size: 2.2rem; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.enc-icon img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* 卡片/详情条里的作物小圆图（emoji 兜底垫在图下） */
.select-thumb {
  position: relative; width: 30px; height: 30px; border-radius: 50%; overflow: hidden;
  display: inline-flex; flex: 0 0 auto; vertical-align: -9px; margin-right: 4px;
  background: rgba(60,122,67,0.1);
  box-shadow: inset 0 0 0 1px rgba(32,49,42,0.18);
}
.select-thumb .st-emoji { font-size: 1rem; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.select-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.enc-title { font-family: var(--display); font-size: 1.5rem; font-weight: 800; letter-spacing: 0.04em; color: var(--ink); }
.enc-family { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); }
.enc-section { margin-bottom: 1.1rem; }
.enc-section h4 {
  font-family: var(--display); font-size: 1.02rem; font-weight: 700; color: var(--ink);
  margin-bottom: 0.5rem; letter-spacing: 0.03em;
}
.enc-section p { font-size: 0.86rem; color: var(--ink); margin-bottom: 0.25rem; }
.enc-section strong { color: var(--ink); }
.enc-warn { color: var(--gold-ink); font-weight: 600; }
.enc-risk-bar { height: 10px; background: var(--bg2); border: 1px solid var(--ink); border-radius: 2px; overflow: hidden; margin: 0.4rem 0; }
.enc-risk-fill { height: 100%; }
.enc-risk-high { background: var(--beet); }
.enc-risk-medium { background: var(--gold); }
.enc-risk-low { background: var(--green); }
.enc-authority { font-size: 0.74rem; color: var(--muted); margin-top: 0.5rem; line-height: 1.6; }
.enc-authority a { color: var(--green); text-decoration: underline; text-underline-offset: 2px; }

/* ===== 分享海报浮层 ===== */
.poster-overlay {
  position: fixed; inset: 0; z-index: 1100;
  background: rgba(32,49,42,0.82); backdrop-filter: blur(3px);
  display: flex; flex-direction: column; align-items: center;
  padding: 1rem; overflow-y: auto;
}
.poster-tip {
  color: #F4F1E6; font-size: 0.88rem; font-weight: 600; margin: 0.4rem 0 0.7rem;
  font-family: var(--mono); letter-spacing: 0.06em;
}
.poster-overlay img {
  max-width: min(420px, 92vw);
  border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}
.poster-actions { display: flex; gap: 0.6rem; margin: 0.9rem 0 1.5rem; }

/* ===== Toast ===== */
.toast {
  position: fixed; left: 50%; bottom: 2.2rem; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: var(--paper);
  font-family: var(--mono); font-size: 0.82rem; letter-spacing: 0.04em;
  padding: 0.55rem 1.1rem; border-radius: var(--radius-sm);
  border: 1px solid rgba(244,241,230,0.3);
  opacity: 0; pointer-events: none; z-index: 1200;
  transition: opacity .25s ease, transform .25s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== 响应式 ===== */
@media (max-width: 720px) {
  .hero-features { grid-template-columns: repeat(2, 1fr); }
  .plan-stats { grid-template-columns: repeat(2, 1fr); }
  .stat-card:nth-child(2) { border-right: none; }
  .stat-card:nth-child(1), .stat-card:nth-child(2) { border-bottom: 1px solid var(--rule); }
  .season-bars { grid-template-columns: 1fr; }
  .navbar { padding: 0.7rem 1rem; }
  .page { padding: 1.5rem 1rem 3rem; }
  .hero-vterm { display: none; }
  /* tab 单行横滚，不折两行；未滚到底时右缘渐隐提示还有更多 */
  .tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs.fade-r {
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 30px), transparent 100%);
    mask-image: linear-gradient(90deg, #000 calc(100% - 30px), transparent 100%);
  }
  .tab { padding: 0.55rem 0.6rem; font-size: 0.85rem; }
  /* iOS 聚焦不触发放大：输入控件 ≥16px */
  input[type="number"], select, .pot-select { font-size: 1rem; }
}
@media (max-width: 420px) {
  .hero-features { grid-template-columns: 1fr; }
  .select-crop-grid, .crop-grid { grid-template-columns: 1fr; }
  .materials-bar { padding: 0.7rem 0.9rem; }
  html { scroll-padding-top: 70px; scroll-padding-bottom: 150px; }
}

/* ===== 动效降级 ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ===== 摆放图纸（写实插画版） ===== */
.layout-stage {
  border: 1.5px solid var(--ink); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
}
/* 图纸标题栏（替代原透视横幅，与下方地台无缝相连） */
.layout-titleblock {
  background: var(--ink); color: var(--paper);
  padding: 0.6rem 1rem; display: flex; align-items: baseline;
  justify-content: space-between; gap: 0.6rem; flex-wrap: wrap;
}
.layout-titleblock .tb-title {
  font-family: var(--display); font-size: 1.12rem; font-weight: 700; letter-spacing: 0.06em;
}
.layout-titleblock .tb-meta { font-family: var(--mono); font-size: 0.74rem; opacity: 0.85; }
.diagram-deck, .layout-deck {
  background-color: #C9A87C;
  background-image: url('assets/parts/deck_tile.webp');
  background-position: center; background-size: cover;
}
.layout-deck {
  padding: 0.9rem 1rem 1.1rem;
  border-top: 1px solid rgba(32,49,42,0.25);
}
.lay-section-label {
  font-family: var(--mono); font-size: 0.72rem; color: #3a2c1e;
  background: rgba(244,241,230,0.82); display: inline-block;
  padding: 2px 8px; border-radius: 5px; margin: 0.3rem 0 0.5rem; font-weight: 600;
}
.lay-row { display: flex; align-items: flex-end; gap: 0.55rem; flex-wrap: wrap; margin-bottom: 0.7rem; }
.lay-rowlabel {
  flex: 0 0 auto; width: 2.3rem; align-self: center; text-align: center;
  font-family: var(--mono); font-size: 0.64rem; line-height: 1.15; color: #3a2c1e;
  background: rgba(244,241,230,0.78); border-radius: 5px; padding: 3px 2px;
}
.lay-cell { display: flex; flex-direction: column; align-items: center; gap: 3px; width: var(--mw, 84px); }
.lay-medallion {
  position: relative; width: var(--mw, 84px); height: var(--mw, 84px);
  border-radius: 50%; overflow: hidden; background: #EAE3D2;
  border: 2px solid rgba(255,255,255,0.7); box-shadow: 0 4px 9px rgba(32,49,42,0.30);
  display: flex; align-items: center; justify-content: center;
}
.lay-medallion img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.lay-medallion .lay-emoji { font-size: 1.7rem; }
.lay-empty {
  width: var(--mw, 84px); height: var(--mw, 84px); border-radius: 50%;
  border: 2px dashed rgba(244,241,230,0.85); background: rgba(32,49,42,0.10);
  display: flex; align-items: center; justify-content: center;
  color: rgba(244,241,230,0.95); font-size: 1.5rem;
}
.lay-name {
  font-size: 0.74rem; font-weight: 600; color: #20312A; text-align: center; line-height: 1.15;
  text-shadow: 0 1px 2px rgba(244,241,230,0.95), 0 0 3px rgba(244,241,230,0.8);
}
.lay-badge {
  font-family: var(--mono); font-size: 0.62rem; padding: 0 3px; border-radius: 3px;
  background: rgba(244,241,230,0.9); color: var(--gold-ink);
}
.lay-tip { font-size: 0.78rem; color: var(--muted); margin-top: 0.6rem; }

/* 作物圆形缩略图（作物方案卡） */
.crop-thumb {
  width: 54px; height: 54px; flex: 0 0 auto; border-radius: 50%; overflow: hidden;
  position: relative; background: #EAE3D2; border: 1.5px solid rgba(255,255,255,0.6);
  box-shadow: 0 2px 5px rgba(32,49,42,0.2);
}
.crop-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.crop-thumb .lay-emoji { font-size: 1.35rem; display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; }

/* 首页主图 */
.hero-art {
  width: 100%; max-width: 620px; margin: 0 auto 1.6rem; display: block;
  border-radius: var(--radius); border: 1.5px solid var(--ink); box-shadow: var(--shadow);
  aspect-ratio: 16 / 9; object-fit: cover;
}

/* ===== 常见尺寸快填 ===== */
.preset-row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.65rem; }
.preset-btn {
  font-family: var(--mono); font-size: 0.76rem; padding: 0.45rem 0.7rem;
  border: 1.5px solid var(--ink); border-radius: var(--radius-sm);
  background: var(--card); color: var(--ink); cursor: pointer; transition: box-shadow .12s, transform .1s;
}
.preset-btn:hover { box-shadow: 2px 2px 0 var(--ink); }
.preset-btn:active { transform: translate(1px,1px); box-shadow: none; }

/* ===== 摆放图纸：采光窗示意 ===== */
.lay-windowbar {
  display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap;
  background: rgba(244,241,230,0.86); border: 1px solid var(--rule);
  border-radius: 8px; padding: 0.5rem 0.7rem; margin-bottom: 0.7rem;
}
.lay-windowbar svg { flex: 0 0 auto; }
.lay-windowbar .wb-title { font-weight: 700; color: var(--ink); font-size: 0.92rem; }
.lay-windowbar .wb-sub { font-family: var(--mono); font-size: 0.74rem; color: var(--muted); margin-top: 2px; }

/* ===== 阳台图纸（输入页交互 / 选择页 / 结果页共用） ===== */
.vh { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.window-editor {
  position: relative;
  background: var(--paper); border: 1.5px solid var(--ink); border-radius: var(--radius);
  padding: 0.5rem; display: flex; flex-direction: column; justify-content: center;
  max-width: 620px; margin: 0 auto;
}
.we-svg { flex: 1; display: flex; justify-content: center; }

/* 朝向按钮：嵌在图纸框内、贴着图下沿（点按钮，图上的墙/窗/光带立刻跟着转） */
.ori-inline {
  display: flex; align-items: center; gap: 0.55rem; flex-wrap: wrap;
  border-top: 1px dashed var(--rule);
  margin: 0.35rem 0.2rem 0.1rem; padding-top: 0.55rem;
}
.ori-label {
  font-family: var(--mono); font-size: 0.78rem; font-weight: 600;
  letter-spacing: 0.08em; color: var(--ink);
  padding-left: 0.8rem; position: relative; flex: 0 0 auto;
}
.ori-label::before { content: "▪"; position: absolute; left: 0; top: -1px; color: var(--gold-ink); }
.ori-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; flex: 1; min-width: 0; }
.ori-chips .radio-option label { padding: 0.34rem 0.62rem; font-size: 0.84rem; }
.window-editor svg { width: 100%; height: auto; touch-action: manipulation; }
/* 尺寸标注线拖拽手柄（HTML 覆盖层，重绘不掉指针捕获） */
.dim-handle {
  position: absolute; width: 32px; height: 32px;
  transform: translate(-50%, -50%);
  background: transparent; border: none; padding: 0;
  display: flex; align-items: center; justify-content: center;
  cursor: ew-resize; touch-action: none; z-index: 5;
}
.dim-handle.dh-wid { cursor: ns-resize; }
.dh-grip {
  width: 15px; height: 15px; position: relative;
  background: var(--gold); border: 1.5px solid var(--ink); border-radius: 3px;
  box-shadow: 1.5px 1.5px 0 var(--ink);
}
.dh-grip::before {
  content: ""; position: absolute; inset: 3px 4.5px;
  border-left: 1.5px solid var(--ink); border-right: 1.5px solid var(--ink);
}
.dim-handle.dh-wid .dh-grip::before {
  inset: 4.5px 3px;
  border-left: none; border-right: none;
  border-top: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink);
}
.dim-handle:hover .dh-grip { background: #EBB23B; }
.dim-handle:focus-visible { outline: 2px solid var(--green); outline-offset: -4px; border-radius: 8px; }

/* ===== 盆位/季节详情条（点图上的盆或四季条弹出） ===== */
.pot-detail {
  max-width: 620px; margin: 0.55rem auto 0;
  display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
  background: var(--card); border: 1.5px solid var(--ink); border-radius: var(--radius-sm);
  padding: 0.5rem 0.85rem;
  box-shadow: 2px 2px 0 rgba(32,49,42,0.12);
}
.pot-detail .pd-name { font-family: var(--display); font-weight: 700; font-size: 0.95rem; color: var(--ink); flex: 0 0 auto; }
.pot-detail .pd-info { font-family: var(--mono); font-size: 0.75rem; color: var(--muted); line-height: 1.5; flex: 1; min-width: 12rem; }
.pot-detail .pd-info small { font-size: 0.68rem; opacity: 0.85; }
.pot-detail .pd-btn {
  font-family: var(--mono); font-size: 0.72rem; padding: 0.28rem 0.6rem;
  background: var(--gold); color: var(--ink); border: 1.5px solid var(--ink); border-radius: 3px;
  cursor: pointer; box-shadow: 1.5px 1.5px 0 var(--ink); flex: 0 0 auto;
}
.pot-detail .pd-btn:active { transform: translate(1px,1px); box-shadow: none; }
#layout-pot-detail { margin: 0.55rem 0.9rem 0.7rem; max-width: none; }

/* 选择页 toast 抬到吸底栏上方，不盖生成按钮 */
body:has(#page-select.active) #toast { bottom: 158px; }

/* 受限作物：可选但降饱和 + 警示徽章（原因简写，title 有破解提示） */
.select-card.gated { border-style: dashed; }
.select-card.gated:not(.selected) { opacity: 0.82; }
.select-badge.badge-gate {
  background: none; color: var(--gold-ink);
  border: 1px dashed var(--gold-ink);
  cursor: help;
}

/* ===== 手机端整体优化（2026-07 小白审计批） ===== */
/* 新手引导语 */
.select-guide {
  font-size: 0.88rem; line-height: 1.6; color: var(--ink);
  background: var(--card); border: 1.5px solid var(--ink); border-radius: var(--radius-sm);
  padding: 0.6rem 0.8rem; margin: 0.7rem 0;
  box-shadow: 2px 2px 0 rgba(32,49,42,0.12);
}
/* 四季/图纸折叠区 */
.select-fold { margin: 0.4rem 0 0.8rem; }
.select-fold > summary {
  cursor: pointer; font-family: var(--display); font-weight: 700; font-size: 0.95rem;
  color: var(--ink); padding: 0.55rem 0.2rem; list-style: none;
  display: flex; align-items: baseline; gap: 0.5rem; min-height: 44px; box-sizing: border-box;
}
.select-fold > summary::before { content: '▸'; transition: transform .15s; }
.select-fold[open] > summary::before { transform: rotate(90deg); }
.select-fold > summary::-webkit-details-marker { display: none; }
.select-fold > summary small { font-family: var(--mono); font-size: 0.74rem; color: var(--muted); font-weight: 400; }
/* 词典行 */
.glossary {
  font-size: 0.78rem; color: var(--muted); line-height: 1.6;
  background: rgba(60,122,67,0.06); border-radius: 3px; padding: 0.4rem 0.6rem; margin-top: 0.35rem;
}
/* 首页 CTA 微文案 */
.cta-micro { font-family: var(--mono); font-size: 0.76rem; color: var(--muted); margin-top: 0.5rem; letter-spacing: 0.06em; }
/* tab 短标签切换 + 吸顶 */
.tab .t-short { display: none; }
.tabs { position: sticky; top: 54px; z-index: 60; background: var(--bg); }
@media (max-width: 520px) {
  .tab .t-long { display: none; }
  .tab .t-short { display: inline; }
  .tab { padding: 0.6rem 0.3rem; min-height: 44px; }
}
/* 类型筛选吸顶（手机） */
@media (max-width: 760px) {
  .type-filter { position: sticky; top: 54px; z-index: 55; background: var(--bg); padding: 0.45rem 0; margin-top: 0; }
}
/* 未选中卡片折叠：只留头部+徽章，点选后展开控件（页高从18屏压到约6屏） */
.select-card:not(.selected) .select-card-info,
.select-card:not(.selected) .select-card-yield,
.select-card:not(.selected) .select-card-row,
.select-card:not(.selected) details { display: none; }
/* 触控目标下限 */
.nav-back, .btn-small, .sort-btn, .sun-play { min-height: 44px; }
.type-chip { min-height: 40px; }
.stepper-btn { min-width: 42px; min-height: 42px; }
.season-bar-item { min-height: 40px; align-items: center; display: flex; }
/* 小字号提级（决策信息 ≥12px） */
.tc-sub { font-size: 0.72rem; }
.select-badge { font-size: 0.78rem; }
.select-badge.risk-high, .select-badge.risk-medium, .select-badge.risk-low { font-weight: 700; }
.select-card-info, .select-card-yield { font-size: 0.8rem; }
/* 甘特条加高 */
#gantt-body .bar { height: 32px; }
.bar-label { font-size: 0.76rem; }

/* 分享区页尾 */
.plan-share-footer { margin: 1.6rem 0 0.8rem; padding-top: 1rem; border-top: 1px dashed rgba(32,49,42,0.3); }
.plan-share-footer .share-title { font-family: var(--display); font-weight: 700; margin-bottom: 0.6rem; }
/* 统计卡手机压缩为两列小卡 */
@media (max-width: 520px) {
  .plan-stats { grid-template-columns: repeat(2, 1fr) !important; gap: 0.5rem !important; }
  .plan-stats .stat-card { padding: 0.55rem 0.5rem !important; }
  .plan-stats .stat-value { font-size: 1.3rem !important; }
}

/* 受限原因就地展开 */
.gate-explain {
  font-size: 0.8rem; color: var(--gold-ink); line-height: 1.55;
  background: rgba(224,162,27,0.09); border-left: 3px solid var(--gold);
  padding: 0.45rem 0.6rem; border-radius: 3px; margin: 0.4rem 0 0.2rem;
}

/* 类型筛选章 */
.type-filter { display: flex; gap: 0.45rem; flex-wrap: wrap; margin: 0.6rem 0 0.9rem; }
.type-chip {
  font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.05em;
  padding: 0.3rem 0.7rem; background: var(--card); color: var(--muted);
  border: 1.5px solid rgba(32,49,42,0.4); border-radius: var(--radius-sm);
  cursor: pointer; box-shadow: 1.5px 1.5px 0 rgba(32,49,42,0.12);
}
.type-chip.active { background: var(--ink); color: var(--paper); border-color: var(--ink); box-shadow: 1.5px 1.5px 0 var(--gold); }
.type-chip:hover:not(.active) { border-color: var(--ink); color: var(--ink); }

/* 四季条可点 */
.season-bar-item { border-radius: var(--radius-sm); padding: 2px 4px; margin: -2px -4px; transition: background .12s; }
.season-bar-item:hover { background: rgba(224,162,27,0.12); }
.season-bar-item.active { background: rgba(224,162,27,0.18); box-shadow: inset 0 0 0 1.5px var(--gold); }

/* ===== 月份时间穿梭标尺 ===== */
/* 月份标尺：13 格手账纸带 [全年‖1..12]，选中格墨底反白 */
.month-ruler {
  max-width: 620px; margin: 0.55rem auto 0;
  display: flex; align-items: stretch;
  background: var(--card); border: 1.5px solid var(--ink); border-radius: var(--radius-sm);
  box-shadow: 2px 2px 0 rgba(32,49,42,0.12);
  overflow: hidden; touch-action: pan-y; user-select: none; -webkit-user-select: none;
}
.mr-cell {
  flex: 1; min-width: 0; padding: 0.4rem 0;
  font-family: var(--mono); font-size: 0.72rem; line-height: 1; color: var(--muted);
  background: none; border: none; border-left: 1px solid rgba(32,49,42,0.14);
  cursor: pointer; transition: background .12s; white-space: nowrap;
}
@media (max-width: 520px) {
  .mr-cell { font-size: 0.7rem; letter-spacing: -0.02em; padding: 0.8rem 0; }
  .mr-year { padding: 0.8rem 0.4rem; }
  /* 手机上摆放图纸用满宽度，盆位更好点 */
  #select-diagram, #layout-diagram { padding: 0.3rem !important; }
}
.mr-cell:first-child { border-left: none; }
.mr-year {
  flex: 0 0 auto; padding: 0.4rem 0.65rem;
  font-weight: 600; letter-spacing: 0.1em; color: var(--ink);
  border-right: 3px double var(--ink);
}
.mr-cell.now { color: var(--gold-ink); font-weight: 700; }
.mr-cell.on { background: var(--ink); color: var(--paper); }
.mr-cell.on.now { color: var(--gold); }
.mr-cell:hover:not(.on) { background: rgba(224,162,27,0.14); }
.mr-cell:focus-visible { outline: 2px solid var(--gold-ink); outline-offset: -2px; }
.month-suggest {
  text-align: center; font-family: var(--mono); font-size: 0.78rem;
  color: var(--gold-ink); margin-top: 0.35rem; min-height: 1rem;
}
.layout-ruler-wrap {
  background: var(--card);
  padding: 0.45rem 0.9rem 0.35rem;
  border-bottom: 1px solid rgba(32,49,42,0.25);
}

/* ===== 一键起步模板 ===== */
.template-row { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.7rem; align-items: stretch; }
.template-label {
  font-family: var(--mono); font-size: 0.74rem; color: var(--muted);
  align-self: center; letter-spacing: 0.08em; margin-right: 0.15rem;
}
.template-chip {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  padding: 0.38rem 0.7rem;
  background: var(--card); border: 1.5px solid var(--ink); border-radius: var(--radius-sm);
  cursor: pointer; box-shadow: 2px 2px 0 rgba(32,49,42,0.12);
  transition: transform .1s, box-shadow .1s;
}
.template-chip:hover { transform: translate(-1px,-1px); box-shadow: 3px 3px 0 rgba(32,49,42,0.18); }
.template-chip:active { transform: translate(1px,1px); box-shadow: none; }
.template-chip .tc-name { font-family: var(--display); font-weight: 700; font-size: 0.88rem; color: var(--ink); line-height: 1.2; }
.template-chip .tc-sub { font-family: var(--mono); font-size: 0.6rem; color: var(--muted); letter-spacing: 0.02em; }
.template-chip.tc-clear { justify-content: center; border-style: dashed; box-shadow: none; }
.template-chip.tc-clear .tc-name { font-family: var(--sans); font-weight: 600; font-size: 0.78rem; color: var(--muted); }
.window-editor [data-winedge] { cursor: pointer; }
.window-editor [data-winedge] .edge-hit { fill: transparent; }
.window-editor [data-winedge]:hover .edge-hint { opacity: 1; }
.window-editor [data-pot], .window-editor [data-empty] {
  transition: opacity .18s ease, transform .18s ease;
  outline: none;
}
.window-editor [data-pot]:focus-visible,
.window-editor [data-empty]:focus-visible {
  filter: drop-shadow(0 0 3px var(--gold-ink));
}
.window-editor [data-winedge]:focus-visible,
.window-editor [data-dial]:focus-visible,
.window-editor [data-ghost]:focus-visible,
.window-editor [data-building]:focus-visible { outline: none; }
.window-editor [data-winedge]:focus-visible .edge-hit { stroke: var(--green); stroke-width: 2; stroke-dasharray: 4 3; }
.window-editor [data-dial]:focus-visible circle { stroke: var(--green); stroke-width: 2; stroke-dasharray: 3 2; }
.window-editor [data-ghost]:focus-visible rect:last-of-type,
.window-editor [data-building]:focus-visible rect:last-of-type { stroke: var(--green); stroke-width: 2; stroke-dasharray: 4 3; }
.window-light {
  text-align: center; font-family: var(--mono); font-size: 0.86rem;
  color: var(--gold-ink); margin-top: 0.55rem; font-weight: 600;
}

/* ===== 一天日照模拟：时刻标尺 ===== */
.sun-ruler {
  max-width: 620px; margin: 0.55rem auto 0;
  display: flex; align-items: flex-start; gap: 0.6rem;
}
.sun-play {
  flex: 0 0 auto;
  width: 2.1rem; height: 2.1rem; margin-top: 1px;
  background: var(--card); color: var(--gold-ink);
  border: 1.5px solid var(--ink); border-radius: var(--radius-sm);
  font-size: 0.8rem; cursor: pointer;
  box-shadow: 1.5px 1.5px 0 var(--ink);
  display: inline-flex; align-items: center; justify-content: center;
}
.sun-play:hover { background: var(--gold); color: var(--ink); }
.sun-play:active { transform: translate(1px, 1px); box-shadow: none; }
.sun-ruler-track { flex: 1; min-width: 0; }
.sun-ruler input[type="range"] {
  width: 100%; appearance: none; -webkit-appearance: none;
  height: 24px; background: transparent; cursor: pointer; display: block;
}
.sun-ruler input[type="range"]::-webkit-slider-runnable-track {
  height: 4px; border-radius: 2px;
  background: linear-gradient(90deg, var(--rule) 0%, var(--gold) 50%, var(--rule) 100%);
}
.sun-ruler input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  margin-top: -8px; width: 20px; height: 20px;
  background: var(--gold); border: 1.5px solid var(--ink); border-radius: 50%;
  box-shadow: 1.5px 1.5px 0 var(--ink); cursor: grab;
}
.sun-ruler input[type="range"]::-moz-range-track {
  height: 4px; border-radius: 2px;
  background: linear-gradient(90deg, var(--rule) 0%, var(--gold) 50%, var(--rule) 100%);
}
.sun-ruler input[type="range"]::-moz-range-thumb {
  width: 17px; height: 17px; background: var(--gold);
  border: 1.5px solid var(--ink); border-radius: 50%; cursor: grab;
}
.sr-ticks { display: flex; justify-content: space-between; padding: 0 6px; margin-top: 1px; }
.sr-ticks span { font-family: var(--mono); font-size: 0.66rem; color: var(--muted); }
.sun-time {
  flex: 0 0 auto; width: 3.2rem; text-align: right;
  font-family: var(--mono); font-size: 0.88rem; font-weight: 700;
  color: var(--gold-ink); margin-top: 5px;
}

/* =====================================================================
   打印样式：一键打印「种植月历 + 图纸 + 清单」，隐藏交互骨架
   ===================================================================== */
@media print {
  body { background: #fff; }
  .navbar, .tabs, .plan-actions, .nav-back, .materials-bar,
  .sort-bar, .cal-scroll-hint, .poster-overlay, .toast, .btn,
  .dim-handle, .month-suggest { display: none !important; }
  .page { display: none; padding: 0; max-width: none; }
  #page-plan.active { display: block; }
  .tab-content { display: block !important; margin-bottom: 1.2rem; }
  .tab-content::before {
    content: attr(data-print-title);
    display: block;
    font-family: var(--display); font-size: 1.15rem; font-weight: 700;
    border-bottom: 2px solid var(--ink); margin-bottom: 0.7rem; padding-bottom: 0.25rem;
    break-after: avoid; page-break-after: avoid;
  }
  /* 小单元不跨页拦腰截断；大区块允许自然分页 */
  .crop-card, .cal-row, .cal-legend, .task-item, .feas-check, .ledger-total, .plan-stats {
    break-inside: avoid; page-break-inside: avoid;
  }
  .task-month-head { break-after: avoid; page-break-after: avoid; }
  .cal-wrap { overflow: visible; mask-image: none; -webkit-mask-image: none; }
  .cal-label { position: static; }
  * { box-shadow: none !important; }
  .bar, .seg-grow, .seg-harvest, .season-bar-fill, .enc-risk-fill, .legend-dot {
    print-color-adjust: exact; -webkit-print-color-adjust: exact;
  }
  .calendar-container, .crop-card, .select-card, .task-month { border-width: 1px; }
}
