/* ============================================================
   徒步路线耗时估算器 · 独立视觉：山径苔绿 + 赭石路标
   ============================================================ */

.hte-page {
  --hte-bg: #f4f2ea;
  --hte-bg-2: #e7e3d5;
  --hte-card: #fffef9;
  --hte-soft: #f2efe4;
  --hte-soft-2: #e6e1d1;
  --hte-ink: #1e2a23;
  --hte-muted: #5f6d63;
  --hte-line: #ddd6c3;
  --hte-accent: #1f5c46;
  --hte-accent-2: #2f7d61;
  --hte-ochre: #b05e2a;
  --hte-ok: #1d6b47;
  --hte-warn: #a15a0b;
  --hte-bad: #a8341f;
  --hte-sun: #d99a2b;
  --hte-shadow: 0 12px 30px rgba(43, 55, 45, .09);

  background: var(--hte-bg);
  color: var(--hte-ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.8;
  padding-bottom: 48px;
  transition: background-color .2s ease, color .2s ease;
}

:root[data-theme="dark"] .hte-page {
  --hte-bg: #0c1310;
  --hte-bg-2: #121c17;
  --hte-card: #15201a;
  --hte-soft: #1a2620;
  --hte-soft-2: #233129;
  --hte-ink: #e8efe8;
  --hte-muted: #9fb0a4;
  --hte-line: #2b3b32;
  --hte-accent: #79d3ad;
  --hte-accent-2: #a5e6c8;
  --hte-ochre: #e39b62;
  --hte-ok: #66d3a2;
  --hte-warn: #efb565;
  --hte-bad: #f08e7c;
  --hte-sun: #f0c164;
  --hte-shadow: 0 12px 30px rgba(0, 0, 0, .45);
}

html[data-theme="dark"] .hte-page { color-scheme: dark; }

.hte-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 20px 0;
}

/* ---------- 面包屑 ---------- */
.hte-crumb { font-size: 13px; color: var(--hte-muted); margin-bottom: 14px; }
.hte-crumb a { color: var(--hte-muted); text-decoration: none; }
.hte-crumb a:hover { color: var(--hte-accent); }

/* ---------- Hero ---------- */
.hte-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 306px;
  gap: 24px;
  align-items: center;
  background:
    repeating-radial-gradient(ellipse at 88% 120%, transparent 0 26px, rgba(31, 92, 70, .07) 26px 27px),
    linear-gradient(140deg, var(--hte-bg-2), var(--hte-card) 72%);
  border: 1px solid var(--hte-line);
  border-radius: 22px;
  padding: 26px 28px;
  box-shadow: var(--hte-shadow);
  margin-bottom: 18px;
}
.hte-eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  color: #fff;
  background: var(--hte-accent);
  border-radius: 6px;
  padding: 3px 9px;
  margin-bottom: 10px;
}
.hte-hero h1 { font-size: 30px; line-height: 1.3; margin: 0 0 10px; letter-spacing: -.015em; }
.hte-hero p { margin: 0; font-size: 14.5px; color: var(--hte-muted); max-width: 640px; }
.hte-hero p b { color: var(--hte-ink); background: linear-gradient(transparent 62%, rgba(176, 94, 42, .22) 62%); }
.hte-hero-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.hte-hero-meta span {
  font-size: 12px;
  color: var(--hte-accent);
  background: var(--hte-soft);
  border: 1px solid var(--hte-line);
  border-radius: 8px;
  padding: 4px 10px;
}

