/* =========================================================
   计算器页面样式（仅外观；所有 id / class / 结构与计算脚本保持不变）
   ========================================================= */

.calculator-box {
  position: relative;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 40px;
  margin: 0 auto 40px;
  box-shadow: 0 30px 70px rgba(10, 22, 33, .06);
}
.js .calculator-box { animation: calc-rise .9s .15s var(--ease-out) both; }
@keyframes calc-rise { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }

/* 依赖提示：默认隐藏，由各计算脚本在缺少战力系数时设为 display:flex */
.warning-message {
  display: none;
  align-items: flex-start; gap: 12px;
  padding: 14px 18px; margin-bottom: 28px;
  border-radius: 14px;
  background: #fff4ec; border: 1px solid #ffd3b8;
  color: #9a3a0b; font-size: 14.5px; font-weight: 500; line-height: 1.6;
}
.warning-message .ico { width: 20px; height: 20px; flex: 0 0 20px; margin-top: 1px; }

.section-title {
  display: flex; align-items: center; gap: 12px;
  margin: 0 0 18px;
  font-size: 20px; font-weight: 600; letter-spacing: -.015em; line-height: 1.35; color: var(--ink);
}
/* v15：方块改为圆点 + 脉动光圈（与全站 section-label 圆点同一语言） */
.section-title::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: 0 0 auto;
  box-shadow: 0 0 0 0 rgba(242, 102, 43, .5); animation: st-pulse 2.4s cubic-bezier(.22,.61,.36,1) infinite;
}
@keyframes st-pulse {
  0% { box-shadow: 0 0 0 0 rgba(242, 102, 43, .5); }
  70% { box-shadow: 0 0 0 9px rgba(242, 102, 43, 0); }
  100% { box-shadow: 0 0 0 0 rgba(242, 102, 43, 0); }
}
@media (prefers-reduced-motion: reduce) { .section-title::before { animation: none; } }

/* ===== 输入 ===== */
.input-section { margin-top: 4px; }
.input-section .section-title:not(:first-child) { margin-top: 34px; }
.input-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 22px; }
.input-section > .input-group + .input-group { margin-top: 18px; }
.input-group { display: flex; flex-direction: column; min-width: 0; }
.input-group label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500; color: var(--ink-2); line-height: 1.5; }
.input-group input {
  width: 100%; min-height: 52px; padding: 12px 16px;
  font-family: var(--font-body); font-size: 17px; font-weight: 500; color: var(--ink);
  background: var(--paper); border: 1px solid transparent; border-radius: 12px;
  outline: none; line-height: 1.4; font-variant-numeric: tabular-nums;
  transition: border-color .2s, box-shadow .25s, background .2s;
}
.input-group input::placeholder { color: #a0a9b3; font-weight: 400; font-size: 15px; }
.input-group input:hover { border-color: var(--line-strong); }
.input-group input:focus { background: #fff; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(242, 102, 43, .14); }
.input-tips { margin-top: 7px; font-size: 12.5px; color: var(--ink-3); line-height: 1.55; }

/* ===== 计算按钮 ===== */
.calculate-btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 56px; margin-top: 26px; padding: 14px 22px;
  font-family: var(--font-body); font-size: 16px; font-weight: 600; letter-spacing: .02em; line-height: 1;
  color: #fff; background: var(--navy);
  border: 0; border-radius: 999px; cursor: pointer;
  transition: background .25s, transform .3s var(--ease-out), box-shadow .3s;
}
.calculate-btn::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: -40%; width: 30%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .22), transparent);
  transform: skewX(-20deg); transition: left .7s var(--ease-out);
}
.calculate-btn:hover { background: var(--accent); box-shadow: 0 14px 30px rgba(242, 102, 43, .3); transform: translateY(-2px); }
.calculate-btn:hover::after { left: 120%; }
.calculate-btn:active { transform: translateY(0) scale(.99); }
.calculate-btn .ico { width: 18px; height: 18px; flex: 0 0 18px; }

