/* ===== 登山杖长度 trekking-pole-length ===== 向导手册风：原木米色底 + 松绿 #2f5d46 × 原木棕 #a4713f */
.tpl-page {
    --tpl-bg: #f8f6f0;
    --tpl-surface: #ffffff;
    --tpl-surface2: #efece2;
    --tpl-line: #e3ded0;
    --tpl-ink: #2b2f26;
    --tpl-dim: #7e8374;
    --tpl-green: #2f5d46;
    --tpl-wood: #a4713f;
    --tpl-bad: #b0503f;
    --tpl-good: #4d8a5f;
    background: var(--tpl-bg);
    color: var(--tpl-ink);
    border-radius: 16px;
    padding: 0 0 30px;
    overflow: hidden;
    border: 1px solid var(--tpl-line);
}
.tpl-inner { padding: 30px 34px 0; }

.tpl-hero { display: grid; grid-template-columns: 1.35fr .95fr; gap: 26px; align-items: center; }
.tpl-kicker { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .14em; color: var(--tpl-wood); margin-bottom: 12px; }
.tpl-kicker::before { content: ""; width: 22px; height: 3px; background: var(--tpl-wood); border-radius: 2px; }
.tpl-hero h1 { font-size: 34px; font-weight: 800; margin: 0 0 10px; color: var(--tpl-ink); }
.tpl-hero-sub { color: var(--tpl-dim); line-height: 1.9; margin: 0 0 14px; font-size: 15px; }
.tpl-hero-sub b { color: var(--tpl-green); }
.tpl-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; }
.tpl-chips li { font-size: 12.5px; color: var(--tpl-green); background: var(--tpl-surface); border: 1px solid var(--tpl-line); border-radius: 999px; padding: 4px 11px; font-weight: 600; }

/* 人形持杖图 */
.tpl-figure-card { background: var(--tpl-surface); border: 1px solid var(--tpl-line); border-radius: 14px; padding: 18px 18px 14px; text-align: center; box-shadow: 0 1px 3px rgba(43, 47, 38, .06); }
.tpl-figure-card svg { width: 100%; max-width: 230px; display: block; margin: 0 auto; }
.tpl-ground { stroke: var(--tpl-line); stroke-width: 3; stroke-linecap: round; }
.tpl-head { fill: none; stroke: var(--tpl-green); stroke-width: 3.5; }
.tpl-body, .tpl-arm, .tpl-forearm { stroke: var(--tpl-green); stroke-width: 4; stroke-linecap: round; }
.tpl-pole { stroke: var(--tpl-wood); stroke-width: 4; stroke-linecap: round; }
.tpl-angle { font-size: 11px; fill: var(--tpl-wood); font-weight: 700; }
.tpl-angle-arc { fill: none; stroke: var(--tpl-wood); stroke-width: 2; stroke-dasharray: 3 3; }
.tpl-fig-num span { font-size: 44px; font-weight: 800; color: var(--tpl-green); font-variant-numeric: tabular-nums; }
.tpl-fig-num em { font-style: normal; font-size: 13px; color: var(--tpl-dim); margin-left: 6px; }
.tpl-fig-tag { font-size: 12.5px; color: var(--tpl-dim); margin: 4px 0 0; min-height: 18px; }