/* 路线牌 */
.hte-pass {
  background: #10231b;
  color: #e8f2ea;
  border: 1px solid #27453a;
  border-radius: 16px;
  padding: 15px 16px 12px;
  box-shadow: 0 16px 30px rgba(16, 35, 27, .28);
  transform: rotate(-1deg);
}
.hte-pass-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  letter-spacing: .14em;
  color: #8fb5a1;
  padding-bottom: 9px;
  border-bottom: 1px dashed #2c4b3d;
}
.hte-pass-head b { color: #a9e7c7; letter-spacing: .06em; }
.hte-pass-num { display: flex; align-items: baseline; gap: 7px; margin: 9px 0 2px; }
.hte-pass-num strong { font-size: 40px; line-height: 1; font-weight: 800; letter-spacing: -.02em; }
.hte-pass-num em { font-style: normal; font-size: 13px; color: #9dc4ae; }
.hte-pass-sub { font-size: 11.5px; color: #9dc4ae; letter-spacing: .02em; }

.hte-profile {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 44px;
  margin: 12px 0 6px;
  padding-top: 4px;
  border-bottom: 1px solid #2c4b3d;
}
.hte-profile i {
  flex: 1;
  background: linear-gradient(180deg, #7fd9ac, #347a58);
  border-radius: 2px 2px 0 0;
  opacity: .9;
}
.hte-profile i:nth-child(1) { height: 20%; }
.hte-profile i:nth-child(2) { height: 42%; }
.hte-profile i:nth-child(3) { height: 35%; }
.hte-profile i:nth-child(4) { height: 58%; }
.hte-profile i:nth-child(5) { height: 74%; }
.hte-profile i:nth-child(6) { height: 66%; }
.hte-profile i:nth-child(7) { height: 88%; }
.hte-profile i:nth-child(8) { height: 100%; }
.hte-profile i:nth-child(9) { height: 82%; }
.hte-profile i:nth-child(10) { height: 54%; }
.hte-profile i:nth-child(11) { height: 38%; }
.hte-profile i:nth-child(12) { height: 16%; }
.hte-pass-foot { display: flex; justify-content: space-between; font-size: 10.5px; color: #8fb5a1; }

/* ---------- 错误条 ---------- */
.hte-error {
  display: none;
  font-size: 13px;
  color: var(--hte-bad);
  background: rgba(168, 52, 31, .07);
  border: 1px solid rgba(168, 52, 31, .28);
  border-radius: 10px;
  padding: 9px 12px;
  margin-bottom: 12px;
}
.hte-error.on { display: block; }
.hte-error ul { margin: 0; padding-left: 18px; }

/* ---------- 布局 ---------- */
.hte-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 376px;
  gap: 18px;
  align-items: start;
}
.hte-col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

/* ---------- 卡片 ---------- */
.hte-card {
  background: var(--hte-card);
  border: 1px solid var(--hte-line);
  border-radius: 18px;
  padding: 20px 22px;
  box-shadow: 0 6px 18px rgba(43, 55, 45, .05);
}
.hte-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.hte-card-head h2 { font-size: 17px; margin: 0; }
.hte-card-head span { font-size: 12px; color: var(--hte-muted); }

.hte-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.hte-field { min-width: 0; }
.hte-field.full { grid-column: 1 / -1; }
.hte-field > label {
  display: block;
  font-size: 12.5px;
  color: var(--hte-muted);
  margin-bottom: 5px;
  font-weight: 600;
  letter-spacing: .01em;
}
.hte-unit { position: relative; display: flex; align-items: center; }
.hte-unit input {
  width: 100%;
  font: inherit;
  font-size: 15px;
  font-weight: 650;
  color: var(--hte-ink);
  background: var(--hte-soft);
  border: 1px solid var(--hte-line);
  border-radius: 10px;
  padding: 9px 44px 9px 12px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.hte-unit input:focus {
  border-color: var(--hte-accent-2);
  background: var(--hte-card);
  box-shadow: 0 0 0 3px rgba(47, 125, 97, .14);
}
.hte-unit em {
  position: absolute;
  right: 12px;
  font-style: normal;
  font-size: 12px;
  color: var(--hte-muted);
  pointer-events: none;
}
.hte-unit input[type="time"] { padding-right: 12px; }
.hte-unit input.plain { padding-right: 12px; font-weight: 500; font-size: 14px; }

.hte-select {
  width: 100%;
  font: inherit;
  font-size: 14px;
  color: var(--hte-ink);
  background: var(--hte-soft);
  border: 1px solid var(--hte-line);
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
  appearance: none;
  cursor: pointer;
}
.hte-select:focus { border-color: var(--hte-accent-2); box-shadow: 0 0 0 3px rgba(47, 125, 97, .14); }

.hte-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.hte-seg.two { grid-template-columns: 1fr 1fr; }
.hte-seg label { position: relative; display: block; }
.hte-seg input { position: absolute; opacity: 0; width: 0; height: 0; }
.hte-seg span {
  display: block;
  text-align: center;
  font-size: 12.5px;
  color: var(--hte-muted);
  background: var(--hte-soft);
  border: 1px solid var(--hte-line);
  border-radius: 9px;
  padding: 8px 4px;
  cursor: pointer;
  transition: all .15s ease;
}
.hte-seg input:checked + span {
  color: #fff;
  background: var(--hte-accent);
  border-color: var(--hte-accent);
  font-weight: 700;
}
.hte-seg input:focus-visible + span { box-shadow: 0 0 0 3px rgba(47, 125, 97, .2); }

.hte-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.hte-btn {
  font: inherit;
  font-size: 13.5px;
  font-weight: 650;
  color: #fff;
  background: var(--hte-accent);
  border: 1px solid var(--hte-accent);
  border-radius: 10px;
  padding: 9px 18px;
  cursor: pointer;
  transition: transform .12s ease, opacity .15s ease, background-color .15s ease;
}
.hte-btn:hover { opacity: .9; }
.hte-btn:active { transform: translateY(1px); }
.hte-btn.ghost {
  color: var(--hte-accent);
  background: transparent;
  border-color: var(--hte-line);
  font-weight: 600;
}
.hte-btn.ghost:hover { border-color: var(--hte-accent-2); background: var(--hte-soft); }
.hte-btn.small { padding: 7px 13px; font-size: 12.5px; }

.hte-hint { font-size: 12.5px; color: var(--hte-muted); margin: 12px 0 0; line-height: 1.75; }
.hte-hint b { color: var(--hte-ink); }

.hte-rules { margin-top: 14px; border-top: 1px dashed var(--hte-line); padding-top: 10px; }
.hte-rules summary {
  font-size: 12.5px;
  font-weight: 650;
  color: var(--hte-accent);
  cursor: pointer;
  list-style: none;
}
.hte-rules summary::-webkit-details-marker { display: none; }
.hte-rules summary::before { content: "＋ "; font-weight: 700; }
.hte-rules[open] summary::before { content: "－ "; }
.hte-rules .hte-fields { margin-top: 12px; }

/* ---------- 批量 ---------- */
.hte-textarea {
  width: 100%;
  min-height: 116px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.7;
  color: var(--hte-ink);
  background: var(--hte-soft);
  border: 1px solid var(--hte-line);
  border-radius: 10px;
  padding: 10px 12px;
  resize: vertical;
  outline: none;
}
.hte-textarea:focus { border-color: var(--hte-accent-2); box-shadow: 0 0 0 3px rgba(47, 125, 97, .14); }
.hte-batch-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.hte-batch-count { font-size: 12.5px; color: var(--hte-muted); margin-top: 10px; }

/* ---------- 表格 ---------- */
.hte-tbl-wrap { overflow-x: auto; margin-top: 12px; -webkit-overflow-scrolling: touch; }
.hte-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 560px;
}
.hte-table th {
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  color: var(--hte-muted);
  background: var(--hte-soft);
  padding: 8px 10px;
  border-bottom: 1px solid var(--hte-line);
  white-space: nowrap;
}
.hte-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--hte-soft-2);
  vertical-align: top;
}
.hte-table tbody tr:last-child td { border-bottom: none; }
.hte-table td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.hte-table td b { color: var(--hte-accent); }

/* ---------- 结果 ---------- */
.hte-result {
  position: sticky;
  top: 14px;
  background: var(--hte-card);
  border: 1px solid var(--hte-line);
  border-radius: 18px;
  padding: 20px 20px 18px;
  box-shadow: var(--hte-shadow);
}
.hte-result-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hte-result-head h2 { font-size: 16px; margin: 0; }
.hte-chip {
  font-size: 11.5px;
  font-weight: 700;
  border-radius: 999px;
  padding: 3px 10px;
  color: var(--hte-ok);
  background: rgba(29, 107, 71, .1);
  border: 1px solid rgba(29, 107, 71, .24);
}
.hte-chip.warn { color: var(--hte-warn); background: rgba(161, 90, 11, .1); border-color: rgba(161, 90, 11, .26); }
.hte-chip.bad { color: var(--hte-bad); background: rgba(168, 52, 31, .1); border-color: rgba(168, 52, 31, .26); }

.hte-total { display: flex; align-items: baseline; gap: 8px; margin: 12px 0 2px; }
.hte-total strong { font-size: 44px; line-height: 1.05; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.hte-total em { font-style: normal; font-size: 14px; color: var(--hte-muted); }
.hte-basis { font-size: 12.5px; color: var(--hte-muted); }
.hte-basis b { color: var(--hte-ink); }

.hte-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.hte-kpi {
  background: var(--hte-soft);
  border: 1px solid var(--hte-line);
  border-radius: 11px;
  padding: 9px 11px;
}
.hte-kpi small { display: block; font-size: 11px; color: var(--hte-muted); }
.hte-kpi b { font-size: 16px; font-variant-numeric: tabular-nums; }
.hte-kpi span { font-size: 11.5px; color: var(--hte-muted); margin-left: 3px; }

/* 时间轴 */
.hte-timeline { margin-top: 16px; }
.hte-timeline-bar {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--hte-accent-2), var(--hte-sun));
  overflow: visible;
}
.hte-timeline-bar i {
  position: absolute;
  top: -5px;
  width: 2px;
  height: 20px;
  background: var(--hte-bad);
  border-radius: 2px;
}
.hte-timeline-bar i::after {
  content: attr(data-label);
  position: absolute;
  top: -19px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--hte-bad);
  white-space: nowrap;
  font-style: normal;
}
.hte-timeline-labels { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--hte-muted); margin-top: 7px; }

