/* ================= 学习工具（对照鸽小站 /tools 系列） ================= */
.tool-page {
  max-width: 840px;
  margin: 0 auto;
  padding: 8px 0 64px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.tool-page.wide { max-width: 1080px; }
.tool-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tool-back {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line-c); background: var(--card-bg);
  font-size: 12px; color: var(--text-muted); text-decoration: none;
}
.tool-back:hover { color: var(--text); border-color: var(--line-strong-c); }
.tool-sign { font-size: 12px; color: var(--text-faint); letter-spacing: .02em; }
.tool-pill {
  height: 30px; padding: 0 12px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line-c); font-size: 12px; color: var(--text-muted); text-decoration: none;
}
.tool-title { font-size: 34px; font-weight: 750; letter-spacing: -.02em; margin: 4px 0 0; }
.tool-sub { font-size: 13px; color: var(--text-muted); line-height: 1.7; margin: -8px 0 0; max-width: 680px; }

.tool-card {
  background: var(--card-bg);
  border: 1px solid var(--line-c);
  border-radius: 14px;
  padding: 16px 18px 18px;
}
.tool-card-hd { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.tool-card-hd b { font-size: 13.5px; font-weight: 650; }
.tool-badge {
  font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  background: rgba(88, 160, 33, .12); color: #3e7d18;
}
.tool-badge.soft { background: rgba(35, 109, 233, .09); color: #236de9; }
html.dark .tool-badge { background: rgba(88, 160, 33, .18); color: #8fd05a; }
html.dark .tool-badge.soft { background: rgba(121, 167, 255, .16); color: #9cc0ff; }

.tool-row2 { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: end; }
.tool-field { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.tool-field > span { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.tool-input {
  height: 40px; width: 100%; padding: 0 12px;
  border: 1px solid var(--line-c); border-radius: 10px;
  background: var(--bg2); color: var(--text);
  font-size: 14px; font-family: inherit; outline: none;
}
.tool-input:focus { border-color: var(--brand-c); background: var(--card-bg); box-shadow: 0 0 0 3px rgba(37, 99, 235, .1); }
select.tool-input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-faint) 50%), linear-gradient(135deg, var(--text-faint) 50%, transparent 50%); background-position: calc(100% - 16px) 18px, calc(100% - 11px) 18px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
.tool-swap {
  width: 38px; height: 40px; border-radius: 10px; border: 1px solid var(--line-c);
  background: var(--card-bg); color: var(--text-muted); display: grid; place-items: center; cursor: pointer;
}
.tool-swap:hover { color: var(--brand-ink); border-color: var(--line-strong-c); }
.tool-result { display: flex; align-items: baseline; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.tool-result b { font-size: 30px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tool-result span { font-size: 13px; color: var(--text-muted); }
.tool-hint { font-size: 12px; color: var(--text-faint); margin: 8px 0 0; font-variant-numeric: tabular-nums; }
.tool-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.tool-chip {
  height: 28px; padding: 0 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-c); background: var(--bg2);
  font-size: 12px; color: var(--text-muted); font-family: inherit;
}
.tool-chip:hover { background: var(--brand-soft-c); color: var(--brand-ink); border-color: transparent; }
.tool-actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.tool-actions.column { flex-direction: column; align-items: stretch; }
.tool-btn {
  height: 40px; padding: 0 16px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line-c); background: var(--card-bg);
  font-size: 13px; font-weight: 600; color: var(--text); font-family: inherit;
}
.tool-btn:hover { border-color: var(--line-strong-c); background: var(--bg2); }
.tool-btn.primary { background: var(--brand-c); border-color: transparent; color: #fff; }
.tool-btn.primary:hover { background: rgb(var(--brand-hover)); }
.tool-btn.sm { height: 32px; padding: 0 12px; font-size: 12px; border-radius: 8px; }
.tool-btn:disabled { opacity: .5; cursor: not-allowed; }
html.dark .tool-btn.primary { color: #071426; }

.tool-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.tool-table th { text-align: left; font-size: 11.5px; color: var(--text-faint); font-weight: 600; padding: 8px 0; border-bottom: 1px solid var(--line-c); }
.tool-table td { padding: 9px 0; border-bottom: 1px solid var(--line-c); font-variant-numeric: tabular-nums; }
.tool-table tr:last-child td { border-bottom: 0; }
.tool-note {
  margin: 14px 0 0; padding: 12px 14px; border-radius: 10px;
  background: var(--bg2); color: var(--text-muted); font-size: 12px; line-height: 1.75;
}
.tool-note code, .pc-k, .pc-v { font-family: ui-monospace, Menlo, Consolas, monospace; }

.tool-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tool-tile {
  position: relative; display: grid; grid-template-columns: 34px 1fr; gap: 4px 12px;
  padding: 16px; border-radius: 14px; border: 1px solid var(--line-c);
  background: var(--card-bg); text-decoration: none; color: var(--text);
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.tool-tile:hover { border-color: var(--line-strong-c); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(20, 28, 42, .06); }
.tool-tile-ic { grid-row: span 2; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft-c); color: var(--brand-ink); }
.tool-tile b { font-size: 14px; font-weight: 650; }
.tool-tile > span:not(.tool-tile-ic):not(.tool-tile-go) { grid-column: 2; font-size: 12px; color: var(--text-muted); line-height: 1.6; }
.tool-tile-go { position: absolute; right: 14px; top: 16px; color: var(--text-faint); }

.tool-split { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 14px; align-items: start; }
.tool-subcards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.tool-subcards b { display: block; font-size: 12.5px; margin-bottom: 8px; }
.tool-subcards ul { margin: 0; padding-left: 16px; font-size: 12px; color: var(--text-muted); line-height: 1.9; }

/* 卷号拆解 */
.tool-out:empty { display: none; }
.pc-rows { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.pc-row { display: grid; grid-template-columns: 92px 110px minmax(0, 1fr); gap: 12px; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--bg2); }
.pc-k { font-size: 11.5px; color: var(--text-faint); }
.pc-v { font-size: 14px; }
.pc-note { font-size: 12px; color: var(--text-muted); }

/* 函数图像 */
.graph-card { padding: 10px; }
.graph-card canvas { width: 100%; height: auto; border-radius: 10px; display: block; }
.graph-row { display: grid; grid-template-columns: 10px 26px minmax(0, 1fr) 24px; gap: 8px; align-items: center; margin-bottom: 8px; }
.graph-dot { width: 8px; height: 8px; border-radius: 50%; }
.graph-y { font-size: 12px; color: var(--text-faint); }
.graph-row .tool-input { height: 34px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
.tool-icon { width: 24px; height: 24px; border: 0; background: none; color: var(--text-faint); cursor: pointer; font-size: 16px; line-height: 1; }
.tool-icon:hover { color: #e0443b; }
.tool-zoom { display: flex; gap: 8px; }

/* 行李清单 */
.pack-side { position: sticky; top: 84px; }
.pack-progress { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text-muted); }
.pack-bar { flex: 1; height: 8px; border-radius: 999px; background: var(--bg3); overflow: hidden; }
.pack-bar i { display: block; height: 100%; width: 0; background: var(--brand-c); border-radius: 999px; transition: width .2s; }
.pack-list { display: flex; flex-direction: column; gap: 18px; }
.pack-group-hd { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.pack-group-hd b { font-size: 13px; }
.pack-group-hd span { font-size: 11.5px; color: var(--text-faint); }
.pack-item { display: flex; align-items: center; gap: 10px; padding: 7px 2px; font-size: 13px; border-bottom: 1px dashed var(--line-c); cursor: pointer; }
.pack-item:last-child { border-bottom: 0; }
.pack-item input { width: 15px; height: 15px; accent-color: rgb(var(--brand)); }
.pack-item.done span { color: var(--text-faint); text-decoration: line-through; }

/* MBTI */
.mbti-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.mbti-len {
  display: flex; flex-direction: column; gap: 6px; align-items: flex-start;
  padding: 16px; border-radius: 12px; border: 1px solid var(--line-c); background: var(--bg2);
  cursor: pointer; font-family: inherit; color: var(--text);
}
.mbti-len:hover { border-color: var(--brand-c); background: var(--brand-soft-c); }
.mbti-len b { font-size: 14px; }
.mbti-len span { font-size: 12px; color: var(--text-muted); }
.mbti-top { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-faint); }
.mbti-bar { height: 6px; border-radius: 999px; background: var(--bg3); overflow: hidden; margin: 8px 0 18px; }
.mbti-bar i { display: block; height: 100%; width: 0; background: var(--brand-c); transition: width .25s; }
.mbti-q { font-size: 18px; font-weight: 650; margin: 0 0 16px; line-height: 1.5; }
.mbti-opts { display: flex; flex-direction: column; gap: 10px; }
.mbti-opt {
  text-align: left; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line-c);
  background: var(--card-bg); font-size: 14px; font-family: inherit; color: var(--text); cursor: pointer;
}
.mbti-opt:hover { border-color: var(--brand-c); background: var(--brand-soft-c); }
.mbti-nav { display: flex; justify-content: space-between; margin-top: 18px; }
.mbti-type { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.mbti-type b { font-size: 34px; letter-spacing: .02em; }
.mbti-type span { font-size: 14px; color: var(--text-muted); }
.mbti-bars { display: flex; flex-direction: column; gap: 10px; margin: 16px 0 4px; }
.mbti-bar-row { display: grid; grid-template-columns: 16px minmax(0, 1fr) 16px 78px; gap: 10px; align-items: center; font-size: 12px; color: var(--text-muted); }
.mbti-track { height: 8px; border-radius: 999px; background: var(--brand-soft-c); overflow: hidden; }
.mbti-track i { display: block; height: 100%; background: var(--brand-c); margin-left: auto; }
.mbti-bar-row em { font-style: normal; text-align: right; font-variant-numeric: tabular-nums; }

/* 科学计算器 */
.calc-page { max-width: 560px; margin: 0 auto; padding: 8px 0 64px; }
.calc-body {
  margin-top: 14px; border-radius: 18px; padding: 16px 14px 18px;
  background: linear-gradient(180deg, #2b2f36, #1c2026 55%, #15181d);
  box-shadow: 0 24px 48px rgba(10, 14, 20, .35), inset 0 1px 0 rgba(255, 255, 255, .08);
}
.calc-brand { color: #e9edf3; font-size: 11px; line-height: 1.25; padding: 2px 6px 10px; }
.calc-brand b { display: block; font-size: 15px; letter-spacing: .08em; }
.calc-brand span { display: block; color: #c3ccd9; }
.calc-brand em { font-style: normal; font-size: 9px; letter-spacing: .18em; color: #8e9bad; }
.calc-lcd {
  border-radius: 6px; padding: 8px 10px 10px; min-height: 104px;
  background: #cfd8c4; color: #22271f;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .35);
  font-family: ui-monospace, Menlo, Consolas, monospace;
}
.calc-lcd-top { display: flex; justify-content: space-between; font-size: 10px; color: #5b6455; height: 12px; }
.calc-expr { font-size: 25px; min-height: 30px; word-break: break-all; text-align: right; margin-top: 6px; }
.calc-caret { color:#22271f; animation: calcBlink 1s steps(1) infinite; font-weight:700; }
@keyframes calcBlink { 50% { opacity: 0; } }
.calc-page:fullscreen .calc-body { max-width: 520px; margin: 0 auto; }
.calc-res { font-size: 15px; text-align: right; min-height: 20px; color: #3a4237; }
.calc-keys { margin-top: 12px; display: flex; flex-direction: column; gap: 7px; }
.calc-row { display: flex; justify-content: center; gap: 7px; }
.calc-key { flex: 0 0 calc((100% - 35px) / 6); min-width: 0; }
.calc-key {
  height: 40px; border-radius: 8px; border: 0; cursor: pointer;
  font-family: inherit; font-size: 13px; font-weight: 600;
  background: linear-gradient(180deg, #3b414b, #2b3038); color: #eef2f8;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .06), inset 0 -2px 0 rgba(0, 0, 0, .35);
}
.calc-key:active { transform: translateY(1px); }
.calc-key.k-shift { background: linear-gradient(180deg, #e2a43c, #c98922); color: #241a08; }
.calc-key.k-alpha { background: linear-gradient(180deg, #d95a63, #b83b47); color: #fff; }
.calc-key.k-nav, .calc-key.k-dark, .calc-key.k-on { background: linear-gradient(180deg, #3f4650, #31363d); }
.calc-key.k-num { background: linear-gradient(180deg, #565d68, #40464f); font-size: 15px; }
.calc-key.k-op, .calc-key.k-eq { background: linear-gradient(180deg, #4a515c, #363c45); }
.calc-key.k-ac, .calc-key.k-del { background: linear-gradient(180deg, #6a3a3a, #4d2a2a); color: #ffd9d9; }
.calc-key.k-eq { background: linear-gradient(180deg, #2f6fd0, #2358a8); color: #fff; }
.calc-tip { font-size: 11.5px; color: var(--text-faint); text-align: center; margin: 12px 0 0; }
.calc-history { margin-top: 16px; }
.calc-his-list { display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow: auto; }
.calc-his { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; color: var(--text-muted); padding: 6px 8px; border-radius: 6px; background: var(--bg2); }

@media (max-width: 900px) {
  .tool-page { padding: 4px 0 48px; }
  .tool-title { font-size: 26px; }
  .tool-split { grid-template-columns: 1fr; }
  .pack-side { position: static; }
  .tool-grid, .tool-subcards, .mbti-pick { grid-template-columns: 1fr; }
  .tool-row2 { grid-template-columns: 1fr auto 1fr; }
  .pc-row { grid-template-columns: 1fr; gap: 4px; }
  .calc-key { height: 36px; font-size: 12px; }
  .calc-body { padding: 12px 10px 14px; }
}

/* 工具页：隐藏左右栏，内容居中成文档式版面 */
body.tools-mode #railLeft, body.tools-mode #railRight { display: none; }
body.tools-mode .shell { grid-template-columns: minmax(0, 1fr); max-width: 1120px; }
body.tools-mode .shell > #view { max-width: 100%; }
body.tools-mode .tool-page { margin: 0 auto; }
@media (max-width: 900px) {
  body.tools-mode .shell { padding: 12px 16px 40px; }
}

/* ================= 学年校历 ================= */
.cal-year { font-size: 16px; font-weight: 600; color: var(--text-faint); letter-spacing: 0; margin-left: 6px; }
.cal-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: -4px 0 4px; }
.cal-seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--line-c); }
.cal-seg button {
  height: 28px; padding: 0 12px; border: 0; border-radius: 8px; background: none;
  font-family: inherit; font-size: 12.5px; color: var(--text-muted); cursor: pointer;
}
.cal-seg button:hover { color: var(--text); }
.cal-seg button.on { background: var(--card-bg); color: var(--text); box-shadow: 0 1px 3px rgba(20, 28, 42, .1); font-weight: 600; }
.cal-hint { font-size: 11.5px; color: var(--text-faint); }
.cal-up { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.cal-up-item { display: grid; grid-template-columns: 132px 62px minmax(0, 1fr); gap: 12px; align-items: center; padding: 9px 2px; border-bottom: 1px dashed var(--line-c); font-size: 13px; }
.cal-up-item:last-child { border-bottom: 0; }
.cal-up-date { font-variant-numeric: tabular-nums; color: var(--text-muted); }
.cal-up-tag { font-size: 11px; font-weight: 600; text-align: center; padding: 2px 0; border-radius: 5px; }
.cal-up-item.k-holiday .cal-up-tag { background: rgba(217, 83, 79, .12); color: #c0392b; }
.cal-up-item.k-exam .cal-up-tag { background: rgba(184, 134, 11, .14); color: #96700a; }
.cal-up-item.k-event .cal-up-tag { background: rgba(35, 109, 233, .1); color: #236de9; }
.cal-up-item.k-school .cal-up-tag { background: rgba(91, 100, 115, .12); color: #5b6473; }
.cal-up-title i, .cal-t i, .cal-month header b i { display: block; font-style: normal; font-size: 11px; color: var(--text-faint); margin-top: 2px; font-weight: 400; }
.cal-months { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.cal-month {
  background: var(--card-bg); border: 1px solid var(--line-c); border-radius: 14px;
  padding: 14px 14px 10px; display: flex; flex-direction: column; gap: 8px;
}
.cal-month.is-current { border-color: rgba(35, 109, 233, .45); box-shadow: 0 0 0 3px rgba(35, 109, 233, .08); }
.cal-month header { display: flex; align-items: baseline; gap: 8px; }
.cal-month header b { font-size: 14px; font-weight: 700; }
.cal-month header em { font-style: normal; font-size: 11.5px; color: var(--text-faint); margin-left: auto; }
.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; font-size: 10.5px; color: var(--text-faint); text-align: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-cell {
  height: 25px; display: grid; place-items: center; border-radius: 6px;
  font-size: 11.5px; color: var(--text); font-variant-numeric: tabular-nums;
}
.cal-cell.is-empty { visibility: hidden; }
.cal-cell.k-holiday { background: rgba(217, 83, 79, .1); color: #c0392b; font-weight: 600; }
.cal-cell.k-exam { background: rgba(184, 134, 11, .12); color: #8a6608; font-weight: 600; }
.cal-cell.k-event { background: rgba(35, 109, 233, .08); color: #1d5fd1; }
.cal-cell.k-school { background: var(--bg3); color: var(--text-muted); }
.cal-cell.is-today { box-shadow: inset 0 0 0 2px var(--brand-c); font-weight: 700; }
.cal-events { list-style: none; margin: 4px 0 0; padding: 8px 0 0; border-top: 1px dashed var(--line-c); display: flex; flex-direction: column; gap: 6px; }
.cal-events li { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 8px; font-size: 11.5px; line-height: 1.5; }
.cal-d { font-variant-numeric: tabular-nums; color: var(--text-faint); }
.cal-events li.k-holiday .cal-d { color: #c0392b; }
.cal-events li.k-exam .cal-d { color: #8a6608; }
.cal-none { color: var(--text-faint); font-size: 11.5px; }
.cal-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; font-size: 11.5px; color: var(--text-muted); margin: 2px 0 0; }
.cal-legend span { display: inline-flex; align-items: center; gap: 5px; }
.cal-legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.cal-legend .k-holiday i { background: rgba(217, 83, 79, .55); }
.cal-legend .k-exam i { background: rgba(184, 134, 11, .6); }
.cal-legend .k-event i { background: rgba(35, 109, 233, .5); }
.cal-legend .k-school i { background: #b6bcc6; }
.cal-pdf { margin-left: auto; color: var(--brand-ink); text-decoration: none; }
@media (max-width: 1080px) { .cal-months { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) {
  .cal-months { grid-template-columns: 1fr; }
  .cal-up-item { grid-template-columns: 1fr auto; }
  .cal-up-title { grid-column: 1 / -1; }
  .cal-toolbar { gap: 8px; }
  .cal-year { display: block; margin: 6px 0 0; }
}

.cal-months { align-items: start; }

.cal-up-item { grid-template-columns: 186px 58px minmax(0, 1fr); }
.cal-up-date { white-space: nowrap; }