/* 面板 */
.tpl-main { display: grid; grid-template-columns: 1.05fr .95fr; gap: 16px; margin-top: 24px; }
.tpl-panel { background: var(--tpl-surface); border: 1px solid var(--tpl-line); border-radius: 14px; padding: 20px 22px; box-shadow: 0 1px 3px rgba(43, 47, 38, .04); }
.tpl-panel-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.tpl-step { width: 24px; height: 24px; border-radius: 7px; background: var(--tpl-green); color: #fff; font-weight: 700; font-size: 12.5px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.tpl-panel-head h2 { margin: 0; font-size: 16.5px; }
.tpl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tpl-field span { display: block; font-size: 12.5px; color: var(--tpl-dim); margin-bottom: 5px; font-weight: 600; }
.tpl-field input, .tpl-field select { width: 100%; box-sizing: border-box; background: var(--tpl-surface2); border: 1px solid var(--tpl-line); border-radius: 8px; color: var(--tpl-ink); padding: 9px 11px; font-size: 15px; font-variant-numeric: tabular-nums; }
.tpl-field input:focus, .tpl-field select:focus { outline: 2px solid rgba(47, 93, 70, .25); border-color: var(--tpl-green); }
.tpl-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.tpl-btn { border: 1px solid var(--tpl-green); background: var(--tpl-green); color: #fff; border-radius: 8px; padding: 9px 18px; font-size: 14px; font-weight: 600; cursor: pointer; }
.tpl-btn:hover { background: #254b38; }
.tpl-btn-copy { background: transparent; color: var(--tpl-green); }
.tpl-btn-copy:hover { background: rgba(47, 93, 70, .07); }
.tpl-btn-dl { background: transparent; border-color: var(--tpl-line); color: var(--tpl-dim); font-weight: 500; }
.tpl-err { color: var(--tpl-bad); font-size: 13px; margin: 10px 0 0; }

.tpl-result { margin: 0; }
.tpl-result > div { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px dashed var(--tpl-line); padding: 8px 0; }
.tpl-result > div:last-child { border-bottom: 0; }
.tpl-result dt { color: var(--tpl-dim); font-size: 13px; }
.tpl-result dd { margin: 0; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tpl-result dd b { font-size: 26px; color: var(--tpl-wood); }
.tpl-note { font-size: 12.5px; color: var(--tpl-dim); line-height: 1.8; margin: 10px 0 0; }

/* 对照表 / 批量 */
.tpl-table { margin-top: 24px; background: var(--tpl-surface); border: 1px solid var(--tpl-line); border-radius: 14px; padding: 20px 22px; }
.tpl-table h2 { font-size: 17px; margin: 0 0 6px; }
.tpl-table-sub { font-size: 13px; color: var(--tpl-dim); margin: 0 0 12px; }
.tpl-table-scroll { overflow-x: auto; }
.tpl-table table { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.tpl-table th { background: var(--tpl-green); color: #fff; font-weight: 600; padding: 8px 10px; text-align: center; white-space: nowrap; }
.tpl-table th:first-child { text-align: left; }
.tpl-table td { border-top: 1px solid var(--tpl-line); padding: 7px 10px; text-align: center; color: var(--tpl-ink); }
.tpl-table td:first-child { text-align: left; font-weight: 600; }
.tpl-batch { margin-top: 24px; }
.tpl-batch textarea { width: 100%; box-sizing: border-box; background: var(--tpl-surface2); border: 1px solid var(--tpl-line); border-radius: 8px; color: var(--tpl-ink); padding: 10px 12px; font-size: 14px; font-family: Consolas, monospace; resize: vertical; }
.tpl-batch-tip { font-size: 13px; color: var(--tpl-dim); margin: 0 0 8px; }
.tpl-batch-out { margin-top: 14px; overflow-x: auto; }
.tpl-batch-out table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tpl-batch-out th { background: var(--tpl-surface2); padding: 7px 10px; color: var(--tpl-dim); text-align: left; white-space: nowrap; }
.tpl-batch-out td { border-top: 1px solid var(--tpl-line); padding: 6px 10px; }

/* 用杖要点 */
.tpl-risk { margin-top: 24px; }
.tpl-risk h2 { font-size: 18px; margin: 0 0 12px; }
.tpl-risk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.tpl-risk-card { background: var(--tpl-surface); border: 1px solid var(--tpl-line); border-left: 3px solid var(--tpl-wood); border-radius: 10px; padding: 14px 16px; }
.tpl-risk-card h3 { margin: 0 0 6px; font-size: 14.5px; }
.tpl-risk-card p { margin: 0; font-size: 13px; color: var(--tpl-dim); line-height: 1.85; }
.tpl-risk-card b { color: var(--tpl-green); }

.tpl-toast { position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%) translateY(16px); background: var(--tpl-green); color: #fff; border-radius: 9px; padding: 10px 22px; font-size: 14px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .22s ease, transform .22s ease; z-index: 99; }
.tpl-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 900px) {
    .tpl-inner { padding: 24px 18px 0; }
    .tpl-hero { grid-template-columns: 1fr; }
    .tpl-main { grid-template-columns: 1fr; }
}

/* 深色：夜径松林 */
:root[data-theme="dark"] .tpl-page, :root[data-theme="dark"] .tpl-toast {
    --tpl-bg: #141813;
    --tpl-surface: #1c211a;
    --tpl-surface2: #262d23;
    --tpl-line: #37402f;
    --tpl-ink: #eaeee3;
    --tpl-dim: #a3ab97;
    --tpl-green: #7fb899;
    --tpl-wood: #c98f55;
    --tpl-bad: #d97a5f;
    --tpl-good: #7fbf8f;
}
:root[data-theme="dark"] .tpl-step { background: var(--tpl-wood); color: #241608; }
:root[data-theme="dark"] .tpl-btn { background: var(--tpl-wood); border-color: var(--tpl-wood); color: #241608; }
:root[data-theme="dark"] .tpl-btn:hover { background: #d9a066; }
:root[data-theme="dark"] .tpl-btn-copy { background: transparent; color: var(--tpl-wood); }
:root[data-theme="dark"] .tpl-table th { background: #262d23; color: #cfe0d2; }