* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif; color: #222; background: #f6f4ef; line-height: 1.6; }
a { color: #8a4b14; }
header.site { background: #fff; border-bottom: 1px solid #e6e1d6; }
header.site .in { max-width: 960px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.logo { font-weight: 700; font-size: 18px; color: #5b3410; text-decoration: none; }
header.site nav { display: flex; gap: 16px; flex: 1; }
header.site nav a { text-decoration: none; color: #444; }
header.site nav a.on { color: #8a4b14; font-weight: 600; }
header.site .right { margin-left: auto; font-size: 14px; }
header.admin { background: #34404c; }
header.admin .logo, header.admin nav a, header.admin .right, header.admin .right a { color: #fff; }
header.admin nav a.on { color: #ffd27a; }
main { max-width: 960px; margin: 0 auto; padding: 20px 16px 60px; }
h1 { font-size: 22px; margin: 8px 0 16px; }
h2 { font-size: 18px; margin: 24px 0 12px; }
.muted { color: #777; font-size: 14px; }
.card { background: #fff; border: 1px solid #e6e1d6; border-radius: 10px; padding: 16px; margin-bottom: 16px; }
.book { display: flex; gap: 20px; align-items: flex-start; }
.cover { width: 110px; min-width: 110px; height: 150px; border-radius: 6px; background: linear-gradient(160deg, #a0612a, #5b3410); color: #fff; display: flex; align-items: center; justify-content: center; text-align: center; padding: 8px; font-weight: 700; font-size: 15px; }
.book .title { font-size: 22px; font-weight: 700; margin: 0; }
.book .author { color: #555; margin: 4px 0 8px; }
.tag { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 10px; background: #eee; color: #555; vertical-align: middle; }
.tag.cur { background: #8a4b14; color: #fff; }
.tag.green { background: #e3f3e6; color: #1d7a34; }
.tag.red { background: #fde8e6; color: #b3261e; }
.tag.gray { background: #eee; color: #666; }
.tag.blue { background: #e4eef9; color: #1f5fa8; }
.tag.orange { background: #fff1dc; color: #a55d00; }
.sessions { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.session h3 { margin: 0 0 8px; font-size: 16px; display: flex; justify-content: space-between; align-items: center; }
.session .row { font-size: 14px; margin: 2px 0; }
.session .row b { display: inline-block; width: 3em; color: #888; font-weight: 400; }
.session .actions { margin-top: 12px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.bar { height: 6px; background: #eee; border-radius: 3px; overflow: hidden; margin-top: 8px; }
.bar i { display: block; height: 100%; background: #c9893f; }
.btn { display: inline-block; border: 1px solid #8a4b14; background: #8a4b14; color: #fff; padding: 7px 18px; border-radius: 6px; text-decoration: none; font-size: 15px; cursor: pointer; font-family: inherit; }
.btn.ghost { background: #fff; color: #8a4b14; }
.btn.small { padding: 3px 10px; font-size: 13px; }
.btn.danger { background: #b3261e; border-color: #b3261e; }
.btn.danger.ghost { background: #fff; color: #b3261e; }
.btn[disabled], .btn.disabled { background: #ccc; border-color: #ccc; color: #fff; cursor: not-allowed; pointer-events: none; }
.admin-ui .btn { background: #34607f; border-color: #34607f; }
.admin-ui .btn.ghost { background: #fff; color: #34607f; }
.admin-ui .btn.danger { background: #b3261e; border-color: #b3261e; }
.admin-ui .btn.danger.ghost { background: #fff; color: #b3261e; }
.admin-ui a { color: #2b5f88; }
form .field { margin-bottom: 14px; }
form label { display: block; font-size: 14px; margin-bottom: 4px; color: #444; }
form input[type=text], form input[type=tel], form input[type=password], form input[type=number], form input[type=date], form input[type=time], form input[type=month], form textarea, form select { width: 100%; max-width: 420px; padding: 8px 10px; border: 1px solid #ccc; border-radius: 6px; font-size: 15px; font-family: inherit; }
form .err input, form .err textarea { border-color: #b3261e; background: #fff8f7; }
.errmsg { color: #b3261e; font-size: 13px; margin-top: 4px; display: none; }
.err .errmsg { display: block; }
.hint { color: #888; font-size: 13px; margin-top: 4px; }
.notice { padding: 12px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 15px; }
.notice.ok { background: #e3f3e6; color: #1d5a2c; border: 1px solid #b9e0c2; }
.notice.warn { background: #fff4e0; color: #7a4a00; border: 1px solid #f1d39b; }
.notice.bad { background: #fde8e6; color: #8c1d16; border: 1px solid #f3bcb6; }
.notice.info { background: #e9f1fa; color: #1e4c7a; border: 1px solid #c3d8ef; }
.big-ok { text-align: center; padding: 30px 16px; }
.big-ok .icon { font-size: 48px; }
table { width: 100%; border-collapse: collapse; background: #fff; font-size: 14px; }
th, td { padding: 8px 10px; border-bottom: 1px solid #eee; text-align: left; vertical-align: middle; }
th { background: #f3f5f7; font-weight: 600; color: #444; white-space: nowrap; }
tr.absent td { color: #999; }
tr.walkin td { background: #fffaf0; }
.stats { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.stat { background: #fff; border: 1px solid #e3e6ea; border-radius: 8px; padding: 10px 16px; min-width: 120px; }
.stat .n { font-size: 24px; font-weight: 700; }
.stat .l { font-size: 13px; color: #777; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid #ddd; margin-bottom: 0; flex-wrap: wrap; }
.tabs a { padding: 8px 14px; text-decoration: none; color: #555; border: 1px solid transparent; border-bottom: none; border-radius: 6px 6px 0 0; }
.tabs a.on { background: #fff; border-color: #ddd; color: #222; font-weight: 600; margin-bottom: -1px; }
.empty { text-align: center; color: #888; padding: 40px 16px; background: #fff; }
.month-list { list-style: none; padding: 0; margin: 0; }
.month-list li { display: flex; gap: 16px; align-items: center; padding: 12px 0; border-bottom: 1px solid #eee; }
.month-list .ml { width: 110px; color: #777; }
.month-list .mb { flex: 1; }
.sess-edit { border: 1px dashed #c9ced6; border-radius: 8px; padding: 12px; margin-bottom: 12px; background: #fafbfc; }
.sess-edit .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px 16px; }
.sess-edit .grid .wide { grid-column: 1 / -1; }
.toast { position: fixed; top: 60px; left: 50%; transform: translateX(-50%); background: #1d5a2c; color: #fff; padding: 10px 20px; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,.2); z-index: 9; }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; z-index: 10; padding: 16px; }
.modal { background: #fff; border-radius: 10px; padding: 20px; max-width: 420px; width: 100%; }
.table-wrap { overflow-x: auto; border: 1px solid #ddd; border-top: none; border-radius: 0 0 8px 8px; }
footer { text-align: center; color: #999; font-size: 13px; padding: 20px; }
@media (max-width: 640px) {
  .book { flex-direction: column; }
  .cover { width: 90px; min-width: 90px; height: 120px; }
  header.site nav { order: 3; width: 100%; flex: none; }
  h1 { font-size: 20px; }
}
.hero { background: linear-gradient(135deg, #5b3410, #a0612a); color: #fff; border-radius: 12px; padding: 20px 22px; margin: 8px 0 20px; box-shadow: 0 4px 14px rgba(91,52,16,.25); }
.hero .k { font-size: 14px; opacity: .85; letter-spacing: 1px; }
.hero .when { font-size: 26px; font-weight: 700; margin: 6px 0 2px; }
.hero .where { font-size: 16px; margin: 2px 0; }
.hero .bk { font-size: 14px; opacity: .9; margin-top: 4px; }
.hero .go { margin-top: 14px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.hero .btn { background: #fff; color: #5b3410; border-color: #fff; font-size: 17px; padding: 9px 28px; font-weight: 700; }
.hero .btn.disabled { background: rgba(255,255,255,.35); border-color: transparent; color: #fff; }
.hero a { color: #ffe2b8; }
.hero.none { background: #fff; color: #444; border: 1px dashed #c9b79c; box-shadow: none; }
@media (max-width: 640px) { .hero .when { font-size: 21px; } .hero .btn { width: 100%; text-align: center; } }

/* ---- 以下为实现补充（原型中以内联样式或浏览器默认样式出现的部分） ---- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.req { color: #b3261e; margin-left: 2px; }
.narrow { max-width: 460px; }
.head-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.head-row h1 { margin-right: auto; }
.back { margin: 0 0 4px; font-size: 14px; }
.loading { color: #888; padding: 40px 0; text-align: center; }
.empty .icon { font-size: 40px; }
.empty p { margin: 6px 0; }
.links-inline { display: flex; flex-wrap: wrap; gap: 8px 12px; margin: 8px 0 0; }
.month-list .mb .muted { display: block; }
.hero h2 { font-size: 14px; font-weight: 400; opacity: .85; letter-spacing: 1px; margin: 0; }
.hero.none h2 { opacity: 1; color: #777; }
.hero.none .none-title { font-weight: 700; margin: 8px 0 0; font-size: 17px; }
.book .title { font-size: 22px; }
.book h2.title, .book h3.title { margin: 0; }
.cover { user-select: none; }
.session h3 .nm { font-weight: 700; }
.session .row b { width: 2.5em; }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, button:focus-visible, [role=tab]:focus-visible { outline: 3px solid #e0a24a; outline-offset: 2px; }
button.btn { line-height: 1.6; }
.notice p { margin: 4px 0 0; }
.notice strong + span { margin-left: 2px; }
form .field input[aria-invalid=true], form .field select[aria-invalid=true] { border-color: #b3261e; background: #fff8f7; }
.field .errmsg:empty { display: none; }
.big-ok h1 { margin-top: 4px; }
.big-ok .actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 12px; }
.big-ok .detail { margin: 8px 0; }
dialog.modal { border: none; border-radius: 10px; padding: 20px; max-width: 420px; width: calc(100% - 32px); box-shadow: 0 10px 30px rgba(0,0,0,.25); }
dialog.modal::backdrop { background: rgba(0,0,0,.4); }
dialog.modal h2 { margin-top: 0; }
dialog.modal .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.toast-zone { position: fixed; top: 60px; left: 50%; transform: translateX(-50%); z-index: 9; pointer-events: none; }
.toast-zone .toast { position: static; transform: none; }
.toast-zone:empty { display: none; }
header.site .right { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
header.admin .right button.linkish { background: none; border: none; color: #fff; text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }
.tabs [role=tab] { padding: 8px 14px; color: #555; border: 1px solid transparent; border-bottom: none; border-radius: 6px 6px 0 0; background: none; font: inherit; cursor: pointer; }
.tabs [role=tab][aria-selected=true] { background: #fff; border-color: #ddd; color: #222; font-weight: 600; margin-bottom: -1px; }
.roster-tools { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 8px; }
.roster-tools input[type=search] { padding: 6px 10px; border: 1px solid #ccc; border-radius: 6px; margin-bottom: 6px; font: inherit; font-size: 14px; min-width: 200px; }
.table-wrap table { min-width: 620px; }
.table-wrap .empty { border-radius: 0 0 8px 8px; }
td input[type=checkbox] { width: 20px; height: 20px; cursor: pointer; }
td .linkish, .sess-edit .linkish { background: none; border: none; color: #b3261e; cursor: pointer; font: inherit; padding: 0; text-decoration: underline; }
.walkin-form { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.walkin-form .field input { width: 180px; }
.walkin-form .field .spacer { display: block; height: 1.6em; margin-bottom: 4px; }
.admin-table { overflow-x: auto; margin-top: 10px; }
.admin-table table { min-width: 640px; }
.sess-edit legend { font-weight: 700; padding: 0 4px; }
.sess-edit { position: relative; }
.sess-edit .sess-head { display: flex; justify-content: flex-end; align-items: center; margin-top: -4px; }
.sess-edit .grid .wide input { max-width: 100%; }
.sess-edit .notice { margin: 4px 0 0; }
.radio-line { display: flex; gap: 8px; align-items: center; margin: 6px 0; font-size: 15px; }
form .radio-line label { display: inline; margin: 0; font-size: 15px; color: #222; }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
.card h2.in-card { margin-top: 0; }
.stat .n { line-height: 1.3; }
@media (max-width: 640px) {
  .roster-tools input[type=search] { min-width: 0; width: 100%; }
  .walkin-form .field, .walkin-form .field input { width: 100%; }
  .walkin-form .field .spacer { display: none; }
  .stat { min-width: calc(50% - 6px); flex: 1; }
}
header.site nav .nav-right { margin-left: auto; }
fieldset.sess-edit { min-width: 0; }
h2.inline-title { display: inline; font-size: 16px; margin: 0; }
.nowrap { white-space: nowrap; }
.admin-ui a.btn { color: #fff; }
.admin-ui a.btn.ghost { color: #34607f; }
