:root {
  --paper: #f8f7fc;
  --card: #fff;
  --ink: #20193a;
  --body: #504866;
  --line: #e5e0ef;
  --purple: #563dba;
  --lavender: #eee8ff;
  --lime: #e4f6a9;
  --radius: 21px;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  scroll-behavior: smooth;
}
* { box-sizing: border-box; }
body { margin: 0; }
h1, h2, h3, p, figure { margin: 0; }
h1, h2, h3 { line-height: 1.22; }
p { color: var(--body); }
a { color: inherit; text-decoration: none; }
a, button { -webkit-tap-highlight-color: transparent; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .52; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid #7157d5; outline-offset: 3px; }
img { display: block; max-width: 100%; }
svg { width: 1em; height: 1em; }
[hidden] { display: none !important; }
.shell { width: min(1152px, calc(100% - 64px)); margin-inline: auto; }
.skip { position: fixed; padding: 12px 16px; top: 0; left: 16px; transform: translateY(-120%); z-index: 10; background: #fff; }
.skip:focus { transform: none; }
.site-header { background: var(--card); border-bottom: 1px solid var(--line); }
.header-inner, .footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 73px; }
.brand { display: inline-flex; gap: 10px; align-items: center; font-weight: 800; font-size: 1.16rem; white-space: nowrap; min-height: 44px; }
.brand span { display: grid; place-items: center; background: var(--ink); color: var(--lime); border-radius: 10px; width: 36px; height: 36px; }
.brand svg { width: 21px; height: 21px; }
nav, .footer-inner > div { display: flex; gap: 21px; align-items: center; font-size: .925rem; font-weight: 650; }
nav > a, .footer-inner > div a { min-height: 44px; display: inline-flex; align-items: center; }
nav a:hover, .plain:hover, .footer-inner > div a:hover, .back-link:hover { color: var(--purple); }
.button { display: inline-flex; gap: .45rem; justify-content: center; align-items: center; min-height: 48px; border: 1px solid transparent; border-radius: 10px; padding: .6rem 1.18rem; font-weight: 700; transition: color .18s, background .18s, border-color .18s; white-space: nowrap; }
.button.small { min-height: 44px; font-size: .9rem; padding-inline: .95rem; }
.button.dark { background: var(--ink); color: #fff; }
.button.dark:hover:not(:disabled) { background: #49357d; color: #fff; }
.button.outline { background: transparent; border-color: #cbc2e2; color: var(--ink); }
.button.outline:hover { background: var(--lavender); border-color: #a38fd9; }
.plain { border: 0; background: transparent; color: var(--ink); min-height: 44px; padding: 0; font-weight: 650; }
.hero { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; align-items: center; padding: 64px 0 58px; }
.eyebrow { display: flex; align-items: center; gap: 8px; font-size: .94rem; color: var(--purple); font-weight: 750; }
.eyebrow span { width: 9px; height: 9px; border-radius: 50%; background: var(--purple); }
.hero h1 { font-size: clamp(2.9rem, 5.6vw, 5.05rem); letter-spacing: -.058em; margin: 17px 0 18px; font-weight: 900; line-height: 1.13; }
.period { color: var(--purple); }
.hero-description { font-size: 1.07rem; max-width: 386px; line-height: 1.75; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 23px; }
.hero-art { overflow: hidden; border-radius: 24px; background: #a49af5; }
.hero-art img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; }
.catalog { padding: 15px 0 42px; scroll-margin-top: 20px; }
.section-header h2, .join-strip h2 { font-size: 2rem; letter-spacing: -.04em; font-weight: 850; }
.section-header p { margin-top: 7px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 20px 0 17px; }
.filters button { background: #fff; color: var(--body); border: 1px solid var(--line); border-radius: 30px; padding: 7px 15px; min-height: 44px; font-size: .9rem; font-weight: 650; transition: background .18s; }
.filters button:hover { background: var(--lavender); }
.filters button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.lesson-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .18s, box-shadow .18s; }
.lesson-card:hover, .lesson-card:focus-within { border-color: #b8a5e7; box-shadow: 0 8px 22px #3821700b; }
.lesson-card > a { display: flex; flex-direction: column; height: 100%; min-height: 208px; padding: 20px; border-radius: inherit; }
.card-top, .card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.icon-tile { display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; flex: 0 0 auto; }
.icon-tile svg { width: 22px; height: 22px; }
.lavender { background: var(--lavender); color: #5033ab; }
.green { background: #e8f6c3; color: #3d5912; }
.peach { background: #ffe8db; color: #8a3d19; }
.blue { background: #e2eaff; color: #34488c; }
.access, .card-bottom span { display: inline-flex; align-items: center; gap: 5px; font-size: .85rem; color: var(--body); }
.access { background: #f5f2fa; border-radius: 20px; padding: 4px 9px; }
.lesson-card h3 { margin-top: 14px; font-size: 1.17rem; font-weight: 800; }
.lesson-card p { font-size: .95rem; margin: 7px 0 16px; }
.card-bottom { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); }
.join-strip { background: var(--lime); display: flex; justify-content: space-between; align-items: center; gap: 20px; border-radius: var(--radius); padding: 25px 30px; margin: 0 0 42px; }
.join-strip p { margin-top: 7px; color: #37402a; }
.site-footer { margin-top: 10px; border-top: 1px solid var(--line); }
.footer-inner { min-height: 88px; }
.footer-inner .brand { font-size: 1rem; }
.footer-inner .brand span { width: 30px; height: 30px; }
.form-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px; align-items: stretch; padding-block: 52px 58px; }
.form-box, .admin-panel { padding: clamp(22px, 3.6vw, 43px); border-radius: var(--radius); border: 1px solid var(--line); background: #fff; }
.form-box h1, .admin h1, .poster-layout h1 { font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -.04em; }
.form-box > p:first-of-type { margin-top: 10px; }
.form-art { border-radius: var(--radius); overflow: hidden; background: #a49af5; position: relative; min-height: 365px; }
.form-art img { height: 100%; width: 100%; object-fit: cover; position: absolute; }
.stack { display: grid; gap: 15px; margin-top: 20px; }
.stack label { display: grid; gap: 5px; color: var(--ink); font-size: .94rem; font-weight: 650; }
.stack input { min-width: 0; width: 100%; padding: 10px 12px; min-height: 46px; border: 1px solid #cac1dc; border-radius: 9px; background: #fcfbff; color: var(--ink); font-size: 1rem; }
.stack input[type="file"] { cursor: pointer; }
.stack small { color: var(--body); font-weight: 500; font-size: .88rem; }
.stack > .button { margin-top: 3px; }
.form-links { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 16px; }
.form-links a, .reading a:not(.button), .poster-layout .back-link { color: var(--purple); text-decoration: underline; text-underline-offset: .16em; }
.notice { padding: 12px 14px; border-radius: 10px; background: var(--lavender); margin: 14px 0; }
.notice.error { color: #851f35; background: #fae5e9; }
.steps { padding-inline-start: 1.35rem; margin: 19px 0; color: var(--body); }
.steps li + li { margin-top: 8px; }
.contact-qr { width: min(100%, 268px); margin: 0 0 20px; border: 1px solid var(--line); border-radius: 10px; }
.reading { max-width: 751px; min-height: 60vh; padding: 40px 0 60px; }
.back-link { display: inline-flex; min-height: 44px; align-items: center; font-size: .95rem; font-weight: 700; }
.reading .eyebrow { margin-top: 15px; }
.reading h1 { font-size: clamp(2.1rem, 6vw, 3.6rem); margin: 11px 0 14px; letter-spacing: -.04em; }
.reading h2 { font-size: 1.32rem; margin-bottom: 8px; }
.reading p { line-height: 1.85; }
.reading .lede { font-size: 1.12rem; }
.reading section { margin-top: 29px; }
.reading section p + p { margin-top: 10px; }
.locked-panel, .prompt-box { border: 1px solid var(--line); border-radius: var(--radius); background: white; padding: 23px; margin-top: 26px; }
.locked-panel h2 { margin-top: 12px; }
.prompt-box > div { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.prompt-box h2 { margin: 0 auto 0 0; }
.prompt-box pre { margin: 14px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; color: var(--body); }
.admin { padding-block: 38px 59px; min-height: 70vh; }
.admin-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 19px; }
.admin-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.admin > .form-box { max-width: 450px; }
.admin-panel h2 { margin-bottom: 8px; }
.admin-panel > a { margin-top: 14px; }
.invite-result { border-radius: 10px; background: var(--lime); padding: 9px 12px; font-weight: 800; overflow-wrap: anywhere; margin-top: 13px; }
.invite-result button { margin: 4px 8px; }
.invite-table { margin-top: 18px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 420px; border-collapse: collapse; text-align: left; }
td, th { padding: 8px 12px; border-bottom: 1px solid var(--line); }
.qr-thumbnail { max-width: 110px; margin-top: 14px; }
#qr-status:empty { display: none; }
.poster-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; padding-block: 38px 55px; align-items: start; }
.poster-layout p { margin: 12px 0 20px; }
.poster-frame canvas { display: block; width: 100%; height: auto; border-radius: var(--radius); background: var(--lavender); }
@media (max-width: 840px) {
  .hero { gap: 24px; padding-block: 44px 34px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 630px) {
  .shell { width: calc(100% - 32px); }
  .header-inner { min-height: 64px; gap: 10px; }
  .brand { gap: 6px; font-size: 1rem; }
  .brand span { width: 32px; height: 32px; }
  nav { gap: 10px; font-size: .9rem; }
  nav .small { padding-inline: 9px; }
  nav .catalog-nav { display: none; }
  .hero, .form-layout, .admin-columns, .poster-layout { grid-template-columns: 1fr; }
  .hero { padding-block: 32px 26px; }
  .hero-art { border-radius: 17px; }
  .hero h1 { font-size: clamp(2.5rem, 11vw, 3.6rem); }
  .grid { gap: 12px; }
  .join-strip { align-items: start; flex-direction: column; padding: 21px; }
  .form-layout { padding-block: 25px 38px; }
  .form-art { display: none; }
  .footer-inner > div { gap: 10px; flex-wrap: wrap; font-size: .85rem; justify-content: flex-end; }
}
@media (max-width: 470px) {
  .grid { grid-template-columns: 1fr; }
  .lesson-card > a { min-height: 185px; }
  .filters { gap: 6px; }
  .filters button { padding-inline: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
