:root {
  color-scheme: light;
  --ink: #1a2541;
  --muted: #586682;
  --soft-ink: #455571;
  --line: #e4e9f5;
  --canvas: #f5f7ff;
  --white: #fff;
  --primary: #3956e9;
  --primary-dark: #263fc4;
  --pale: #edf0ff;
  --violet: #6a4fca;
  --teal: #147c70;
  --orange: #946018;
  --red: #ad343d;
  --radius: 19px;
  --font: system-ui, 'PingFang SC', 'Microsoft YaHei', sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--canvas); }
body { margin: 0; color: var(--ink); font-family: var(--font); font-size: 1rem; line-height: 1.55; }
button, input, select { color: inherit; font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid #607bff; outline-offset: 3px; }
a { color: inherit; text-decoration: none; }
p, h1, h2, h3 { margin: 0; }
button, input { min-width: 0; }
svg.icon { width: 22px; height: 22px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.icon-button { display: inline-grid; place-items: center; background: #fff; border: 1px solid var(--line); width: 44px; height: 44px; border-radius: 12px; color: var(--soft-ink); }
.icon-button:hover { color: var(--primary); background: var(--pale); }
.icon-button.on { color: #8b5800; background: #fff1ce; border-color: #f4dfa6; }
.icon-button.on svg { fill: #ffd16b; }
.layout { min-height: 100vh; display: grid; grid-template-columns: 228px minmax(0, 1fr); }
.sidebar { grid-column: 1; position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; padding: 33px 16px 22px; background: var(--white); border-right: 1px solid #e7ebf5; z-index: 5; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px; line-height: 1.25; width: max-content; }
.brand-mark { width: 43px; height: 43px; display: grid; place-items: center; color: white; background: linear-gradient(140deg, #5d75ff, #304ae0); border-radius: 14px; box-shadow: 0 4px 10px #304ae032; flex: none; }
.brand-mark .icon { width: 23px; height: 23px; }
.brand strong { display: block; font-size: 1.3rem; font-weight: 800; letter-spacing: .04em; }
.brand small { display: block; color: var(--muted); margin-top: 4px; font-size: .76rem; font-weight: 700; }
.side-nav { margin-top: 38px; display: grid; gap: 5px; }
.nav-link { padding: 12px 13px; min-height: 46px; display: flex; align-items: center; gap: 12px; color: #52617c; border-radius: 11px; font-size: .94rem; font-weight: 700; }
.nav-link .icon { width: 20px; height: 20px; }
.nav-link:hover { background: #f4f6ff; color: var(--primary-dark); }
.nav-link.active { color: #314bd9; background: #eaeeff; }
.side-bottom { margin-top: auto; }
.side-bottom button { width: 100%; text-align: left; background: transparent; border: 0; }
.sidebar-caption { color: var(--muted); padding: 14px 13px 5px; font-size: .76rem; }
.workspace { grid-column: 2; min-width: 0; }
.topbar { height: 70px; border-bottom: 1px solid #e5eafa; background: #fff; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(22px, 4vw, 58px); }
.topbar-title { font-weight: 800; font-size: .98rem; }
.topbar-right { display: flex; align-items: center; gap: 15px; }
.date { color: var(--muted); display: flex; align-items: center; gap: 8px; font-size: .86rem; font-weight: 700; }
.date .icon { width: 17px; height: 17px; }
.sync-status { color: #205f54; background: #e6f7f2; border-radius: 7px; padding: 4px 7px; font-size: .78rem; font-weight: 750; }
.share-link { width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: 8px; font-size: .88rem; }
.top-settings { border: 0; background: var(--pale); color: var(--primary-dark); width: 39px; height: 39px; }
.top-settings .icon { width: 19px; height: 19px; }
.topbar .brand { display: none; }
.mobile-nav { display: none; }
.content { max-width: 1290px; margin: 0 auto; padding: 30px clamp(22px, 4vw, 58px) 50px; min-width: 0; outline: none; }
.page-heading { margin-bottom: 21px; }
.page-heading h1 { font-size: clamp(1.56rem, 3.4vw, 2.15rem); line-height: 1.22; letter-spacing: -.025em; font-weight: 800; }
.page-heading p { margin-top: 8px; font-size: .94rem; color: var(--muted); }
.section-heading { display: flex; gap: 10px; align-items: center; justify-content: space-between; margin: 26px 0 12px; }
.section-heading h2, .panel h2 { font-size: 1.12rem; font-weight: 800; }
.section-heading a { color: var(--primary-dark); font-size: .88rem; font-weight: 800; }
.button { display: inline-flex; min-height: 44px; padding: 9px 16px; align-items: center; justify-content: center; gap: 8px; border-radius: 11px; border: 1px solid transparent; font-weight: 800; font-size: .9rem; line-height: 1.2; text-align: center; }
.button .icon { width: 18px; height: 18px; }
.button.primary { background: var(--primary); color: white; }
.button.primary:hover { background: var(--primary-dark); }
.button.secondary { background: #fff; border-color: #dce3f5; color: #344561; }
.button.secondary:hover { background: #f0f3ff; border-color: #c5d0f7; color: var(--primary-dark); }
.button.tint { background: var(--pale); color: var(--primary-dark); }
.button.tint:hover { background: #e1e7ff; }
.actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.hero { position: relative; isolation: isolate; overflow: hidden; min-height: 224px; display: flex; align-items: center; padding: 28px 32px; border: 1px solid #3c55dd; border-radius: 22px; color: white; background: linear-gradient(117deg,#273daf 0%,#3d55e7 56%,#6375ff 100%); box-shadow: 0 8px 22px #2f49d224; }
.hero-copy { z-index: 1; position: relative; flex: 1; }
.hero-meta { display: inline-flex; align-items: center; gap: 7px; color: #eef1ff; font-size: .84rem; font-weight: 700; }
.hero-meta .icon { width: 18px; height: 18px; }
.hero h2 { font-size: clamp(1.55rem, 3.7vw, 2.25rem); letter-spacing: -.025em; font-weight: 800; line-height: 1.2; margin: 9px 0; }
.hero p { color: #edf0ff; font-size: .92rem; max-width: 350px; }
.hero .actions { margin-top: 19px; }
.hero .button.light { color: #233bab; background: white; box-shadow: 0 3px 9px #1d288d24; }
.hero .button.light:hover { background: #e9edff; }
.hero .button.ghost { color: white; background: #2238ad39; border-color: #ffffff78; }
.hero .button.ghost:hover { background: #2238ad85; }
.hero-visual { position: absolute; inset: 0 0 0 auto; width: 45%; pointer-events: none; }
.visual-ring { position: absolute; border-radius: 50%; border: 1px solid #dce7ff59; width: 340px; height: 210px; top: 4%; right: 2%; transform: rotate(-26deg); }
.visual-ring.second { width: 280px; height: 182px; right: 9%; top: 13%; border-style: dashed; border-color: #e5ebff62; }
.spark { position: absolute; width: 14px; height: 14px; background: #e0faff; clip-path: polygon(50% 0, 61% 37%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 37%); }
.spark.one { top: 22%; right: 13%; width: 23px; height: 23px; }
.spark.two { top: 65%; right: 79%; }
.spark.three { top: 20%; right: 70%; width: 11px; height: 11px; }
.spark.four { top: 77%; right: 14%; width: 12px; height: 12px; }
.illustrated-card { width: clamp(160px, 19vw, 215px); height: 125px; border-radius: 16px; position: absolute; left: 50%; top: 50%; }
.illustrated-card.back { transform: translate(-37%,-48%) rotate(12deg); background: #aab8ff; border: 1px solid #d0d8ff; }
.illustrated-card.front { transform: translate(-56%,-53%) rotate(-10deg); padding: 14px 17px; background: #f7f8ff; color: #283873; border: 1px solid #ffffff; box-shadow: 0 15px 35px #13227455; }
.art-chip { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; color: #3d56db; background: #e2e8ff; }
.art-chip .icon { width: 16px; height: 16px; }
.illustrated-card strong { display: block; font-size: 1.46rem; letter-spacing: -.045em; margin-top: 3px; }
.illustrated-card small { display: block; color: #596894; font-size: .83rem; }
.art-lines { display: flex; gap: 5px; margin-top: 7px; }
.art-lines i { width: 22px; height: 4px; border-radius: 4px; background: #ccd7ff; }
.art-lines i+ i { width: 32px; background: #e5eaff; }
.stat-grid { display: grid; grid-template-columns: repeat(4,minmax(0, 1fr)); gap: 13px; margin-top: 16px; }
.stat { min-width: 0; display: flex; align-items: center; gap: 11px; padding: 14px; min-height: 84px; background: white; border: 1px solid var(--line); border-radius: 15px; }
.tile-icon { width: 39px; height: 39px; flex: none; display: grid; place-items: center; border-radius: 12px; background: #eaf0ff; color: #3956d6; }
.tile-icon.purple { background: #f1ecff; color: #6a4fbb; }
.tile-icon.green { background: #e6f7f2; color: #137a6a; }
.tile-icon.amber { background: #fff1dc; color: #966221; }
.tile-icon .icon { width: 20px; height: 20px; }
.stat strong { display: block; font-size: 1.32rem; line-height: 1.2; font-weight: 800; }
.stat small { color: var(--muted); font-size: .83rem; font-weight: 700; display: block; margin-top: 4px; }
.decks { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.deck, .panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
.deck { padding: 17px 18px; }
.deck-top { display: flex; align-items: center; gap: 12px; }
.deck-top .tile-icon { width: 44px; height: 44px; }
.deck-top h3 { font-size: 1rem; font-weight: 800; }
.deck-top p, .subtle { color: var(--muted); font-size: .86rem; }
.deck-top .button { margin-left: auto; white-space: nowrap; }
.progress-band { margin-top: 14px; }
.progress-label { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .79rem; color: var(--muted); font-weight: 700; }
.progress-track { background: #ebeffa; height: 7px; border-radius: 9px; overflow: hidden; margin-top: 7px; }
.progress-track span { display: block; background: #5871f1; height: 100%; border-radius: inherit; }
.progress-track.purple span { background: #8a69e9; }
.panel { padding: 19px 20px; }
.activity { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 19px; }
.activity .panel-header { display: flex; gap: 10px; justify-content: space-between; align-items: center; }
.week { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 7px; margin-top: 14px; }
.week-day { text-align: center; color: var(--muted); font-size: .78rem; font-weight: 750; }
.week-day b { min-height: 27px; border-radius: 8px; background: #eff2fc; display: grid; place-items: center; color: #65728a; margin-bottom: 4px; }
.week-day.done b { color: #fff; background: #5169ea; }
.week-day.today b { box-shadow: inset 0 0 0 1px #8598ff; }
.study-container, .quiz-container { max-width: 810px; margin: 0 auto; }
.filters, .session-bar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.filters { margin-bottom: 14px; }
.filters label, .field-label { color: var(--muted); font-size: .85rem; font-weight: 800; }
.filters select, .dialog input[type="number"], .search-field input, .answer-field { border: 1px solid #d8e0f3; border-radius: 11px; min-height: 43px; padding: 7px 12px; background: white; }
.filters select { appearance: none; padding-right: 33px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='m4 6 4 4 4-4' stroke='%23586682' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; }
.session-bar { justify-content: space-between; margin-top: 9px; margin-bottom: 7px; color: var(--muted); font-size: .89rem; font-weight: 800; }
.session-progress { margin: 0 0 14px; }
.card { box-shadow: 0 9px 23px #314c8711; padding: 21px 24px 25px; }
.card-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.card-label { border-radius: 7px; color: #4054a5; background: #eef1ff; padding: 4px 8px; font-weight: 800; font-size: .79rem; }
.card-center { text-align: center; padding: 39px 0 31px; }
.card-center h2 { font-size: clamp(1.68rem, 6vw, 3rem); font-family: var(--font); line-height: 1.15; font-weight: 800; letter-spacing: -.035em; overflow-wrap: anywhere; }
.pronunciation { margin-top: 12px; color: var(--muted); font-size: 1rem; }
.card-def { margin: 7px 0 18px; padding: 15px 16px; border-radius: 12px; background: #f4f6ff; overflow-wrap: anywhere; }
.card-def p { white-space: pre-line; }
.card-def details { padding-top: 8px; margin-top: 8px; border-top: 1px solid var(--line); color: var(--muted); font-size: .87rem; }
.card-def summary { cursor: pointer; }
.card-def details p { margin-top: 6px; }
.reveal { width: 100%; min-height: 49px; }
.grades { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }
.grades button { min-height: 58px; display: grid; align-content: center; gap: 4px; line-height: 1.2; border: 1px solid transparent; border-radius: 12px; padding: 7px 5px; color: #333f70; background: #eef0ff; font-weight: 800; }
.grades button:hover { filter: brightness(.97); border-color: currentColor; }
.grades button:first-child { background: #fff0f0; color: #a9343c; }
.grades button:nth-child(2) { background: #fff2df; color: #855216; }
.grades button:last-child { background: #e9f8ee; color: #1f694b; }
.grades small { font-size: .75rem; font-weight: 700; }
.hint { color: var(--muted); text-align: center; margin-top: 12px; font-size: .81rem; }
.empty { text-align: center; padding: 32px 18px; }
.empty .tile-icon { margin: 0 auto 12px; }
.empty h2 { margin-bottom: 6px; }
.empty p { color: var(--muted); margin-bottom: 14px; }
.empty .actions { justify-content: center; }
.search-field { position: relative; flex: 1; min-width: 180px; }
.search-field .icon { position: absolute; top: 11px; left: 11px; width: 19px; height: 19px; color: var(--muted); pointer-events: none; }
.search-field input { width: 100%; padding-left: 37px; }
.list-tools { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.segment { display: flex; gap: 5px; padding: 4px; background: #eaf0fc; border-radius: 11px; flex-wrap: wrap; }
.segment button { border: 0; background: transparent; padding: 6px 10px; border-radius: 8px; color: var(--muted); min-height: 36px; font-size: .85rem; font-weight: 800; }
.segment button.active { background: white; color: var(--primary-dark); box-shadow: 0 1px 3px #24458816; }
.list-summary { margin-bottom: 10px; color: var(--muted); font-size: .85rem; }
.list-panel { padding: 0; overflow: hidden; }
.list-row { min-height: 64px; display: flex; align-items: center; gap: 9px; padding: 9px 12px 9px 16px; }
.list-row + .list-row { border-top: 1px solid var(--line); }
.list-term { flex: 1; text-align: left; padding: 3px 0; border: 0; background: transparent; min-width: 0; min-height: 44px; overflow: hidden; }
.list-term strong, .list-term span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.list-term strong { font-size: 1.03rem; }
.list-term:hover strong { color: var(--primary-dark); }
.list-term span { color: var(--muted); font-size: .84rem; }
.list-row .icon-button { width: 40px; height: 40px; }
.list-row .icon-button .icon { width: 19px; height: 19px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 14px; color: var(--muted); font-size: .87rem; font-weight: 750; }
.quiz-question { padding: 16px 0; }
.quiz-question h2 { font-size: clamp(1.33rem,4vw,2.1rem); margin-top: 7px; line-height: 1.28; overflow-wrap: anywhere; }
.quiz-choices { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.option { border: 1px solid #dae1f7; border-radius: 12px; background: #f7f8fd; padding: 11px 12px; display: flex; align-items: flex-start; gap: 9px; text-align: left; min-height: 57px; line-height: 1.4; overflow-wrap: anywhere; }
.option:hover:enabled { border-color: #7c91f5; background: #eef1ff; }
.option b { flex: 0 0 23px; text-align: center; color: #354dbe; border-radius: 6px; background: #e8edff; }
.option.correct { border-color: #64ad90; background: #eaf8ef; }
.option.incorrect { border-color: #e89494; background: #fff1f1; }
.option:disabled { opacity: 1; }
.feedback { margin: 13px 0 9px; }
.feedback.ok { color: #19654b; }
.feedback.error { color: #aa313b; }
.form-row { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.answer-field { flex: 1; min-width: 128px; }
.dialog { width: min(calc(100% - 28px),530px); max-height: calc(100dvh - 36px); overflow: auto; color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); background: white; padding: 21px; box-shadow: 0 18px 70px #20365d36; }
.dialog::backdrop { background: #1c2b4d7d; }
.dialog-header { display: flex; align-items: start; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.dialog-header h2 { font-size: 1.24rem; overflow-wrap: anywhere; }
.dialog-section { padding: 13px 0; border-top: 1px solid var(--line); }
.dialog-section p { margin-bottom: 10px; }
.dialog input[type="number"] { width: 88px; }
.dialog-def { margin: 12px 0; }
.toast { position: fixed; bottom: 20px; right: 22px; z-index: 30; max-width: calc(100vw - 44px); padding: 9px 13px; border-radius: 10px; color: white; background: #243459; opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .18s, transform .18s; }
.toast.visible { opacity: 1; transform: none; }
.loading { color: var(--muted); padding: 18px 0; }

@media (min-width: 1500px) { .hero { min-height: 248px; } }
@media (max-width: 1050px) {
  .layout { grid-template-columns: 186px minmax(0,1fr); }
  .stat { gap: 8px; padding: 10px; }
  .stat .tile-icon { width: 34px; height: 34px; }
  .hero-visual { width: 42%; }
  .visual-ring { width: 245px; height: 172px; }
  .visual-ring.second { width: 206px; height: 145px; }
}
@media (max-width: 800px) {
  .layout { display: block; }
  .sidebar { display: none; }
  .topbar { height: 60px; padding: 0 19px; }
  .topbar .brand { display: flex; padding: 0; gap: 8px; }
  .topbar .brand-mark { height: 34px; width: 34px; border-radius: 10px; }
  .topbar .brand strong { font-size: 1.03rem; }
  .topbar .brand small, .topbar-title { display: none; }
  .topbar .brand-mark .icon { width: 19px; height: 19px; }
  .topbar-right { gap: 11px; }
  .topbar-right .date { display: none; }
  .content { padding: 22px 19px calc(82px + env(safe-area-inset-bottom)); }
  .mobile-nav { display: flex; justify-content: space-around; position: fixed; inset: auto 0 0; z-index: 10; background: white; border-top: 1px solid var(--line); padding: 5px 3px calc(5px + env(safe-area-inset-bottom)); }
  .mobile-nav .nav-link { flex: 1; max-width: 105px; justify-content: center; flex-direction: column; padding: 6px 2px; min-height: 50px; gap: 2px; font-size: .75rem; }
  .mobile-nav .nav-link.active { background: transparent; }
  .mobile-nav .nav-link.active .icon { filter: drop-shadow(0 0 4px #a5b1ff); }
  .toast { bottom: calc(72px + env(safe-area-inset-bottom)); }
}
@media (max-width: 535px) {
  .content { padding-left: 14px; padding-right: 14px; }
  .topbar { padding: 0 14px; }
  .page-heading { margin-bottom: 15px; }
  .page-heading p { font-size: .87rem; }
  .hero { min-height: 214px; padding: 19px 14px; }
  .hero-copy h2 { font-size: 1.53rem; }
  .hero-copy p { font-size: .85rem; max-width: 206px; }
  .hero-copy .actions { gap: 6px; margin-top: 16px; }
  .hero-copy .button { min-height: 43px; padding: 8px 9px; font-size: .81rem; }
  .hero-visual { width: 42%; opacity: .58; top: 7%; }
  .illustrated-card { width: 94px; height: 66px; border-radius: 9px; }
  .illustrated-card.front { padding: 5px 6px; }
  .illustrated-card strong { font-size: .87rem; margin-top: 1px; }
  .illustrated-card small { font-size: .64rem; }
  .art-chip { width: 15px; height: 15px; border-radius: 4px; }
  .art-chip .icon { width: 10px; height: 10px; }
  .art-lines { display: none; }
  .visual-ring { width: 138px; height: 130px; right: 0; top: 22%; }
  .visual-ring.second { display: none; }
  .spark.one { width: 13px; height: 13px; }
  .stat-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; margin-top: 10px; }
  .stat { min-height: 65px; padding: 8px; }
  .stat small { font-size: .79rem; }
  .stat strong { font-size: 1.2rem; }
  .decks, .activity { grid-template-columns: 1fr; gap: 8px; }
  .deck, .panel { padding: 13px 12px; }
  .list-panel { padding: 0; }
  .list-row { padding-left: 10px; padding-right: 8px; }
  .activity { margin-top: 12px; }
  .section-heading { margin-top: 19px; }
  .card-center { padding: 34px 0 24px; }
  .filters { gap: 6px; }
  .filters select { font-size: .85rem; max-width: 100%; }
  .quiz-choices { grid-template-columns: 1fr; }
  .hint.shortcuts { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
[hidden] { display: none !important; }
.cloud-login {
  width: min(100% - 2rem, 420px);
  padding: 1.75rem;
  margin: clamp(3rem, 14vh, 9rem) auto 2rem;
  border: 1px solid #dfe4fa;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 14px 40px #1e296615;
}
.cloud-login h1 { margin: 0 0 .5rem; }
.cloud-login form { display: grid; gap: .65rem; margin: 1.4rem 0 0; }
.cloud-login input {
  width: 100%;
  min-height: 44px;
  margin-bottom: .4rem;
  padding: .6rem .8rem;
  border: 1px solid #b9c3e4;
  border-radius: 10px;
  font: inherit;
}
.cloud-login button { justify-content: center; }
