/* 首页任务台专用。基座（变量 / 暗色 / 重置）在 base.css，本文件不重复定义。 */

/* ---------- 登录 ---------- */
.login-screen {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
}
.login-box { width: 100%; max-width: 340px; text-align: center; }
.login-mark { color: var(--brand); margin-bottom: 18px; }
.login-box h1 { font-size: 24px; font-weight: 600; margin: 0 0 6px; letter-spacing: .02em; }
.login-sub { font-size: 13px; color: var(--muted); margin: 0 0 32px; }
#login-form { display: flex; flex-direction: column; gap: 12px; }
#login-user, #login-pass {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--text);
  outline: none;
  text-align: center;
  letter-spacing: .12em;
}
#login-user:focus, #login-pass:focus { border-color: var(--brand); }
#login-btn {
  width: 100%;
  padding: 14px;
  font-size: 15px;
  font-weight: 500;
  border: none;
  border-radius: 12px;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
}
@media (prefers-color-scheme: dark) { #login-btn { color: #06201A; } }
#login-btn:active { opacity: .85; }
.login-error { color: var(--bad); font-size: 13px; min-height: 18px; margin: 12px 0 0; }

/* ---------- 骨架 ---------- */
/* 底部留出 iPhone 的 home indicator；首页加了 apple-mobile-web-app-capable，
   从主屏打开是全屏模式，不留会压住最下面的链接 */
.app {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 18px calc(28px + env(safe-area-inset-bottom, 0px));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: calc(env(safe-area-inset-top, 0px) + 16px) 0 10px;
}
.topbar .day { font-size: 15px; font-weight: 600; }
.topbar .right { display: flex; align-items: center; gap: 8px; }
.streak {
  display: inline-flex;
  align-items: center;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--brand-ink);
  background: var(--brand-soft);
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.link-btn {
  border: none;
  background: none;
  color: var(--muted);
  font-size: 13px;
  /* 点击区补到 40px 高，右上角"退出"原来只有一行字高，手指容易按空 */
  padding: 10px 8px;
  margin: -6px -8px -6px 0;
  cursor: pointer;
}

/* ---------- 今日提示 ---------- */
.today-note {
  font-size: 13px;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 14px;
  margin: 4px 0 14px;
}
.today-note b { color: var(--text); font-weight: 600; }

/* ---------- 结课卡 ---------- */
/* 走完全部排程才出现。用强调色描边，与"今天该练什么"的任务卡区分开 */
.recap {
  background: var(--card);
  border: 1px solid var(--brand);
  border-radius: var(--radius, 16px);
  padding: 16px 18px;
  margin: 0 0 14px;
}
.recap-h {
  font-size: 16px;
  font-weight: 650;
  color: var(--text);
  margin: 0 0 6px;
}
.recap-s {
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
  margin: 0 0 12px;
}
.recap-nums {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.recap-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: var(--bg);
  border-radius: 10px;
  padding: 8px 4px;
}
.recap-v {
  font-size: 17px;
  font-weight: 650;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.recap-k {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
@media (max-width: 340px) {
  /* 窄屏四列会把「打卡天数」挤成两行，退成两列 */
  .recap-nums { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- 任务卡 ---------- */
.tasks { display: flex; flex-direction: column; gap: 12px; }
.task-card {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius, 16px);
  box-shadow: var(--shadow, none);
  padding: 16px 18px;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.task-card:active { transform: translateY(1px); }
.task-card.done { border-color: var(--brand); }

.tc-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.tc-title { font-size: 16px; font-weight: 600; margin: 0; }
.tc-time { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tc-desc { font-size: 13px; color: var(--muted); margin: 6px 0 12px; line-height: 1.5; }

.tc-bar { height: 4px; background: var(--rail); border-radius: 4px; overflow: hidden; }
.tc-fill { height: 100%; background: var(--brand); border-radius: 4px; transition: width .3s ease; }
.task-card.done .tc-fill { background: var(--good); }

.tc-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 11px;
}
.tc-state { font-size: 12.5px; color: var(--muted); }
.tc-state.done { color: var(--good); font-weight: 600; }
.tc-go {
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-ink);
  background: var(--brand-soft);
  border-radius: 18px;
  padding: 6px 14px;
  white-space: nowrap;
}
.task-card.done .tc-go { background: var(--rail); color: var(--muted); }

/* ---------- 日历 ---------- */
.cal-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius, 16px);
  padding: 16px 18px;
  margin-top: 18px;
}
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-head > span { font-size: 14px; font-weight: 500; }
.cal-nav {
  display: flex;
  gap: 6px;
}
.cal-nav button {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
}
.cal-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  margin-bottom: 6px;
}
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-cell {
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  border-radius: 8px;
  font-variant-numeric: tabular-nums;
}
.cal-cell.empty { visibility: hidden; }
.cal-cell.done { background: var(--brand); color: #fff; font-weight: 500; }
@media (prefers-color-scheme: dark) { .cal-cell.done { color: #06201A; } }
.cal-cell.partial { background: var(--brand-soft); color: var(--brand-ink); }
.cal-cell.today { outline: 1.5px solid var(--brand); outline-offset: -1.5px; }

/* ---------- 底部入口 ---------- */
.links {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}
.links a {
  flex: 1;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 0;
  background: var(--card);
}

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 12px);
  background: rgba(20, 28, 25, .93);
  color: #fff;
  font-size: 13px;
  padding: 10px 18px;
  border-radius: 22px;
  opacity: 0;
  pointer-events: none;
  transition: all .25s ease;
  max-width: 82vw;
  text-align: center;
  z-index: 99;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 额外练习：与两张主线卡区分开 —— 不是任务，是"想多练"的出口 */
.task-card.extra {
  text-decoration: none;
  border-style: dashed;
  background: transparent;
}
.task-card.extra .tc-title { font-size: 15px; }
.task-card.extra .tc-desc { margin-bottom: 4px; }
.task-card.extra .tc-go { color: var(--muted); }
.task-card.extra:hover .tc-go { color: var(--brand); }

/* ---------- 日历回看 ---------- */
.cal-cell[data-date] { cursor: pointer; }
.cal-cell.sel { outline: 2px solid var(--brand); outline-offset: -2px; }

.cal-detail {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}
.cd-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}
.cd-date { font-size: 13.5px; font-weight: 600; color: var(--text); }
.cd-state { font-size: 12px; color: var(--muted); }
.cd-state.ok { color: var(--brand-ink); }
.cd-close {
  margin-left: auto;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  padding: 0 4px;
  cursor: pointer;
}
.cd-line { font-size: 12.5px; color: var(--muted); margin: 0 0 6px; }
.cd-group {
  font-size: 11.5px;
  color: var(--muted);
  margin: 10px 0 4px;
  letter-spacing: .02em;
}
.cd-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  border-top: 1px solid var(--line);
}
.cd-item:first-of-type { border-top: none; }
.cd-no {
  flex: 0 0 auto;
  font-size: 10.5px;
  color: var(--muted);
  background: var(--rail);
  border-radius: 5px;
  padding: 1px 5px;
}
.cd-title {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cd-extra { font-size: 11px; color: var(--muted); }
.cd-play {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
}
.cd-play:hover { border-color: var(--brand); color: var(--brand); }

/* ---------- 安装到桌面提示 ---------- */
.install-tip {
  background: var(--brand-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 0 0 12px;
}
.it-s {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
  margin: 0 0 10px;
}
.it-row { display: flex; gap: 8px; }
.it-go,
.it-later {
  flex: 1;
  padding: 9px;
  font-size: 13px;
  font-family: inherit;
  border-radius: 9px;
  cursor: pointer;
  border: 1px solid var(--line);
}
.it-go {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 550;
}
.it-later {
  background: var(--card);
  color: var(--muted);
}
