/* =========================================================================
   工具层：各工具自己的可视化部件
   （换算、计算器、时钟、天气、秒表、正则、颜色、密码、二维码、万年历）
   通用组件（面板/按钮/表单/表格）在 components.css，这里不再重复定义
   ========================================================================= */

/* ============================== 工具页 ============================== */


.io-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

/* 左右两栏必须等高对齐：components.css 的 .panel + .panel { margin-top: 16px }
   本意是给上下堆叠的卡片拉间距，但在两列网格里同样命中右列，
   把右卡往下推 16px —— 二维码页「生成 / 识别」不齐就是它。间距统一交给上面的 gap。 */
.io-grid > .panel + .panel {
  margin-top: 0;
}

/* 工具页正文的纵向节奏：上下堆叠的块之间统一留白。
   计算器页「表达式/历史记录」与「支持的函数」贴在一起，就是因为
   .panel + .panel 匹配不到「io-grid 后面的 panel」（前一个兄弟不是 panel）。 */
#tool-root > * + * {
  margin-top: var(--space-4);
}

/* 面板内：工具栏（格式化/压缩等按钮行）与下方输入区之间留出呼吸空间，
   否则按钮底边直接贴着 textarea（XML 页最明显） */
.panel > .toolbar + * {
  margin-top: var(--space-4);
}

.io-pane {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  min-height: 260px;
  min-width: 0;
}

.io-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-3);
  font-weight: 600;
  letter-spacing: 0.3px;
}

.io-head .right {
  margin-left: auto;
  display: flex;
  gap: 4px;
  align-items: center;
}

.io-pane textarea {
  flex: 1;
  width: 100%;
  border: 0;
  border-radius: 0;
  min-height: 220px;
  background: transparent;
  resize: none;
}

.io-pane textarea:focus {
  box-shadow: none;
}

.io-body {
  flex: 1;
  padding: 12px 16px;
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
  overflow: auto;
  min-height: 220px;
  background: var(--code-bg);
}

.io-foot {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-3);
  background: var(--surface-2);
}


.err-text {
  color: var(--err);
}

.ok-text {
  color: var(--ok);
}


/* 换算专用 */
.convert-row {
  display: grid;
  grid-template-columns: 1fr 44px 1fr;
  gap: 12px;
  align-items: end;
}

.convert-box {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.16s, box-shadow 0.16s;
}

.convert-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.convert-box .big-input {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.5px;
  padding: 0;
  text-align: right;
  height: 40px;
}

.convert-box .row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.convert-box .row .select {
  flex: 1;
  height: var(--control-h);
  border: 1px solid var(--border);
  border-radius: 9px;
  background-color: var(--surface);
  font-size: 15px;
  padding: 0 10px;
}
.convert-box .row .select:focus {
  border-color: var(--accent);
  outline: none;
}

.convert-box .sym {
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
}

.swap-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 0;
  background: var(--surface-2);
  color: var(--text-2);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.16s;
  margin-bottom: 4px;
}

.swap-btn:hover {
  color: var(--accent-text);
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: rotate(180deg);
}

.swap-btn svg {
  width: 17px;
  height: 17px;
}


/* 计算器 */
.calc-display {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 12px 16px;
  text-align: right;
}

.calc-expression {
  width: 100%;
  min-height: var(--control-h);
  border: 0;
  outline: none;
  background: transparent;
  text-align: right;
  font-family: var(--mono);
  font-size: 20px;
  letter-spacing: 0.2px;
  padding: 0;
  color: var(--text);
}

.calc-result {
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.6px;
  margin-top: 4px;
  min-height: 42px;
  word-break: break-all;
}

.calc-result.error {
  font-size: 17px;
  font-weight: 500;
  color: var(--err);
  letter-spacing: 0;
  line-height: 1.5;
}

.calc-keys {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.calc-keys button {
  height: 46px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 17px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.12s;
}

.calc-keys button:hover {
  background: var(--surface-2);
}

.calc-keys button:active {
  transform: translateY(1px);
}

.calc-keys button.fn {
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 15px;
}

.calc-keys button.op {
  color: var(--accent-text);
  background: var(--accent-soft);
  border-color: transparent;
  font-weight: 600;
}

.calc-keys button.eq {
  background: var(--color-primary-solid);
  color: var(--color-on-primary);
  border-color: transparent;
  font-weight: 600;
}

.history {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 420px;
  overflow: auto;
}

.history-item {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.16s;
}

.history-item:hover {
  background: var(--surface-2);
  border-color: var(--border);
}

.history-item .expr {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-3);
  word-break: break-all;
}

.history-item .val {
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 600;
  word-break: break-all;
}

/* 时钟 */
.clock-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}

.clock-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px 16px;
  overflow: hidden;
}

.clock-card.local {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
}

.clock-card .city {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  font-size: 15px;
}

.clock-card .city .country {
  font-size: 12px;
  color: var(--text-3);
  font-weight: 400;
}

.clock-card .time {
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -1px;
  line-height: 1.25;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

.clock-card .meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--text-3);
  margin-top: 4px;
}

.clock-card .remove {
  position: absolute;
  top: var(--space-1);
  right: var(--space-1);
  width: var(--control-h);
  height: var(--control-h);
  border-radius: var(--radius-sm);
  border: 0;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.16s, background 0.16s;
}

.clock-card:hover .remove {
  opacity: 1;
}

.clock-card .remove:hover {
  background: var(--err-soft);
  color: var(--err);
}

.clock-card .remove svg {
  width: 16px;
  height: 16px;
}

/* 天气 */
.wx-hero {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  padding: 20px 22px;
  color: #fff;
  box-shadow: 0 10px 30px rgba(45, 55, 110, 0.18);
}
.wx-hero.wx-day {
  background: linear-gradient(135deg, #5387ec 0%, #6d74e4 52%, #9770d8 100%);
}
.wx-hero.wx-night {
  background: linear-gradient(135deg, #26325e 0%, #333466 52%, #46386f 100%);
}
.wx-hero::after {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  top: -120px;
  right: -60px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 70%);
  pointer-events: none;
}
.wx-hero-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  position: relative;
  z-index: 1;
}
.wx-city {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 20px;
  font-weight: 600;
}
.wx-hero-pin svg {
  width: 18px;
  height: 18px;
}
.wx-region {
  margin-top: 2px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.78);
}
.wx-updated {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
  white-space: nowrap;
  padding-top: 3px;
}
.wx-hero-body {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  position: relative;
  z-index: 1;
}
.wx-hero-emoji {
  font-size: 52px;
  line-height: 1;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.18));
}
.wx-hero-temp {
  font-family: var(--mono);
  font-size: 76px;
  font-weight: 300;
  letter-spacing: -5px;
  line-height: 1;
}
.wx-hero-temp sup {
  font-size: 30px;
  font-weight: 400;
  vertical-align: super;
  letter-spacing: 0;
}
.wx-hero-desc {
  margin-left: auto;
  text-align: right;
}
.wx-cond {
  font-size: 18px;
  font-weight: 500;
}
.wx-range {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 14px;
  color: rgba(255, 255, 255, 0.82);
}

.wx-detail-panel {
  margin-top: 12px;
}
.wx-details {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}
.wx-detail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 4px;
  border-radius: 10px;
  text-align: center;
}
.wx-detail-ic {
  color: var(--text-3);
  line-height: 1;
}
.wx-detail-ic svg {
  width: 18px;
  height: 18px;
}
.wx-detail b {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}
.wx-detail-label {
  font-size: 11px;
  color: var(--text-3);
  white-space: nowrap;
}
.wx-astro {
  display: flex;
  justify-content: space-around;
  gap: 10px;
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-2);
}
.wx-astro span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.wx-astro svg {
  width: 15px;
  height: 15px;
  color: var(--text-3);
}
@media (max-width: 560px) {
  .wx-details { grid-template-columns: repeat(3, 1fr); }
  .wx-hero-temp { font-size: 62px; }
  .wx-hero-emoji { font-size: 42px; }
  .wx-updated { display: none; }
}

.hour-strip {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.hour-cell {
  flex: none;
  width: 62px;
  text-align: center;
  padding: 8px 4px;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: background 0.16s, border-color 0.16s;
}

.hour-cell.now {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.hour-cell.now .h {
  color: var(--accent-text);
  font-weight: 600;
}

.hour-cell:hover {
  background: var(--surface-2);
  border-color: var(--border);
}

.hour-cell .h {
  font-size: 12px;
  color: var(--text-3);
}

.hour-cell .i {
  font-size: 20px;
  margin: 4px 0;
}

.hour-cell .t {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
}

.hour-cell .p {
  font-family: var(--mono);
  font-size: 11px;
  min-height: 14px;
}
.hour-cell .p.on {
  color: var(--accent-text);
}

.day-row {
  display: grid;
  grid-template-columns: 64px 30px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 8px 4px;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
}

.day-row:last-child {
  border-bottom: 0;
}

.day-row .d {
  color: var(--text-2);
}

.day-row .cond {
  color: var(--text-3);
  font-size: 12px;
}

.day-row .bar {
  display: block;
  position: relative;
  height: 6px;
  border-radius: 8px;
  background: var(--surface-3);
  overflow: hidden;
  min-width: 80px;
}

.day-row .bar i {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 8px;
  background: linear-gradient(90deg, #5aa9f0, #6d74e4 55%, #a474d8);
}

.day-row .t {
  font-family: var(--mono);
  font-size: 15px;
  white-space: nowrap;
  color: var(--text-2);
}
.day-row .t .slash {
  color: var(--text-3);
  margin: 0 2px;
}

.search-pop {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 20;
  overflow: hidden;
  max-height: 280px;
  overflow-y: auto;
}

.search-pop button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-size: 15px;
}

.search-pop button:hover {
  background: var(--surface-2);
}

.search-pop .sub {
  color: var(--text-3);
  font-size: 12px;
  margin-left: auto;
}

/* 秒表 */
.stopwatch-time {
  font-family: var(--mono);
  font-size: var(--text-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  text-align: center;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.stopwatch-time small {
  font-size: var(--text-body-sm);
  font-weight: 500;
  color: var(--text-3);
  letter-spacing: 0;
}

.lap-list {
  max-height: 200px;
  overflow: auto;
  font-family: var(--mono);
  font-size: 15px;
}

.lap-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 8px;
  border-bottom: 1px dashed var(--border);
}

.lap-row:last-child {
  border-bottom: 0;
}

.lap-row.best {
  color: var(--ok);
}

.lap-row.worst {
  color: var(--err);
}

/* 正则高亮 */
.regex-view {
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 260px;
  overflow: auto;
}

.regex-view mark {
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  color: var(--text);
  border-radius: 6px;
  padding: 0 4px;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent);
}

/* 颜色 */
.color-preview {
  height: 120px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: grid;
  place-items: end center;
  padding: 8px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
}

.shades {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
  border-radius: 8px;
  overflow: hidden;
}

.shades div {
  height: 46px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-family: var(--mono);
  color: rgba(0, 0, 0, 0.55);
}

/* 密码 */
.pw-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pw-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font-family: var(--mono);
  font-size: 17px;
}

.pw-item span {
  flex: 1;
  word-break: break-all;
}

.strength {
  display: flex;
  gap: 4px;
  align-items: center;
}

.strength i {
  display: block;
  width: 34px;
  height: 5px;
  border-radius: 8px;
  background: var(--surface-3);
}

.strength i.on-1 { background: var(--err); }
.strength i.on-2 { background: var(--warn); }
.strength i.on-3 { background: var(--color-success); }
.strength i.on-4 { background: var(--ok); }


/* ============================== 二维码 ============================== */

.qr-stage {
  margin-top: 12px;
  min-height: 232px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border-radius: 8px;
  padding: 16px;
}

.qr-canvas {
  background: var(--color-paper);
  padding: 8px;
  border-radius: 8px;
  line-height: 0;
  box-shadow: var(--shadow-xs);
}

.qr-canvas img {
  display: block;
  max-width: 100%;
  height: auto;
}

.drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 208px;
  padding: 24px;
  border: 1.5px dashed var(--border-2);
  border-radius: 8px;
  color: var(--text-2);
  text-align: center;
  cursor: pointer;
  font-size: 15px;
  transition: border-color 0.16s, background 0.16s;
}

.drop-zone:hover,
.drop-zone.hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.drop-zone svg {
  width: 30px;
  height: 30px;
  color: var(--text-3);
}

.drop-preview {
  max-height: 132px;
  max-width: 100%;
  border-radius: 8px;
}

.qr-result {
  margin-top: 12px;
}

/* ============================== 字符编码 ============================== */

.charset-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px minmax(0, 1fr);
  gap: 8px;
  align-items: end;
  max-width: 660px;
}

.cs-hex {
  margin-top: 12px;
}

.cs-hex summary {
  cursor: pointer;
  font-size: 15px;
  color: var(--text-2);
  padding: 4px 0;
  user-select: none;
}

.cs-hex .result-box {
  margin-top: 8px;
  max-height: 150px;
  overflow: auto;
  font-size: 12px;
}

.detect-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detect-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ============================== 加解密 ============================== */

.crypto-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 12px;
  margin-top: 12px;
}

.digest-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.digest-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.digest-head b {
  font-size: 15px;
  font-weight: 600;
}

.digest-item .result-box {
  font-size: 12px;
}

/* ============================== 天气搜索 ============================== */

.weather-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.weather-input {
  position: relative;
  flex: 1;
  min-width: 220px;
  max-width: 400px;
}

.weather-input > svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--text-3);
  pointer-events: none;
}

.weather-input .input {
  width: 100%;
  padding-left: 32px;
}

.weather-hot {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.weather-place {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 17px;
  font-weight: 600;
}

.weather-place .hint {
  font-weight: 400;
}

.day-icon {
  font-size: 17px;
  text-align: center;
}

/* ============================== 万年历 ============================== */

.cal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 12px;
  /* 左右两张卡等高：左侧日历把多余高度分给日格，右侧详情占满 */
  align-items: stretch;
}

/* 间距已经由 gap 负责，再叠一层 .panel + .panel 的纵向 margin，
   右侧那张卡会整体下移 16px 且矮 16px —— 就是左右对不齐的真正原因 */
.cal-layout > .panel + .panel {
  margin-top: 0;
}

.cal-main {
  display: flex;
  flex-direction: column;
}

.cal-side {
  display: flex;
  flex-direction: column;
}

.cal-detail {
  flex: 1;
  min-height: 300px;
}

/* 年月选择：一个按钮 + 弹出式 12 宫格月份，替代两个长下拉（年份 200 项太长） */
.cal-picker {
  position: relative;
}

.cal-picker-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  padding: 0 10px 0 12px;
  border: 1px solid var(--color-border);
  border-radius: 9px;
  background: var(--color-surface);
  color: var(--color-text-primary);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.cal-picker-btn svg {
  width: 14px;
  height: 14px;
  color: var(--color-text-tertiary);
  transition: transform 0.15s ease;
}

.cal-picker-btn:hover {
  border-color: var(--color-border-strong);
}

.cal-picker-btn[aria-expanded='true'] svg {
  transform: rotate(180deg);
}

.cal-picker-pop {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 30;
  width: 252px;
  padding: 10px;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
}

