/* ============================================================
   灯塔志愿 · 位次换算器 rank.css v1
   ============================================================ */
.rk-wrap { max-width: 980px; padding-top: 110px; padding-bottom: 40px; }

/* ---------- 页头 ---------- */
.rk-head { text-align: center; margin-bottom: 26px; }
.rk-head h1 { font-size: 32px; margin: 14px 0 10px; color: var(--navy-900); line-height: 1.25; }
.rk-head p { color: var(--muted); font-size: 15px; max-width: 640px; margin: 0 auto; }

/* ---------- 查询面板 ---------- */
.rk-panel {
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  padding: 22px 24px; box-shadow: 0 8px 24px rgba(11, 36, 25, .05);
}
.rk-controls { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 18px; }
.rk-field label { display: block; font-size: 13px; font-weight: 700; color: var(--ink-2); margin-bottom: 8px; }
.rk-field select {
  width: 100%; height: 42px; border: 1.5px solid var(--line); border-radius: 10px;
  padding: 0 12px; font-size: 14px; background: #fff; color: var(--ink);
}
.rk-field select:focus { outline: none; border-color: var(--navy-500); }

.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1.5px solid var(--line); background: #fff; color: var(--muted);
  border-radius: 999px; padding: 8px 18px; font-size: 13.5px; font-weight: 600; cursor: pointer;
  transition: all .15s;
}
.chip:hover { border-color: var(--navy-500); color: var(--navy-600); }
.chip.is-on { background: var(--navy-700); border-color: var(--navy-700); color: #fff; }

/* 模式切换 */
.rk-mode {
  display: inline-flex; margin: 20px 0 16px; border: 1.5px solid var(--line);
  border-radius: 999px; padding: 3px; background: var(--bg-soft); gap: 2px;
}
.rk-mode .seg-btn {
  border: none; background: transparent; color: var(--muted); font-size: 14px; font-weight: 700;
  padding: 8px 22px; border-radius: 999px; cursor: pointer; transition: all .15s;
}
.rk-mode .seg-btn.is-on { background: var(--navy-700); color: #fff; }

/* 大输入框 */
.rk-input-row { display: flex; gap: 12px; align-items: stretch; }
.rk-input-box { position: relative; flex: 1; }
.rk-input-box input {
  width: 100%; height: 58px; font-size: 24px; font-weight: 800; color: var(--navy-900);
  border: 2px solid var(--line); border-radius: 12px; padding: 0 64px 0 18px; background: #fff;
}
.rk-input-box input:focus { outline: none; border-color: var(--navy-500); }
.rk-unit { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 16px; font-weight: 700; }
#rkSearchBtn { height: 58px; padding: 0 30px; white-space: nowrap; }
.rk-hint { margin: 12px 2px 0; font-size: 12.5px; color: var(--muted); }

/* ---------- 结果 ---------- */
.rk-result {
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 18px; margin-top: 20px;
}
.rkr-main, .rkr-table-wrap {
  background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 24px;
  box-shadow: 0 8px 24px rgba(11, 36, 25, .05);
}
.rkr-num { text-align: center; padding: 8px 0 16px; border-bottom: 1px dashed var(--line); }
.rkr-label { display: block; font-size: 14px; color: var(--muted); font-weight: 700; }
.rkr-num b {
  display: block; font-size: 52px; line-height: 1.15; margin: 8px 0;
  color: var(--navy-700); letter-spacing: -1px;
}
.rkr-sub { display: block; font-size: 12.5px; color: var(--muted); }
.rkr-sub b { display: inline; font-size: inherit; color: var(--navy-600); }
.rkr-meta { padding: 16px 0 4px; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.rk-src {
  font-style: normal; font-size: 12.5px; font-weight: 700; padding: 5px 13px;
  border-radius: 999px; border: 1px solid #9fd8b8; color: #0f5132; background: #d8f0e2;
}
.rk-meta-line { font-size: 13px; color: var(--muted); }
.rkr-cta { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.rkr-cta .btn { width: 100%; text-align: center; }

/* 附近分档表 */
.rkr-table-wrap h4 { margin: 0 0 12px; font-size: 15px; color: var(--ink-2); }
.rkr-table { max-height: 380px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; }
.rkr-row {
  display: grid; grid-template-columns: 1fr 1.2fr 1.2fr; padding: 8px 14px;
  font-size: 13.5px; border-bottom: 1px solid var(--line);
}
.rkr-row:last-child { border-bottom: none; }
.rkr-head {
  position: sticky; top: 0; background: var(--bg-soft); font-weight: 700; color: var(--muted);
  font-size: 12.5px; z-index: 1;
}
.rkr-row .rkr-s { font-weight: 700; color: var(--ink-2); }
.rkr-row .rkr-r { color: var(--navy-700); font-weight: 700; }
.rkr-row .rkr-c { color: var(--muted); }
.rkr-row.is-target { background: rgba(212, 175, 106, .16); }
.rkr-row.is-target span { color: var(--navy-800); }

/* ---------- 空状态 / 说明 ---------- */
.rk-state {
  margin-top: 20px; text-align: center; padding: 48px 20px;
  border: 1px dashed var(--line); border-radius: 16px; background: rgba(255,255,255,.6);
}
.rks-emoji { font-size: 36px; margin-bottom: 10px; }
.rk-state h3 { font-size: 18px; color: var(--ink-2); margin: 0 0 8px; }
.rk-state p { color: var(--muted); font-size: 14px; margin: 0 0 16px; }
.rk-disclaimer {
  margin: 22px 2px 0; font-size: 12.5px; line-height: 1.8; color: var(--muted);
  border-top: 1px solid var(--line); padding-top: 16px;
}

.footer-scr { margin-top: 30px; padding: 26px 0; border-top: 1px solid var(--line); }
.footer-scr .container {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  max-width: 980px; font-size: 13px; color: var(--muted);
}
.footer-scr a { color: var(--navy-600); font-weight: 600; }

/* 轻提示 */
#rkToast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%);
  background: var(--navy-900); color: #fff; font-size: 13.5px; padding: 10px 20px;
  border-radius: 999px; z-index: 200; box-shadow: 0 6px 20px rgba(0,0,0,.2);
}

/* ---------- 移动端 ---------- */
@media (max-width: 760px) {
  .rk-wrap { padding-top: 92px; }
  .rk-head h1 { font-size: 25px; }
  .rk-panel { padding: 18px 16px; }
  .rk-controls { grid-template-columns: 1fr; gap: 14px; }
  .rk-input-row { flex-direction: column; }
  #rkSearchBtn { width: 100%; }
  .rk-result { grid-template-columns: 1fr; }
  .rkr-num b { font-size: 42px; }
}

/* ---------- 暗色 ---------- */
html[data-theme="dark"] body { background: var(--bg); }
html[data-theme="dark"] .rk-head h1 { color: #f2ead6; }
html[data-theme="dark"] .rk-panel,
html[data-theme="dark"] .rkr-main,
html[data-theme="dark"] .rkr-table-wrap { background: #101c15; border-color: #22382c; box-shadow: none; }
html[data-theme="dark"] .rk-field label { color: #e7eee9; }
html[data-theme="dark"] .rk-field select,
html[data-theme="dark"] .rk-input-box input { background: #16261d; border-color: #2b4436; color: #e7eee9; }
html[data-theme="dark"] .chip { background: #16261d; border-color: #2b4436; color: #aebcb4; }
html[data-theme="dark"] .chip:hover { color: var(--gold-300); border-color: var(--gold-500); }
html[data-theme="dark"] .rk-mode { background: #16261d; border-color: #2b4436; }
html[data-theme="dark"] .rk-mode .seg-btn { color: #aebcb4; }
html[data-theme="dark"] .rk-mode .seg-btn.is-on { background: var(--navy-600); color: #fff; }
html[data-theme="dark"] .rkr-label,
html[data-theme="dark"] .rkr-table-wrap h4 { color: #cdd8d1; }
html[data-theme="dark"] .rkr-num b { color: var(--gold-300); }
html[data-theme="dark"] .rkr-row .rkr-s { color: #e7eee9; }
html[data-theme="dark"] .rkr-row .rkr-r { color: var(--gold-300); }
html[data-theme="dark"] .rkr-head { background: #1d3126; color: #8ea397; }
html[data-theme="dark"] .rkr-row { border-color: #22382c; }
html[data-theme="dark"] .rkr-row.is-target { background: rgba(212,175,106,.14); }
html[data-theme="dark"] .rk-src { color: #8fdcb0; background: rgba(37,117,75,.18); border-color: rgba(88,178,122,.35); }
html[data-theme="dark"] .rk-state { background: #101c15; border-color: #2b4436; }
html[data-theme="dark"] .rk-state h3 { color: #f2ead6; }
html[data-theme="dark"] .rkr-num { border-color: #22382c; }