.hte-note {
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--hte-muted);
  background: var(--hte-soft);
  border-left: 3px solid var(--hte-accent-2);
  border-radius: 0 10px 10px 0;
  padding: 9px 12px;
  margin-top: 14px;
}
.hte-note b { color: var(--hte-ink); }
.hte-note.bad { border-left-color: var(--hte-bad); background: rgba(168, 52, 31, .07); }
.hte-note.warn { border-left-color: var(--hte-warn); background: rgba(161, 90, 11, .08); }

/* AI */
.hte-ai {
  margin-top: 14px;
  background:
    radial-gradient(320px 120px at 110% -20%, rgba(176, 94, 42, .18), transparent 70%),
    var(--hte-card);
  border: 1px solid var(--hte-line);
  border-radius: 16px;
  padding: 16px;
}
.hte-ai-btn {
  width: 100%;
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(120deg, var(--hte-accent), var(--hte-accent-2));
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
}
.hte-ai-btn:hover { opacity: .93; }
.hte-ai-btn:disabled { opacity: .6; cursor: default; }
.hte-ai-note { font-size: 11.5px; color: var(--hte-muted); margin: 9px 0 0; line-height: 1.7; }
.hte-ai-status { display: none; font-size: 13px; line-height: 1.8; margin-top: 10px; white-space: pre-wrap; }
.hte-ai-status.on { display: block; }
.hte-ai-status.err { color: var(--hte-bad); }