.cal-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.cal-picker-head b {
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.cal-picker-months {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.cp-month {
  height: 34px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--color-text-primary);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.cp-month:hover {
  background: var(--color-hover);
}

.cp-month.on {
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
}

.cal-picker-today {
  width: 100%;
  height: 30px;
  margin-top: 8px;
  border: none;
  border-top: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-primary);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.cal-picker-today:hover {
  text-decoration: underline;
}

.cal-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.cal-head h2 {
  font-size: 17px;
  font-weight: 600;
  min-width: 112px;
  letter-spacing: -0.02em;
}

.cal-meta {
  font-size: 12px;
  color: var(--text-3);
}

.cal-next {
  color: var(--accent);
}

.cal-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 4px;
}

.cal-week span {
  text-align: center;
  font-size: 12px;
  color: var(--text-3);
  padding: 4px 0;
}

.cal-week .is-weekend {
  color: var(--err);
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  /* 固定 6 行 + 允许拉伸：左右两张卡高度一致，切月份也不跳 */
  grid-auto-rows: minmax(58px, 1fr);
  flex: 1;
}

.cal-cell {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 60px;
  padding: 4px 4px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  transition: background 0.14s;
}

.cal-cell:hover {
  background: var(--surface-2);
}

.cal-cell.is-empty {
  cursor: default;
}

.cal-cell.is-empty:hover {
  background: transparent;
}

.cal-num {
  font-size: 17px;
  font-weight: 500;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.cal-sub {
  font-size: 12px;
  color: var(--text-3);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
}

.cal-sub.special {
  color: var(--accent);
}

/* 节日 / 节气 / 假期名：特殊日额外一行高亮提示 */
.cal-fest {
  font-size: 11px;
  line-height: 1.3;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--accent);
  font-weight: 600;
}

.cal-cell.is-selected .cal-fest {
  color: var(--color-on-primary);
}

/* 国际节日：可勾选的「选项」胶囊，点击即叠加国际节日；默认仅国内法定假期 */
.cal-opt {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.cal-opt:hover { border-color: var(--border-strong); }

.cal-opt input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.cal-opt-box {
  width: 16px;
  height: 16px;
  flex: none;
  border: 1.5px solid var(--border-strong);
  border-radius: 5px;
  position: relative;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.cal-opt input:checked + .cal-opt-box {
  background: var(--accent);
  border-color: var(--accent);
}

.cal-opt input:checked + .cal-opt-box::after {
  content: '';
  position: absolute;
  left: 4.5px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.cal-opt-label {
  font-weight: 600;
}

.cal-opt.is-on {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft, rgba(0, 122, 255, 0.08));
}

.cal-cell.is-weekend .cal-num {
  color: var(--err);
}

.cal-cell.is-holiday {
  background: var(--err-soft);
}

.cal-cell.is-holiday .cal-num {
  color: var(--err);
}

.cal-cell.is-adjusted {
  background: var(--warn-soft);
}

.cal-cell.is-today {
  box-shadow: inset 0 0 0 1.5px var(--accent);
}

.cal-cell.is-today .cal-num {
  color: var(--accent);
  font-weight: 600;
}

.cal-cell.is-selected {
  background: var(--accent);
}

.cal-cell.is-selected .cal-num,
.cal-cell.is-selected .cal-sub {
  color: var(--color-on-primary);
}

.cal-cell.is-selected .cal-sub.special {
  color: var(--color-on-primary);
}

.cal-badge {
  position: absolute;
  top: 3px;
  right: 4px;
  width: 12px;
  height: 12px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 12px;
  line-height: 1;
  color: var(--color-on-primary);
}

.cal-badge.red {
  background: var(--err);
}

.cal-badge.orange {
  background: var(--color-text-secondary);
}

.cal-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-3);
}

.cal-legend .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 4px;
}

.cal-legend .dot.red { background: var(--err); }
.cal-legend .dot.gray { background: var(--text-3); }
.cal-legend .dot.orange { background: var(--color-text-secondary); }

.cal-detail-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.cal-detail-day {
  font-size: 34px;
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.cal-detail-lunar {
  font-size: 15px;
  font-weight: 500;
}

.cal-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.cal-kv {
  border: 0;
  border-top: 1px solid var(--border);
}

.cal-kv .kv-row {
  padding: 8px 0;
  grid-template-columns: 78px 1fr;
  background: transparent;
}

.cal-kv .kv-row:nth-child(even) {
  background: transparent;
}

.cal-yiji {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.cal-yiji > div {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.cal-yiji-label {
  width: 20px;
  height: 20px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  background: var(--surface-2);
  color: var(--text-2);
  margin-top: 4px;
}

.cal-yiji-list {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.cal-holidays {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  /* 放假安排自带滚动：不然列表一长就把整页撑高，左边日历被拉成一片空白 */
  max-height: 320px;
  /* 数据没回来时先占住位置。否则这一块会从十几像素突然长到 320，
     右栏和整页跟着跳一下，看着就是「页面在抖」 */
  min-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
}

.cal-holidays::-webkit-scrollbar {
  width: 6px;
}

.cal-holidays::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: var(--color-border-strong);
}

.cal-holidays-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 4px;
}

.holiday-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.holiday-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 5px 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  font: inherit;
  font-size: 14px;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.holiday-item:hover {
  background: var(--color-hover);
  border-color: var(--color-border);
}

.holiday-name {
  width: 92px;
  flex: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.holiday-range {
  flex: 1;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.holiday-item.is-work .holiday-name {
  color: var(--text-2);
}

.qr-options {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 560px) {
  .qr-options {
    grid-template-columns: 1fr;
  }
}

/* 320px：月份标题与翻月按钮允许换行，避免 7 列表格被整体顶出视口 */
@media (max-width: 479px) {
  .cal-head {
    flex-wrap: wrap;
  }

  .cal-head h2 {
    min-width: 0;
    flex: 1 1 auto;
  }
}

/* ==========================================================================
   倒数日 / 纪念日（days）：自定义倒计时、已过去天数、每年固定纪念日
   ========================================================================== */
.days-panel { margin-bottom: var(--space-4); }

.days-hint {
  margin: 6px 0 0;
  font-size: var(--text-footnote, 12px);
  color: var(--color-text-tertiary);
}

.days-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-top: var(--space-3);
}

.days-form .field:first-child,
.days-form .field:nth-child(2) { grid-column: 1 / -1; }

@media (max-width: 640px) {
  .days-form { grid-template-columns: 1fr; }
  .days-form .field:nth-child(2) { grid-column: auto; }
}

.days-icon-pick { display: flex; flex-wrap: wrap; gap: 8px; }

.days-icon-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: border-color 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
}

.days-icon-btn svg { width: 20px; height: 20px; }
.days-icon-btn:hover { color: var(--color-text-primary); }
.days-icon-btn.on {
  border-color: var(--color-primary);
  color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary-soft);
}

.days-color-pick { display: flex; flex-wrap: wrap; gap: 10px; }

.days-color-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.days-color-btn:hover { transform: scale(1.12); }
.days-color-btn.on {
  border-color: var(--color-text-primary);
  box-shadow: 0 0 0 2px var(--color-surface), 0 0 0 4px currentColor;
}

/* —— 卡片网格 —— */
.days-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-4);
}

.days-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--accent, var(--color-border));
  border-radius: var(--radius-card);
  background: var(--color-surface);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.days-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md, 0 10px 26px rgba(0, 0, 0, 0.08));
  border-color: var(--color-border-strong);
}

.days-card-icon {
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--accent, #C9942E);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);
}

.days-card-icon svg { width: 24px; height: 24px; }

.days-card-body { flex: 1; min-width: 0; }

.days-card-top { display: flex; align-items: center; gap: 8px; }

.days-card-name {
  font-size: var(--text-body, 15px);
  font-weight: 700;
  color: var(--color-text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.days-tag {
  flex: none;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--color-surface-sunken);
  color: var(--color-text-secondary);
}

.days-big {
  margin-top: 4px;
  font-size: 34px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--accent, var(--color-text-primary));
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.days-big small {
  font-size: 15px;
  font-weight: 600;
  margin-left: 3px;
  color: var(--color-text-secondary);
}

.days-label {
  margin-top: 2px;
  font-size: var(--text-caption, 13px);
  color: var(--color-text-secondary);
}

.days-sub {
  margin-top: 2px;
  font-size: var(--text-footnote, 12px);
  color: var(--color-text-tertiary);
}

.days-edit, .days-del {
  position: absolute;
  top: 10px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--color-text-tertiary);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.days-edit { right: 44px; }
.days-del { right: 10px; }

.days-edit:hover { background: var(--color-surface-sunken); color: var(--color-primary); }
.days-del:hover { background: var(--color-error-soft, rgba(255, 59, 48, 0.12)); color: var(--color-error, #FF3B30); }

.days-edit svg, .days-del svg { width: 17px; height: 17px; }

/* —— 空状态 —— */
.days-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: var(--space-7, 40px) var(--space-4);
  text-align: center;
}

.days-empty-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--color-surface-sunken);
  color: var(--color-text-tertiary);
}

.days-empty-icon svg { width: 30px; height: 30px; }

.days-empty-title { font-size: var(--text-body, 15px); font-weight: 700; color: var(--color-text-primary); }
.days-empty-sub { font-size: var(--text-caption, 13px); color: var(--color-text-tertiary); margin-bottom: var(--space-2, 8px); }

/* ==========================================================================
   学习模块：诗词 / 字典 / 英文词典 / 翻译 / 打字练习
   统一用 st- 前缀，配色跟随 [data-theme]，深浅色都可读
   ========================================================================== */