/* ===== 结果 ===== */
.result-section { margin-top: 36px; }
.result-header {
  display: flex; align-items: center; gap: 12px; margin: 0 0 16px;
  font-size: 12px; font-weight: 500; letter-spacing: .18em; color: var(--accent-ink); line-height: 1.4;
}
.result-header::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.result-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  background: var(--white); gap: 0;
}
.result-item { background: var(--white); padding: 20px 18px; text-align: left; transition: background .25s; box-shadow: 1px 0 0 var(--line), 0 1px 0 var(--line); }
.result-item:hover { background: #fbfbfc; }
.result-label { margin-bottom: 8px; font-size: 13px; font-weight: 500; color: var(--muted); line-height: 1.4; }
.result-value {
  font-size: clamp(22px, 2.2vw, 30px); font-weight: 600; letter-spacing: -.035em; line-height: 1.15;
  color: var(--ink); font-variant-numeric: tabular-nums; word-break: break-all;
}
.result-value span { color: var(--accent-ink); }
.result-value.loading { color: var(--ink-3); font-weight: 500; font-size: 16px; }

/* fadeIn 关键帧名称被计算脚本以内联 style 引用，必须保留 */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.result-value.show { animation: fadeIn .45s ease both; }

/* 合计 */
.total-result {
  position: relative; overflow: hidden;
  margin-top: 16px; padding: 26px 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  border-radius: 18px; background: var(--navy); color: #fff;
}
.total-result::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(60% 140% at 100% 0%, rgba(242, 102, 43, .35), transparent 65%);
}
.total-label { position: relative; font-size: 15px; font-weight: 500; color: #c3d0dc; }
.total-value {
  position: relative;
  font-size: clamp(30px, 3.4vw, 46px); font-weight: 600; letter-spacing: -.045em; line-height: 1.05;
  color: #fff; font-variant-numeric: tabular-nums; word-break: break-all;
}

/* 战力系数 */
.coefficient-section { margin-bottom: 34px; }
.coefficient-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line); border-radius: 16px; overflow: hidden; gap: 0; background: var(--paper);
}
.coefficient-item { background: var(--paper); padding: 18px; box-shadow: 1px 0 0 var(--line), 0 1px 0 var(--line); }
.coefficient-label { margin-bottom: 6px; font-size: 13px; font-weight: 500; color: var(--muted); }
.coefficient-value { font-size: 24px; font-weight: 600; letter-spacing: -.03em; color: var(--accent-ink); font-variant-numeric: tabular-nums; }

/* 勾玉 */
.magatama-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.magatama-section {
  padding: 26px; border-radius: 18px;
  background: var(--paper); border: 1px solid var(--line);
  transition: border-color .3s, box-shadow .4s var(--ease-out);
}
.magatama-section:hover { border-color: rgba(242, 102, 43, .4); box-shadow: 0 18px 40px rgba(10, 22, 33, .06); }
.magatama-section .input-group + .input-group { margin-top: 14px; }
.magatama-section .input-group input { background: #fff; }
.magatama-section .calculate-btn { margin-top: 20px; }
.magatama-section .result-section { margin-top: 20px; }
.magatama-section .result-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.magatama-section .result-item { padding: 14px 12px; }
.magatama-section .result-value { font-size: 20px; }
.magatama-section .result-section:not(:has(.result-grid)) {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line); border-radius: 14px; overflow: hidden; gap: 0; background: var(--white);
}