/* ---------- 下部内容块 ---------- */
.hte-block {
  background: var(--hte-card);
  border: 1px solid var(--hte-line);
  border-radius: 18px;
  padding: 22px 24px;
  margin-top: 18px;
  box-shadow: 0 6px 18px rgba(43, 55, 45, .05);
}
.hte-block h2 { font-size: 19px; margin: 0 0 8px; }
.hte-block .lead { font-size: 14px; color: var(--hte-muted); margin: 0 0 14px; }
.hte-block .lead b { color: var(--hte-ink); }

.hte-formula {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 14px 0 6px;
}
.hte-formula div {
  background: var(--hte-soft);
  border: 1px solid var(--hte-line);
  border-radius: 12px;
  padding: 12px 14px;
}
.hte-formula b { display: block; font-size: 12.5px; color: var(--hte-accent); margin-bottom: 4px; }
.hte-formula code {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  color: var(--hte-ink);
  line-height: 1.7;
  word-break: break-word;
}

.hte-breakdown { display: flex; flex-direction: column; gap: 7px; margin-top: 14px; }
.hte-breakdown-row {
  display: grid;
  grid-template-columns: 100px 1fr 84px;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}
.hte-breakdown-row > span:first-child { color: var(--hte-muted); }
.hte-breakdown-row > b { text-align: right; font-variant-numeric: tabular-nums; }
.hte-bar { height: 7px; background: var(--hte-soft-2); border-radius: 999px; overflow: hidden; }
.hte-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--hte-accent-2), var(--hte-sun)); border-radius: 999px; }

