/* =========================================================
   战力计算 · 计算器样式（与 style.css 同一设计语言）
   浅色 · MiSans · 小圆角 · 无左侧色描边 · 精致控件
   本次修订：
   - 修复结果区/系数区 auto-fit 导致的列宽不均与偏移
   - 收紧字号、行距、间距、按钮
   - 修正 .calculator-box 与 .container 的嵌套关系
   ========================================================= */

/* ===== 计算容器 ===== */
.calculator-box {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-md);
  padding: 26px;
  margin: 0 auto 40px;
  max-width: 100%;
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}

/* ===== 提示 / 警告 ===== */
.warning-message {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  margin-bottom: 22px;
  border: 1px solid rgba(255, 138, 61, 0.32);
  background: rgba(255, 138, 61, 0.10);
  border-radius: var(--r-ctrl);
  color: #b4530a;
  font-size: var(--fs-sm);
  font-weight: 500;
  line-height: 1.55;
}
.warning-message .ico {
  width: 18px; height: 18px;
  flex: 0 0 18px;
  margin-top: 1px;
}

/* ===== 区块标题 ===== */
.section-title {
  font-size: var(--fs-h3);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.01em;
  margin: 0 0 14px;
  line-height: 1.35;
}
.section-title + .input-grid,
.section-title + .result-section { margin-top: 0; }

/* ===== 输入区 ===== */
.input-section { margin-top: 4px; }
.input-section .section-title:not(:first-child) { margin-top: 22px; }

.input-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px 18px;
}

.input-group { display: flex; flex-direction: column; min-width: 0; }
.input-group label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--ink-2);
  margin-bottom: 7px;
  line-height: 1.5;
}
.input-group input {
  width: 100%;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: 400;
  color: var(--ink);
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-ctrl);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  line-height: 1.5;
}
.input-group input::placeholder { color: var(--ink-3); }
.input-group input:focus {
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 106, 61, 0.18);
}

/* 输入下方的倍率 / 提示小字 */
.input-tips {
  margin-top: 6px;
  font-size: var(--fs-xs);
  font-weight: 400;
  color: var(--ink-3);
  line-height: 1.5;
}

/* ===== 计算按钮 ===== */
.calculate-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 18px;
  padding: 12px 18px;
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border: none;
  border-radius: var(--r-ctrl);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
  line-height: 1;
}
.calculate-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(255, 106, 61, 0.34);
  filter: saturate(108%);
}
.calculate-btn:active { transform: translateY(0); }
.calculate-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.calculate-btn .ico { width: 16px; height: 16px; flex: 0 0 16px; }

/* ===== 计算结果：固定列数，避免拉伸不均 ===== */
.result-section { margin-top: 26px; }

.result-header {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.35;
}
.result-header::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.result-item {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-ctrl);
  padding: 14px 12px;
  text-align: center;
}
.result-label {
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--ink-3);
  margin-bottom: 6px;
  line-height: 1.4;
}
.result-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.result-value span { color: var(--brand-ink); }
.result-value.loading { color: var(--ink-3); font-weight: 500; font-size: 15px; }

/* 动画：淡入 */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.result-value.show { animation: fadeIn 0.4s ease both; }

/* ===== 合计战力 ===== */
.total-result {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: linear-gradient(135deg, rgba(255, 106, 61, 0.10), rgba(91, 108, 255, 0.08));
  border: 1px solid rgba(255, 106, 61, 0.22);
  border-radius: var(--r-ctrl);
  padding: 16px 18px;
}
.total-label { font-size: var(--fs-sm); font-weight: 500; color: var(--ink-2); }
.total-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--brand-ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  line-height: 1.1;
}

/* ===== 战力系数：固定 3 列，与结果区一致 ===== */
.coefficient-section { margin-bottom: 26px; }
.coefficient-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.coefficient-item {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-ctrl);
  padding: 14px 12px;
  text-align: center;
}
.coefficient-label { font-size: var(--fs-xs); font-weight: 500; color: var(--ink-3); margin-bottom: 6px; line-height: 1.4; }
.coefficient-value {
  font-size: 20px;
  font-weight: 600;
  color: var(--brand-ink);
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}

/* ===== 勾玉网格 ===== */
.magatama-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}
.magatama-section {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 20px;
}
.magatama-section .section-title { margin-bottom: 16px; }
.magatama-section .result-section { margin-top: 16px; }
.magatama-section .result-grid { grid-template-columns: repeat(2, 1fr); }

/* ===== 许愿宝库 · info 信息块 ===== */
.info-section {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 20px;
  margin-bottom: 26px;
}
.info-header { font-size: var(--fs-h3); font-weight: 600; color: var(--ink); margin: 0 0 14px; line-height: 1.35; }
.info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.info-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-ctrl);
  padding: 13px 14px;
}
.info-item .label { font-size: var(--fs-xs); color: var(--ink-3); margin-bottom: 4px; line-height: 1.4; }
.info-item .value {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}
.info-item > span {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--ink-2);
  line-height: 1.55;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .calculator-box { padding: 20px; margin-bottom: 32px; }
  .input-grid { grid-template-columns: 1fr; gap: 14px; }
  .result-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .result-value { font-size: 18px; }
  .coefficient-grid { grid-template-columns: repeat(2, 1fr); }
  .total-value { font-size: 22px; }
  .magatama-grid { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .calculator-box { padding: 18px; }
  .result-grid { grid-template-columns: 1fr; }
  .coefficient-grid { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: 1fr; }
  .total-result { flex-direction: column; gap: 8px; align-items: flex-start; }
  .total-value { font-size: 20px; }
}
