/* 墙角量角器 · 水平仪 — 仅本页样式（沿用站内既有命名与 CSS 变量） */

.calculator-container {
  max-width: 900px; margin: 1rem auto; padding: 0 1rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.page-header { margin-bottom: 1rem; }
.page-title { margin: 0; font-size: 1.6rem; color: var(--text-primary, #1a1a1a); }
.page-sub { margin: .35rem 0 0; font-size: .9rem; color: var(--text-secondary, #666); line-height: 1.5; }

.calc-card {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 10px; padding: 1rem; margin-bottom: 1rem;
}
.section-title {
  margin: 0 0 .75rem; font-size: 1.15rem; color: var(--text-primary, #1a1a1a);
  padding-bottom: .35rem; border-bottom: 1px solid var(--border-color, #e2e8f0);
}
.hidden { display: none !important; }

/* ---- 传感器状态（三态以上·读不到就明说） ---- */
.sensor-state { text-align: center; padding: .25rem 0; }
.state-text { margin: 0 0 .6rem; font-size: 1rem; color: var(--text-primary, #333); }
.state-text.bad { color: #b45309; font-weight: 600; }
.state-text.ok  { color: #15803d; font-weight: 600; display: inline; }
.state-sub { margin: 0; font-size: .82rem; color: var(--text-secondary, #94a3b8); line-height: 1.6; }
.live-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: #22c55e; margin-right: .4rem; vertical-align: middle;
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .35 } }

/* ---- 步骤 ---- */
.steps { margin: 0 0 .75rem; padding-left: 1.2rem; font-size: .88rem; color: var(--text-secondary, #555); line-height: 1.7; }
.steps b { color: var(--text-primary, #1a1a1a); }

.grab-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.grab-readout { display: flex; gap: .5rem; margin: .6rem 0 .25rem; }
.grab-slot {
  flex: 1; text-align: center; padding: .35rem;
  background: #f8fafc; border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 6px; font-size: .9rem; color: var(--text-secondary, #64748b);
  font-variant-numeric: tabular-nums;
}

/* ---- 结果 ---- */
.result-box {
  background: #f8fafc; border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 8px; padding: .85rem 1rem; text-align: center; margin-top: .5rem;
}
.result-main {
  font-size: 2.2rem; font-weight: 700; color: #1a1a1a;
  line-height: 1.2; font-variant-numeric: tabular-nums;
}
.result-main.is-flat { color: #15803d; }
.result-sub { margin-top: .3rem; font-size: .85rem; color: var(--text-secondary, #64748b); }
.result-sub .dot { margin: 0 .4rem; color: #cbd5e1; }
.result-exact { margin-top: .35rem; font-size: .82rem; }
.result-exact.ok   { color: #15803d; }
.result-exact.warn { color: #b45309; font-weight: 600; }

/* ---- 水平仪气泡 ---- */
.bubble-wrap { padding: .5rem 0 .25rem; }
.bubble-track {
  position: relative; height: 46px; border-radius: 23px;
  background: linear-gradient(#eef2f7, #e2e8f0);
  border: 1px solid var(--border-color, #cbd5e1); overflow: hidden;
}
.bubble-center {
  position: absolute; left: 50%; top: 0; bottom: 0; width: 2px;
  margin-left: -1px; background: rgba(34,197,94,.55);
}
.bubble {
  position: absolute; top: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px;
  border-radius: 50%; background: rgba(34,197,94,.75);
  border: 2px solid #16a34a; left: 50%;
  transition: left .08s linear;
}

.link-btn {
  background: none; border: none; padding: 0;
  color: #2563eb; font-size: .85rem; cursor: pointer; text-decoration: underline;
}

.wt-btn {
  flex: 1; min-width: 7rem; height: 40px; border-radius: 6px;
  border: 1px solid #2563eb; background: #2563eb; color: #fff;
  font-size: .95rem; cursor: pointer;
}
.wt-btn.ghost { background: #fff; color: #2563eb; }
.wt-btn:hover { opacity: .9; }

.hint { margin: .5rem 0 0; font-size: .78rem; color: var(--text-secondary, #94a3b8); line-height: 1.6; }
.foot-note { font-size: .75rem; color: var(--text-secondary, #94a3b8); line-height: 1.6; margin: 0 0 2rem; }

/* ---- 手机优先：这个工具【只有】手机上有意义 ---- */
@media (max-width: 640px) {
  .calculator-container { padding: 0 .75rem; }
  .page-title { font-size: 1.3rem; }
  .result-main { font-size: 2rem; }
  .wt-btn { min-width: 5.5rem; font-size: .9rem; }
  .grab-row { gap: .4rem; }
}