.st { display: flex; flex-direction: column; gap: 14px; }
.st-head { display: flex; flex-wrap: wrap; align-items: stretch; gap: 12px; }
.st-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.st-tab {
  display: flex; flex-direction: column; gap: 2px; align-items: flex-start;
  box-sizing: border-box; min-height: 44px; justify-content: center;
  padding: 7px 16px; border: 1px solid var(--color-border, rgba(120,120,128,.22));
  border-radius: 12px; background: var(--color-surface, #fff); color: var(--color-text-primary);
  cursor: pointer; text-align: left; transition: border-color .18s, background .18s, transform .18s;
}
.st-tab b { font-size: 14px; }
.st-tab small { font-size: 11px; color: var(--color-text-tertiary); }
.st-tab-pill { flex-direction: row; align-items: center; box-sizing: border-box; height: 44px; padding: 0 16px; font-size: 13px; font-weight: 600; }
.st-tab:hover { transform: translateY(-1px); }
.st-tab.on { border-color: var(--color-primary, #0071E3); background: var(--color-primary-soft, rgba(0,113,227,.10)); color: var(--color-primary, #0071E3); }
.st-tab.on small { color: var(--color-primary, #0071E3); }
.st-search {
  display: flex; align-items: center; gap: 8px; flex: 1 1 260px; min-width: 220px;
  box-sizing: border-box; padding: 0 12px; min-height: 44px; height: auto; border: 1px solid var(--color-border, rgba(120,120,128,.22));
  border-radius: 12px; background: var(--color-surface, #fff);
}
.st-search-wide { flex: 1 1 340px; }
.st-search svg { width: 18px; height: 18px; flex: none; color: var(--color-text-tertiary); }
.st-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--color-text-primary); font-size: 14px; }
.st-search-mode { display: flex; gap: 2px; padding-left: 8px; border-left: 1px solid var(--color-border, rgba(120,120,128,.2)); }
.st-search-mode button { border: 0; background: transparent; color: var(--color-text-tertiary); font-size: 12px; padding: 4px 6px; border-radius: 6px; cursor: pointer; }
.st-search-mode button.on { background: var(--color-primary-soft, rgba(0,113,227,.12)); color: var(--color-primary, #0071E3); font-weight: 700; }
.st-meta { font-size: 12px; color: var(--color-text-tertiary); }
.st-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.st-grid-2 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.st-empty { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 40px 16px; text-align: center; color: var(--color-text-tertiary); }
.st-empty svg { width: 34px; height: 34px; }
.st-empty b { color: var(--color-text-primary); font-size: 15px; }
.st-empty span { font-size: 12px; }

/* 诗词卡片 */
.pt-card, .dc-card, .en-card {
  display: flex; flex-direction: column; gap: 8px; padding: 16px 18px;
  border: 1px solid var(--color-border, rgba(120,120,128,.18)); border-radius: 16px;
  background: var(--color-surface, #fff); box-shadow: 0 1px 2px rgba(0,0,0,.03);
}
.pt-card-top, .dc-card-top, .en-card-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.pt-card h3, .dc-card h3, .en-card h3 { margin: 0; font-size: 17px; font-weight: 700; }
.pt-dynasty { font-size: 11px; padding: 2px 8px; border-radius: 6px; background: var(--color-surface-sunken, rgba(120,120,128,.10)); color: var(--color-text-secondary); }
.pt-author { font-size: 12px; color: var(--color-text-secondary); }
.pt-content { margin: 4px 0; font-size: 14px; line-height: 2; letter-spacing: .02em; color: var(--color-text-primary); white-space: pre-wrap; }
.pt-foot, .dc-foot, .en-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--color-border, rgba(120,120,128,.14)); font-size: 12px; color: var(--color-text-tertiary); }
.pt-foot button, .dc-foot button, .en-foot button { display: inline-flex; align-items: center; gap: 4px; border: 0; background: transparent; color: var(--color-primary, #0071E3); font-size: 12px; cursor: pointer; }
.pt-foot svg, .dc-foot svg, .en-foot svg { width: 14px; height: 14px; }

/* 字典 / 英文词典 */
.dc-pinyin { font-size: 12px; color: var(--color-text-tertiary); letter-spacing: .04em; }
.dc-explain { margin: 2px 0; font-size: 13.5px; line-height: 1.8; }
.dc-tag { font-size: 11px; padding: 2px 8px; border-radius: 6px; background: var(--color-primary-soft, rgba(0,113,227,.10)); color: var(--color-primary, #0071E3); }
.en-phonetic { font-size: 12px; color: var(--color-text-tertiary); }
.en-pos { display: inline-block; align-self: flex-start; font-size: 11px; font-style: italic; padding: 1px 7px; border-radius: 6px; background: var(--color-surface-sunken, rgba(120,120,128,.10)); color: var(--color-text-secondary); }
.en-meaning { margin: 0; font-size: 15px; font-weight: 600; }
.en-en { margin: 0; font-size: 12.5px; color: var(--color-text-secondary); }
.en-example { margin: 0; padding: 8px 10px; border-left: 3px solid var(--color-primary, #0071E3); border-radius: 0 8px 8px 0; background: var(--color-surface-sunken, rgba(120,120,128,.08)); font-size: 12.5px; font-style: italic; }
.st-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.st-quick button { border: 1px solid var(--color-border, rgba(120,120,128,.22)); border-radius: 999px; padding: 5px 11px; background: transparent; color: var(--color-text-secondary); font-size: 12px; cursor: pointer; }
.st-quick button:hover { color: var(--color-primary, #0071E3); border-color: var(--color-primary, #0071E3); }

/* 翻译 */
.tr-notice { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 12px 14px; border-radius: 12px; background: var(--color-primary-soft, rgba(0,113,227,.10)); color: var(--color-primary, #0071E3); font-size: 12px; }
.tr-notice svg { width: 18px; height: 18px; flex: none; }
.tr-notice b { font-size: 13px; }
.tr-notice span { color: var(--color-text-secondary); }
.tr-panel { display: grid; grid-template-columns: 1fr 44px 1fr; gap: 10px; align-items: stretch; }
.tr-side { display: flex; flex-direction: column; min-height: 220px; padding: 12px; border: 1px solid var(--color-border, rgba(120,120,128,.18)); border-radius: 16px; background: var(--color-surface, #fff); }
.tr-side-head { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 700; color: var(--color-text-secondary); margin-bottom: 8px; }
.tr-mini { border: 0; background: transparent; color: var(--color-primary, #0071E3); font-size: 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.tr-mini svg { width: 13px; height: 13px; }
.tr-side textarea { flex: 1; width: 100%; resize: vertical; border: 0; outline: 0; background: transparent; color: var(--color-text-primary); font-size: 17px; line-height: 1.7; }
.tr-detect { font-size: 11px; color: var(--color-text-tertiary); padding-top: 8px; }
.tr-swap { align-self: center; width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--color-border, rgba(120,120,128,.22)); border-radius: 50%; background: var(--color-surface, #fff); color: var(--color-primary, #0071E3); cursor: pointer; }
.tr-swap svg { width: 18px; height: 18px; }
.tr-swap:hover { background: var(--color-primary-soft, rgba(0,113,227,.10)); }
.tr-output { flex: 1; font-size: 20px; line-height: 1.7; word-break: break-word; }
.tr-output b { font-weight: 700; color: var(--color-primary, #0071E3); }
.tr-placeholder, .tr-miss { font-size: 14px; color: var(--color-text-tertiary); }
.tr-miss { color: var(--color-error, #FF3B30); }
.tr-detail { padding-top: 10px; border-top: 1px solid var(--color-border, rgba(120,120,128,.14)); font-size: 12.5px; color: var(--color-text-secondary); line-height: 1.7; }
.tr-word b { font-size: 15px; color: var(--color-text-primary); }
.tr-word i { font-style: normal; color: var(--color-text-tertiary); margin-left: 6px; }
.tr-word em { font-style: normal; margin-left: 6px; }
.tr-en { color: var(--color-text-tertiary); }
.tr-eg { margin-top: 4px; font-style: italic; }
.tr-quick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; color: var(--color-text-tertiary); }
.tr-quick button { border: 1px solid var(--color-border, rgba(120,120,128,.22)); border-radius: 999px; padding: 5px 11px; background: transparent; color: var(--color-text-secondary); cursor: pointer; }
@media (max-width: 700px) { .tr-panel { grid-template-columns: 1fr; } .tr-swap { justify-self: center; transform: rotate(90deg); } }

/* 打字练习 */
.ty-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ty-name { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--color-text-tertiary); }
.ty-name input { width: 110px; height: 32px; padding: 0 8px; border: 1px solid var(--color-border, rgba(120,120,128,.22)); border-radius: 8px; background: var(--color-surface, #fff); color: var(--color-text-primary); font-size: 12px; outline: 0; }
.ty-new { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; padding: 7px 13px; border: 1px solid var(--color-border, rgba(120,120,128,.22)); border-radius: 10px; background: var(--color-surface, #fff); color: var(--color-primary, #0071E3); font-size: 12px; cursor: pointer; }
.ty-new svg { width: 14px; height: 14px; }
.ty-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.ty-stats > div { padding: 12px 14px; border-radius: 14px; background: var(--color-surface-sunken, rgba(120,120,128,.08)); }
.ty-stats span { display: block; font-size: 11px; color: var(--color-text-tertiary); }
.ty-stats b { display: block; margin-top: 4px; font-size: 20px; }
.ty-stats i { font-size: 11px; font-style: normal; font-weight: 500; color: var(--color-text-tertiary); }
.ty-text { padding: 18px 20px; border: 1px solid var(--color-border, rgba(120,120,128,.18)); border-radius: 16px; background: var(--color-surface, #fff); font-size: 18px; line-height: 2.1; letter-spacing: .02em; word-break: break-all; min-height: 96px; }
.ty-ch { border-radius: 3px; padding: 1px 0; }
.ty-ch.ok { color: var(--color-primary, #0071E3); }
.ty-ch.bad { color: var(--color-error, #FF3B30); background: rgba(255,59,48,.12); }
.ty-ch.now { border-bottom: 2px solid var(--color-primary, #0071E3); }
.ty-input { width: 100%; padding: 14px 16px; border: 1px solid var(--color-border, rgba(120,120,128,.22)); border-radius: 14px; background: var(--color-surface, #fff); color: var(--color-text-primary); font-size: 15px; line-height: 1.8; outline: 0; }
.ty-input:focus { border-color: var(--color-primary, #0071E3); }
.ty-progress-bar { height: 8px; border-radius: 99px; background: var(--color-surface-sunken, rgba(120,120,128,.12)); overflow: hidden; margin: 12px 0 2px; }
.ty-progress-bar > i { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--color-primary, #0071E3), #42a5f5); transition: width .12s ease; }
.ty-actions { display: flex; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.ty-end { padding: 11px 22px; border: 0; border-radius: 12px; background: var(--color-primary, #0071E3); color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; transition: opacity .15s, transform .05s; }
.ty-end:hover:not(:disabled) { opacity: .92; }
.ty-end:active:not(:disabled) { transform: scale(.97); }
.ty-end:disabled { opacity: .4; cursor: not-allowed; }
.ty-actions-hint { font-size: 12px; color: var(--color-text-tertiary); }
.ty-result-card { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 16px; border-radius: 14px; background: var(--color-primary-soft, rgba(0,113,227,.10)); }
.ty-result-card span { display: block; font-size: 11px; color: var(--color-text-secondary); }
.ty-result-card b { font-size: 19px; }
.ty-result-card p { grid-column: 1 / -1; margin: 4px 0 0; font-size: 12px; color: var(--color-text-secondary); }
.ty-board { border: 1px solid var(--color-border, rgba(120,120,128,.18)); border-radius: 16px; overflow: hidden; }
.ty-board-head { padding: 14px 18px; border-bottom: 1px solid var(--color-border, rgba(120,120,128,.14)); }
.ty-board-head h3 { margin: 0; font-size: 15px; }
.ty-board-head small { margin-left: 6px; font-size: 11px; color: var(--color-text-tertiary); }
.ty-board-head span { font-size: 11px; color: var(--color-text-tertiary); }
.ty-board-body { padding: 6px 18px 14px; font-size: 13px; }
.ty-board-row { display: grid; grid-template-columns: 34px 1fr 100px 80px 50px 100px; align-items: center; gap: 6px; padding: 9px 0; border-bottom: 1px solid var(--color-border, rgba(120,120,128,.10)); }
.ty-board-row:last-child { border-bottom: 0; }
.ty-board-th { font-size: 11px; color: var(--color-text-tertiary); }
.ty-rank.top { color: #C9942E; font-weight: 800; }
.ty-grade { font-weight: 800; text-align: center; }
.g-S { color: #B8860B; } .g-A { color: #E8590C; } .g-B { color: #1971C2; } .g-C { color: #2F9E44; } .g-D { color: #86868B; }
.ty-date { font-size: 11px; color: var(--color-text-tertiary); }
.ty-board-empty { padding: 20px 0; text-align: center; color: var(--color-text-tertiary); font-size: 12px; }
@media (max-width: 700px) { .ty-stats, .ty-result-card { grid-template-columns: repeat(2, 1fr); } .ty-board-row { grid-template-columns: 28px 1fr 76px 56px 30px; } .ty-date { display: none; } }

/* ==========================================================================
   城市信息模块
   ========================================================================== */
.ct { display: flex; flex-direction: column; gap: 14px; }
.ct-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ct-search { flex: 1 1 280px; }
.ct-select { height: 42px; padding: 0 12px; border: 1px solid var(--color-border, rgba(120,120,128,.22)); border-radius: 12px; background: var(--color-surface, #fff); color: var(--color-text-primary); font-size: 13px; outline: 0; }
.ct-views { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--color-surface-sunken, rgba(120,120,128,.09)); }
.ct-views button { border: 0; background: transparent; color: var(--color-text-secondary); padding: 7px 14px; border-radius: 9px; font-size: 13px; cursor: pointer; }
.ct-views button.on { background: var(--color-surface, #fff); color: var(--color-primary, #0071E3); font-weight: 700; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.ct-letters { display: flex; flex-wrap: wrap; gap: 4px; }
.ct-letters button { min-width: 30px; height: 30px; border: 1px solid var(--color-border, rgba(120,120,128,.2)); border-radius: 8px; background: transparent; color: var(--color-text-secondary); font-size: 12px; font-weight: 600; cursor: pointer; }
.ct-letters button.on { border-color: var(--color-primary, #0071E3); background: var(--color-primary, #0071E3); color: #fff; }
.ct-pin { margin-right: 3px; font-size: 12px; }
.ct-group { margin-bottom: 20px; }
.ct-group-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.ct-group-head h3 { margin: 0; font-size: 16px; }
.ct-group-head span { font-size: 11px; color: var(--color-text-tertiary); }
.ct-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.ct-card { position: relative; display: flex; flex-direction: column; gap: 3px; padding: 14px; text-align: left; border: 1px solid var(--color-border, rgba(120,120,128,.18)); border-radius: 14px; background: var(--color-surface, #fff); color: var(--color-text-primary); cursor: pointer; transition: transform .18s, border-color .18s; }
.ct-card:hover { transform: translateY(-2px); border-color: var(--color-primary, #0071E3); }
.ct-letter { position: absolute; right: 12px; top: 10px; font-size: 11px; font-weight: 800; color: var(--color-text-tertiary); }
.ct-card-name { font-size: 16px; font-weight: 700; padding-right: 24px; }
.ct-plate { align-self: flex-start; margin: 2px 0; padding: 1px 7px; border-radius: 6px; background: var(--color-primary-soft, rgba(0,113,227,.10)); color: var(--color-primary, #0071E3); font-size: 11px; font-weight: 700; }
.ct-card-sub { font-size: 11px; color: var(--color-text-tertiary); }
.ct-card-gdp { margin-top: 4px; padding-top: 6px; border-top: 1px solid var(--color-border, rgba(120,120,128,.12)); font-size: 11.5px; color: var(--color-text-secondary); }

.ct-rank-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ct-rank-metrics { display: flex; flex-wrap: wrap; gap: 5px; flex: 1; }
.ct-rank-metrics button { border: 1px solid var(--color-border, rgba(120,120,128,.22)); border-radius: 999px; padding: 6px 12px; background: transparent; color: var(--color-text-secondary); font-size: 12px; cursor: pointer; }
.ct-rank-metrics button.on { border-color: var(--color-primary, #0071E3); background: var(--color-primary, #0071E3); color: #fff; }
.ct-rank-body { display: flex; flex-direction: column; gap: 2px; }
.ct-rank-row { display: grid; grid-template-columns: 34px 180px 1fr 130px; gap: 10px; align-items: center; padding: 8px 4px; border-bottom: 1px solid var(--color-border, rgba(120,120,128,.10)); }
.ct-rank-no { font-size: 14px; font-weight: 800; color: var(--color-text-tertiary); text-align: center; }
.ct-rank-no.top { color: #C9942E; }
.ct-rank-name { font-size: 13px; font-weight: 700; }
.ct-rank-name small { display: block; font-size: 10px; font-weight: 400; color: var(--color-text-tertiary); }
.ct-rank-track { height: 9px; border-radius: 999px; background: var(--color-surface-sunken, rgba(120,120,128,.12)); overflow: hidden; }
.ct-rank-track i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #0071E3, #5AC8FA); }
.ct-rank-row b { text-align: right; font-size: 13px; }
.ct-rank-row b small { font-weight: 400; color: var(--color-text-tertiary); }
.ct-hint { margin: 10px 0 0; font-size: 11.5px; line-height: 1.7; color: var(--color-text-tertiary); }

.ct-modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; background: rgba(0,0,0,.42); backdrop-filter: blur(6px); }
.ct-modal[aria-hidden="true"] { display: none; }
.ct-modal-card { position: relative; width: min(760px, 100%); max-height: 88vh; overflow-y: auto; padding: 20px 22px 26px; border-radius: 20px; background: var(--color-surface, #fff); color: var(--color-text-primary); box-shadow: 0 20px 60px rgba(0,0,0,.22); }
.ct-close { position: absolute; right: 16px; top: 14px; z-index: 2; width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--color-border, rgba(120,120,128,.22)); border-radius: 50%; background: var(--color-surface, #fff); color: var(--color-text-secondary); cursor: pointer; }
.ct-close svg { width: 15px; height: 15px; }
.ct-hero-svg { width: 100%; height: auto; border-radius: 14px; }
.ct-detail-title { margin-top: 10px; }
.ct-detail-title h2 { margin: 0; font-size: 22px; }
.ct-detail-title span { font-size: 12px; color: var(--color-text-secondary); }
.ct-intro { margin: 12px 0; font-size: 14px; line-height: 1.85; }
.ct-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ct-metrics > div { padding: 12px; border-radius: 12px; background: var(--color-surface-sunken, rgba(120,120,128,.08)); }
.ct-metrics span { display: block; font-size: 11px; color: var(--color-text-tertiary); }
.ct-metrics b { display: block; margin-top: 3px; font-size: 15px; }
.ct-section { margin-top: 18px; }
.ct-section h4 { margin: 0 0 8px; font-size: 14px; }
.ct-section h4 small { font-size: 11px; font-weight: 400; color: var(--color-text-tertiary); }
.ct-section p { margin: 0; font-size: 13px; line-height: 1.8; color: var(--color-text-secondary); }
.ct-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.ct-tags span { padding: 4px 10px; border-radius: 999px; background: var(--color-primary-soft, rgba(0,113,227,.10)); color: var(--color-primary, #0071E3); font-size: 12px; }
.ct-tags.food span { background: rgba(233,89,12,.10); color: #B34700; }
.ct-note { margin-top: 8px !important; font-size: 11.5px !important; color: var(--color-text-tertiary) !important; }
.ct-note.warn { color: #B34700 !important; }
.ct-districts { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px; max-height: 260px; overflow-y: auto; }
.ct-district { display: grid; grid-template-columns: 1fr 70px 42px; gap: 6px; align-items: center; padding: 7px 9px; border-radius: 9px; background: var(--color-surface-sunken, rgba(120,120,128,.07)); font-size: 12px; }
.ct-district-name small { display: block; font-size: 10px; color: var(--color-text-tertiary); }
.ct-district-bar { height: 6px; border-radius: 999px; background: var(--color-border, rgba(120,120,128,.2)); overflow: hidden; }
.ct-district-bar i { display: block; height: 100%; background: #C9942E; }
.ct-district b { text-align: right; font-size: 11px; }
.ct-district-na { grid-column: 2 / -1; text-align: right; font-size: 10.5px; color: var(--color-text-tertiary); }
@media (max-width: 700px) { .ct-metrics { grid-template-columns: repeat(2, 1fr); } .ct-rank-row { grid-template-columns: 28px 120px 1fr 90px; } }

/* ============================== 文件工具 ==============================
   三个页签：格式转换 / 文件加密 / 文件解密。所有颜色走主题变量，深浅色都可读。
   ===================================================================== */
.ft { display: flex; flex-direction: column; gap: 16px; }
.ft-notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: var(--color-surface-sunken, rgba(120,120,128,.08)); border: 1px solid var(--color-border, rgba(120,120,128,.2)); }
.ft-notice > svg { width: 22px; height: 22px; flex: 0 0 22px; color: var(--color-primary, #0071E3); }
.ft-notice b { display: block; font-size: 13.5px; margin-bottom: 4px; }
.ft-notice span { display: block; font-size: 12px; line-height: 1.7; color: var(--color-text-secondary); }
.ft-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.ft-tab { display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px; border-radius: 999px; border: 1px solid var(--color-border, rgba(120,120,128,.2)); background: var(--color-surface, #fff); color: var(--color-text-secondary); font-size: 13px; cursor: pointer; transition: background .16s, color .16s, border-color .16s; }
.ft-tab svg { width: 16px; height: 16px; }
.ft-tab:hover { border-color: var(--color-primary, #0071E3); }
.ft-tab.on { background: var(--color-primary, #0071E3); border-color: var(--color-primary, #0071E3); color: #fff; }
.ft-cap { font-size: 12px; color: var(--color-text-secondary); }
.ft-cap b { color: var(--color-text-primary, inherit); }
.ft-ok { color: #1B7F4B; }
.ft-warn, .ft-cap-err { color: #B34700; }
.ft-pane { display: none; }
.ft-pane.on { display: block; }
.ft-card { padding: 20px; border-radius: 16px; background: var(--color-surface, #fff); border: 1px solid var(--color-border, rgba(120,120,128,.2)); }
.ft-card h3 { margin: 0 0 6px; font-size: 16px; }
.ft-desc { margin: 0 0 16px; font-size: 12.5px; line-height: 1.8; color: var(--color-text-secondary); }
.ft-desc code, .ft-rules code { padding: 1px 5px; border-radius: 5px; background: var(--color-surface-sunken, rgba(120,120,128,.1)); font-size: 11.5px; }
.ft-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.ft-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 132px; padding: 18px; border: 1.5px dashed var(--color-border, rgba(120,120,128,.35)); border-radius: 14px; background: var(--color-surface-sunken, rgba(120,120,128,.06)); cursor: pointer; text-align: center; transition: border-color .16s, background .16s; }
.ft-drop:hover, .ft-drop.dragging { border-color: var(--color-primary, #0071E3); background: var(--color-primary-soft, rgba(0,113,227,.06)); }
.ft-drop.has-file { border-style: solid; border-color: var(--color-primary, #0071E3); }
.ft-drop > svg { width: 26px; height: 26px; color: var(--color-primary, #0071E3); transform: rotate(180deg); }
.ft-drop b { font-size: 13px; }
.ft-drop span { font-size: 12px; color: var(--color-text-tertiary); word-break: break-all; }
.ft-row { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 12px; align-items: center; margin-top: 16px; }
.ft-label { font-size: 12.5px; color: var(--color-text-secondary); }
.ft-check { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; padding: 12px 14px; border-radius: 12px; background: var(--color-surface-sunken, rgba(120,120,128,.08)); cursor: pointer; }
.ft-check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--color-primary, #0071E3); }
.ft-check b { display: block; font-size: 13px; }
.ft-check small { display: block; margin-top: 3px; font-size: 11.5px; line-height: 1.6; color: var(--color-text-tertiary); }
.ft-hint { margin: 10px 0 0; font-size: 11.5px; color: var(--color-text-tertiary); }
.ft-action { margin-top: 18px; min-width: 130px; }
.ft-result { padding: 18px 20px; border-radius: 16px; background: var(--color-surface, #fff); border: 1px solid var(--color-border, rgba(120,120,128,.2)); }
.ft-result-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ft-result-head b { font-size: 13px; word-break: break-all; }
.ft-badge { padding: 4px 10px; border-radius: 999px; background: rgba(27,127,75,.12); color: #1B7F4B; font-size: 11px; }
.ft-badge.fail { background: rgba(179,71,0,.12); color: #B34700; }
.ft-result-msg { margin: 10px 0 14px; font-size: 12.5px; line-height: 1.8; color: var(--color-text-secondary); }
.ft-keybox { margin: 0 0 14px; padding: 14px; border-radius: 12px; background: var(--color-surface-sunken, rgba(120,120,128,.08)); border: 1px solid var(--color-border, rgba(120,120,128,.2)); }
.ft-keybox-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; font-size: 12px; }
.ft-keybox-head span { font-size: 11px; color: #B34700; }
.ft-keyrow { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ft-keyrow code { flex: 1; min-width: 200px; font-size: 15px; letter-spacing: 1px; word-break: break-all; }
.ft-result-foot { margin: 12px 0 0; font-size: 11px; color: var(--color-text-tertiary); }
.ft-rules { padding: 16px 20px; border-radius: 14px; background: var(--color-surface-sunken, rgba(120,120,128,.07)); }
.ft-rules b { font-size: 13px; }
.ft-rules ul { margin: 10px 0 0; padding-left: 18px; font-size: 11.5px; line-height: 1.9; color: var(--color-text-secondary); }
.ft-rules li { word-break: break-word; }
@media (max-width: 700px) { .ft-row { grid-template-columns: 1fr; gap: 6px; } .ft-tab { flex: 1; justify-content: center; padding: 9px 8px; } }

/* ==========================================================================
   新华字典（汉字查询）
   ========================================================================== */
.st-grid-char { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.ch-search { display: flex; align-items: center; gap: 8px; box-sizing: border-box; padding: 0 12px; height: 44px; border: 1px solid var(--color-border, rgba(120,120,128,.22)); border-radius: 12px; background: var(--color-surface, #fff); }
.ch-search svg { width: 18px; height: 18px; flex: none; color: var(--color-text-tertiary); }
.ch-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--color-text-primary); font-size: 14px; }
.ch-card { display: flex; align-items: center; gap: 14px; padding: 16px; border: 1px solid var(--color-border, rgba(120,120,128,.18)); border-radius: 14px; background: var(--color-surface, #fff); }
.ch-card-char { flex: none; width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; font-size: 36px; font-weight: 600; border-radius: 12px; background: var(--color-primary-soft, rgba(0,113,227,.10)); color: var(--color-primary, #0071E3); }
.ch-card-info { flex: 1; min-width: 0; }
.ch-card-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ch-card-line b { font-size: 16px; }
.ch-tag { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--color-surface-sunken, rgba(120,120,128,.12)); color: var(--color-text-secondary); }
.ch-card-explain { margin: 6px 0 0; font-size: 12.5px; line-height: 1.7; color: var(--color-text-secondary); }
.ch-card-examples { margin: 4px 0 0; font-size: 11.5px; color: var(--color-text-tertiary); }
.ch-copy { flex: none; border: 0; background: transparent; color: var(--color-text-tertiary); cursor: pointer; padding: 6px; border-radius: 8px; }
.ch-copy:hover { color: var(--color-primary, #0071E3); background: var(--color-surface-sunken, rgba(120,120,128,.1)); }
.st-cat { box-sizing: border-box; height: 44px; border: 1px solid var(--color-border, rgba(120,120,128,.22)); border-radius: 12px; background: var(--color-surface, #fff); padding: 0 12px; font-size: 13px; color: var(--color-text-primary); }
.en-cat { font-size: 10.5px; padding: 1px 7px; border-radius: 999px; background: rgba(0,113,227,.10); color: var(--color-primary, #0071E3); margin-left: 6px; }

/* ============================== 导航网站 ============================== */
.nv { display: flex; flex-direction: column; gap: 16px; }
.nv-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.nv-title h2 { margin: 0 0 4px; font-size: 18px; color: var(--color-text-primary); }
.nv-title p { margin: 0; font-size: 12.5px; color: var(--color-text-tertiary); }
.nv-search { display: inline-flex; align-items: center; gap: 8px; box-sizing: border-box; height: 44px; min-width: 260px; padding: 0 14px; border: 1px solid var(--color-border, rgba(120,120,128,.22)); border-radius: 12px; background: var(--color-surface, #fff); }
.nv-search svg { width: 16px; height: 16px; color: var(--color-text-tertiary); flex: none; }
.nv-search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font-size: 13.5px; color: var(--color-text-primary); }
.nv-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.nv-tab { box-sizing: border-box; height: 36px; padding: 0 14px; border: 1px solid var(--color-border, rgba(120,120,128,.22)); border-radius: 999px; background: var(--color-surface, #fff); color: var(--color-text-primary); font-size: 13px; cursor: pointer; transition: all .15s; }
.nv-tab:hover { border-color: var(--color-primary, #0071E3); color: var(--color-primary, #0071E3); }
.nv-tab.on { background: var(--color-primary, #0071E3); border-color: var(--color-primary, #0071E3); color: #fff; }
.nv-body { display: flex; flex-direction: column; gap: 22px; }
.nv-group-head { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 14px; color: var(--color-text-primary); }
.nv-group-head span { font-size: 11px; font-weight: 400; color: var(--color-text-tertiary); background: var(--color-surface-sunken, rgba(120,120,128,.1)); border-radius: 999px; padding: 1px 8px; }
.nv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.nv-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--color-border, rgba(120,120,128,.18)); border-radius: 14px; background: var(--color-surface, #fff); text-decoration: none; transition: transform .15s, box-shadow .15s, border-color .15s; }
.nv-card:hover { transform: translateY(-2px); border-color: var(--color-primary, #0071E3); box-shadow: 0 8px 22px rgba(0,0,0,.08); }
.nv-logo { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; overflow: hidden; background: var(--color-surface-sunken, rgba(120,120,128,.1)); }
.nv-logo img { width: 24px; height: 24px; object-fit: contain; }
.nv-logo i { width: 100%; height: 100%; display: grid; place-items: center; font-style: normal; font-size: 16px; font-weight: 700; color: #fff; border-radius: 10px; }
.nv-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.nv-info b { font-size: 14px; color: var(--color-text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nv-info small { font-size: 11.5px; color: var(--color-text-tertiary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nv-go { flex: none; color: var(--color-text-tertiary); opacity: .6; }
.nv-go svg { width: 15px; height: 15px; }
.nv-card:hover .nv-go { color: var(--color-primary, #0071E3); opacity: 1; }

/* ============================== 地图示意 ============================== */
.mp { display: flex; flex-direction: column; gap: 16px; }
.mp-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.mp-title h2 { margin: 0 0 4px; font-size: 18px; color: var(--color-text-primary); }
.mp-title p { margin: 0; font-size: 12.5px; color: var(--color-text-tertiary); }
.mp-tabs { display: flex; gap: 8px; }
.mp-tab { box-sizing: border-box; height: 36px; padding: 0 18px; border: 1px solid var(--color-border, rgba(120,120,128,.22)); border-radius: 999px; background: var(--color-surface, #fff); color: var(--color-text-primary); font-size: 13px; cursor: pointer; }
.mp-tab.on { background: var(--color-primary, #0071E3); border-color: var(--color-primary, #0071E3); color: #fff; }
.mp-canvas { position: relative; border: 1px solid var(--color-border, rgba(120,120,128,.16)); border-radius: 16px; background: var(--color-surface, #fff); padding: 10px; }
.mp-svg { display: block; width: 100%; height: auto; }
.mp-tile { cursor: pointer; }
.mp-tile rect { transition: fill-opacity .15s, filter .15s; }
.mp-tile:hover rect, .mp-tile:focus-visible rect { fill-opacity: 1; filter: brightness(1.05); stroke: #fff; stroke-width: 1.5; }
.mp-tile-short { font-size: 17px; font-weight: 700; fill: #fff; pointer-events: none; }
.mp-tile-count { font-size: 9.5px; fill: rgba(255,255,255,.9); pointer-events: none; }
.mp-legend { display: flex; flex-wrap: wrap; gap: 10px 16px; padding: 10px 6px 2px; font-size: 12px; color: var(--color-text-tertiary); }
.mp-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.mp-legend-item i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.mp-note { margin: 0; font-size: 12px; color: var(--color-text-tertiary); line-height: 1.7; }
.mp-prov { display: flex; flex-direction: column; gap: 14px; }
.mp-prov-head { display: flex; align-items: center; gap: 12px; }
.mp-prov-head h3 { margin: 0; font-size: 16px; color: var(--color-text-primary); }
.mp-prov-count { font-size: 12px; color: var(--color-text-tertiary); background: var(--color-surface-sunken, rgba(120,120,128,.1)); border-radius: 999px; padding: 2px 10px; }
.mp-back { display: inline-flex; align-items: center; gap: 6px; box-sizing: border-box; height: 34px; padding: 0 12px; border: 1px solid var(--color-border, rgba(120,120,128,.22)); border-radius: 10px; background: var(--color-surface, #fff); color: var(--color-text-primary); font-size: 12.5px; cursor: pointer; }
.mp-back svg { width: 14px; height: 14px; }
.mp-back:hover { border-color: var(--color-primary, #0071E3); color: var(--color-primary, #0071E3); }
.mp-dot { cursor: pointer; }
.mp-dot circle { fill: var(--color-primary, #0071E3); fill-opacity: .85; stroke: #fff; stroke-width: 1.2; transition: r .12s; }
.mp-dot:hover circle { fill-opacity: 1; r: 6; }
.mp-dot.on circle { fill: #E8453C; fill-opacity: 1; }
.mp-dot-label { font-size: 10px; fill: var(--color-text-primary, #1d1d1f); pointer-events: none; }
.mp-dot.on .mp-dot-label { font-weight: 700; fill: #E8453C; }
.mp-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.mp-chip { display: inline-flex; align-items: baseline; gap: 5px; box-sizing: border-box; height: 34px; padding: 0 12px; border: 1px solid var(--color-border, rgba(120,120,128,.22)); border-radius: 10px; background: var(--color-surface, #fff); color: var(--color-text-primary); font-size: 13px; cursor: pointer; }
.mp-chip small { font-size: 10.5px; color: var(--color-text-tertiary); }
.mp-chip:hover { border-color: var(--color-primary, #0071E3); color: var(--color-primary, #0071E3); }
.mp-chip.on { background: var(--color-primary, #0071E3); border-color: var(--color-primary, #0071E3); color: #fff; }
.mp-chip.on small { color: rgba(255,255,255,.8); }
.mp-city { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.mp-kvs { display: flex; flex-direction: column; gap: 2px; }
.mp-kv { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 4px; border-bottom: 1px solid var(--color-border, rgba(120,120,128,.12)); font-size: 13px; }
.mp-kv span { color: var(--color-text-tertiary); }
.mp-kv b { color: var(--color-text-primary); font-weight: 600; text-align: right; }
.mp-grat line { stroke: var(--color-border, rgba(120,120,128,.18)); stroke-width: 1; }
.mp-land { fill: #A9C7E8; fill-opacity: .85; stroke: #fff; stroke-width: 1; }
.mp-land-label { font-size: 11px; fill: #2E4C6B; font-weight: 600; pointer-events: none; }
@media (max-width: 720px) { .mp-city { grid-template-columns: 1fr; } }

/* ============================== 交通 ============================== */
.tf { display: flex; flex-direction: column; gap: 18px; }
.tf-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.tf-title h2 { margin: 0 0 4px; font-size: 18px; color: var(--color-text-primary); }
.tf-title p { margin: 0; font-size: 12.5px; color: var(--color-text-tertiary); }
.tf-search { display: inline-flex; align-items: center; gap: 8px; box-sizing: border-box; height: 44px; min-width: 240px; padding: 0 14px; border: 1px solid var(--color-border, rgba(120,120,128,.22)); border-radius: 12px; background: var(--color-surface, #fff); }
.tf-search svg { width: 16px; height: 16px; color: var(--color-text-tertiary); flex: none; }
.tf-search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font-size: 13.5px; color: var(--color-text-primary); }
.tf-ranks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.tf-rank-card { border: 1px solid var(--color-border, rgba(120,120,128,.16)); border-radius: 16px; background: var(--color-surface, #fff); padding: 14px 16px; }
.tf-rank-head { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 14px; color: var(--color-text-primary); }
.tf-rank-head svg { width: 16px; height: 16px; color: var(--color-primary, #0071E3); }
.tf-rank-head small { margin-left: auto; font-size: 11px; font-weight: 400; color: var(--color-text-tertiary); }
.tf-rank-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.tf-rank-list li { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.tf-rank-no { flex: none; width: 18px; height: 18px; border-radius: 6px; display: grid; place-items: center; font-size: 11px; color: var(--color-text-tertiary); background: var(--color-surface-sunken, rgba(120,120,128,.1)); }
.tf-rank-no.top { background: var(--color-primary, #0071E3); color: #fff; }
.tf-rank-name { flex: none; width: 96px; color: var(--color-text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tf-rank-name small { color: var(--color-text-tertiary); margin-left: 4px; font-size: 10px; }
.tf-rank-track { flex: 1; height: 6px; border-radius: 999px; background: var(--color-surface-sunken, rgba(120,120,128,.12)); overflow: hidden; }
.tf-rank-track i { display: block; height: 100%; border-radius: 999px; background: var(--color-primary, #0071E3); }
.tf-rank-track i.air { background: #2E9E4F; }
.tf-rank-track i.metro { background: #E6852B; }
.tf-rank-track i.hsr { background: #2F6FEB; }
.tf-rank-list b { flex: none; width: 54px; text-align: right; font-size: 12px; color: var(--color-text-primary); }
.tf-prov { display: flex; flex-wrap: wrap; gap: 8px; }
.tf-chip { box-sizing: border-box; height: 34px; padding: 0 14px; border: 1px solid var(--color-border, rgba(120,120,128,.22)); border-radius: 999px; background: var(--color-surface, #fff); color: var(--color-text-primary); font-size: 12.5px; cursor: pointer; }
.tf-chip:hover { border-color: var(--color-primary, #0071E3); color: var(--color-primary, #0071E3); }
.tf-chip.on { background: var(--color-primary, #0071E3); border-color: var(--color-primary, #0071E3); color: #fff; }
.tf-city-meta { margin: 10px 0 0; font-size: 12px; color: var(--color-text-tertiary); }
.tf-grid { margin-top: 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.tf-card { text-align: left; border: 1px solid var(--color-border, rgba(120,120,128,.18)); border-radius: 14px; background: var(--color-surface, #fff); padding: 12px 14px; cursor: pointer; transition: transform .15s, border-color .15s, box-shadow .15s; }
.tf-card:hover { transform: translateY(-2px); border-color: var(--color-primary, #0071E3); box-shadow: 0 8px 22px rgba(0,0,0,.07); }
.tf-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tf-card-top b { font-size: 15px; color: var(--color-text-primary); }
.tf-badges { display: inline-flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.tf-badge { font-size: 10px; padding: 1px 7px; border-radius: 999px; white-space: nowrap; }
.tf-badge.hsr { background: rgba(47,111,235,.12); color: #2F6FEB; }
.tf-badge.air { background: rgba(46,158,79,.12); color: #2E9E4F; }
.tf-badge.metro { background: rgba(230,133,43,.14); color: #C46A16; }
.tf-card-sub { margin: 8px 0 0; font-size: 11.5px; color: var(--color-text-tertiary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 详情弹层 */
.tf-modal { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.42); display: grid; place-items: center; padding: 20px; }
.tf-modal-card { width: min(640px, 100%); max-height: 86vh; overflow: auto; background: var(--color-surface, #fff); border-radius: 18px; box-shadow: 0 24px 60px rgba(0,0,0,.28); }
.tf-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 12px; position: sticky; top: 0; background: var(--color-surface, #fff); border-bottom: 1px solid var(--color-border, rgba(120,120,128,.14)); }
.tf-modal-head h3 { margin: 0; font-size: 19px; color: var(--color-text-primary); }
.tf-modal-head span { font-size: 12px; color: var(--color-text-tertiary); }
.tf-modal-x { border: 0; background: transparent; color: var(--color-text-tertiary); cursor: pointer; padding: 6px; border-radius: 8px; }
.tf-modal-x:hover { background: var(--color-surface-sunken, rgba(120,120,128,.12)); color: var(--color-text-primary); }
.tf-modal-body { padding: 8px 20px 22px; display: flex; flex-direction: column; gap: 18px; }
.tf-sec h4 { display: flex; align-items: center; gap: 8px; margin: 8px 0 10px; font-size: 14px; color: var(--color-text-primary); }
.tf-sec h4 svg { width: 16px; height: 16px; color: var(--color-primary, #0071E3); }
.tf-sec h4 small { font-size: 11px; font-weight: 400; color: var(--color-text-tertiary); }
.tf-air-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tf-air-list li { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--color-text-primary); padding: 8px 10px; border: 1px solid var(--color-border, rgba(120,120,128,.14)); border-radius: 10px; }
.tf-air-district { font-size: 11px; color: #2E9E4F; background: rgba(46,158,79,.1); padding: 1px 8px; border-radius: 999px; }
.tf-air-code { margin-left: auto; font-size: 11px; color: var(--color-text-tertiary); font-family: ui-monospace, monospace; }
.tf-stations { display: flex; flex-wrap: wrap; gap: 6px; }
.tf-station { font-size: 12px; color: var(--color-text-primary); background: var(--color-surface-sunken, rgba(120,120,128,.1)); padding: 3px 10px; border-radius: 8px; }
.tf-metro-svg { width: 100%; height: auto; }
.tf-metro-label { font-size: 10.5px; fill: var(--color-text-tertiary, #8e8e93); }
@media (max-width: 860px) { .tf-ranks { grid-template-columns: 1fr; } }
.ct-rank-row.empty .ct-rank-name, .ct-rank-row.empty b { color: var(--color-text-tertiary); }
.ct-rank-row.empty .ct-rank-track { opacity: .4; }
.ct-map-svg { width: 100%; height: auto; display: block; }
.ct-map-dot circle { fill: var(--color-primary, #0071E3); fill-opacity: .8; stroke: #fff; stroke-width: 1.1; }
.ct-map-dot text { font-size: 9.5px; fill: var(--color-text-tertiary, #8e8e93); }
.ct-map-dot.on circle { fill: #E8453C; fill-opacity: 1; }
.ct-map-dot.on text { fill: #E8453C; font-weight: 700; }

/* ============================== 地图 v2（真实中国/世界，可缩放） ============================== */
.mp-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.mp-zoom { display: inline-flex; gap: 6px; }
.mp-zbtn { box-sizing: border-box; width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--color-border, rgba(120,120,128,.22)); border-radius: 10px; background: var(--color-surface, #fff); color: var(--color-text-primary); font-size: 17px; line-height: 1; cursor: pointer; }
.mp-zbtn svg { width: 15px; height: 15px; }
.mp-zbtn:hover { border-color: var(--color-primary, #0071E3); color: var(--color-primary, #0071E3); }
.mp-stage { position: relative; border: 1px solid var(--color-border, rgba(120,120,128,.16)); border-radius: 16px; background: linear-gradient(180deg, #EEF4FB 0%, #E7EFF8 100%); padding: 8px; overflow: hidden; }
.mp-svg { display: block; width: 100%; height: auto; cursor: grab; touch-action: none; background: transparent; }
.mp-svg.grabbing { cursor: grabbing; }
.mp-prov { stroke: #ffffff; stroke-width: .7; vector-effect: non-scaling-stroke; cursor: pointer; transition: filter .12s; }
.mp-prov:hover { filter: brightness(0.96) saturate(1.1); }
.mp-plabel { font-size: 10px; font-weight: 600; fill: #5b6a7a; pointer-events: none; user-select: none; }
.mp-cdot { cursor: pointer; }
.mp-cdot circle { fill: var(--color-primary, #0071E3); stroke: #fff; stroke-width: 1; }
.mp-cdot text { font-size: 10px; fill: #17324d; font-weight: 600; pointer-events: none; user-select: none; }
.mp-cdot:hover circle { fill: #E8453C; }
.mp-land { stroke: #ffffff; stroke-width: .6; vector-effect: non-scaling-stroke; }
.mp-clabel { font-size: 10px; fill: #33506e; font-weight: 600; pointer-events: none; user-select: none; }
.mp-modal { position: absolute; inset: 0; background: rgba(0,0,0,.35); display: grid; place-items: center; padding: 16px; z-index: 5; }
.mp-modal-card { width: min(420px, 96%); background: var(--color-surface, #fff); border-radius: 16px; box-shadow: 0 20px 50px rgba(0,0,0,.25); padding: 18px 20px 20px; }
.mp-modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.mp-modal-head h3 { margin: 0; font-size: 18px; color: var(--color-text-primary); }
.mp-modal-x { border: 0; background: transparent; color: var(--color-text-tertiary); cursor: pointer; padding: 6px; border-radius: 8px; }
.mp-modal-x:hover { background: var(--color-surface-sunken, rgba(120,120,128,.12)); color: var(--color-text-primary); }
.mp-modal .mp-kv { display: flex; justify-content: space-between; gap: 12px; padding: 8px 2px; border-bottom: 1px solid var(--color-border, rgba(120,120,128,.12)); font-size: 13px; }
.mp-modal .mp-kv span { color: var(--color-text-tertiary); }
.mp-modal .mp-kv b { color: var(--color-text-primary); text-align: right; }

/* ============================== 交通 v2（地铁/高铁/飞机 左右布局） ============================== */
.tf2 { display: flex; flex-direction: column; gap: 16px; }
.tf2-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.tf2-title h2 { margin: 0 0 4px; font-size: 18px; color: var(--color-text-primary); }
.tf2-title p { margin: 0; font-size: 12.5px; color: var(--color-text-tertiary); }
.tf2-tabs { display: inline-flex; gap: 6px; padding: 4px; border-radius: 12px; background: var(--color-surface-sunken, rgba(120,120,128,.1)); }
.tf2-tab { box-sizing: border-box; height: 38px; padding: 0 22px; border: 0; border-radius: 9px; background: transparent; color: var(--color-text-secondary, #555); font-size: 14px; cursor: pointer; transition: all .15s; }
.tf2-tab.on { background: var(--color-surface, #fff); color: var(--color-primary, #0071E3); font-weight: 600; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.tf2-body { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.tf2-pane { border: 1px solid var(--color-border, rgba(120,120,128,.16)); border-radius: 16px; background: var(--color-surface, #fff); padding: 14px 16px; }
.tf2-pane-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.tf2-pane-head h3 { margin: 0; font-size: 15px; color: var(--color-text-primary); }
.tf2-pane-head h3 small { font-size: 11.5px; font-weight: 400; color: var(--color-text-tertiary); margin-left: 6px; }
.tf2-search { display: inline-flex; align-items: center; gap: 7px; box-sizing: border-box; height: 38px; min-width: 200px; padding: 0 12px; border: 1px solid var(--color-border, rgba(120,120,128,.22)); border-radius: 10px; background: var(--color-surface, #fff); }
.tf2-search svg { width: 15px; height: 15px; color: var(--color-text-tertiary); flex: none; }
.tf2-search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font-size: 13px; color: var(--color-text-primary); }
.tf2-list { display: flex; flex-direction: column; gap: 8px; max-height: 62vh; overflow: auto; padding-right: 4px; }
.tf2-city { display: flex; align-items: center; gap: 10px; text-align: left; padding: 10px 12px; border: 1px solid var(--color-border, rgba(120,120,128,.16)); border-radius: 12px; background: var(--color-surface, #fff); cursor: pointer; transition: border-color .15s, transform .15s; }
.tf2-city:hover { border-color: var(--color-primary, #0071E3); transform: translateX(2px); }
.tf2-city-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tf2-city-main b { font-size: 14.5px; color: var(--color-text-primary); }
.tf2-city-main small { font-size: 11.5px; color: var(--color-text-tertiary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tf2-city-badges { display: inline-flex; gap: 4px; flex: none; }
.tf2-badge { font-size: 10px; padding: 1px 7px; border-radius: 999px; white-space: nowrap; }
.tf2-badge.hsr { background: rgba(47,111,235,.12); color: #2F6FEB; }
.tf2-badge.air { background: rgba(46,158,79,.12); color: #2E9E4F; }
.tf2-badge.metro { background: rgba(230,133,43,.14); color: #C46A16; }
.tf2-city-go { flex: none; color: var(--color-text-tertiary); opacity: .5; }
.tf2-city:hover .tf2-city-go { color: var(--color-primary, #0071E3); opacity: 1; }
.tf2-rank-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tf2-rank-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.tf2-rank-no { flex: none; width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; font-size: 11px; color: var(--color-text-tertiary); background: var(--color-surface-sunken, rgba(120,120,128,.1)); }
.tf2-rank-no.top { background: var(--color-primary, #0071E3); color: #fff; }
.tf2-rank-name { flex: none; width: 104px; color: var(--color-text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tf2-rank-name small { color: var(--color-text-tertiary); margin-left: 4px; font-size: 10px; }
.tf2-rank-track { flex: 1; height: 7px; border-radius: 999px; background: var(--color-surface-sunken, rgba(120,120,128,.12)); overflow: hidden; }
.tf2-rank-track i { display: block; height: 100%; border-radius: 999px; background: var(--color-primary, #0071E3); }
.tf2-rank-row b { flex: none; width: 52px; text-align: right; font-size: 12px; color: var(--color-text-primary); }
.tf2-note { margin: 12px 0 0; font-size: 11.5px; color: var(--color-text-tertiary); line-height: 1.7; }
/* 详情弹层 */
.tf2-modal { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.42); display: grid; place-items: center; padding: 20px; }
.tf2-modal-card { width: min(720px, 100%); max-height: 88vh; overflow: auto; background: var(--color-surface, #fff); border-radius: 18px; box-shadow: 0 24px 60px rgba(0,0,0,.28); }
.tf2-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 12px; position: sticky; top: 0; background: var(--color-surface, #fff); border-bottom: 1px solid var(--color-border, rgba(120,120,128,.14)); z-index: 1; }
.tf2-modal-head h3 { margin: 0; font-size: 19px; color: var(--color-text-primary); }
.tf2-modal-head span { font-size: 12px; color: var(--color-text-tertiary); }
.tf2-modal-x { border: 0; background: transparent; color: var(--color-text-tertiary); cursor: pointer; padding: 6px; border-radius: 8px; }
.tf2-modal-x:hover { background: var(--color-surface-sunken, rgba(120,120,128,.12)); color: var(--color-text-primary); }
.tf2-modal-body { padding: 8px 20px 22px; display: flex; flex-direction: column; gap: 16px; }
.tf2-sec h4 { display: flex; align-items: center; gap: 8px; margin: 8px 0 10px; font-size: 14px; color: var(--color-text-primary); }
.tf2-sec h4 svg { width: 16px; height: 16px; color: var(--color-primary, #0071E3); }
.tf2-sec h4 small { font-size: 11px; font-weight: 400; color: var(--color-text-tertiary); }
.tf2-airs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tf2-airs li { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--color-text-primary); padding: 8px 10px; border: 1px solid var(--color-border, rgba(120,120,128,.14)); border-radius: 10px; }
.tf2-district { font-size: 11px; color: #2E9E4F; background: rgba(46,158,79,.1); padding: 1px 8px; border-radius: 999px; }
.tf2-code { margin-left: auto; font-size: 11px; color: var(--color-text-tertiary); font-family: ui-monospace, monospace; }
.tf2-stations { display: flex; flex-wrap: wrap; gap: 6px; }
.tf2-stations span { font-size: 12px; color: var(--color-text-primary); background: var(--color-surface-sunken, rgba(120,120,128,.1)); padding: 3px 10px; border-radius: 8px; }
/* 地铁线路示意 */
.mt-wrap { position: relative; border: 1px solid var(--color-border, rgba(120,120,128,.14)); border-radius: 12px; background: var(--color-surface-sunken, #f6f7f9); overflow: hidden; }
.mt-toolbar { position: absolute; right: 8px; top: 8px; display: flex; gap: 6px; z-index: 2; }
.mt-zbtn { width: 30px; height: 30px; border: 1px solid var(--color-border, rgba(120,120,128,.22)); border-radius: 8px; background: rgba(255,255,255,.92); color: var(--color-text-primary); cursor: pointer; font-size: 15px; display: grid; place-items: center; }
.mt-zbtn:hover { color: var(--color-primary, #0071E3); border-color: var(--color-primary, #0071E3); }
.mt-svg { display: block; width: 100%; height: auto; cursor: grab; touch-action: none; }
.mt-svg.grabbing { cursor: grabbing; }
.mt-ln { font-size: 10.5px; font-weight: 600; }
.mt-st { cursor: pointer; }
.mt-st:hover { r: 6; }
.mt-tip { position: absolute; transform: translate(-50%, -100%); background: rgba(20,24,30,.9); color: #fff; font-size: 11.5px; padding: 4px 9px; border-radius: 7px; pointer-events: none; opacity: 0; transition: opacity .15s; white-space: nowrap; z-index: 3; }
.mt-tip.on { opacity: 1; }
@media (max-width: 820px) { .tf2-body { grid-template-columns: 1fr; } .tf2-list { max-height: 40vh; } }

/* ============================== 地图 v3（分级设色 + 点击信息，无缩放） ============================== */
.mp-main { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.mp-canvas { position: relative; border: 1px solid var(--color-border, rgba(120,120,128,.16)); border-radius: 16px; background: linear-gradient(180deg,#EDF4FB,#E6EFF8); padding: 8px; }
.mp-svg { display: block; width: 100%; height: auto; }
.mp-prov { stroke: #ffffff; stroke-width: .8; cursor: pointer; transition: filter .12s; }
.mp-prov:hover { filter: brightness(0.94) saturate(1.05); }
.mp-prov.sel { stroke: #E8453C; stroke-width: 2; filter: brightness(0.96); }
.mp-country { stroke: #ffffff; stroke-width: .6; cursor: pointer; transition: filter .12s; }
.mp-country:hover { filter: brightness(0.92); }
.mp-country.sel { stroke: #E8453C; stroke-width: 1.6; }
.mp-plabel { font-size: 10px; font-weight: 600; fill: #46586a; pointer-events: none; user-select: none; }
.mp-tip { position: absolute; transform: translate(-50%, -100%); background: rgba(20,24,30,.92); color: #fff; font-size: 12px; padding: 4px 10px; border-radius: 8px; pointer-events: none; opacity: 0; transition: opacity .12s; white-space: nowrap; z-index: 4; }
.mp-tip.on { opacity: 1; }
.mp-legend { display: flex; align-items: center; gap: 5px; padding: 8px 6px 2px; font-size: 11px; color: var(--color-text-tertiary); }
.mp-legend i { width: 20px; height: 10px; border-radius: 2px; display: inline-block; }
.mp-info { border: 1px solid var(--color-border, rgba(120,120,128,.16)); border-radius: 16px; background: var(--color-surface, #fff); padding: 16px; min-height: 220px; }
.mp-info-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; color: var(--color-text-tertiary); padding: 40px 8px; }
.mp-info-empty svg { width: 26px; height: 26px; opacity: .5; }
.mp-info-empty b { color: var(--color-text-primary); font-size: 14px; }
.mp-info-empty span { font-size: 12px; }
.mp-info-head { border-bottom: 1px solid var(--color-border, rgba(120,120,128,.12)); padding-bottom: 10px; margin-bottom: 10px; }
.mp-info-head h3 { margin: 0; font-size: 18px; color: var(--color-text-primary); }
.mp-info-head span { font-size: 12px; color: var(--color-text-tertiary); }
.mp-info-kv { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--color-border, rgba(120,120,128,.08)); font-size: 13px; }
.mp-info-kv span { color: var(--color-text-tertiary); }
.mp-info-kv b { color: var(--color-text-primary); text-align: right; }
.mp-info-intro { margin: 12px 0 0; font-size: 12.5px; line-height: 1.8; color: var(--color-text-secondary, #555); }
@media (max-width: 820px) { .mp-main { grid-template-columns: 1fr; } }

/* 交通 v2 布局增强：左右等高、内部滚动、右侧排行放大 */
.tf2-body { align-items: stretch; }
.tf2-pane { height: calc(100vh - 240px); min-height: 380px; display: flex; flex-direction: column; }
.tf2-left .tf2-list { flex: 1; max-height: none; overflow: auto; }
.tf2-right .tf2-rank-list { flex: 1; overflow: auto; padding-right: 4px; }
.tf2-city { padding: 12px 14px; }
.tf2-city-main b { font-size: 15px; }
.tf2-city-main small { font-size: 12px; }
.tf2-rank-list { gap: 2px; }
.tf2-rank-row { font-size: 13.5px; padding: 10px 4px; border-bottom: 1px solid var(--color-border, rgba(120,120,128,.08)); }
.tf2-rank-no { width: 24px; height: 24px; font-size: 12px; }
.tf2-rank-name { width: 132px; font-size: 13.5px; }
.tf2-rank-name small { font-size: 11px; }
.tf2-rank-track { height: 10px; }
.tf2-rank-row b { width: 72px; font-size: 13.5px; }
.tf2-pane-head h3 { font-size: 16px; }
/* 地铁网络示意 */
.mt-line { fill: none; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.mt-inter { fill: #fff; stroke: #3a4a5a; stroke-width: 2; }
.mt-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; padding: 8px 6px 2px; font-size: 11.5px; color: var(--color-text-secondary, #555); }
.mt-legend span { display: inline-flex; align-items: center; gap: 5px; }
.mt-legend i { width: 14px; height: 4px; border-radius: 2px; display: inline-block; }

/* 地图：信息面板点击后才出现 */
.mp-main { grid-template-columns: 1fr; }
.mp-main .mp-info { display: none; }
.mp-main.has-info { grid-template-columns: minmax(0, 1fr) 300px; }
.mp-main.has-info .mp-info { display: block; }
.mp-info-head { position: relative; }
.mp-info-x { position: absolute; right: 0; top: 0; width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--color-border, rgba(120,120,128,.22)); border-radius: 50%; background: var(--color-surface, #fff); color: var(--color-text-tertiary); cursor: pointer; }
.mp-info-x:hover { color: var(--color-text-primary); border-color: var(--color-text-tertiary); }
.mp-info-x svg { width: 13px; height: 13px; }

/* 诗词分页 */
.pt-size { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--color-text-tertiary); }
.pt-size select { box-sizing: border-box; height: 44px; border: 1px solid var(--color-border, rgba(120,120,128,.22)); border-radius: 12px; background: var(--color-surface, #fff); padding: 0 10px; font-size: 13px; color: var(--color-text-primary); }
.pt-pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 18px; }
.pt-pg { box-sizing: border-box; height: 38px; padding: 0 16px; border: 1px solid var(--color-border, rgba(120,120,128,.22)); border-radius: 10px; background: var(--color-surface, #fff); color: var(--color-text-primary); font-size: 13px; cursor: pointer; }
.pt-pg:hover:not(:disabled) { border-color: var(--color-primary, #0071E3); color: var(--color-primary, #0071E3); }
.pt-pg:disabled { opacity: .45; cursor: not-allowed; }
.pt-pg-info { font-size: 13px; color: var(--color-text-tertiary); }

/* 交通：取消内部小滚动，整页自然滚动；地铁全屏放大 */
.tf2-pane { height: auto; min-height: 0; }
.tf2-left .tf2-list { overflow: visible; }
.tf2-right .tf2-rank-list { overflow: visible; }
.mt-wrap.mt-full { position: fixed; inset: 0; z-index: 90; border-radius: 0; background: var(--color-surface, #fff); padding: 24px; }
.mt-wrap.mt-full .mt-svg { width: 100%; height: calc(100vh - 48px); }
.mt-wrap.mt-full .mt-toolbar { right: 24px; top: 18px; }

/* 城市详情：顶部标题栏 + 自然的关闭按钮（不再压在封面图上） */
.ct-modal-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -4px 0 14px; padding-bottom: 12px; border-bottom: 1px solid var(--color-border, rgba(120,120,128,.14)); }
.ct-modal-title { font-size: 15px; font-weight: 600; color: var(--color-text-primary); }
.ct-close { position: static; right: auto; top: auto; width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--color-border, rgba(120,120,128,.22)); border-radius: 50%; background: var(--color-surface, #fff); color: var(--color-text-secondary); cursor: pointer; }
.ct-close:hover { color: var(--color-text-primary); border-color: var(--color-text-tertiary); }
.ct-close svg { width: 15px; height: 15px; }
/* 交通详情弹层关闭按钮更明显 */
.tf2-modal-x { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--color-border, rgba(120,120,128,.22)); border-radius: 50%; background: var(--color-surface, #fff); color: var(--color-text-secondary); }
.tf2-modal-x svg { width: 15px; height: 15px; }
.tf2-modal-x:hover { color: var(--color-text-primary); border-color: var(--color-text-tertiary); }

/* 诗词：分页并入 meta 行，字号与 meta 一致 */
.pt-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 2px 0 4px; }
.pt-bar .st-meta { margin: 0; }
.pt-bar-right { display: inline-flex; align-items: center; gap: 10px; }
.pt-size { font-size: 12.5px; color: var(--color-text-tertiary); }
.pt-size select { height: 30px; padding: 0 8px; border-radius: 8px; font-size: 12.5px; margin-left: 4px; }
.pt-pager { margin: 0; gap: 8px; justify-content: flex-end; }
.pt-pg { height: 30px; padding: 0 12px; font-size: 12.5px; border-radius: 8px; }

/* 关闭按钮：与首页天气弹窗一致——平时与背景同色（透明），悬停才出现方形浅底 */
.ct-close, .tf2-modal-x {
  width: 32px; height: 32px;
  border: 1px solid transparent;
  border-radius: var(--radius-control, 8px);
  background: transparent;
  color: var(--color-text-secondary);
  box-shadow: none;
}
.ct-close:hover, .tf2-modal-x:hover {
  background: var(--color-hover, rgba(120,120,128,.12));
  color: var(--color-text-primary);
  border-color: transparent;
}
.ct-close svg, .tf2-modal-x svg { width: 16px; height: 16px; }

/* 城市详情滚动闪烁修复：去掉毛玻璃滤镜 */
.ct-modal { backdrop-filter: none; background: rgba(0,0,0,.46); }
.ct-modal-card { overscroll-behavior: contain; }

/* 汉字默认只展示两排（4 列 × 2 行） */
.st-grid-char.ch-default { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* 地图：信息卡片改为覆盖层，不挤压地图；地图居中放大；关闭键改为方形悬停 */
.mp-main { position: relative; grid-template-columns: 1fr; }
.mp-main.has-info { grid-template-columns: 1fr; }
.mp-main .mp-info { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); width: 300px; max-height: calc(100% - 28px); overflow: auto; box-shadow: 0 16px 40px rgba(0,0,0,.18); }
.mp-canvas { max-width: 1120px; margin: 0 auto; }
.mp-info-x { border-radius: var(--radius-control, 8px); border: 1px solid transparent; background: transparent; color: var(--color-text-tertiary); }
.mp-info-x:hover { background: var(--color-hover, rgba(120,120,128,.12)); color: var(--color-text-primary); border-color: transparent; }

/* 重要日子（原倒数日）重设计 */
.days-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.days-head-title h2 { margin: 0 0 4px; font-size: 18px; color: var(--color-text-primary); }
.days-head-title p { margin: 0; font-size: 12.5px; color: var(--color-text-tertiary); }
.days-modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; background: rgba(0,0,0,.42); }
.days-modal[aria-hidden="true"] { display: none; }
.days-modal-card { width: min(560px, 100%); max-height: 88vh; overflow: auto; background: var(--color-surface, #fff); border-radius: 18px; box-shadow: 0 24px 60px rgba(0,0,0,.28); padding: 18px 20px 22px; }
.days-modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.days-modal-head h3 { margin: 0; font-size: 17px; color: var(--color-text-primary); }
.days-modal-x { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid transparent; border-radius: var(--radius-control, 8px); background: transparent; color: var(--color-text-tertiary); cursor: pointer; }
.days-modal-x:hover { background: var(--color-hover, rgba(120,120,128,.12)); color: var(--color-text-primary); }
.days-modal-x svg { width: 15px; height: 15px; }
/* 国家信息副标题：允许换行，排版更清楚 */
.fin-country-sub { white-space: normal; line-height: 1.7; }

/* ============ 地图 v4：省名白字描边、国名标注、画布更大 ============ */
.mp-canvas { max-width: none; width: 100%; margin: 0; padding: 10px 12px; border-radius: 18px; }
/* 中国：省名统一白色，深色描边保证浅色省份上也看得清 */
.mp-plabel { fill: #ffffff; font-size: 10.5px; font-weight: 700; stroke: rgba(10,32,62,.55); stroke-width: 2; paint-order: stroke; }
/* 世界：国名深蓝字 + 白色描边，压在地形上不糊 */
.mp-clabel { fill: #14304f; font-weight: 700; stroke: rgba(255,255,255,.92); stroke-width: 2.6; paint-order: stroke; letter-spacing: .5px; }
.mp-rank-scope, .ct-rank-scope { margin: 0 0 10px; font-size: 12.5px; color: var(--color-text-tertiary); }

/* ============ 重要日子：假期开关、下一个假期条、法定假日卡片 ============ */
.days-head-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.days-switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; font-size: 13px; color: var(--color-text-secondary); }
.days-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.days-switch-track { box-sizing: border-box; width: 38px; height: 22px; border-radius: 999px; background: var(--color-surface-sunken, rgba(120,120,128,.2)); position: relative; transition: background .18s; flex: none; }
.days-switch-track i { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.22); transition: transform .18s; }
.days-switch input:checked + .days-switch-track { background: var(--color-primary, #0071E3); }
.days-switch input:checked + .days-switch-track i { transform: translateX(16px); }
.days-switch-text { color: var(--color-text-primary); font-weight: 600; }

.days-next { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 16px; padding: 12px 16px; border-radius: 14px; border: 1px solid rgba(201,148,46,.35); background: linear-gradient(90deg, rgba(201,148,46,.12), rgba(201,148,46,.03)); }
.days-next-tag { font-size: 12px; font-weight: 700; color: #9a6f18; letter-spacing: .04em; }
.days-next-name { font-size: 16px; color: var(--color-text-primary); }
.days-next-when { font-size: 13px; color: var(--color-text-secondary); }
.days-next-num { margin-left: auto; font-size: 13px; color: var(--color-text-secondary); }
.days-next-num b { font-size: 20px; color: #B8791A; font-variant-numeric: tabular-nums; }
.days-next-empty { font-size: 13px; color: var(--color-text-tertiary); }

/* 法定假日：金色底 + 左侧金边，和自定义记录一眼分得开 */
.days-card.is-holiday { background: linear-gradient(180deg, rgba(201,148,46,.07), rgba(201,148,46,.02)); border-color: rgba(201,148,46,.28); }
.days-card.is-holiday .days-tag { background: rgba(201,148,46,.16); color: #9a6f18; }
/* 已过去的假期：整卡灰掉 + 名称划横线，不用再看 */
.days-card.is-past { opacity: .55; background: var(--color-surface); border-color: var(--color-border); }
.days-card.is-past .days-card-icon { filter: grayscale(1); }
.days-card.is-past .days-card-name { text-decoration: line-through; color: var(--color-text-tertiary); }
.days-card.is-past .days-big { font-size: 24px; color: var(--color-text-tertiary); }
/* 「已过 / 待定」这类文字值，字号要收小一点 */
.days-big { word-break: keep-all; }

/* 每年固定：月 / 日两个下拉 */
.days-md { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.days-md select { width: 110px; }
.days-hint-inline { font-size: 12px; color: var(--color-text-tertiary); }
.days-next-pending { flex-basis: 100%; font-size: 12px; color: #9a6f18; opacity: .9; }

/* 地图：南海诸岛小图 */
.mp-inset { position: absolute; right: 14px; bottom: 46px; width: 92px; padding: 4px 4px 3px; border: 1px solid rgba(30,80,145,.26); border-radius: 8px; background: rgba(255,255,255,.9); text-align: center; box-shadow: 0 2px 8px rgba(20,50,90,.08); }
.mp-inset svg { display: block; width: 100%; height: auto; }
.mp-inset span { display: block; margin-top: 2px; font-size: 9.5px; line-height: 1.2; color: #3f5872; letter-spacing: .3px; }
/* 重要日子：标题交给外层页面，这里只留统计与开关 */
.days-head-sub { margin: 0; font-size: 12.5px; color: var(--color-text-tertiary); }
.days-next[hidden] { display: none; }
.mp-inset { width: 104px; background: linear-gradient(180deg,#F4F9FF,#EAF3FC); }
.mp-inset .mp-nine { fill: #5b86b5; stroke: none; }
.mp-inset .mp-prov { stroke-width: 0.6; }
.mp-clabel { font-size: inherit; letter-spacing: .2px; }

/* ============ 弹层/侧栏：顶部标题栏固定，只有内容区滚动 ============ */
/* 城市详情：头部（城市详情 + ✕）常驻，下面 #ct-detail 自己滚，滚到底也能直接关 */
.ct-modal-card {
  display: flex;
  flex-direction: column;
  max-height: 86vh;
  padding: 0;
  overflow: hidden;
}
.ct-modal-top {
  flex: none;
  margin: 0;
  padding: 14px 20px 12px;
  border-bottom: 1px solid var(--color-border, rgba(120,120,128,.14));
  background: var(--color-surface, #fff);
  border-radius: 20px 20px 0 0;
  z-index: 2;
}
#ct-detail {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 22px 24px;
  scrollbar-width: thin;
}

/* 重要日子编辑弹层：同样处理 */
.days-modal-card { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.days-modal-head {
  flex: none;
  margin: 0;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--color-border, rgba(120,120,128,.14));
  background: var(--color-surface, #fff);
  border-radius: 18px 18px 0 0;
}
.days-modal-card #d-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 16px 20px 20px; overscroll-behavior: contain; }

/* 地图侧栏：固定在视口右侧，页面滚到底也还在；标题常驻，内容区自己滚 */
.mp-main.has-info .mp-info {
  display: flex;
  position: fixed;
  right: 28px;
  top: 50%;
  transform: translateY(-50%);
  width: 320px;
  max-height: calc(100vh - 190px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  z-index: 20;
  box-shadow: 0 18px 44px rgba(0,0,0,.20);
}
.mp-info-head {
  flex: none;
  margin: 0;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--color-border, rgba(120,120,128,.14));
  background: var(--color-surface, #fff);
}
.mp-info-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 4px 16px 16px; overscroll-behavior: contain; }
@media (max-width: 1280px) { .mp-main .mp-info { width: 280px; right: 16px; } }
@media (max-width: 860px) {
  .mp-main .mp-info { right: 10px; left: 10px; width: auto; top: 76px; max-height: calc(100vh - 100px); }
}

/* 交通详情弹层：统一成「头部固定 + 内容滚动」 */
.tf2-modal-card { display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.tf2-modal-head {
  position: static;
  flex: none;
  margin: 0;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--color-border, rgba(120,120,128,.14));
  border-radius: 18px 18px 0 0;
}
.tf2-modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px 20px 22px; }

/* 重要日子表单：图标与主题色占满整行，避免半栏里挤成一团 */
.days-form .field:nth-child(n+4) { grid-column: 1 / -1; }
.days-form .toolbar { grid-column: 1 / -1; }

/* 城市排行：指标 → 统计范围 → 数据 之间留出呼吸感 */
.ct-rank-bar { margin: 0 0 14px; }
.ct-rank-scope {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--color-surface-sunken, rgba(120,120,128,.07));
  font-size: 12.5px;
  color: var(--color-text-secondary);
  line-height: 1.5;
}
.ct-rank-body { padding-top: 2px; }

/* 城市详情标题栏：显示当前城市名 + 省份·车牌 */
.ct-modal-heading { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ct-modal-title { font-size: 17px; font-weight: 700; color: var(--color-text-primary); }
.ct-modal-sub { font-size: 12px; color: var(--color-text-tertiary); }

/* 交通：官方线网图（有图就用官方图，可点开放大） */
.mt-real { margin: 0; }
.mt-real img { display: block; width: 100%; height: auto; border: 1px solid var(--color-border, rgba(120,120,128,.18)); border-radius: 12px; background: #fff; cursor: zoom-in; }
.mt-real figcaption { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; font-size: 11.5px; color: var(--color-text-tertiary); }
.mt-real-link { color: var(--color-primary, #0071E3); text-decoration: none; }
.mt-real-link:hover { text-decoration: underline; }
.mt-lb { position: fixed; inset: 0; z-index: 130; display: flex; flex-direction: column; background: rgba(10,12,16,.94); }
.mt-lb-bar { flex: none; display: flex; align-items: center; gap: 12px; padding: 12px 18px; color: #fff; background: rgba(255,255,255,.06); border-bottom: 1px solid rgba(255,255,255,.1); }
.mt-lb-name { font-size: 14px; font-weight: 600; }
.mt-lb-tip { font-size: 12px; color: rgba(255,255,255,.55); }
.mt-lb-tools { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; }
.mt-lb-tools button { min-width: 34px; height: 32px; padding: 0 10px; border: 1px solid rgba(255,255,255,.2); border-radius: 9px; background: rgba(255,255,255,.1); color: #fff; font-size: 13px; cursor: pointer; }
.mt-lb-tools button:hover { background: rgba(255,255,255,.22); }
.mt-lb-x { font-size: 19px !important; line-height: 1 !important; }
.mt-lb-stage { flex: 1 1 auto; min-height: 0; display: grid; place-items: center; overflow: hidden; touch-action: none; }
.mt-lb-stage img { max-width: 94vw !important; max-height: calc(100vh - 110px) !important; border-radius: 6px; box-shadow: 0 24px 70px rgba(0,0,0,.6); transform-origin: center center; user-select: none; -webkit-user-drag: none; }

/* 打字练习：篇幅选择 + 篇目信息 + 长文可滚动 */
.ty-levels { padding: 3px; border-radius: 12px; background: var(--color-surface-sunken, rgba(120,120,128,.1)); gap: 4px; }
.ty-lv { box-sizing: border-box; height: 30px; padding: 0; border: 0; border-radius: 9px; background: transparent; color: var(--color-text-secondary); font-size: 12.5px; line-height: 1; cursor: pointer; min-width: 24px; padding: 0 14px; }
.ty-lv.on { background: var(--color-surface, #fff); color: var(--color-primary, #0071E3); font-weight: 600; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.ty-meta { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--color-text-tertiary); }
.ty-meta-lv { padding: 2px 8px; border-radius: 999px; background: var(--color-primary-soft, rgba(0,113,227,.1)); color: var(--color-primary, #0071E3); font-weight: 600; }
.ty-meta-tip { color: var(--color-text-tertiary); opacity: .85; }
.ty-text { max-height: 42vh; overflow-y: auto; overscroll-behavior: contain; }
.ty-head .st-tabs-sm { padding: 3px; border-radius: 12px; background: var(--color-surface-sunken, rgba(120,120,128,.1)); }
.ty-name { margin-left: 6px; }
.ty-levels { margin-left: 2px; }

/* ============ 打字练习 v2：左练习 / 右榜单，分层清晰 ============ */
.st-typing { display: block; }
.ty-page { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 18px; align-items: start; }
.ty-main { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.ty-side { position: sticky; top: 16px; }

/* 顶部控制条：两组分段按钮 + 换一篇，右侧对齐 */
.ty-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ty-seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 12px; background: var(--color-surface-sunken, rgba(120,120,128,.1)); }
.ty-seg-btn { box-sizing: border-box; height: 32px; padding: 0 16px; border: 0; border-radius: 9px; background: transparent; color: var(--color-text-secondary); font-size: 13px; line-height: 1; cursor: pointer; transition: background .15s, color .15s; white-space: nowrap; }
.ty-seg-btn:hover { color: var(--color-text-primary); }
.ty-seg-btn.on { background: var(--color-surface, #fff); color: var(--color-primary, #0071E3); font-weight: 600; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.ty-new { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border: 1px solid var(--color-border, rgba(120,120,128,.22)); border-radius: 10px; background: var(--color-surface, #fff); color: var(--color-primary, #0071E3); font-size: 13px; cursor: pointer; }
.ty-new:hover { border-color: var(--color-primary, #0071E3); }
.ty-new svg { width: 14px; height: 14px; }

/* 练习卡：一张卡里装下「篇目信息 + 正文 + 进度 + 输入 + 操作」 */
.ty-card { display: flex; flex-direction: column; gap: 14px; padding: 18px 20px 20px; border: 1px solid var(--color-border, rgba(120,120,128,.18)); border-radius: 18px; background: var(--color-surface, #fff); box-shadow: 0 1px 2px rgba(0,0,0,.03); }
.ty-card-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.ty-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--color-text-tertiary); }
.ty-meta-lv { padding: 3px 9px; border-radius: 999px; background: var(--color-primary-soft, rgba(0,113,227,.1)); color: var(--color-primary, #0071E3); font-weight: 600; }
.ty-meta-tip { color: var(--color-text-tertiary); opacity: .8; }

/* 指标：紧凑一行，弱化呈现，打字时才显眼 */
.ty-stats { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.ty-stats > div { display: flex; flex-direction: column; gap: 2px; min-width: 56px; }
.ty-stats span { font-size: 11px; color: var(--color-text-tertiary); }
.ty-stats b { font-size: 17px; font-weight: 700; color: var(--color-text-primary); font-variant-numeric: tabular-nums; line-height: 1.2; }
.ty-stats i { margin-left: 2px; font-size: 10px; font-style: normal; font-weight: 500; color: var(--color-text-tertiary); }

/* 正文区：更安静的底、更松的行距，长文自己滚 */
.ty-text { max-height: 40vh; overflow-y: auto; overscroll-behavior: contain; padding: 16px 18px; border: 1px solid var(--color-border, rgba(120,120,128,.14)); border-radius: 14px; background: var(--color-surface-sunken, rgba(120,120,128,.05)); font-size: 17px; line-height: 2.05; letter-spacing: .02em; word-break: break-all; color: var(--color-text-primary); }
.ty-progress-bar { height: 4px; border-radius: 999px; background: var(--color-surface-sunken, rgba(120,120,128,.14)); overflow: hidden; }
.ty-progress-bar i { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--color-primary, #0071E3); transition: width .12s linear; }
.ty-input { width: 100%; min-height: 96px; padding: 14px 16px; border: 1px solid var(--color-border, rgba(120,120,128,.22)); border-radius: 14px; background: var(--color-surface, #fff); color: var(--color-text-primary); font-size: 15px; line-height: 1.9; outline: 0; resize: vertical; }
.ty-input:focus { border-color: var(--color-primary, #0071E3); box-shadow: 0 0 0 3px rgba(0,113,227,.12); }
.ty-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0; }
.ty-end { height: 40px; padding: 0 22px; border: 0; border-radius: 11px; background: var(--color-primary, #0071E3); color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; }
.ty-end:disabled { background: var(--color-surface-sunken, rgba(120,120,128,.16)); color: var(--color-text-tertiary); cursor: not-allowed; }

/* 右侧榜单：标题一行 + 昵称 + 副说明 */
.ty-board { border: 1px solid var(--color-border, rgba(120,120,128,.18)); border-radius: 18px; background: var(--color-surface, #fff); overflow: hidden; }
.ty-board-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 15px 18px 10px; border-bottom: 0; }
.ty-board-head h3 { margin: 0; font-size: 15px; }
.ty-board-head small { margin-left: 6px; font-size: 11px; color: var(--color-text-tertiary); font-weight: 400; }
.ty-board-sub { padding: 0 18px 12px; font-size: 11.5px; color: var(--color-text-tertiary); border-bottom: 1px solid var(--color-border, rgba(120,120,128,.14)); }
.ty-name { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--color-text-tertiary); }
.ty-name input { width: 96px; height: 28px; padding: 0 8px; border: 1px solid var(--color-border, rgba(120,120,128,.22)); border-radius: 8px; background: var(--color-surface, #fff); color: var(--color-text-primary); font-size: 12px; outline: 0; }
.ty-board-body { padding: 6px 18px 14px; font-size: 13px; max-height: 52vh; overflow-y: auto; }
.ty-board-row { grid-template-columns: 28px minmax(0, 1fr) 74px 62px 44px !important; }
.ty-result { margin-top: 2px; }

@media (max-width: 1080px) {
  .ty-page { grid-template-columns: 1fr; }
  .ty-side { position: static; }
  .ty-board-body { max-height: none; }
}

/* 长篇时输入框不被挤走：练习卡整体定高，正文自己滚，输入区常驻 */
.ty-card { height: calc(100vh - 325px); min-height: 420px; padding: 16px 20px; gap: 12px; }
.ty-text { flex: 1 1 auto; min-height: 0; max-height: none; }
.ty-progress-bar { flex: none; }
.ty-input { flex: none; min-height: 84px; max-height: 40%; resize: none; }
.ty-actions { flex: none; margin-top: -2px; }
@media (max-width: 1080px) {
  .ty-card { height: auto; min-height: 0; }
  .ty-text { max-height: 46vh; flex: none; }
  .ty-input { max-height: none; }
}

/* ============ 打字 v3：按钮上移、指标缩小、正文紧凑、榜单等高 ============ */
.ty-page { align-items: stretch; grid-template-columns: minmax(0, 1.7fr) minmax(250px, 0.85fr); }
.ty-card { height: auto; min-height: 0; padding: 14px 18px 16px; gap: 12px; }
.ty-head-right { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.ty-stats { gap: 12px; }
.ty-stats > div { min-width: 46px; }
.ty-stats span { font-size: 10.5px; }
.ty-stats b { font-size: 15px; }
.ty-stats i { font-size: 9.5px; }
.ty-end { height: 34px; padding: 0 16px; font-size: 13px; }
.ty-end:disabled { cursor: not-allowed; }
.ty-text { position: relative; flex: none; height: 216px; max-height: none; font-size: 16.5px; line-height: 1.95; padding: 14px 16px; }
.ty-ch.now { background: rgba(0,113,227,.10); border-bottom-width: 2px; }
.ty-actions-hint { font-size: 11.5px; }
.ty-side { display: flex; }
.ty-side .ty-board { flex: 1 1 auto; display: flex; flex-direction: column; }
.ty-board-body { flex: 1 1 auto; max-height: none; overflow-y: auto; }
.ty-board-sub { border-bottom: 1px solid var(--color-border, rgba(120,120,128,.14)); }
@media (max-width: 1080px) {
  .ty-page { grid-template-columns: 1fr; }
  .ty-side { display: block; }
  .ty-text { height: 200px; }
}

/* ============ 打字 v3：按钮上移、指标缩小、正文紧凑、榜单等高 ============ */
.ty-page { align-items: stretch; grid-template-columns: minmax(0, 1.7fr) minmax(250px, 0.85fr); }
.ty-card { height: auto; min-height: 0; padding: 14px 18px 16px; gap: 12px; }
.ty-head-right { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.ty-stats { gap: 12px; }
.ty-stats > div { min-width: 46px; }
.ty-stats span { font-size: 10.5px; }
.ty-stats b { font-size: 15px; }
.ty-stats i { font-size: 9.5px; }
.ty-end { height: 34px; padding: 0 16px; font-size: 13px; }
.ty-end:disabled { cursor: not-allowed; }
.ty-text { position: relative; flex: none; height: 216px; max-height: none; font-size: 16.5px; line-height: 1.95; padding: 14px 16px; }
.ty-ch.now { background: rgba(0,113,227,.10); border-bottom-width: 2px; }
.ty-actions-hint { font-size: 11.5px; }
.ty-side { display: flex; }
.ty-side .ty-board { flex: 1 1 auto; display: flex; flex-direction: column; }
.ty-board-body { flex: 1 1 auto; max-height: none; overflow-y: auto; }
.ty-board-sub { border-bottom: 1px solid var(--color-border, rgba(120,120,128,.14)); }
@media (max-width: 1080px) {
  .ty-page { grid-template-columns: 1fr; }
  .ty-side { display: block; }
  .ty-text { height: 200px; }
}

/* 语言/篇幅两组分段控件完全一致：可见灰轨道 + 等宽按钮 + 统一选中态 */
.ty-bar .ty-seg {
  flex: none;
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: 12px;
  background: rgba(120,120,128,.14);
  border: 1px solid rgba(120,120,128,.08);
}
.ty-bar .ty-seg .ty-seg-btn {
  flex: none;
  min-width: 76px;
  height: 30px;
  padding: 0 18px;
  border-radius: 9px;
  background: transparent;
  color: var(--color-text-secondary, #555);
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
  box-shadow: none;
}
.ty-bar .ty-seg .ty-seg-btn.on {
  background: var(--color-surface, #fff);
  color: var(--color-primary, #0071E3);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0,0,0,.10);
}
.ty-bar .ty-seg.ty-levels { gap: 2px; }

/* 语言/篇幅两组分段控件完全一致：可见灰轨道 + 等宽按钮 + 统一选中态 */
.ty-bar .ty-seg {
  flex: none;
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: 12px;
  background: rgba(120,120,128,.14);
  border: 1px solid rgba(120,120,128,.08);
}
.ty-bar .ty-seg .ty-seg-btn {
  flex: none;
  min-width: 76px;
  height: 30px;
  padding: 0 18px;
  border-radius: 9px;
  background: transparent;
  color: var(--color-text-secondary, #555);
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
  box-shadow: none;
}
.ty-bar .ty-seg .ty-seg-btn.on {
  background: var(--color-surface, #fff);
  color: var(--color-primary, #0071E3);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0,0,0,.10);
}
.ty-bar .ty-seg.ty-levels { gap: 2px; }

/* 打字头部统一两行结构：第 1 行篇目信息（超长省略），第 2 行指标 + 结束练习。
   短/中/长篇排版完全一致，不再因文字长短而换行错位 */
.ty-card-head { display: flex; flex-direction: column; align-items: stretch; gap: 10px; flex-wrap: nowrap; }
.ty-meta { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ty-head-right { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: nowrap; }
.ty-stats { flex-wrap: nowrap; gap: 14px; }
.ty-stats > div { flex: none; }
.ty-meta .ty-meta-tip { display: inline; }

/* 打字头部改单行：篇目信息(超长省略) → 指标 → 开始/结束按钮，全部同一行 */
.ty-card-head { flex-direction: row; align-items: center; gap: 14px; flex-wrap: nowrap; }
.ty-meta { flex: 0 1 auto; min-width: 0; }
.ty-head-right { margin-left: auto; flex: none; }
.ty-stats { flex: none; }
.ty-head-btns { display: inline-flex; align-items: center; gap: 8px; flex: none; }
.ty-start { height: 34px; padding: 0 18px; border: 1px solid var(--color-primary, #0071E3); border-radius: 11px; background: var(--color-surface, #fff); color: var(--color-primary, #0071E3); font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.ty-start:hover:not(:disabled) { background: var(--color-primary-soft, rgba(0,113,227,.08)); }
.ty-start:disabled { border-color: var(--color-border, rgba(120,120,128,.22)); background: var(--color-surface-sunken, rgba(120,120,128,.08)); color: var(--color-text-tertiary); cursor: not-allowed; }
.ty-end { height: 34px; }

/* 打字头部改单行：篇目信息(超长省略) → 指标 → 开始/结束按钮，全部同一行 */
.ty-card-head { flex-direction: row; align-items: center; gap: 14px; flex-wrap: nowrap; }
.ty-meta { flex: 0 1 auto; min-width: 0; }
.ty-head-right { margin-left: auto; flex: none; }
.ty-stats { flex: none; }
.ty-head-btns { display: inline-flex; align-items: center; gap: 8px; flex: none; }
.ty-start { height: 34px; padding: 0 18px; border: 1px solid var(--color-primary, #0071E3); border-radius: 11px; background: var(--color-surface, #fff); color: var(--color-primary, #0071E3); font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.ty-start:hover:not(:disabled) { background: var(--color-primary-soft, rgba(0,113,227,.08)); }
.ty-start:disabled { border-color: var(--color-border, rgba(120,120,128,.22)); background: var(--color-surface-sunken, rgba(120,120,128,.08)); color: var(--color-text-tertiary); cursor: not-allowed; }
.ty-end { height: 34px; }

/* 头部再收一点间距，保证长篇提示完整显示 */
.ty-card-head { gap: 10px; }
.ty-stats { gap: 10px; }
.ty-stats > div { min-width: 0; }
.ty-start { padding: 0 14px; }
.ty-head-right { gap: 12px; }

/* 世界国家卡片：来自国家信息的「大洲·首都·人口·GDP」一行 */
.mp-info-sub { margin-top: 12px; font-size: 12.5px; line-height: 1.8; color: var(--color-text-secondary, #555); }
.mp-info-sub b { color: var(--color-text-primary); }


/* 交通城市详情：提高遮罩层级，避免顶部/侧边元素漏在灰色背景之上 */
.tf2-modal { z-index: 120; background: rgba(0, 0, 0, .48); backdrop-filter: blur(2px); }
.tf2-modal-card { position: relative; z-index: 1; }

/* 打字练习分段按钮与资讯/游戏页签保持同一套选中态 */
.ty-seg-btn.on { background: var(--color-primary); color: #fff; box-shadow: none; }
.ty-seg-btn.on:hover { color: #fff; }


/* 交通详情遮罩：必须覆盖顶部导航，不能再被工具容器裁切 */
.tf2-modal { position: fixed; inset: 0; z-index: 300; }

/* 重要日子：类型切换统一为蓝底分段控件，表单单列更整齐，保存键固定在弹层底部 */
.days-form {
  grid-template-columns: 1fr;
}
.days-form .field,
.days-form .field:first-child,
.days-form .field:nth-child(2),
.days-form .field:nth-child(n+4) {
  grid-column: auto;
}
#d-mode {
  display: flex;
  width: 100%;
  padding: 4px;
  gap: 3px;
  border: 0;
  border-radius: 12px;
  background: var(--color-surface-sunken);
  overflow: visible;
}
#d-mode button {
  flex: 1;
  min-height: 36px;
  border: 0 !important;
  border-radius: 9px;
  background: transparent;
  color: var(--color-text-secondary);
  font-size: 13px;
  font-weight: 500;
}
#d-mode button + button { border-left: 0; }
#d-mode button:hover { background: transparent; color: var(--color-text-primary); }
#d-mode button.on {
  background: var(--color-primary);
  color: #fff;
  font-weight: 700;
}
.days-modal-card #d-body { padding-bottom: 10px; }
.days-modal-foot {
  flex: none;
  display: flex;
  justify-content: flex-end;
  padding: 12px 20px 18px;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
  border-radius: 0 0 18px 18px;
}
.days-modal-foot .btn { min-width: 110px; }

/* 计算器角度/弧度：去掉外层框线，只保留两个独立按钮 */
#angle-seg {
  display: inline-flex;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}
#angle-seg button {
  height: 30px;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--color-border);
  border-radius: 7px;
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: 12px;
}
#angle-seg button + button { border-left: 1px solid var(--color-border); }
#angle-seg button.on {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
}

/* 单位换算：分类不再是一整条灰底，单位下拉有明确边框，单位选择放在数值上方 */
#cats.pill-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
}
#cats button {
  min-height: 32px;
  padding: 0 14px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
}
#cats button.on {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: #fff;
}
.convert-box .row .select {
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface);
  padding: 0 10px;
}
.convert-box .row .select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}

/* 颜色转换：常用色板 */
.color-palette {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 10px;
}
.color-swatch {
  display: grid;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: center;
}
.cs-chip {
  display: block;
  width: 100%;
  aspect-ratio: 1.35;
  border: 1px solid var(--color-border);
  border-radius: 9px;
  transition: transform .12s ease, box-shadow .12s ease;
}
.color-swatch:hover .cs-chip { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.14); }
.cs-code {
  font-size: 10.5px;
  letter-spacing: .02em;
  color: var(--text-3);
  user-select: all;
}
.color-swatch:hover .cs-code { color: var(--text-1); }
@media (max-width: 900px) { .color-palette { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (max-width: 720px) { .color-palette { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* 日期计算：计算方式两个按钮独立，不再套一层长条框 */
#pane-diff .form-row,
#pane-add .form-row { gap: 14px; }
#pane-diff .result-box,
#pane-add .result-box { border-radius: 16px; }


/* JSON / XML：输入输出区域加大，数据多时不再挤在 220px 小框里 */
.io-grid { gap: 16px; }
.io-pane { min-height: 560px; }
.io-pane textarea {
  min-height: 480px;
  padding: 14px 16px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.65;
  tab-size: 2;
}
@media (max-width: 900px) {
  .io-pane { min-height: 420px; }
  .io-pane textarea { min-height: 340px; }
}

/* 字符编码：转换按钮与源/目标编码下拉保持同一高度 */
.charset-bar .select,
#cs-run,
#cs-fix { min-height: 44px; height: 44px; }
#cs-run { padding: 0 18px; }
.charset-bar { max-width: 720px; gap: 10px; }

/* 编码解码：模式改为独立胶囊按钮，方向按钮去掉外层长框，输入区加大 */
#modes.pill-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
}
#modes button {
  height: 32px;
  min-height: 32px;
  padding: 0 14px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: 12px;
}
#modes button.on {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
}
#direction {
  display: inline-flex;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}
#direction button {
  height: 30px;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--color-border);
  border-radius: 7px;
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: 12px;
}
#direction button + button { border-left: 1px solid var(--color-border); }
#direction button.on { border-color: var(--color-primary); background: var(--color-primary); color: #fff; }
#left, #right { min-height: 420px; }

/* 加密解密：页签、口令区和结果区统一视觉 */
#crypto-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  margin-bottom: 12px;
}
#crypto-tabs button {
  height: 32px;
  min-height: 32px;
  padding: 0 14px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: 12px;
}
#crypto-tabs button.on { border-color: var(--color-primary); background: var(--color-primary); color: #fff; font-weight: 600; }
.crypto-bar .field .input,
.crypto-bar .field .select { min-height: 42px; }
.crypto-bar { align-items: end; }

/* 哈希计算：每种摘要独立卡片，结果等宽且可横向滚动 */
.digest-list { gap: 14px; }
.digest-item {
  padding: 14px 16px;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background: var(--color-surface);
}
.digest-head { margin-bottom: 8px; }
.digest-head b { font-size: 14px; }
.digest-item .result-box {
  margin: 0;
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--color-surface-sunken);
  font-family: var(--mono);
  font-size: 12px;
  word-break: break-all;
}

/* 正则测试：表达式栏、开关、输入和结果区域统一设计 */
.regex-bar { display: flex; flex-direction: column; gap: 14px; margin-bottom: 16px; }
.regex-pattern-field { max-width: 860px; }
.regex-pattern-box {
  display: flex;
  align-items: center;
  gap: 2px;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--color-border);
  border-radius: 11px;
  background: var(--color-surface);
}
.regex-pattern-box:focus-within { border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-primary-soft); }
.regex-pattern-box input { flex: 1; min-width: 0; height: 44px; border: 0; outline: 0; background: transparent; font-family: var(--mono); font-size: 14px; }
.regex-flags { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }
.regex-view { min-height: 360px; padding: 16px; font-family: var(--mono); font-size: 13px; line-height: 1.8; white-space: pre-wrap; }
.regex-view mark { padding: 1px 3px; border-radius: 4px; background: #FDE68A; color: #111827; }

/* URL 解析：输入区更大、基础信息行更清晰 */
#url {
  min-height: 96px;
  padding: 14px 16px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.65;
  resize: vertical;
}
#basic { gap: 0; }
#basic .kv-row {
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border);
}
#basic .kv-row:last-child { border-bottom: 0; }
#basic .kv-row:nth-child(odd) { background: var(--color-surface-sunken); }

/* 文本处理：动作标签改为独立胶囊，输入输出加大 */
#actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
}
#actions button {
  height: 32px;
  min-height: 32px;
  padding: 0 13px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: 12px;
}
#actions button.on { border-color: var(--color-primary); background: var(--color-primary); color: #fff; font-weight: 600; }
#input, #output { min-height: 440px; padding: 14px 16px; font-size: 13.5px; line-height: 1.75; }
#stats { margin-top: 16px; }

/* 密码生成：选项区域分组，滑块和结果列表更清晰 */
#length { height: 6px; accent-color: var(--color-primary); cursor: pointer; }
#pw-list .pw-row,
.pw-list .pw-row {
  padding: 13px 16px;
  border: 1px solid var(--color-border);
  border-radius: 11px;
  background: var(--color-surface);
  margin-bottom: 8px;
  font-family: var(--mono);
  font-size: 14px;
}
.pw-list .pw-row + .pw-row { margin-top: 0; }
#list { display: flex; flex-direction: column; gap: 0; }
#list .empty { border: 0; }
#generate { min-height: 36px; }

/* 二维码：两张面板等高，生成舞台与上传区更有层次 */
.io-grid > .panel { min-width: 0; }
.qr-stage {
  display: grid;
  place-items: center;
  min-height: 280px;
  margin-top: 14px;
  padding: 20px;
  border: 1px dashed var(--color-border);
  border-radius: 16px;
  background: var(--color-surface-sunken);
}
.drop-zone {
  min-height: 220px;
  padding: 24px;
  border: 1px dashed var(--color-border);
  border-radius: 16px;
  background: var(--color-surface-sunken);
}
.qr-options { gap: 12px; }
.qr-result { margin-top: 14px; border-radius: 14px; }

/* 诗词 / 字典 / 英文词典：输入框本身透明，只保留外层搜索框，避免液态玻璃下叠出小白块 */
.st-search input {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

/* 英文词典：搜索框与分类下拉保持同一行 */
.st-eng .st-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.st-eng .st-search { flex: 1 1 auto; min-width: 240px; }
.st-eng .st-quick { flex-basis: 100%; }
.st-eng .st-cat {
  flex: 0 0 160px;
  width: 160px;
  height: 44px;
  min-height: 44px;
}
@media (max-width: 720px) {
  .st-eng .st-head { flex-wrap: wrap; }
  .st-eng .st-cat { width: 100%; flex-basis: 100%; }
}

/* 打字练习：统一为清晰的左右双栏、卡片式指标和主次按钮 */
.st-typing .ty-page {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, .85fr);
  gap: 18px;
  align-items: start;
}
.st-typing .ty-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.st-typing .ty-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.st-typing .ty-seg { padding: 4px; border-radius: 12px; background: var(--color-surface-sunken); gap: 3px; }
.st-typing .ty-seg-btn { height: 32px; padding: 0 15px; border-radius: 9px; font-size: 13px; }
.st-typing .ty-new { margin-left: auto; height: 38px; padding: 0 15px; }
.st-typing .ty-card { padding: 20px; border-radius: 18px; display: flex; flex-direction: column; gap: 16px; }
.st-typing .ty-card-head { flex-direction: column; align-items: stretch; gap: 12px; }
.st-typing .ty-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.st-typing .ty-stats > div { padding: 10px 12px; border-radius: 11px; background: var(--color-surface-sunken); }
.st-typing .ty-stats span { display: block; font-size: 11px; color: var(--color-text-tertiary); }
.st-typing .ty-stats b { display: block; margin-top: 3px; font-size: 20px; }
.st-typing .ty-head-right { display: flex; flex-direction: column; gap: 12px; margin: 0; }
.st-typing .ty-head-btns { justify-content: flex-end; }
.st-typing .ty-start { height: 36px; padding: 0 18px; background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.st-typing .ty-end { height: 36px; padding: 0 18px; background: var(--color-surface); color: var(--color-text-primary); border: 1px solid var(--color-border); }
.st-typing .ty-text { height: 250px; padding: 20px; font-size: 19px; line-height: 2; border-radius: 15px; overflow-y: auto; }
.st-typing .ty-input { min-height: 118px; padding: 16px; font-size: 16px; line-height: 1.7; border-radius: 14px; }
.st-typing .ty-side { position: sticky; top: 16px; }
.st-typing .ty-board { border-radius: 18px; }
@media (max-width: 980px) {
  .st-typing .ty-page { grid-template-columns: 1fr; }
  .st-typing .ty-side { position: static; }
  .st-typing .ty-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 游戏获奖 */
.aw-group { margin-bottom: 24px; }
.aw-group-head { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.aw-group-head h3 { margin: 0; font-size: 18px; }
.aw-group-head span:last-child { font-size: 12px; color: var(--color-text-tertiary); }
.aw-dot { width: 10px; height: 10px; border-radius: 50%; }
.aw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.aw-card { display: flex; gap: 14px; padding: 16px; border: 1px solid var(--color-border); border-radius: 15px; background: var(--color-surface); }
.aw-year { flex: none; font-size: 22px; font-weight: 700; color: var(--color-primary); }
.aw-body b { display: block; margin-bottom: 4px; font-size: 16px; }
.aw-body span { font-size: 12px; color: var(--color-text-tertiary); }

/* 万年历：更大的月历主卡、清晰的分隔和日格，右侧详情独立卡片 */
.cal-layout { grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; }
.cal-main { padding: 20px 22px 22px; border-radius: 20px; }
.cal-side { gap: 14px; }
.cal-head {
  gap: 10px;
  padding-bottom: 14px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
}
.cal-grid { gap: 3px; }
.cal-cell { min-height: 78px; border-radius: 11px; }
.cal-week { margin-bottom: 8px; }
.cal-week span { font-size: 12px; font-weight: 600; color: var(--color-text-tertiary); }
.cal-detail { padding: 18px; border-radius: 18px; }
@media (max-width: 1080px) {
  .cal-layout { grid-template-columns: 1fr; }
  .cal-cell { min-height: 66px; }
}

/* 时间戳转换：放大当前时间戳读数，转换结果行更清晰 */
.ts-page .stat-grid { gap: 14px; }
.ts-page .stat { padding: 16px; border: 1px solid var(--color-border); border-radius: 14px; background: var(--color-surface); }
.ts-page #now-seconds, .ts-page #now-millis { font-size: 24px; letter-spacing: -.02em; }
.ts-page .kv-row { padding: 9px 2px; }
.ts-page .form-row { gap: 14px; }

/* 秒表与倒计时：中心大读数、清楚的主次操作区 */
.timer-page .stopwatch-time { margin: 18px 0 4px; font-size: clamp(58px, 12vw, 92px); font-weight: 700; letter-spacing: -.04em; }
.timer-page #mode-seg { margin-bottom: 4px; }
.timer-page .toolbar { gap: 10px; }
.timer-page .btn { min-height: 40px; }
.timer-page .form-row { gap: 12px; }
.timer-page .lap-list { margin-top: 16px; }

/* 万年历：只保留行分隔横线，取消每格完整边框 */
.cal-cell {
  border: 0 !important;
  border-bottom: 1px solid var(--color-border) !important;
  border-radius: 0 !important;
  background: transparent;
}
.cal-grid { gap: 0; }
.cal-cell:hover { background: var(--color-hover); }
.cal-cell.is-today, .cal-cell.on { border-radius: 9px !important; border-bottom-color: transparent !important; }

/* 打字排行榜：文字不贴边，榜单与主内容底部对齐并拉长 */
.ty-side .ty-board { min-height: 100%; }
.ty-side .ty-board-head { padding: 18px 20px 12px; }
.ty-side .ty-board-sub { padding: 0 20px 14px; }
.ty-side .ty-board-body { padding: 0 12px 12px; }
.ty-side .ty-board-row { padding-left: 8px; padding-right: 8px; }

/* 日期计算 / 世界时钟按钮在扁平化下保留清晰边框 */
html[data-design="flat"] #mode-seg button,
html[data-design="flat"] #fmt-seg button { border-color: var(--color-border); background: var(--color-surface); }
html[data-design="flat"] #mode-seg button.on,
html[data-design="flat"] #fmt-seg button.on { border-color: var(--color-primary); background: var(--color-primary); }

/* 复制按钮统一为纯图标，避免撑高左右面板导致不对齐 */
#copy, #copy-replaced, #cs-copy, #aes-copy, [id$="-copy"] { padding: 0; width: 32px; height: 32px; justify-content: center; }
#copy svg, #copy-replaced svg, #cs-copy svg, #aes-copy svg { width: 15px; height: 15px; }

/* 万年历国际节日：改成开关外观 */
.cal-opt { gap: 8px; cursor: pointer; }
.cal-opt-box { width: 38px; height: 22px; border-radius: 999px; border: 0; background: var(--color-surface-sunken); position: relative; transition: background .16s; }
.cal-opt-box::after { content: ""; position: absolute; left: 2px; top: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .16s; }
.cal-opt input:checked + .cal-opt-box { background: var(--color-primary); }
.cal-opt input:checked + .cal-opt-box::after { transform: translateX(16px); }
.cal-opt-label { font-size: 12px; }

/* 贵金属：涨幅数字居中，标题旁涨幅小字 */
.metal-move { display: inline-flex; align-items: center; justify-content: center; width: 100%; }
.metal-quote-head { display: inline-flex; align-items: baseline; gap: 6px; }
.metal-change-inline { font-size: 12px; font-weight: 600; }

/* 输入/输出两栏：头部等高、面板等高、复制按钮纯图标，保证上下完全对齐 */
.io-grid { align-items: stretch; }
.io-pane { display: flex; flex-direction: column; height: 100%; }
.io-head {
  flex: none;
  box-sizing: border-box;
  height: 52px;
  min-height: 52px;
  padding: 0 14px;
  justify-content: space-between;
}
.io-head .right { margin-left: auto; }
.io-head .btn,
.io-head .icon-btn,
.io-head [id$="-copy"] {
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.io-head .btn span { display: none; }
.io-pane textarea { flex: 1 1 auto; min-height: 0; }
.io-foot { flex: none; min-height: 38px; display: flex; align-items: center; }

/* 按钮必须完整包住文字，不允许文字溢出 */
.btn, .btn-sm { white-space: nowrap; flex: none; }
.toolbar { flex-wrap: wrap; row-gap: 8px; }

/* 世界时钟：扁平化下给城市时间卡片明确的浅边框，避免白底白背景看不出边界 */
html[data-design="flat"] .clock-card {
  border: 1px solid var(--color-border, rgba(60, 60, 67, 0.18)) !important;
  background: var(--color-surface, #FFFFFF) !important;
}
html[data-design="flat"] .clock-card.local {
  border-color: var(--color-primary, #0A84FF) !important;
}

/* 哈希计算：独立结果卡片 */
.hash-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.hash-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 28px 16px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  color: var(--text-3);
  font-size: var(--text-caption);
}

.hash-card {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color .16s ease, background-color .16s ease, transform .16s ease;
}

.hash-card:hover {
  border-color: var(--color-primary, #0A84FF);
  background: var(--surface-2, var(--surface));
}

.hash-card:active { transform: scale(.998); }

.hash-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.hash-head b {
  font-size: var(--text-caption);
  letter-spacing: .02em;
}

.hash-hex {
  font-size: 12.5px;
  line-height: 1.55;
  word-break: break-all;
  color: var(--text-1);
  user-select: all;
}

.hash-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-3);
}

.hash-meta code {
  word-break: break-all;
  color: var(--text-2);
}

/* 密码结果卡片微调：数字对齐、hover 提示可复制 */
.pw-item {
  font-variant-numeric: tabular-nums;
  letter-spacing: .01em;
  transition: border-color .16s ease, background-color .16s ease;
}

.pw-item:hover { border-color: var(--color-primary, #0A84FF); }
.pw-item .icon-btn { flex: none; }

/* 万年历：只保留每行之间的横线，去掉每个日期的完整边框（对齐主流万年历观感） */
html[data-design] .cal-grid {
  column-gap: 0;
  row-gap: 0;
}
html[data-design] .cal-cell {
  border: 0 !important;
  border-radius: 8px;
  background: transparent;
}
html[data-design] .cal-cell::after {
  content: '';
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 0;
  height: 1px;
  background: var(--border);
  opacity: .55;
  pointer-events: none;
}
html[data-design] .cal-cell.is-empty::after { opacity: .3; }
html[data-design] .cal-cell:hover { background: var(--surface-2, rgba(120, 120, 128, .08)); }
html[data-design] .cal-cell.is-selected::after { opacity: 0; }
html[data-design] .cal-cell.is-today { box-shadow: inset 0 0 0 1.5px var(--accent); }

/* 万年历：国际节日改为开关 */
.cal-opt-switch {
  position: relative;
  width: 34px;
  height: 20px;
  flex: none;
  border-radius: 999px;
  background: var(--surface-3, rgba(120, 120, 128, .24));
  transition: background .16s ease;
}
.cal-opt-switch i {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .22);
  transition: transform .16s ease;
}
.cal-opt input:checked + .cal-opt-switch { background: var(--accent); }
.cal-opt input:checked + .cal-opt-switch i { transform: translateX(14px); }
.cal-opt input:focus-visible + .cal-opt-switch { outline: 2px solid var(--accent); outline-offset: 2px; }

/* 打字练习：排行榜与左侧练习区等高，文字离边框留出呼吸位，列表拉长 */
.ty-side {
  position: sticky;
  top: 16px;
  align-self: stretch;
  display: flex;
  flex-direction: column;
}
.ty-board {
  display: flex;
  flex-direction: column;
  width: 100%;
  flex: 1 1 auto;
}
.ty-board-body {
  flex: 1 1 auto;
  max-height: none;
  overflow-y: auto;
  padding: 6px 20px 16px;
}
.ty-board-row {
  padding: 10px 2px;
  gap: 10px;
}
.ty-board-row > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ty-board-row > span:last-child { text-align: right; }
@media (max-width: 1080px) {
  .ty-side { position: static; align-self: auto; }
  .ty-board-body { max-height: none; }
}

/* 纪念日弹窗：三种类型来回切换时日期控件高度一致，页面不跳 */
#d-date-host { min-height: 44px; display: flex; align-items: center; }
#d-date-host > * { flex: 1 1 auto; min-width: 0; }