.hte-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 14px; }
.hte-step { background: var(--hte-soft); border: 1px solid var(--hte-line); border-radius: 12px; padding: 13px 14px; }
.hte-step b { display: block; font-size: 11px; letter-spacing: .1em; color: var(--hte-ochre); margin-bottom: 5px; }
.hte-step h4 { font-size: 14px; margin: 0 0 5px; }
.hte-step p { font-size: 12.5px; color: var(--hte-muted); margin: 0; }

.hte-faq details { border-top: 1px solid var(--hte-soft-2); padding: 12px 0 10px; }
.hte-faq details:first-of-type { border-top: none; padding-top: 4px; }
.hte-faq summary {
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-left: 20px;
}
.hte-faq summary::-webkit-details-marker { display: none; }
.hte-faq summary::before {
  content: "›";
  position: absolute;
  left: 4px;
  top: -1px;
  color: var(--hte-accent);
  font-weight: 700;
  transition: transform .15s ease;
}
.hte-faq details[open] summary::before { transform: rotate(90deg); }
.hte-faq p { font-size: 13.5px; color: var(--hte-muted); margin: 8px 0 0; line-height: 1.85; }
.hte-faq p b { color: var(--hte-ink); }

.hte-copy-holder {
  position: fixed;
  left: -9999px;
  top: 0;
  opacity: 0;
}

.hte-disclaimer {
  max-width: 1180px;
  margin: 18px auto 0;
  padding: 0 4px;
  font-size: 12px;
  line-height: 1.8;
  color: var(--hte-muted);
}

/* ---------- 响应式 ---------- */
@media (max-width: 1060px) {
  .hte-grid { grid-template-columns: 1fr; }
  .hte-result { position: static; }
  .hte-hero { grid-template-columns: 1fr 260px; }
}
@media (max-width: 820px) {
  .hte-hero { grid-template-columns: 1fr; }
  .hte-pass { transform: none; max-width: 340px; }
  .hte-steps { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  .hte-shell { padding: 14px 14px 0; }
  .hte-hero { padding: 20px 18px; }
  .hte-hero h1 { font-size: 24px; }
  .hte-card { padding: 16px 15px; }
  .hte-block { padding: 18px 16px; }
  .hte-fields { grid-template-columns: 1fr; }
  .hte-formula { grid-template-columns: 1fr; }
  .hte-steps { grid-template-columns: 1fr; }
  .hte-total strong { font-size: 38px; }
  .hte-breakdown-row { grid-template-columns: 76px 1fr 74px; }
}

@media print {
  .hte-page { background: #fff; }
  .hte-ai, .hte-actions, .hte-batch-actions, .hte-crumb { display: none !important; }
  .hte-result { position: static; box-shadow: none; }
}
