/* Home, 往期, 我的成语 and 设置与同步. */
.kai { font-family: var(--kai); }
.small { font-size: var(--fs-sm); }
.text-link { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; font-weight: 600; }

.wechat-banner {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 16px;
  background: var(--mark); font-size: var(--fs-sm); line-height: 1.4;
}
.wechat-banner span { flex: 1; }
.wechat-banner .icon { border: none; background: transparent; width: 44px; height: 44px; padding: 0; }

.home-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; text-align: center; }
/* Small labelled icons in the header corners: reachable, but not another card. */
.head-link {
  display: inline-flex; flex-direction: column; align-items: center; gap: 2px; min-width: 44px; min-height: 44px;
  padding: 4px 2px; text-decoration: none; color: var(--muted); font-size: var(--fs-2xs); line-height: 1.2;
}
.head-link:hover { color: var(--ink); }
.head-link.left { justify-self: start; }
.head-link.right { justify-self: end; }
.home-cards { display: grid; gap: 14px; }

.daily-card {
  background: var(--surface); border: 2px solid var(--accent); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 20px 8px; display: grid; gap: 10px;
}
.daily-card.done { background: var(--good-bg); border-color: var(--good); padding-bottom: 12px; }
.daily-card.done > .daily-head svg { color: var(--good); }
.daily-card p { margin: 0; }
.daily-head { display: flex; align-items: center; gap: 4px 10px; flex-wrap: wrap; }
.daily-title { font-family: var(--kai); font-size: var(--kai-head); font-weight: normal; line-height: var(--lh-title); }
.term-chip {
  justify-self: start; font-family: var(--kai); font-size: var(--fs-sm); color: var(--good);
  border: 1px solid var(--good); border-radius: 4px; padding: 0 8px; line-height: 1.6;
}
.daily-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.yesterday { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; min-height: 44px; }
.streak-badge { margin-left: auto; display: inline-flex; align-items: center; gap: 3px; color: var(--accent); font-weight: 700; }
.streak-note { background: var(--blank); border-radius: 10px; padding: 8px 12px; font-size: var(--fs-sm); }
.daily-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; }
.button.big { padding: 12px 16px; }

.meter { height: 8px; border-radius: 4px; background: var(--blank); overflow: hidden; flex: 1; }
.meter span { display: block; height: 100%; background: var(--good); }
.meter.accent span { background: var(--accent); }
.meter-row { display: flex; align-items: center; gap: 10px; }


/* sub-page header */
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.page-head h1 { margin: 0; font-size: var(--kai-title); letter-spacing: 0.04em; }
.back-button {
  width: 44px; height: 44px; flex: none; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink);
}

/* 往期 */
.streak-line { display: flex; gap: 16px; align-items: center; margin: 0 0 8px; }
.month-nav { display: flex; align-items: center; justify-content: space-between; margin: 6px 0; }
.month-nav button { width: 44px; height: 44px; padding: 0; }
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; text-align: center; }
.cal-head { display: flex; flex-direction: column; line-height: 1.2; font-weight: 700; }
.cal-head span { font-size: 0.7rem; font-weight: 400; color: var(--muted); }
.cal-day {
  min-height: 58px; padding: 3px 0; display: flex; flex-direction: column; align-items: center; gap: 2px;
  border: 1px solid transparent; background: transparent; border-radius: 10px; font-size: 0.8rem; line-height: 1.1;
}
.cal-day:disabled { color: var(--line); }
.cal-day.picked { background: var(--mark); border-color: var(--accent); }
.badge {
  width: 32px; height: 32px; border-radius: 50%; box-sizing: border-box;
  display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 700;
}
.badge.onday { background: var(--accent); color: var(--bg); font-family: var(--kai); font-size: 1rem; border-radius: 4px; transform: rotate(-6deg); }
.badge.late { border: 2px solid var(--accent); color: var(--accent); font-family: var(--kai); font-size: 1rem; border-radius: 4px; }
.badge.open { border: 2px dashed var(--muted); }
.badge.today { border: 3px solid var(--accent); color: var(--accent); font-size: 0.68rem; }
.badge.going { border: 2px dashed var(--accent); color: var(--accent); }
.legend { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; font-size: var(--fs-xs); color: var(--muted); margin: 12px 0 4px; }
.legend > span { display: flex; align-items: center; gap: 6px; }
.legend .badge { width: 24px; height: 24px; font-size: 0.6rem; }
.detail-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 16px; margin-top: 12px; display: grid; gap: 8px;
}
.detail-card p { margin: 0; }

/* 我的成语 */
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; text-align: center; }
.tile-stat { border-radius: var(--radius); padding: 8px 4px; line-height: 1.3; background: var(--surface); border: 1px solid var(--line); }
.tile-stat b { display: block; font-size: 1.5rem; }
.tile-stat.good { background: var(--good-bg); border-color: transparent; }
.tile-stat.good b { color: var(--good); }
.tile-stat.dim { background: var(--blank); border-color: transparent; color: var(--muted); }
.bands {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 16px; margin: 12px 0; display: grid; gap: 8px; font-size: var(--fs-sm);
}
.band { display: grid; grid-template-columns: 4.5em minmax(0, 1fr) 5.5em; gap: 10px; align-items: center; }
.band .num { text-align: right; }
.band.dim { color: var(--muted); grid-template-columns: 4.5em minmax(0, 1fr); }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.tabs button { border-radius: 22px; min-height: 44px; }
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.idiom-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.idiom-list li {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px;
  display: flex; align-items: center; gap: 10px;
}
.idiom-list .text { flex: 1; display: flex; flex-direction: column; line-height: 1.4; }
.idiom-list .w { font-family: var(--kai); font-size: var(--kai-word); }
.idiom-list .m { color: var(--muted); font-size: var(--fs-xs); }
.dots { display: flex; gap: 4px; }
.dots span { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line); box-sizing: border-box; }
.dots span.on { background: var(--good); border-color: var(--good); }
.list-note { text-align: center; color: var(--muted); font-size: var(--fs-xs); }
.wide { display: block; width: 100%; margin-top: 12px; }

/* 设置与同步 */
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 16px; margin-bottom: 14px; display: grid; gap: 10px;
}
.panel h2 { font-size: var(--fs-lead); margin: 0; }
.panel p { margin: 0; }
.toggle { display: flex; align-items: center; justify-content: space-between; min-height: 48px; }
.toggle + .toggle { border-top: 1px solid var(--line); }
.toggle input { width: 22px; height: 22px; accent-color: var(--accent); }
.code { font-size: 1.25rem; font-weight: 700; letter-spacing: 1px; background: var(--blank); border-radius: 10px; padding: 10px 12px; text-align: center; }
.panel input[type="text"], .panel textarea {
  font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; min-height: 44px; width: 100%;
}
.status-ok { color: var(--good); }
.status-bad { color: var(--bad); }
.streak-line .streak-badge { margin-left: 0; }
.month-nav b { white-space: nowrap; }