/* 许愿宝库信息 */
.info-section { padding: 26px; margin-bottom: 34px; border-radius: 18px; background: var(--paper); border: 1px solid var(--line); }
.info-header { margin: 0 0 16px; font-size: 20px; font-weight: 600; letter-spacing: -.015em; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.info-item { padding: 14px 16px; border-radius: 12px; background: #fff; border: 1px solid var(--line); }
.info-item .label { margin-bottom: 4px; font-size: 12.5px; color: var(--muted); }
.info-item .value { font-size: 19px; font-weight: 600; font-variant-numeric: tabular-nums; }
.info-item > span { display: flex; align-items: center; gap: 10px; font-size: 14.5px; font-weight: 500; color: var(--ink-2); line-height: 1.55; }
.info-item > span::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: 0 0 auto; }

/* 概率表 */
.probability-section { margin-bottom: 34px; }
.probability-table { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; font-size: 15px; }
.probability-table th, .probability-table td { padding: 13px 18px; text-align: left; border-bottom: 1px solid var(--line); }
.probability-table tr:last-child td { border-bottom: 0; }
.probability-table th { background: var(--navy); color: #fff; font-weight: 500; font-size: 13.5px; letter-spacing: .04em; }
.probability-table td { background: #fff; font-variant-numeric: tabular-nums; }
.probability-table tr:hover td { background: #fbfbfc; }

/* 抽奖记录中的奖项（类名由 wish-sim.js 生成） */
.history-item .draw-index { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.history-item .coins-amount { margin-left: auto; font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; }
.prize-first { color: var(--accent-ink); font-weight: 600; }
.prize-second { color: #7a4cc2; font-weight: 600; }
.prize-third { color: #1c6fa8; font-weight: 600; }

/* ===== 响应式 ===== */
@media (max-width: 900px) {
  .calculator-box { padding: 28px; border-radius: 18px; }
  .magatama-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .calculator-box { padding: 20px 18px; margin-bottom: 32px; }
  .input-grid { grid-template-columns: 1fr; gap: 16px; }
  .result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result-item { padding: 16px 14px; }
  .coefficient-grid { grid-template-columns: 1fr; }
  .magatama-section { padding: 18px; }
  .magatama-section .result-grid { grid-template-columns: 1fr; }
  .total-result { flex-direction: column; align-items: flex-start; gap: 8px; padding: 22px; }
  .probability-table th, .probability-table td { padding: 11px 12px; }
}

/* ---- 移动端精修 v6 ---- */
@media (max-width: 640px) {
  .coefficient-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .coefficient-item { padding: 14px 12px; }
  .coefficient-label { font-size: 12px; }
  .coefficient-value { font-size: 20px; }
  .input-group input, .input-group select { font-size: 16px; } /* 避免 iOS 聚焦时自动放大 */
}
@media (max-width: 380px) {
  .calculator-box { padding: 16px 14px; border-radius: 18px; }
  .magatama-section { padding: 14px; }
  .coefficient-item { padding: 12px 10px; }
  .coefficient-value { font-size: 18px; }
}

/* v11: 手机端计算结果改为清单式（左标签、右数值），奇数项不再留空格 */
@media (max-width: 640px) {
  .result-header { margin-bottom: 12px; }
  .result-grid { display: flex !important; flex-direction: column; gap: 0; padding: 4px 16px; border-radius: 18px; background: #fff; border: 1px solid var(--line); box-shadow: 0 10px 24px rgba(10,22,33,.05); overflow: hidden; }
  .result-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 0; background: transparent !important; box-shadow: none; border-bottom: 1px solid var(--line); }
  .result-item:last-child { border-bottom: 0; }
  .result-label { margin: 0; font-size: 14px; color: var(--muted); }
  .result-label::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 8px; border-radius: 50%; background: var(--accent); vertical-align: middle; transform: translateY(-1px); }
  .result-value { font-size: 22px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .magatama-section .result-item { padding: 12px 0; }
  .magatama-section .result-value { font-size: 18px; }
}

/* =========================================================
   v14 升级计算（新增模块；沿用现有输入 / 结果 / 表格样式，仅补充少量控件）
   结构：01 等级与经验 → 02 每日体力 → 03 每日经验来源 → 结果 → 方案对比 → 经验表（折叠）→ 数据说明
   ========================================================= */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.up-calc .input-section .section-title { margin-top: 30px; }
.up-calc .input-section .section-title:first-child { margin-top: 0; }
.up-calc .input-group input.is-invalid { border-color: var(--accent); background: #fff4ec; }
.up-err { margin-top: 10px; color: var(--accent-ink); font-weight: 500; }

/* 快捷目标等级：两组分别对齐上方两个输入框的列边界，44px 触控高度 */
.up-calc { --up-gx: 22px; }
.up-quick button { min-width: 0; }
/* 数字框去掉原生上下箭头（有步进器/快捷按钮），避免与右侧内容抢位 */
.up-calc input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.up-calc input[type=number]::-webkit-inner-spin-button, .up-calc input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.up-quick button, .up-jump button, .up-seg button {
  min-height: 44px; padding: 0 12px; border-radius: 999px;
  font-family: var(--font-body); font-size: 14px; font-weight: 500; color: var(--ink-2);
  background: var(--white); border: 1px solid var(--line); cursor: pointer; white-space: nowrap;
  transition: border-color .25s, color .25s, background .25s, transform .35s var(--ease-out);
}
.up-quick button:hover, .up-jump button:hover, .up-seg button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent-ink); }
.up-quick button:active, .up-jump button:active { transform: scale(.97); }

/* 买体力次数：− 数值 + */
.up-stepper { display: grid; grid-template-columns: 56px minmax(0, 1fr) 56px; gap: 8px; align-items: stretch; }
.up-stepper input { text-align: center; font-weight: 600; }
.up-stepper button {
  min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--white);
  font-family: var(--font-body); font-size: 22px; line-height: 1; color: var(--ink); cursor: pointer;
  transition: background .2s, color .2s, border-color .2s, transform .2s;
}
.up-stepper button:hover:not(:disabled) { background: var(--navy); border-color: var(--navy); color: #fff; }
.up-stepper button:active:not(:disabled) { background: var(--accent); border-color: var(--accent); color: #fff; transform: scale(.96); }
.up-stepper button:disabled { opacity: .35; cursor: not-allowed; }
.up-buy-group .input-tips { color: var(--accent-ink); font-variant-numeric: tabular-nums; }

/* 结果 */
.up-calc .result-section { margin-top: 30px; }
.up-calc .total-result { margin: 0 0 16px; }
.up-calc .total-result > div { position: relative; }
.up-calc .is-empty { color: #6b7d8f; font-weight: 500; }
.up-calc .result-value.is-empty { color: var(--ink-3); }
.up-eta { margin-top: 6px; font-size: 14px; color: var(--accent-soft); font-variant-numeric: tabular-nums; }
.up-calc .total-value { white-space: nowrap; }
.up-calc .total-value small { font-size: 18px; font-weight: 500; letter-spacing: 0; color: #c3d0dc; }
.up-result-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* 折叠区（收益参数 / 经验表） */
.up-fold { margin-top: 32px; border-top: 1px solid var(--line); padding-top: 26px; }
.up-fold > summary { cursor: pointer; list-style: none; margin: 0; flex-wrap: wrap; row-gap: 4px; min-height: 44px; }
.up-fold > summary::-webkit-details-marker { display: none; }
.up-fold > summary::after {
  content: ""; width: 8px; height: 8px; margin-left: auto; flex: 0 0 auto; order: 3;
  border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3);
  transform: translateY(-3px) rotate(45deg); transition: transform .3s var(--ease-out);
}
.up-fold[open] > summary::after { transform: translateY(2px) rotate(-135deg); }
.up-fold-hint { order: 2; font-size: 13px; font-weight: 400; letter-spacing: 0; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.up-fold-body { padding-top: 18px; }
.up-group-title { margin: 22px 0 12px; font-size: 13px; font-weight: 500; letter-spacing: .08em; color: var(--muted); }
.up-group-title:first-child { margin-top: 0; }
.up-reset {
  display: inline-flex; align-items: center; min-height: 44px; margin-top: 16px; padding: 0 18px; border-radius: 999px;
  font-family: var(--font-body); font-size: 14px; font-weight: 500; color: var(--ink-2);
  background: var(--paper); border: 1px solid var(--line); cursor: pointer; transition: color .2s, border-color .2s;
}
.up-reset:hover:not(:disabled) { color: var(--accent-ink); border-color: var(--accent); }
.up-reset:disabled { color: var(--accent-ink); cursor: default; }

/* 方案对比 */
.up-compare { margin-top: 32px; border-top: 1px solid var(--line); padding-top: 26px; }
.up-compare .input-tips { margin-top: 10px; }
.up-cmp-table tbody tr[data-buy] { cursor: pointer; }
.up-cmp-table tbody tr:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.up-table tr.is-current td, .up-table tr.in-range td { background: #fff4ec; }
.up-table tr.is-current td { color: var(--accent-ink); font-weight: 600; }
.up-table tr.is-current td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.up-table tr.up-empty td { text-align: center; color: var(--ink-3); padding: 22px; }
.up-table td:first-child { font-weight: 500; }

/* 经验表：不使用内滚动，跟随页面滚动；表头吸顶避开导航 */
.up-exp-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.up-seg { display: inline-flex; padding: 4px; gap: 4px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); }
.up-seg button { min-height: 44px; border: 0; background: transparent; }
.up-seg button.is-on { background: var(--navy); color: #fff; }
.up-seg button:disabled { opacity: .4; cursor: not-allowed; }
.up-jump { display: flex; gap: 8px; }
.up-jump input {
  width: 140px; min-height: 44px; padding: 8px 14px;
  font-family: var(--font-body); font-size: 15px; color: var(--ink);
  background: var(--paper); border: 1px solid transparent; border-radius: 12px; outline: none;
  transition: border-color .2s, box-shadow .25s, background .2s;
}
.up-jump input:focus { background: #fff; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(242, 102, 43, .14); }
.up-exp-table { overflow: visible; }
.up-exp-table thead th { position: sticky; top: calc(var(--header-h) + 8px); z-index: 2; }
.up-exp-table thead th:first-child { border-top-left-radius: 13px; }
.up-exp-table thead th:last-child { border-top-right-radius: 13px; }
.up-exp-table tbody tr:last-child td:first-child { border-bottom-left-radius: 13px; }
.up-exp-table tbody tr:last-child td:last-child { border-bottom-right-radius: 13px; }
.up-table tr.flash td { animation: up-flash 1.6s ease; }
@keyframes up-flash { 0%, 45% { background: #ffd3b8; } 100% { background: inherit; } }

/* 数据说明：降为页尾小字 */
.up-notes { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 22px; padding-top: 18px; border-top: 1px dashed var(--line); font-size: 12.5px; color: var(--ink-3); line-height: 1.6; }
.up-notes span:first-child { color: var(--muted); font-weight: 500; }
.up-notes span + span::before { content: ""; display: inline-block; width: 4px; height: 4px; margin-right: 8px; border-radius: 50%; background: var(--accent); vertical-align: middle; transform: translateY(-1px); }

/* 手机端吸底结果条（与右下悬浮按钮同高同质感，避开其位置） */
.up-dock { display: none; }
@media (max-width: 760px) {
  .up-dock {
    position: fixed; z-index: 60; left: 14px; right: calc(14px + 48px + 12px); bottom: calc(14px + env(safe-area-inset-bottom));
    display: flex; align-items: baseline; gap: 4px; height: 48px; padding: 0 16px; border: 0; border-radius: 999px;
    font-family: var(--font-body); color: #fff; text-align: left; white-space: nowrap; overflow: hidden;
    background: rgba(12, 20, 30, .86); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    box-shadow: 0 10px 24px -8px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.08);
    line-height: 48px; cursor: pointer;
    opacity: 0; transform: translateY(16px); pointer-events: none;
    transition: opacity .3s, transform .4s var(--ease-out);
  }
  .up-dock.is-on { opacity: 1; transform: none; pointer-events: auto; }
  .up-dock b { font-size: 16px; font-weight: 600; letter-spacing: -.02em; color: var(--accent-2); font-variant-numeric: tabular-nums; }
  .up-dock-k, .up-dock-u { font-size: 12.5px; color: #c3d0dc; }
  .up-dock-sep { width: 1px; height: 14px; margin: 0 6px; background: rgba(255,255,255,.18); align-self: center; }
  body:has(music-player:not(.collapsed)) .up-dock { bottom: calc(10px + 66px + 12px + env(safe-area-inset-bottom)); right: 14px; }
  body:not(:has(music-player)) .up-dock { right: 14px; }
}


/* v14c 三步输入：01 等级与经验 / 02 每日体力 / 03 每日经验来源，全部展开 */
.up-step + .up-step { margin-top: 34px; padding-top: 30px; border-top: 1px solid var(--line); }
.up-calc .input-section .up-step .section-title { margin-top: 0; flex-wrap: wrap; row-gap: 2px; }
.up-no { display: inline-block; margin-right: 10px; font-size: 13px; font-weight: 600; letter-spacing: .04em; color: var(--accent-ink); font-variant-numeric: tabular-nums; }
.up-sub { margin-left: 10px; font-size: 13px; font-weight: 400; letter-spacing: 0; color: var(--ink-3); }
.up-calc .up-g2, .up-calc .up-g4 { display: grid; gap: 18px var(--up-gx); align-items: start; }
.up-calc .up-g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.up-calc .up-g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.up-calc .up-g2 > *, .up-calc .up-g4 > * { min-width: 0; }
.up-row2 { margin-top: 18px; }
/* 快捷按钮：与左侧输入框同一行、底边对齐 */
.up-quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; align-self: end; }
.up-calc .up-g2 .up-quick { padding-bottom: 0; }
.up-quick button { min-height: var(--up-h, 52px); }
/* 小计：结构与输入框一致（上标签 + 等高框），与左侧控件顶边、底边对齐 */
.up-sum { font-variant-numeric: tabular-nums; }
.up-sum-k { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500; color: var(--ink-2); line-height: 1.5; }
@media (max-width: 640px) { .up-sum-k { font-size: 13px; margin-bottom: 6px; } }
.up-sum-box {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: var(--up-h, 52px); padding: 0 18px;
  border-radius: 12px; background: var(--navy); color: #fff;
}
.up-sum b { font-size: 20px; font-weight: 600; letter-spacing: -.02em; color: var(--accent-2); white-space: nowrap; }
.up-sum-d { font-size: 13px; color: #c3d0dc; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-reset-wrap { align-self: end; }
.up-reset-wrap .up-reset { margin-top: 0; }
@media (max-width: 1100px) { .up-calc .up-g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .up-calc .up-g2, .up-calc .up-g4 { gap: 14px var(--up-gx); }
  .up-calc .up-row2 { grid-template-columns: 1fr; }
  .up-g2 > .up-quick { grid-column: 1 / -1; margin-top: -4px; }
  .up-quick { gap: 6px; }
  .up-quick button { min-height: 44px; }
  .up-reset-wrap { order: 2; }
  .up-step + .up-step { margin-top: 26px; padding-top: 22px; }
  .up-sub { display: block; width: 100%; margin: 2px 0 0; font-size: 12px; }
  .up-calc { --up-h: 48px; }
  .up-sum-box { padding: 0 14px; }
  .up-sum b { font-size: 18px; }
  .up-sum-d { font-size: 12px; }
  .up-calc .up-notes { margin-top: 26px; }
}
@media (max-width: 1100px) { .up-result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .up-calc { --up-gx: 12px; }
  .up-calc .input-group label { font-size: 13px; margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .up-calc .input-group input { min-height: 48px; padding: 10px 12px; }
  .up-calc .input-tips { font-size: 12px; }

  .up-quick button { padding: 0 4px; font-size: 13px; }
  .up-stepper { grid-template-columns: 52px minmax(0, 1fr) 52px; }
  .up-calc .total-result { flex-direction: column; align-items: flex-start; gap: 6px; padding: 20px; }
  .up-calc .total-value { font-size: 32px; }
  .up-calc .total-value small { font-size: 14px; }
  .up-calc .is-empty { color: #6b7d8f; font-weight: 500; }
.up-calc .result-value.is-empty { color: var(--ink-3); }
.up-eta { font-size: 12.5px; line-height: 1.5; }
  .up-fold, .up-compare { margin-top: 26px; padding-top: 20px; }
  /* 对比表：手机端紧凑 4 列（隐藏「比不买」列），一行一个方案，无横向滚动 */
  .up-cmp-table th:nth-child(5), .up-cmp-table td:nth-child(5) { display: none; }
  .up-cmp-table th, .up-cmp-table td { padding: 11px 8px !important; white-space: nowrap; font-variant-numeric: tabular-nums; }
  .up-cmp-table th { font-size: 12px; letter-spacing: 0; }
  .up-cmp-table td { font-size: 13.5px; }
  .up-cmp-table th:first-child, .up-cmp-table td:first-child { padding-left: 12px !important; }
  .up-cmp-table th:not(:first-child), .up-cmp-table td:not(:first-child) { text-align: right; }
  .up-cmp-table th:last-child, .up-cmp-table td:nth-child(4) { padding-right: 12px !important; }
  .up-exp-tools { flex-direction: column; align-items: stretch; }
  .up-seg { display: grid; grid-template-columns: 1fr 1fr; }
  .up-jump input { flex: 1; width: auto; font-size: 16px; }
  .up-table { font-size: 13.5px; }
  .up-exp-table th, .up-exp-table td { padding: 11px 10px !important; white-space: nowrap; }
  .up-exp-table th { font-size: 12px; letter-spacing: 0; }
  .up-calc .up-notes { display: grid; gap: 4px; }
}
@media (max-width: 380px) {
  .up-exp-table { font-size: 12.5px; }
  .up-exp-table th, .up-exp-table td { padding: 10px 6px !important; }
  .up-exp-table th { font-size: 11.5px; }
  .up-dock { padding: 0 12px; }
  .up-cmp-table th, .up-cmp-table td { padding: 10px 6px !important; font-size: 12.5px; }
  .up-dock b { font-size: 15px; }
}
@media (max-width: 640px) { .up-calc .up-g2:not(.up-row2) > .input-group:nth-child(3) { grid-column: 1 / -1; } }
@media (max-width: 380px) {
  .up-quick button { padding: 0; font-size: 12px; letter-spacing: -.01em; }
  .up-sum-box { padding: 6px 12px; }
  .up-sum-d { white-space: normal; line-height: 1.35; font-size: 11.5px; }
}


/* =========================================================
   v15 等级计算器：进度 / 计算式 / 复制 / 买体力分析 / 逐级明细
   ========================================================= */
.up-calc .result-value, .up-table td, .up-formula, .up-prog { font-variant-numeric: tabular-nums; }
.up-calc .input-group.is-mod > label::after {
  content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 6px; border-radius: 50%;
  background: var(--accent); vertical-align: middle; transform: translateY(-1px);
}
.up-prog { margin-top: 18px; padding: 16px 18px; border-radius: 14px; background: var(--paper); border: 1px solid var(--line); }
.up-prog-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--ink-3); }
.up-prog-pct { color: var(--ink); font-weight: 600; font-size: 14px; text-align: center; }
.up-prog-bar { position: relative; height: 8px; margin: 10px 0 8px; border-radius: 999px; background: #e7eaee; overflow: hidden; }
.up-prog-bar i { position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(90deg, #f2662b, #ff9a5c); transform-origin: left; transform: scaleX(0); transition: transform .7s var(--ease-out); }
.up-prog-note { font-size: 12.5px; color: var(--ink-3); }
.up-formula { margin-top: 12px; display: grid; gap: 6px; font-size: 13px; line-height: 1.55; color: var(--ink-2); }
.up-formula > div { display: flex; gap: 10px; align-items: baseline; min-width: 0; }
.up-f-k { flex: 0 0 auto; padding: 1px 8px; border-radius: 6px; font-size: 12px; font-weight: 500; color: var(--accent-ink); background: #fff4ec; }
.up-formula span:last-child { min-width: 0; overflow-wrap: anywhere; }
.up-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; }
.up-act {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 999px;
  font-family: var(--font-body); font-size: 14px; font-weight: 500; color: var(--ink-2);
  background: var(--white); border: 1px solid var(--line); cursor: pointer; transition: color .2s, border-color .2s, transform .2s;
}
.up-act .i { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.up-act:hover:not(:disabled) { color: var(--accent-ink); border-color: var(--accent); }
.up-act:active:not(:disabled) { transform: scale(.97); }
.up-act:disabled { opacity: .4; cursor: not-allowed; }
.up-act-tip { font-size: 13px; color: var(--accent-ink); opacity: 0; transform: translateY(4px); transition: opacity .25s, transform .25s; }
.up-act-tip.show { opacity: 1; transform: none; }

.up-tier { display: inline-block; margin-left: 8px; padding: 1px 7px; border-radius: 999px; font-size: 11.5px; font-weight: 500; color: var(--accent-ink); background: #fff4ec; border: 1px solid #ffd3b8; white-space: nowrap; vertical-align: 1px; }
.up-table tr.is-current .up-tier { background: #fff; }
.up-cmp-table th:not(:first-child), .up-cmp-table td:not(:first-child),
.up-exp-table th:not(:first-child), .up-exp-table td:not(:first-child) { text-align: right; }
.up-cmp-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-top: 10px; }
.up-cmp-foot .input-tips { margin: 0; flex: 1 1 320px; }
.up-more {
  min-height: 44px; padding: 0 16px; border-radius: 999px; font-family: var(--font-body); font-size: 14px; font-weight: 500;
  color: var(--ink-2); background: var(--white); border: 1px solid var(--line); cursor: pointer; white-space: nowrap; transition: color .2s, border-color .2s;
}
.up-more:hover { color: var(--accent-ink); border-color: var(--accent); }
.up-exp-table tbody tr.in-range { cursor: pointer; }
.up-exp-table tbody tr.in-range:hover td { background: #ffe9db; }
.up-exp-table tbody tr:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.up-exp-tip { margin-top: 10px; }

@media (max-width: 640px) {
  .up-prog { padding: 14px; }
  .up-prog-head { font-size: 12px; }
  .up-prog-pct { font-size: 13px; }
  .up-formula { font-size: 12.5px; }
  .up-act { flex: 1 1 0; justify-content: center; padding: 0 10px; }
  .up-act-tip { flex: 1 0 100%; text-align: center; }
  /* 买体力分析：手机端改卡片，一行一个方案，无横向滚动 */
  .up-cmp-table, .up-cmp-table tbody { display: block; background: none; border: 0; box-shadow: none; }
  .up-cmp-table thead { display: none; }
  .up-cmp-table tbody tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 10px; padding: 12px 14px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--white); }
  .up-cmp-table tbody tr.is-current { border-color: var(--accent); background: #fff4ec; box-shadow: inset 3px 0 0 var(--accent); }
  .up-cmp-table td { display: block !important; padding: 0 !important; border: 0 !important; background: none !important; text-align: left !important; white-space: nowrap; font-size: 14px; box-shadow: none !important; }
  .up-cmp-table td:first-child { grid-column: 1 / -1; display: flex !important; align-items: center; font-size: 15px; font-weight: 600; }
  .up-cmp-table td:not(:first-child)::before { content: attr(data-k); display: block; font-size: 11.5px; font-weight: 400; color: var(--ink-3); margin-bottom: 1px; }
  .up-cmp-table tr.up-empty { display: block; }
  .up-cmp-table tr.up-empty td { text-align: center !important; padding: 18px !important; }
  .up-cmp-table tr.up-empty td::before { content: none; }
  .up-more { width: 100%; }
  /* 逐级明细：手机端隐藏「本级天数」 */
  .up-exp-table th:nth-child(3), .up-exp-table td:nth-child(3) { display: none; }
}
@media (max-width: 380px) {
  .up-cmp-table tbody tr { padding: 10px 12px; gap: 6px 8px; }
  .up-cmp-table td { font-size: 13px; }
  .up-exp-table th:nth-child(2), .up-exp-table td:nth-child(2) { padding-left: 4px !important; }
}

/* v15 空状态：骨架占位条（替代「—」） */
.up-calc .is-empty { display: inline-block; vertical-align: middle; }
.up-calc .is-empty::before {
  content: ""; display: block; width: 4.2em; height: .5em; min-height: 10px; border-radius: 999px;
  background: linear-gradient(90deg, rgba(10,22,33,.07) 0%, rgba(10,22,33,.07) 35%, rgba(10,22,33,.15) 50%, rgba(10,22,33,.07) 65%, rgba(10,22,33,.07) 100%);
  background-size: 300% 100%; animation: up-skel 1.8s ease-in-out infinite;
}
.up-calc .total-value .is-empty::before {
  width: 2.4em; height: .34em;
  background-image: linear-gradient(90deg, rgba(255,255,255,.10) 0%, rgba(255,255,255,.10) 35%, rgba(255,255,255,.24) 50%, rgba(255,255,255,.10) 65%, rgba(255,255,255,.10) 100%);
}
.up-calc .total-value:has(.is-empty) small { opacity: .45; }
@keyframes up-skel { from { background-position: 100% 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .up-calc .is-empty::before { animation: none; } }
.up-base { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 500; color: var(--ink-3); background: var(--paper); border: 1px solid var(--line); }
@media (max-width: 640px) {
  .up-exp-table { font-size: 12.5px; }
  .up-exp-table th, .up-exp-table td { padding: 10px 6px !important; }
  .up-exp-table th:first-child, .up-exp-table td:first-child { padding-left: 10px !important; }
  .up-exp-table th:last-child, .up-exp-table td:last-child { padding-right: 10px !important; }
  .up-exp-table th { font-size: 11.5px; }
}
.up-ar { margin: 0 6px; color: var(--ink-3); }
@media (max-width: 640px) { .up-ar { margin: 0 2px; } }
@media (max-width: 380px) {
  .up-exp-table { width: calc(100% + 20px); margin-left: -10px; margin-right: -10px; }
  .up-exp-table th, .up-exp-table td { padding: 10px 4px !important; }
  .up-exp-table th:first-child, .up-exp-table td:first-child { padding-left: 8px !important; }
  .up-exp-table th:last-child, .up-exp-table td:last-child { padding-right: 8px !important; }
}
.up-formula[hidden], .up-prog[hidden] { display: none !important; }

/* ===== v18 战力系数：缺系数提示 [去计算] + 弹窗（power-coef.js） ===== */
.warning-message.pc-warn { align-items: center; }
.pc-warn-text { flex: 1 1 auto; min-width: 0; }
.pc-go {
  flex: 0 0 auto; min-height: 40px; padding: 0 18px; border: 0; border-radius: 999px;
  background: var(--accent); color: #fff; font: inherit; font-size: 14px; font-weight: 600; white-space: nowrap; cursor: pointer;
  transition: transform .25s, box-shadow .25s;
}
.pc-go:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(242, 102, 43, .28); }
.pc-meta { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.pc-meta[hidden] { display: none; }
.pc-meta.is-done .pc-note { color: var(--accent-ink); font-weight: 600; }
.pc-edit {
  min-height: 32px; padding: 0 12px; border: 1px solid var(--line-strong, #d9dde2); border-radius: 999px;
  background: #fff; color: var(--ink); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: border-color .2s, color .2s;
}
.pc-edit:hover { border-color: var(--accent); color: var(--accent-ink); }
.pc-dialog { width: min(560px, 100%); }
.pc-dialog .zt-body { padding: 28px 36px 32px; }
.pc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.pc-grid .input-group label { white-space: nowrap; }
.pc-err { margin: 12px 0 0; font-size: 13px; font-weight: 600; color: #d93a1d; }
.pc-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 52px; margin-top: 22px;
  border: 0; border-radius: 999px; background: var(--accent); color: #fff; font: inherit; font-size: 16px; font-weight: 600; cursor: pointer;
  transition: transform .25s, box-shadow .25s;
}
.pc-btn:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(242, 102, 43, .3); }
.pc-btn .ico { width: 18px; height: 18px; }
@media (max-width: 640px) {
  .warning-message.pc-warn { flex-wrap: wrap; }
  .pc-warn-text { flex-basis: calc(100% - 32px); }
  .pc-go { margin-left: 32px; }
  .pc-dialog .zt-head { padding: 22px 20px 18px; }
  .pc-dialog .zt-title { font-size: 22px; }
  .pc-dialog .zt-body { padding: 18px 18px 20px; }
  .pc-grid { gap: 12px 10px; }
  .pc-grid .input-group label { font-size: 13px; }
  .pc-grid .input-group input::placeholder { color: transparent; }
}
@media (max-width: 359px) { .pc-grid { grid-template-columns: 1fr; } }
.pc-dialog .zt-eyebrow { padding-right: 52px; }
.pc-grid input[type=number]::-webkit-outer-spin-button, .pc-grid input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pc-grid input[type=number] { -moz-appearance: textfield; appearance: textfield; }
@media (max-width: 640px) { .warning-message.pc-warn { align-items: flex-start; } }

/* ===== v18 视觉对齐（仅桌面端，纯样式，不改结构） ===== */
.input-grid { row-gap: 22px; }
@media (min-width: 901px) {
  /* 3 个输入项：一行三列，与下方 3 列系数/结果对齐，不留孤行空位 */
  .input-grid:has(> .input-group:nth-child(3):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  /* 同一输入区里已有 3 列时，2 项的分组沿用同一套列线 */
  .input-section:has(.input-grid > .input-group:nth-child(3):last-child) .input-grid:has(> .input-group:nth-child(2):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  /* 同区已是 3 列时，4 项的分组一行排满，不留空位 */
  .input-section:has(.input-grid > .input-group:nth-child(3):last-child) .input-grid:has(> .input-group:nth-child(4):last-child) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  /* 勾玉卡片：同一行的计算按钮与结果底部对齐 */
  .magatama-section { display: flex; flex-direction: column; }
  .magatama-section .calculate-btn { margin-top: auto; }
  .magatama-section .input-group:has(+ .calculate-btn) { margin-bottom: 20px; }
}
