/* ============================================================
   tools-redesign.css — 学习工具页（tools.html 专属）
   浅色工具台主题：大图标工具卡 + 即开即用交互
   ============================================================ */

/* ---------------- Banner：工具台主题 ---------------- */
.tl-hero {
  position: relative;
  overflow: hidden;
  padding: 150px 0 96px;
  background:
    radial-gradient(ellipse 40% 46% at 88% 22%, rgba(0, 164, 255, .12), transparent 62%),
    radial-gradient(ellipse 34% 40% at 4% 92%, rgba(0, 209, 104, .10), transparent 58%),
    linear-gradient(168deg, #f2f7ff 0%, #eaf2fe 46%, #f8fbff 100%);
}
.tlh-ghost {
  position: absolute;
  top: 30px; right: 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 700;
  font-size: clamp(120px, 15vw, 230px);
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(0, 106, 245, .12);
  pointer-events: none;
  user-select: none;
  animation: tlhIn 1.3s cubic-bezier(.22, 1, .36, 1) .1s backwards;
}
@keyframes tlhIn { from { opacity: 0; transform: translateX(56px); } to { opacity: 1; transform: none; } }
/* 悬浮文具图标 */
.tlh-stationery {
  position: absolute;
  width: 108px;
  height: 108px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 26px;
  color: #0069f5;
  background: #fff;
  border: 1px solid rgba(0, 106, 245, .14);
  box-shadow: 0 18px 44px rgba(16, 35, 80, .10);
  pointer-events: none;
  translate: calc(var(--hx, 0) * var(--gp, 24px)) calc(var(--hy, 0) * var(--gp, 18px));
  transition: translate .35s ease-out;
  animation: tlhFloat 6.5s ease-in-out infinite alternate, tlhIn 1.1s cubic-bezier(.34, 1.56, .64, 1) backwards;
}
.tlh-stationery svg { width: 52%; height: 52%; }
.tlh-sta--a { top: 26%; right: 26%; --gp: 34px; color: #0069f5; animation-delay: 0s, .45s; }
.tlh-sta--b { top: 52%; right: 12%; --gp: 26px; width: 88px; height: 88px; color: #00b25c; animation-delay: -2.4s, .6s; }
.tlh-sta--c { top: 14%; right: 8%; --gp: 20px; width: 78px; height: 78px; color: #7c5cd6; animation-delay: -4.1s, .75s; }
@keyframes tlhFloat { from { margin-top: 0; } to { margin-top: -18px; } }

.tl-hero .ph-crumbs a, .tl-hero .ph-crumbs span { color: rgba(20, 36, 63, .65); }
.tl-hero .ph-crumbs i { color: rgba(20, 36, 63, .35); }
.tl-hero h1 { color: #14243f; animation: tlhIn .9s cubic-bezier(.22, 1, .36, 1) .15s backwards; }
.tl-hero .ph-lead { color: rgba(20, 36, 63, .72); animation: tlhIn .8s ease .45s backwards; }
@media (max-width: 900px) {
  .tl-hero { padding: 130px 0 76px; }
  .tlh-stationery { display: none; }
  .tlh-ghost { font-size: 110px; }
}

/* ---------------- 工具卡 ---------------- */
.tl-sec { padding: 84px 0 92px; background: linear-gradient(180deg, #fff 0%, #f6f9fe 100%); }
.tl-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 26px;
}
.tl-card {
  --c: #006AFF;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 30px 30px 28px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid #e7eef8;
  box-shadow: 0 10px 34px rgba(16, 35, 80, .06);
  transition: transform .5s cubic-bezier(.22, 1, .36, 1), box-shadow .5s, border-color .4s;
}
.tl-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 26px 60px rgba(16, 35, 80, .12);
  border-color: color-mix(in srgb, var(--c) 36%, #e7eef8);
}
.tl-card__ico {
  width: 74px;
  height: 74px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 9%, #fff);
  border: 1.5px solid color-mix(in srgb, var(--c) 26%, #fff);
  transition: transform .5s cubic-bezier(.34, 1.56, .64, 1), background .4s;
}
.tl-card__ico svg { width: 55%; height: 55%; }
.tl-card:hover .tl-card__ico { transform: rotate(-6deg) scale(1.08); background: color-mix(in srgb, var(--c) 16%, #fff); }
.tl-card__no {
  position: absolute;
  top: 22px;
  right: 26px;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 700;
  font-size: 46px;
  line-height: 1;
  color: color-mix(in srgb, var(--c) 12%, #fff);
  pointer-events: none;
  user-select: none;
}
.tl-card h3 { font-size: 20px; font-weight: 800; color: #14243f; margin: 4px 0 0; }
.tl-card > p { font-size: 14px; color: #64748b; line-height: 1.75; margin: 0; }

/* 工具内交互 */
.tl-tool { margin-top: 8px; display: flex; flex-direction: column; gap: 12px; }
.tl-field { display: flex; flex-direction: column; gap: 6px; }
.tl-field label { font-size: 12.5px; font-weight: 700; color: #4a5a75; letter-spacing: .02em; }
.tl-field input, .tl-field select {
  padding: 10px 14px;
  font-size: 14px;
  color: #14243f;
  background: #f7faff;
  border: 1.5px solid #e3eaf5;
  border-radius: 10px;
  outline: none;
  transition: border-color .25s, background .25s, box-shadow .25s;
  width: 100%;
}
.tl-field input:focus {
  border-color: #0069f5;
  background: #fff;
  box-shadow: 0 0 0 3.5px rgba(0, 105, 245, .12);
}
.tl-field-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.tl-btn {
  align-self: flex-start;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 60%, #00d168));
  border: none;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 8px 22px color-mix(in srgb, var(--c) 30%, transparent);
  transition: transform .35s cubic-bezier(.22, 1, .36, 1), box-shadow .35s;
}
.tl-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 28px color-mix(in srgb, var(--c) 42%, transparent); }
.tl-btn:active { transform: translateY(0); }

/* 结果区 */
.tl-result {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 16px 20px;
  border-radius: 14px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--c) 8%, #fff), #f8fbff);
  border: 1px dashed color-mix(in srgb, var(--c) 34%, #fff);
  animation: tlPop .45s cubic-bezier(.34, 1.56, .64, 1);
}
.tl-result--row { flex-direction: row; align-items: baseline; gap: 12px; }
.tl-result b {
  font-size: 40px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--c);
  font-variant-numeric: tabular-nums;
}
.tl-result--row b { font-size: 30px; }
.tl-result span { font-size: 12.5px; color: #64748b; }
@keyframes tlPop { from { opacity: 0; transform: scale(.92) translateY(6px); } to { opacity: 1; transform: none; } }

/* 快捷 chips */
.tl-quick { display: flex; gap: 8px; flex-wrap: wrap; }
.tl-chip {
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 700;
  color: #0069f5;
  background: rgba(0, 106, 245, .06);
  border: 1px solid rgba(0, 106, 245, .2);
  border-radius: 999px;
  cursor: pointer;
  transition: background .25s, transform .3s cubic-bezier(.34, 1.56, .64, 1), box-shadow .3s;
}
.tl-chip:hover { background: rgba(0, 106, 245, .12); transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0, 106, 245, .18); }

/* 复习计划节点 */
.tl-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: tlPop .45s cubic-bezier(.34, 1.56, .64, 1);
}
.tl-steps li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  font-size: 13.5px;
  color: #14243f;
  background: #f7faff;
  border: 1px solid #e7eef8;
  border-radius: 10px;
  opacity: 0;
  animation: tlRow .4s ease forwards;
}
.tl-steps li i {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #00A4FF, #006AFF);
}
@keyframes tlRow { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }

/* 成绩统计与柱状 */
.tl-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; animation: tlPop .45s cubic-bezier(.34, 1.56, .64, 1); }
.tl-stats div {
  padding: 10px 12px;
  border-radius: 12px;
  background: #f7faff;
  border: 1px solid #e7eef8;
  text-align: center;
}
.tl-stats b { display: block; font-size: 20px; font-weight: 800; color: #00A851; font-variant-numeric: tabular-nums; }
.tl-stats span { font-size: 11px; color: #64748b; }
.tl-bars { display: flex; align-items: flex-end; gap: 6px; height: 74px; padding: 4px 2px 0; animation: tlPop .5s cubic-bezier(.34, 1.56, .64, 1); }
.tl-bars i {
  flex: 1;
  border-radius: 5px 5px 0 0;
  background: linear-gradient(180deg, #00d168, rgba(0, 209, 104, .14));
  transform-origin: bottom;
  animation: tlBar .6s cubic-bezier(.22, 1, .36, 1) backwards;
}
@keyframes tlBar { from { transform: scaleY(0); } to { transform: scaleY(1); } }

.tl-more {
  margin-top: 40px;
  text-align: center;
  font-size: 14px;
  color: #64748b;
}
.tl-more[data-i18n]::before { content: "✦ "; color: #00A4FF; }

/* 入场 */
.js .tl-reveal { opacity: 0; transform: translateY(28px); }
.js .tl-reveal.visible {
  opacity: 1;
  transform: none;
  transition: opacity .8s cubic-bezier(.22, 1, .36, 1) var(--d, 0s), transform .8s cubic-bezier(.22, 1, .36, 1) var(--d, 0s), box-shadow .5s, border-color .4s;
}

@media (max-width: 980px) {
  .tl-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .tl-field-row { grid-template-columns: 1fr; }
  .tl-card { padding: 24px 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .tlh-stationery, .tlh-ghost, .tl-hero h1, .tl-hero .ph-lead,
  .tl-result, .tl-steps, .tl-stats, .tl-bars, .tl-bars i { animation: none !important; }
  .js .tl-reveal { opacity: 1; transform: none; }
}

/* [hidden] 优先级兜底 */
.tl-result[hidden], .tl-stats[hidden], .tl-bars[hidden], .tl-steps[hidden] { display: none !important; }

/* ============================================================
   新工具：番茄专注钟 / 抽认卡 / 打卡日历 / 课时账本
   ============================================================ */
.tl-field-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; }
.tl-field-row .tl-field { margin: 0; }
.tl-field-row--4 { grid-template-columns: 1.4fr .7fr .8fr 1.1fr; }
.tl-btn--ghost { background: #fff; color: var(--ink-2, #2a3a56); border: 1.5px solid var(--line, #e3eaf5); box-shadow: none; }
.tl-btn--ghost:hover { color: var(--blue, #0069f5); border-color: rgba(0, 106, 245, .35); box-shadow: 0 8px 18px rgba(0, 106, 255, .1); }

/* —— 番茄钟 —— */
.tl-pomo__ringwrap { position: relative; width: 150px; margin: 4px auto 10px; }
.tl-pomo__ring { width: 150px; height: 150px; transform: rotate(-90deg); }
.tl-pomo__track { fill: none; stroke: rgba(0, 106, 255, .1); stroke-width: 7; }
.tl-pomo__bar {
  fill: none;
  stroke: url(#tlPomoGrad);
  stroke: #0069f5;
  stroke-width: 7;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear;
}
.tl-pomo__time {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 32px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--ink, #14243f);
  letter-spacing: .04em;
}
.tl-pomo__mode { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 12px; }
.tl-pomo__mode .tl-chip { cursor: pointer; }
.tl-pomo__mode .tl-chip.is-here { background: rgba(0, 106, 245, .1); border-color: rgba(0, 106, 245, .4); color: #0069f5; }
.tl-pomo__acts { display: flex; gap: 10px; justify-content: center; }
.tl-pomo__acts .tl-btn { min-width: 96px; }
.tl-pomo__done {
  margin: 14px 0 0;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted, #64748b);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.tl-pomo__done b { font-size: 18px; color: #0069f5; font-variant-numeric: tabular-nums; }

/* —— 抽认卡 —— */
.tl-flash__card {
  perspective: 900px;
  margin: 4px 0 10px;
}
.tl-flash__inner {
  position: relative;
  min-height: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, #f3f8ff, #eef4ff);
  border: 1.5px solid rgba(0, 164, 255, .25);
  cursor: pointer;
  transition: transform .5s cubic-bezier(.34, 1.3, .5, 1), background .35s, border-color .35s;
  user-select: none;
  text-align: center;
}
.tl-flash__inner.is-back {
  background: linear-gradient(135deg, #f0fbf4, #eaf8ef);
  border-color: rgba(0, 168, 81, .35);
}
.tl-flash__inner.is-back b { color: #00994d; }
.tl-flash__inner:active { transform: scale(.985); }
.tl-flash__inner b { font-size: 18px; font-weight: 800; color: var(--ink, #14243f); word-break: break-all; }
.tl-flash__inner span { font-size: 11px; letter-spacing: .12em; color: var(--muted, #64748b); }
.tl-flash__acts { display: flex; gap: 10px; }
.tl-flash__acts .tl-btn { flex: 1; }
.tl-flash__meta { margin: 8px 0 0; font-size: 12.5px; color: var(--muted, #64748b); text-align: center; }

/* —— 打卡日历 —— */
.tl-habit__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  margin-bottom: 14px;
}
.tl-habit__dow { font-size: 10.5px; text-align: center; color: var(--muted, #64748b); padding-bottom: 2px; letter-spacing: .06em; }
.tl-habit__blank { height: 34px; }
.tl-habit__day {
  appearance: none;
  border: 1px solid var(--line, #e3eaf5);
  background: #f8fafd;
  border-radius: 9px;
  height: 34px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-2, #2a3a56);
  cursor: pointer;
  transition: background .3s, color .3s, border-color .3s, transform .3s cubic-bezier(.34, 1.56, .64, 1);
}
.tl-habit__day:hover { border-color: rgba(0, 168, 81, .45); transform: translateY(-2px); }
.tl-habit__day.is-on {
  background: linear-gradient(135deg, #00a851, #2ecf7f);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 14px rgba(0, 168, 81, .3);
}
.tl-habit__day.is-today { outline: 2px solid rgba(0, 106, 255, .45); outline-offset: 1px; }
.tl-habit__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.tl-habit__stats div { text-align: center; background: #f8fafd; border: 1px solid var(--line, #e3eaf5); border-radius: 10px; padding: 9px 4px; }
.tl-habit__stats b { display: block; font-size: 19px; font-weight: 800; color: #00a851; font-variant-numeric: tabular-nums; }
.tl-habit__stats span { font-size: 11px; color: var(--muted, #64748b); }

/* —— 课时账本 —— */
.tl-ledger__lbl { font-size: 11px; color: var(--muted, #64748b); text-align: center; letter-spacing: .04em; }
.tl-ledger__list { list-style: none; margin: 6px 0 0; padding: 0; max-height: 170px; overflow-y: auto; scrollbar-width: thin; }
.tl-ledger__list li {
  display: grid;
  grid-template-columns: 1.3fr .5fr .8fr .9fr .8fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 6px;
  border-bottom: 1px dashed var(--line, #e3eaf5);
  font-size: 12.5px;
  animation: tlRowIn .35s ease backwards;
}
@keyframes tlRowIn { from { opacity: 0; transform: translateX(-8px); } }
.tl-ledger__list .ld-n { font-weight: 700; color: var(--ink, #14243f); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-ledger__list .ld-s { font-weight: 800; color: #7c5cd6; text-align: right; font-variant-numeric: tabular-nums; }
.tl-ledger__list .ld-h, .tl-ledger__list .ld-r, .tl-ledger__list .ld-d { color: var(--ink-2, #2a3a56); font-variant-numeric: tabular-nums; }
.tl-ledger__list .ld-x {
  appearance: none;
  border: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(229, 72, 77, .1);
  color: #e5484d;
  font-size: 13px;
  cursor: pointer;
  transition: background .3s, transform .3s;
}
.tl-ledger__list .ld-x:hover { background: rgba(229, 72, 77, .2); transform: rotate(90deg); }
.tl-ledger .tl-result--row { margin-top: 12px; }
.tl-ledger__csv {
  appearance: none;
  border: 1px solid rgba(124, 92, 214, .35);
  background: rgba(124, 92, 214, .07);
  color: #7c5cd6;
  font-size: 11.5px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .3s, color .3s, transform .3s;
}
.tl-ledger__csv:hover { background: #7c5cd6; color: #fff; transform: translateY(-1px); }

@media (max-width: 560px) {
  .tl-field-row { grid-template-columns: 1fr 1fr; }
  .tl-field-row--4 { grid-template-columns: 1fr 1fr; }
  .tl-ledger__list li { grid-template-columns: 1.2fr .4fr .6fr .8fr .7fr auto; font-size: 11.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .tl-ledger__list li, .tl-flash__inner, .tl-habit__day, .tl-pomo__bar { transition: none !important; animation: none !important; }
}

/* hidden 兜底（display:flex 等会压过 [hidden]） */
[hidden] { display: none !important; }

/* ============================================================
   课时账本：标签与输入框绑定（修复移动端标签行错位/文案串位）
   ============================================================ */
.tl-ledger__form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
.tl-ledger__form .tl-field { margin: 0; display: block; }
.tl-ledger__form .tl-field span {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--muted, #64748b);
}
.tl-ledger__form .tl-field input { width: 100%; }

@media (max-width: 640px) {
  .tl-ledger__form { grid-template-columns: 1fr 1fr; gap: 8px 10px; }
}
/* 抽认卡：窄屏下「添加」按钮独占一行，避免缩成小方块 */
@media (max-width: 560px) {
  .tl-flash .tl-field-row { grid-template-columns: 1fr 1fr; }
  .tl-flash .tl-field-row .tl-btn { grid-column: 1 / -1; }
}

/* 窄屏：账本「记一笔」占满整行，便于点击 */
@media (max-width: 640px) {
  .tl-ledger > .tl-btn { width: 100%; }
}
