/* Daily practice extends the shared warm paper and wood palette. */
[hidden] { display: none !important; }
.study-page { background: radial-gradient(ellipse at 95% 8%, #e8e8dd 0, transparent 42%), var(--bg); min-height: 100vh; }
.study-topbar { padding-inline: max(22px, calc((100vw - 1180px) / 2)); gap: 20px; }
.brand { color: var(--ink); display: flex; align-items: center; gap: 12px; font-family: "STSong", "Songti SC", "Noto Serif CJK SC", serif; font-size: 19px; font-weight: 600; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand small { display: block; color: var(--ink-soft); font: 11px/1.6 "KaiTi", "STKaiti", serif; letter-spacing: 3px; }
.brand-seal { display: grid; place-items: center; width: 42px; height: 45px; border: 1px solid #ac4635; outline: 1px solid #ac4635; outline-offset: -5px; background: #ac4635; color: #fff8e9; font-family: "KaiTi", "STKaiti", serif; font-size: 27px; }
.study-shell { width: min(1180px, 100%); margin: auto; padding: 0 22px; }
.study-nav { display: flex; gap: 30px; padding-top: 21px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.study-nav a { flex-shrink: 0; padding: 4px 0 15px; color: var(--ink-soft); border-bottom: 3px solid transparent; font-size: 14px; }
.study-nav a[aria-current="page"] { color: var(--accent); border-color: var(--accent); font-weight: 600; }
.study-nav a:hover { text-decoration: none; color: var(--accent); }
.page-heading { padding: 34px 0 24px; }
.eyebrow { margin: 0 0 6px; font-size: 11px; letter-spacing: 3px; color: var(--accent); }
.page-heading h1 { font-family: "STSong", "Songti SC", "Noto Serif CJK SC", serif; font-size: clamp(28px, 4vw, 36px); margin: 0; font-weight: 600; letter-spacing: 3px; }
.page-description { margin: 9px 0 0; color: var(--ink-soft); font-size: 14px; }
.loading-state { padding: 30px 0; color: var(--ink-soft); }
.daily-summary { display: flex; align-items: center; gap: 36px; background: #e9eee7; border: 1px solid #d9e0d5; border-left: 3px solid var(--accent); padding: 16px 22px; margin-bottom: 24px; }
.daily-summary > div { min-width: 120px; }
.small-label { display: block; color: var(--ink-soft); font-size: 12px; }
.daily-summary strong { display: block; font-family: Georgia, "STSong", serif; font-size: 30px; font-weight: normal; line-height: 1.4; }
.daily-summary strong small { font: 14px Georgia, serif; color: var(--ink-soft); }
.daily-summary p { color: var(--ink-soft); font-size: 13px; margin-left: auto; max-width: 250px; }
.practice-layout { display: grid; grid-template-columns: minmax(250px, .68fr) minmax(0, 1.55fr); gap: 24px; align-items: start; }
.practice-layout > .card { margin: 0; }
/* 长题单（200+ 题）往下翻时，棋盘跟随视口停靠，不用翻回页首 */
.practice-layout .solve-card, .practice-layout .practice-note { position: sticky; top: 16px; }
.practice-layout .solve-card { max-height: calc(100vh - 32px); overflow-y: auto; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-title h2 { margin: 0; }
.task-legend { display: flex; gap: 6px; align-items: center; margin: 16px 0 20px; font-size: 11px; color: var(--ink-soft); }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; margin-left: 10px; }
.legend-dot:first-child { margin-left: 0; }
.legend-dot.solved { background: var(--accent); }
.legend-dot.failed { background: var(--red); }
.puzzle-group h3 { display: flex; gap: 10px; align-items: baseline; margin: 20px 0 10px; font-size: 13px; font-weight: 500; color: var(--ink-soft); }
.puzzle-group:first-child h3 { margin-top: 0; }
.puzzle-group h3::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.puzzle-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; }
.puzzle-button { padding: 9px 2px; min-height: 63px; display: flex; flex-direction: column; align-items: center; background: #faf7f0; color: var(--ink); border-color: var(--line); border-radius: 5px; }
.puzzle-button .puzzle-number { font-family: Georgia, serif; font-size: 19px; line-height: 1.3; }
.puzzle-button .puzzle-status { font-size: 10px; margin-top: 4px; white-space: nowrap; }
.puzzle-button.solved { background: #eaf2eb; border-color: #cadfd0; color: var(--accent); }
.puzzle-button.failed { background: #fcf0e9; border-color: #edd6c9; color: #a34534; }
.puzzle-button.active { border-color: #b59860; background: #f5efd9; }
.puzzle-button.selected { outline: 2px solid var(--accent); outline-offset: 2px; }
.wrong-list { display: flex; flex-direction: column; gap: 10px; }
.wrong-item { background: #faf7f0; border-color: var(--line); color: var(--ink); display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: left; padding: 13px 14px; }
.wrong-item strong { display: block; font-size: 14px; font-weight: 500; }
.wrong-item small { display: block; margin-top: 3px; color: var(--ink-soft); font-size: 11px; }
.wrong-item .review-badge { font-size: 11px; color: #a34534; white-space: nowrap; }
.wrong-item.solved .review-badge { color: var(--accent); }
.wrong-item.selected { border-color: var(--accent); }
.practice-note { display: flex; align-items: center; gap: 27px; padding: 56px 30px; position: relative; min-height: 340px; justify-content: center; }
.note-mark { font-family: "KaiTi", "STKaiti", "Noto Serif CJK SC", serif; font-size: 37px; line-height: 1.5; color: #647760; border-right: 1px solid var(--line); padding-right: 22px; }
.practice-note p { font-family: "STSong", "Songti SC", serif; font-size: 18px; line-height: 2; color: var(--ink-soft); }
.practice-note > span { position: absolute; bottom: 14px; font-size: 12px; color: #93897c; }
.solve-card h2 { font-family: "STSong", "Songti SC", serif; font-size: 20px; overflow-wrap: anywhere; }
.play-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--ink-soft); margin: 18px 0 12px; font-variant-numeric: tabular-nums; }
.play-meta b { font-weight: 500; }
/* 电脑端棋盘尽量大：吃满栏宽，同时不超过视口高度（棋盘高宽比≈612/552，
   高度占满时反推宽度），保证整盘不用滚动就能看全。 */
.solve-card .board-wrap { margin-inline: auto; width: 100%; max-width: min(700px, calc((100vh - 230px) * 0.9)); }
.play-message { padding: 13px 0 0; font-size: 14px; color: var(--accent); min-height: 35px; }
.play-message.failed { color: var(--red); line-height: 1.8; }
.play-message.warning { color: #986218; }
.play-guidance { margin: 4px 0 16px; }
.compact { padding: 6px 10px; font-size: 12px; white-space: nowrap; }
.archive-toolbar, .wrong-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-bottom: 20px; font-size: 13px; }
.archive-toolbar select, .wrong-toolbar select { width: auto; min-width: 160px; }
.empty-state { text-align: center; padding: 32px 12px 36px; }
.empty-seal { color: #a29074; border: 1px solid #c7b99f; font: 32px/1.9 "KaiTi", "STKaiti", serif; display: inline-block; width: 58px; height: 62px; }
.empty-state h3 { font-size: 15px; margin: 20px 0 8px; }
.empty-state p { font-size: 13px; color: var(--ink-soft); margin: 0; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-tile { padding: 20px 24px; background: var(--panel); border: 1px solid var(--line); border-top: 3px solid #7c9674; }
.stat-tile strong { display: block; font: 34px/1.5 Georgia, serif; color: var(--accent); }
.stat-tile span { font-size: 12px; color: var(--ink-soft); }
.stats-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.stats-columns > .card { margin: 0; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; font-size: 13px; }
th { color: var(--ink-soft); font-size: 12px; font-weight: 500; background: #f7f4ed; }
th, td { padding: 12px; text-align: left; border-bottom: 1px solid var(--line); }
td { max-width: 250px; overflow: hidden; text-overflow: ellipsis; }
tr.current-user td { color: var(--accent); background: #eff4ec; }
.calendar-list { max-height: 310px; overflow-y: auto; }
.calendar-entry { display: flex; gap: 12px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 10px 0; font-size: 13px; }
.calendar-entry small { display: block; color: var(--ink-soft); font-size: 11px; }
.calendar-entry strong { color: var(--accent); font-weight: 500; }
.ranking-card { margin-top: 24px; }
.password-card { max-width: 460px; }
.password-card > .hint { margin: -5px 0 22px; }
.entry-link { display: inline-block; padding: 9px 18px; border: 1px solid var(--accent); border-radius: 6px; background: var(--accent); color: #fff; font-size: 14px; }
.entry-link:hover { text-decoration: none; opacity: .88; }
.study-footer { display: flex; gap: 20px; justify-content: space-between; padding: 34px 0 24px; margin-top: 28px; color: #978c7e; font-size: 11px; border-top: 1px solid var(--line); letter-spacing: 1px; }
.study-footer a { color: var(--ink-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
@media (prefers-reduced-motion: no-preference) { .page-heading { animation: page-arrive .35s ease-out both; } @keyframes page-arrive { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } } }
@media (max-width: 760px) {
  .study-topbar { flex-wrap: wrap; gap: 10px 14px; padding: 12px 16px; }
  .brand { font-size: 16px; }
  .brand small { font-size: 10px; letter-spacing: 2px; }
  .brand-seal { width: 35px; height: 39px; font-size: 23px; }
  .study-topbar .who { max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
  #admin-link { font-size: 12px; }
  .study-shell { padding-inline: 16px; }
  .study-nav { gap: 23px; padding-top: 14px; }
  .study-nav a { font-size: 13px; }
  .page-heading { padding-top: 26px; }
  .daily-summary { gap: 18px; padding: 14px 16px; flex-wrap: wrap; }
  .daily-summary > div { min-width: 110px; }
  .daily-summary p { max-width: none; margin: 0; width: 100%; font-size: 12px; }
  .practice-layout { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .practice-note { display: none; }
  .card { padding: 18px; }
  .puzzle-group { display: inline-block; width: 100%; }
  .puzzle-grid { gap: 9px; }
  .solve-card { scroll-margin-top: 16px; }
  /* 单栏布局下取消停靠，棋盘随文档流,点击题目时自动滚到棋盘 */
  .practice-layout .solve-card { position: static; max-height: none; overflow: visible; }
  /* 手机上长题单(200+ 题)收进半屏内部滚动:棋盘始终就在列表下方,选完题一小步就到 */
  #puzzle-list { max-height: 48vh; overflow-y: auto; overscroll-behavior: contain; padding: 2px; }
  /* 手机上棋盘出血到卡片边缘：9 路棋盘上每格多 3px，点子准头明显提升 */
  .solve-card { padding-inline: 8px; }
  .solve-card .section-title, .solve-card .play-meta, .solve-card .play-message,
  .solve-card .play-guidance, .solve-card .btn-row { padding-inline: 10px; }
  .solve-card .board-wrap { max-width: none; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .stats-columns { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .stat-tile { padding: 14px 18px; }
  .stat-tile strong { font-size: 29px; }
}
@media (max-width: 390px) { .study-topbar .who { display: none; } .card { padding: 14px; } .play-meta { font-size: 11px; } }
