:root {
  --paper: #f4f0e7;
  --paper-deep: #e9e2d5;
  --card: #fffdf8;
  --ink: #182d35;
  --ink-2: #304851;
  --muted: #718087;
  --line: #d8d3c8;
  --red: #df5b44;
  --red-dark: #bf4633;
  --blue: #4b7f9f;
  --green: #4d8c79;
  --gold: #d4a449;
  --danger: #b83d39;
  --shadow: 0 14px 36px rgba(36, 45, 44, .08);
  --radius: 22px;
  --font: Inter, "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", "Noto Sans CJK JP", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

.quick-plan { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 12px; }
.quick-plan label { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border: 1px solid rgba(70,78,69,.14); border-radius: 12px; background: rgba(255,255,255,.48); }
.quick-plan label span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.quick-plan input, .quick-plan select, .number-field { border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; font-weight: 700; }
.quick-plan input { width: 54px; }
.training-mix { margin: 0 0 12px !important; color: var(--muted); font-size: 12px; }
.training-mix strong { color: var(--ink); }
.number-field { width: 96px; padding: 10px 12px; border: 1px solid rgba(70,78,69,.18); border-radius: 10px; text-align: right; background: #fffdf8; }
.compact-copy { margin: -8px 0 14px; font-size: 12px; line-height: 1.55; }
html { color-scheme: light; scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(79, 98, 92, .035) 1px, transparent 1px) 0 0 / 100% 28px,
    var(--paper);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(75, 127, 159, .28); outline-offset: 2px; }
.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; }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 236px; z-index: 10;
  display: flex; flex-direction: column; padding: 28px 20px 22px;
  border-right: 1px solid rgba(42, 60, 60, .1);
  background: rgba(250, 247, 240, .9); backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 12px; border: 0; background: none; text-align: left; cursor: pointer; padding: 0 8px; }
.brand-mark { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--red); color: white; font: 700 22px/1 serif; box-shadow: 0 7px 18px rgba(223, 91, 68, .22); }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 17px; letter-spacing: .02em; }
.brand small { color: var(--muted); margin-top: 2px; }
.nav-list { display: grid; gap: 8px; margin-top: 48px; }
.nav-item { border: 0; background: transparent; display: flex; align-items: center; gap: 13px; padding: 13px 15px; border-radius: 14px; color: #607078; font-weight: 700; cursor: pointer; text-align: left; transition: .18s ease; }
.nav-item span { display: grid; place-items: center; width: 25px; font-size: 19px; }
.nav-item:hover { color: var(--ink); background: rgba(255,255,255,.65); }
.nav-item.active { color: var(--ink); background: var(--card); box-shadow: 0 6px 20px rgba(42, 52, 48, .07); }
.nav-item.active span { color: var(--red); }
.sidebar-foot { margin-top: auto; padding: 18px 10px 0; border-top: 1px solid var(--line); }
.sidebar-foot p { font-size: 11px; color: var(--muted); line-height: 1.5; }
.mini-streak { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 9px; align-items: center; }
.mini-streak > span { grid-row: 1 / 3; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: #fff0dd; color: #e87932; font-weight: 900; }
.mini-streak strong { font-size: 20px; line-height: 1; }
.mini-streak small { color: var(--muted); font-size: 11px; }

.main-content { margin-left: 236px; min-height: 100vh; padding: 52px clamp(30px, 5vw, 78px) 80px; }
.view { display: none; max-width: 1180px; margin: 0 auto; animation: fadeUp .28s ease; }
.view.active { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 30px; margin-bottom: 34px; }
.compact-head { margin-bottom: 24px; }
.eyebrow { color: var(--red); font-size: 12px; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; margin: 0 0 9px; }
h1 { margin: 0; font-family: "Hiragino Mincho ProN", "Yu Mincho", serif; font-size: clamp(32px, 4vw, 50px); font-weight: 700; letter-spacing: -.035em; }
h2 { margin: 0; font-size: 20px; }
h3 { margin: 0; }
.lede { color: var(--muted); margin: 10px 0 0; line-height: 1.7; }
.paper-card { background: rgba(255, 253, 248, .92); border: 1px solid rgba(70, 78, 69, .09); box-shadow: var(--shadow); border-radius: var(--radius); }
.ink-card { background: var(--ink); color: white; border-radius: var(--radius); box-shadow: var(--shadow); }
.hero-grid { display: grid; grid-template-columns: 1.7fr 1fr; gap: 18px; }
.daily-card { padding: 30px; min-height: 230px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.daily-card::after { content: "復"; position: absolute; right: 24px; top: -28px; color: rgba(223,91,68,.06); font: 150px/1 serif; pointer-events: none; }
.status-kicker { display: inline-flex; padding: 6px 9px; border-radius: 8px; background: #fbe7df; color: var(--red-dark); font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.daily-copy h2 { font: 700 28px/1.3 "Hiragino Mincho ProN", "Yu Mincho", serif; margin: 14px 0 4px; }
.daily-copy p { color: var(--muted); margin: 0 0 18px; }
.goal-track { height: 8px; background: var(--paper-deep); border-radius: 99px; overflow: hidden; max-width: 380px; }
.goal-track span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--red), #ed886d); transition: width .35s ease; }
.daily-copy small { display: block; color: var(--muted); margin-top: 8px; }
.primary-button, .outline-button, .danger-button, .text-button { border: 0; cursor: pointer; border-radius: 13px; font-weight: 800; transition: .18s ease; }
.primary-button { color: white; background: var(--red); padding: 13px 20px; box-shadow: 0 7px 16px rgba(223, 91, 68, .18); }
.primary-button:hover { background: var(--red-dark); transform: translateY(-1px); }
.primary-button.large { width: max-content; font-size: 16px; padding: 15px 20px; }
.primary-button.large span { padding-left: 22px; }
.outline-button { padding: 11px 15px; background: rgba(255,255,255,.65); border: 1px solid var(--line); }
.outline-button:hover { background: white; border-color: #b8b5ad; }
.text-button { color: var(--blue); background: transparent; padding: 6px; }
.text-button:hover { color: var(--ink); }
.danger-button { padding: 12px 15px; color: var(--danger); background: #fff1ee; }
.mastery-card { padding: 28px; display: flex; align-items: center; justify-content: center; gap: 22px; }
.mastery-card p { margin: 0 0 7px; color: #aebdc1; font-size: 13px; }
.mastery-card h3 { font-size: 25px; }
.mastery-card small { display: block; color: #91a3a8; margin-top: 8px; line-height: 1.4; }
.ring { --p: 0; flex: 0 0 auto; width: 112px; height: 112px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--gold) calc(var(--p) * 1%), rgba(255,255,255,.12) 0); position: relative; }
.ring::after { content: ""; position: absolute; inset: 10px; border-radius: inherit; background: var(--ink); }
.ring span { z-index: 1; text-align: center; }
.ring strong, .ring small { display: block; }
.ring strong { font-size: 22px; }
.ring small { color: #aebdc1; font-size: 10px; margin-top: 3px; }
.section-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
#view-home > .section-row { margin: 34px 0 14px; }
.mode-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.mode-card { display: grid; grid-template-columns: auto 1fr; gap: 13px; align-items: center; min-height: 112px; padding: 18px; text-align: left; border: 1px solid rgba(70,78,69,.11); border-radius: 18px; background: rgba(255,253,248,.88); cursor: pointer; position: relative; transition: .18s ease; }
.mode-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: transparent; }
.mode-card featured { color: white; }
.mode-card > span:nth-child(2) { min-width: 0; }
.mode-card strong, .mode-card small { display: block; }
.mode-card strong { font-size: 14px; line-height: 1.3; }
.mode-card small { color: var(--muted); font-size: 11px; line-height: 1.45; margin-top: 5px; }
.mode-card em { position: absolute; right: 12px; top: 10px; font-style: normal; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .08em; }
.mode-card.featured { background: #e7efeb; border-color: #c9ddd4; }
.mode-card.featured em { color: var(--green); }
.mode-icon { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; font: 800 20px/1 serif; }
.mode-icon.vermilion { color: var(--red-dark); background: #fbe7df; }
.mode-icon.blue { color: #356b8d; background: #e3eff5; }
.mode-icon.green { color: #397662; background: #e1f0e9; }
.mode-icon.dark { color: white; background: var(--ink); }
.special-modules { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; }
.special-module { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 15px; padding: 22px 24px; background: linear-gradient(115deg, #fffdf8, #edf4f0); border-color: #ccddd5; }
.special-module-icon { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 17px; color: white; background: var(--green); font: 800 25px/1 serif; box-shadow: 0 8px 18px rgba(57,118,98,.18); }
.kana-module { background: linear-gradient(115deg, #fffdf8, #f2edf7); border-color: #dcd0e6; }
.kana-module .special-module-icon { background: #75628d; box-shadow: 0 8px 18px rgba(117,98,141,.18); }
.special-module h2 { margin: 7px 0 5px; font-size: 19px; }
.special-module p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.special-module .outline-button { grid-column: 1 / -1; width: 100%; }
.special-module .outline-button span { padding-left: 10px; }
.module-back-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: -5px 0 20px; }
.module-back { padding-left: 0; }
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 30px; }
.stats-card, .activity-card { padding: 24px; }
.soft-label { color: var(--muted); font-size: 11px; padding: 5px 8px; border-radius: 7px; background: var(--paper); }
.level-bars { display: grid; gap: 18px; margin-top: 24px; }
.level-row { display: grid; grid-template-columns: 62px 1fr 52px; gap: 12px; align-items: center; font-size: 12px; }
.level-row strong { font-size: 13px; }
.level-row > span:last-child { text-align: right; color: var(--muted); }
.level-track { height: 8px; border-radius: 99px; background: var(--paper-deep); overflow: hidden; }
.level-track i { display: block; height: 100%; border-radius: inherit; background: var(--green); }
.activity-grid { display: grid; grid-template-columns: repeat(14, 1fr); gap: 6px; margin-top: 28px; }
.activity-day { aspect-ratio: 1; border-radius: 5px; background: #ebe7de; position: relative; }
.activity-day[data-l="1"] { background: #c9ddd4; }
.activity-day[data-l="2"] { background: #8fb8a8; }
.activity-day[data-l="3"] { background: #4d8c79; }
.activity-day[data-l="4"] { background: #285e50; }
.activity-day:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); white-space: nowrap; padding: 5px 7px; color: white; background: var(--ink); border-radius: 6px; font-size: 10px; z-index: 3; }
.activity-legend { display: flex; justify-content: flex-end; align-items: center; gap: 4px; color: var(--muted); font-size: 10px; margin-top: 12px; }
.activity-legend i { width: 10px; height: 10px; border-radius: 3px; background: #ebe7de; }.activity-legend i:nth-of-type(2){background:#c9ddd4}.activity-legend i:nth-of-type(3){background:#8fb8a8}.activity-legend i:nth-of-type(4){background:#285e50}

.study-shell { max-width: 800px; margin: 0 auto; }
.study-topbar { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; margin-bottom: 22px; }
.icon-button { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: rgba(255,255,255,.6); cursor: pointer; font-size: 24px; color: var(--muted); }
.session-progress { height: 9px; border-radius: 99px; background: #ddd8ce; overflow: hidden; }
.session-progress span { display: block; height: 100%; width: 0; background: var(--red); transition: width .3s ease; }
#session-counter { color: var(--muted); font-size: 12px; font-weight: 800; }
.quiz-card { min-height: 600px; padding: clamp(24px, 5vw, 48px); border: 1px solid rgba(70,78,69,.1); border-radius: 28px; background: rgba(255,253,248,.96); box-shadow: 0 22px 55px rgba(39,47,44,.1); position: relative; overflow: hidden; }
.quiz-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 5px; background: linear-gradient(90deg,var(--red),var(--gold)); }
.quiz-meta { display: flex; justify-content: center; gap: 8px; }
.question-type, .level-pill { padding: 6px 9px; border-radius: 8px; font-size: 10px; font-weight: 900; letter-spacing: .06em; }
.question-type { color: #356b8d; background: #e5eff4; }
.level-pill { color: var(--red-dark); background: #fbe7df; }
.instruction { text-align: center; color: var(--muted); font-size: 13px; margin: 28px 0 12px; }
.prompt { text-align: center; font: 700 clamp(38px, 7vw, 66px)/1.25 "Hiragino Mincho ProN", "Yu Mincho", serif; letter-spacing: .02em; overflow-wrap: anywhere; }
.prompt-note { min-height: 28px; text-align: center; color: var(--muted); margin: 12px 0; line-height: 1.6; }
.speak-button { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; margin: 8px auto 24px; color: var(--blue); background: white; cursor: pointer; }
.answer-wrap { display: block; max-width: 540px; margin: 0 auto 14px; }
.answer-wrap input, .correction input { width: 100%; padding: 16px 18px; border: 2px solid #d6d2c9; border-radius: 14px; background: white; color: var(--ink); font-size: 20px; text-align: center; transition: .18s; }
.answer-wrap input:focus, .correction input:focus { border-color: var(--blue); outline: 0; box-shadow: 0 0 0 4px rgba(75,127,159,.1); }
.choice-grid { max-width: 620px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice { min-height: 72px; padding: 14px 16px; border-radius: 14px; border: 2px solid #dedad1; background: white; text-align: left; line-height: 1.45; cursor: pointer; position: relative; }
.choice span { position: absolute; top: 10px; right: 11px; color: #a0a9ab; font-size: 10px; font-weight: 900; }
.choice:hover { border-color: #9fb8c6; }
.choice.selected { border-color: var(--blue); background: #edf5f8; }
.choice.correct { border-color: var(--green); background: #eaf5f0; }
.choice.wrong { border-color: var(--red); background: #fff0ec; }
.answer-button { display: block; min-width: 190px; margin: 22px auto 0; }
.answer-button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.feedback { display: none; margin: 28px -48px -48px; padding: 24px 48px 32px; border-top: 1px solid var(--line); background: #f6f3ec; }
.feedback.show { display: block; animation: fadeUp .25s ease; }
.feedback-head { display: flex; align-items: center; gap: 12px; }
.feedback-icon { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 auto; border-radius: 50%; color: white; background: var(--green); font-weight: 900; }
.feedback.wrong .feedback-icon { background: var(--red); }
.feedback-head strong { font-size: 18px; }
.feedback-head p { color: var(--muted); margin: 3px 0 0; }
.word-detail { display: flex; flex-wrap: wrap; gap: 7px; margin: 17px 0; }
.word-detail span { padding: 5px 8px; border-radius: 7px; background: white; border: 1px solid var(--line); font-size: 11px; }
.rating-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.rating-row button { padding: 10px 6px; border: 1px solid var(--line); border-radius: 11px; background: white; cursor: pointer; font-weight: 800; }
.rating-row button:hover { border-color: var(--blue); transform: translateY(-1px); }
.rating-row button span, .rating-row button small { display: block; }
.rating-row button span { float: left; color: var(--muted); font-size: 10px; }
.rating-row button small { color: var(--muted); font-size: 9px; margin-top: 4px; font-weight: 500; }
.rating-row .recommended { border-color: #a8c6ba; background: #f0f7f4; }
.correction { display: none; margin-top: 16px; }
.feedback.wrong .correction { display: block; }
.feedback.wrong .rating-row { display: none; }
.correction label { display: block; font-size: 12px; font-weight: 800; margin-bottom: 8px; }
.correction input { padding: 12px; font-size: 16px; text-align: left; }
.correction small { display: block; min-height: 18px; color: var(--red); margin-top: 5px; }
.correction-next { display: none; width: 100%; margin-top: 12px; }
.feedback.wrong .correction-next { display: block; }
.correction-next:disabled { opacity: .45; cursor: not-allowed; }
.study-hint { text-align: center; color: var(--muted); font-size: 11px; margin-top: 16px; }
kbd { border: 1px solid #c8c4bb; border-bottom-width: 2px; background: #faf8f2; border-radius: 5px; padding: 2px 5px; font: inherit; }

.filter-bar { padding: 13px; display: grid; grid-template-columns: 1fr 160px 160px; gap: 10px; }
.search-box { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 12px; padding: 0 13px; background: white; }
.search-box span { color: var(--muted); font-size: 22px; }
.search-box input { border: 0; outline: 0; width: 100%; padding: 11px 0; color: var(--ink); background: transparent; }
select { padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: white; color: var(--ink); }
.browse-summary { margin: 22px 2px 10px; color: var(--muted); font-size: 12px; }
.word-list { display: grid; gap: 8px; }
.word-row { display: grid; grid-template-columns: minmax(140px,1.1fr) minmax(130px,1fr) 90px 86px minmax(180px,1.8fr) 100px; gap: 14px; align-items: center; padding: 14px 18px; border-radius: 14px; border: 1px solid rgba(70,78,69,.09); background: rgba(255,253,248,.86); }
.word-row:hover { background: white; box-shadow: 0 8px 24px rgba(39,47,44,.06); }
.word-row .lemma { font: 700 18px/1.3 "Hiragino Mincho ProN", "Yu Mincho", serif; }
.word-row .reading { color: var(--blue); }
.word-row .meaning { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.word-row .tag { width: fit-content; padding: 4px 7px; border-radius: 6px; background: var(--paper); font-size: 10px; }
.word-row .state { justify-self: end; font-size: 10px; font-weight: 800; color: var(--muted); }
.word-row .state.mastered { color: var(--green); }
.word-row .state.wrong { color: var(--red); }
.load-more { display: block; margin: 20px auto; }

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.settings-card { padding: 26px; }
.settings-card:last-child { grid-column: 1 / -1; }
.setting-row { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 20px 0 0; }
.setting-row strong, .setting-row small { display: block; }
.setting-row small, .muted { color: var(--muted); line-height: 1.6; }
.subheading { margin-top: 28px; }
.check-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-top: 18px; }
.check-row label, .check-stack label { cursor: pointer; }
.check-row input, .check-stack input { position: absolute; opacity: 0; }
.check-row span { display: block; text-align: center; padding: 11px; border: 1px solid var(--line); border-radius: 10px; background: white; font-weight: 800; }
.check-row input:checked + span { color: var(--blue); background: #eaf3f7; border-color: #9ab8c8; }
.check-stack { display: grid; gap: 9px; margin-top: 16px; }
.check-stack span { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 10px; background: var(--paper); }
.check-stack span::before { content: ""; width: 17px; height: 17px; border: 2px solid #bdb9b0; border-radius: 5px; }
.check-stack input:checked + span::before { border-color: var(--green); background: var(--green); box-shadow: inset 0 0 0 3px var(--paper); }
.button-stack { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 18px; }
.file-button { display: inline-flex; align-items: center; cursor: pointer; }
.file-button input { display: none; }
.error-log-summary { margin-top: 18px; padding: 18px; border-radius: 14px; background: #eef3f1; border: 1px solid #d6e2dd; }
.error-log-summary strong { display: block; margin: 9px 0 4px; font-size: 20px; }
.error-log-summary p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
#export-errors:disabled { opacity: .45; cursor: not-allowed; }

dialog { width: min(520px, calc(100% - 32px)); padding: 36px; border: 0; border-radius: 25px; color: var(--ink); background: var(--card); text-align: center; box-shadow: 0 28px 90px rgba(20,30,30,.28); }
dialog::backdrop { background: rgba(17,29,32,.55); backdrop-filter: blur(5px); }
.dialog-mark { width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 20px; display: grid; place-items: center; color: white; background: var(--red); font: 700 28px/1 serif; }
dialog h2 { font: 700 28px/1.3 "Hiragino Mincho ProN", "Yu Mincho", serif; }
.session-results { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin: 25px 0; }
.session-results div { padding: 14px 8px; border-radius: 12px; background: var(--paper); }
.session-results strong, .session-results span { display: block; }.session-results strong{font-size:22px}.session-results span{color:var(--muted);font-size:10px;margin-top:3px}
dialog .primary-button { width: 100%; } dialog .text-button { margin-top: 10px; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%,20px); z-index: 100; padding: 11px 16px; border-radius: 10px; color: white; background: var(--ink); opacity: 0; pointer-events: none; transition: .2s ease; font-size: 12px; box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translate(-50%,0); }
.mobile-header, .mobile-nav { display: none; }

/* 动词变形 */
.conjugation-head { align-items: center; }
.conj-overview { display: grid; grid-template-columns: auto auto 1px auto auto; gap: 9px; align-items: baseline; padding: 16px 19px; border-radius: 16px; background: var(--ink); color: white; white-space: nowrap; }
.conj-overview strong { font-size: 22px; }
.conj-overview span { color: #afbec2; font-size: 10px; }
.conj-overview i { width: 1px; height: 27px; margin: 0 6px; background: rgba(255,255,255,.18); }
.conj-tabs { display: flex; gap: 7px; margin-bottom: 18px; padding: 5px; border-radius: 15px; background: rgba(222,216,204,.72); width: max-content; max-width: 100%; }
.conj-tabs button { border: 0; border-radius: 11px; padding: 10px 18px; background: transparent; color: var(--muted); font-weight: 800; cursor: pointer; }
.conj-tabs button.active { background: var(--card); color: var(--ink); box-shadow: 0 5px 15px rgba(35,46,44,.08); }
.conj-panel { display: none; }
.conj-panel.active { display: block; animation: fadeUp .24s ease; }
.course-summary { display: flex; justify-content: space-between; align-items: center; gap: 28px; padding: 24px; margin-bottom: 18px; }
.course-summary h2 { margin: 10px 0 6px; }
.course-summary p { max-width: 760px; margin: 0; color: var(--muted); line-height: 1.65; }
.course-ring { flex: 0 0 auto; width: 104px; height: 104px; display: grid; place-content: center; text-align: center; border: 9px solid #dce8e3; border-radius: 50%; background: white; }
.course-ring strong { font-size: 28px; color: var(--green); }
.course-ring span { color: var(--muted); font-size: 10px; }
.course-layout { display: grid; grid-template-columns: minmax(235px,.7fr) minmax(0,1.8fr); gap: 18px; align-items: start; }
.course-path { display: grid; gap: 9px; max-height: 690px; overflow-y: auto; padding-right: 5px; }
.course-node { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; width: 100%; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,253,248,.82); color: var(--ink); text-align: left; cursor: pointer; }
.course-node:hover:not(:disabled), .course-node.active { border-color: #9dbcae; background: #eef5f1; }
.course-node:disabled { opacity: .48; cursor: not-allowed; }
.course-node > span:first-child { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--paper-deep); font-weight: 900; font-size: 11px; }
.course-node.done > span:first-child { color: white; background: var(--green); }
.course-node strong, .course-node small { display: block; }
.course-node strong { font-size: 12px; line-height: 1.35; }
.course-node small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.course-node em { color: var(--muted); font-style: normal; font-size: 12px; }
.course-stage { min-height: 560px; padding: clamp(25px,4vw,42px); }
.course-stage h2 { margin: 12px 0 8px; font: 700 clamp(25px,4vw,36px)/1.3 "Hiragino Mincho ProN", "Yu Mincho", serif; }
.course-stage #course-lesson-focus { color: var(--muted); line-height: 1.7; }
.course-rule { margin: 24px 0 18px; padding: 18px; border-left: 4px solid var(--green); border-radius: 0 13px 13px 0; background: #edf4f0; line-height: 1.75; }
.course-examples { display: grid; gap: 9px; margin-bottom: 24px; }
.course-example { padding: 13px 15px; border-radius: 11px; background: var(--paper); line-height: 1.6; }
.course-example strong { color: var(--blue); }
.course-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 650px; margin: 0 auto; }
.course-options button { min-height: 58px; padding: 12px; border: 2px solid var(--line); border-radius: 12px; background: white; font-weight: 750; cursor: pointer; }
.course-options button.correct, .kana-choices button.correct { border-color: var(--green); background: #eaf5f0; }
.course-options button.wrong, .kana-choices button.wrong { border-color: var(--red); background: #fff0ec; }
#course-answer-form, #kana-answer-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; max-width: 620px; margin: 0 auto; }
#course-answer-form input, #kana-answer-form input { min-width: 0; padding: 15px 17px; border: 2px solid #d8d4ca; border-radius: 13px; background: white; text-align: center; font-size: 18px; }
#course-answer-form[hidden], #kana-answer-form[hidden] { display: none; }
#course-feedback { max-width: 650px; }
.conj-control { display: grid; grid-template-columns: 1.25fr 1fr .75fr auto; gap: 12px; align-items: end; padding: 18px; margin-bottom: 18px; }
.conj-control label, .rule-toolbar label { display: grid; gap: 7px; color: var(--muted); font-size: 10px; font-weight: 800; }
.conj-control select, .rule-toolbar input { width: 100%; min-height: 42px; border: 1px solid var(--line); border-radius: 10px; padding: 0 11px; background: white; color: var(--ink); }
.conj-quiz, .cloze-card { min-height: 510px; padding: clamp(24px, 5vw, 46px); position: relative; overflow: hidden; }
.conj-quiz::before, .cloze-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 5px; background: linear-gradient(90deg,var(--blue),var(--green),var(--gold)); }
.conj-progress { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; color: var(--muted); font-size: 11px; font-weight: 850; }
.conj-progress > div { height: 7px; border-radius: 99px; background: var(--paper-deep); overflow: hidden; }
.conj-progress i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--green); transition: width .25s ease; }
.course-coverage { margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
#view-adjective [hidden] { display: none !important; }
.adj-input { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0; }
.adj-input input { flex: 1; min-width: 160px; padding: 14px; border: 2px solid var(--line); border-radius: 12px; font-size: 18px; }
.adj-reference { margin-bottom: 14px; padding: 18px; }
.adj-reference summary { cursor: pointer; font-weight: 800; }
.adj-reference .adj-text { overflow-wrap: anywhere; line-height: 1.85; font-size: 14px; margin-top: 18px; }
.adj-table-wrap { overflow-x: auto; }
.adj-table-wrap table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.adj-table-wrap td, .adj-table-wrap th { min-width: 100px; padding: 9px; border: 1px solid var(--line); text-align: left; }
.adj-correction { display: block; max-width: 100%; padding: 12px; margin: 10px 0; border: 2px solid var(--line); border-radius: 10px; font-size: 18px; }
#adj-stage .conj-word, #adj-cloze-stage .conj-word { font-size: clamp(24px,4vw,42px); line-height: 1.6; }
#adj-stage .conj-feedback { margin-top: 20px; }
.conj-tags { display: flex; justify-content: center; flex-wrap: wrap; gap: 7px; margin-top: 28px; }
.conj-tags span { padding: 5px 8px; border-radius: 7px; background: #e8f0ed; color: var(--green); font-size: 10px; font-weight: 900; }
.conj-tags span:first-child { color: var(--red-dark); background: #fbe7df; }
.conj-task, .cloze-instruction { margin: 24px 0 8px; text-align: center; color: var(--muted); font-size: 13px; }
.conj-word { text-align: center; font: 700 clamp(42px, 7vw, 68px)/1.25 "Hiragino Mincho ProN", "Yu Mincho", serif; overflow-wrap: anywhere; }
.conj-meaning { max-width: 650px; margin: 9px auto 25px; text-align: center; color: var(--muted); line-height: 1.55; }
#conj-answer-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; max-width: 620px; margin: 0 auto; }
#conj-answer { min-width: 0; padding: 15px 17px; border: 2px solid #d8d4ca; border-radius: 13px; background: white; text-align: center; font-size: 19px; }
#conj-answer:focus { outline: 0; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(75,127,159,.1); }
.conj-feedback { max-width: 620px; margin: 22px auto 0; padding: 18px; border-radius: 14px; background: #eaf5f0; border: 1px solid #bfdbcf; }
.conj-feedback.wrong { background: #fff0ec; border-color: #f0c8bd; }
.conj-feedback strong, .conj-feedback p, .conj-feedback small { display: block; }
.conj-feedback p { margin: 8px 0; font-size: 18px; font-weight: 800; }
.conj-feedback small { color: var(--muted); line-height: 1.55; }
.conj-feedback .primary-button { margin-top: 15px; }
.conj-feedback button:disabled { opacity: .42; cursor: not-allowed; }
.cloze-intro { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 24px; margin-bottom: 18px; }
.cloze-intro h2 { margin: 12px 0 7px; }
.cloze-intro p { max-width: 760px; margin: 0; color: var(--muted); line-height: 1.6; }
.cloze-sentence { max-width: 820px; margin: 20px auto 0; text-align: center; font: 700 clamp(24px, 4vw, 35px)/1.65 "Hiragino Mincho ProN", "Yu Mincho", serif; }
.cloze-translation { min-height: 24px; margin: 9px auto 22px; text-align: center; color: var(--muted); }
.cloze-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 760px; margin: 0 auto; }
.cloze-options button { min-height: 62px; padding: 13px 42px 13px 16px; border: 2px solid #dedad1; border-radius: 13px; background: white; text-align: left; line-height: 1.45; cursor: pointer; position: relative; }
.cloze-options button span { position: absolute; right: 13px; top: 12px; color: #9ca6a8; font-size: 10px; font-weight: 900; }
.cloze-options button:hover { border-color: #9fb8c6; }
.cloze-options button.correct { border-color: var(--green); background: #eaf5f0; }
.cloze-options button.wrong { border-color: var(--red); background: #fff0ec; }
.cloze-explanation { max-width: 760px; margin: 20px auto 0; padding: 18px; border-radius: 14px; background: var(--paper); }
.cloze-explanation strong { color: var(--green); }
.cloze-explanation p { color: var(--muted); line-height: 1.65; }
.rule-toolbar { display: flex; justify-content: space-between; align-items: end; gap: 20px; padding: 18px; margin-bottom: 18px; }
.rule-toolbar label { flex: 1; max-width: 540px; }
.rule-toolbar > span { color: var(--muted); font-size: 11px; }
.rule-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 13px; }
.rule-card { padding: 21px; }
.rule-card > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rule-card h3 { font-size: 18px; }
.rule-card > div span { color: var(--red); font-size: 9px; font-weight: 900; letter-spacing: .08em; }
.rule-card code { display: inline-block; margin-top: 13px; padding: 7px 9px; border-radius: 8px; background: #e9f0ed; color: #2d6857; font-family: var(--font); font-size: 12px; font-weight: 800; }
.rule-card p { color: var(--muted); line-height: 1.65; }
.rule-card small { display: block; padding-top: 12px; border-top: 1px solid var(--line); color: var(--blue); line-height: 1.7; }

/* 片假名认读 */
.kana-overview { display: grid; grid-template-columns: repeat(3,auto); gap: 8px; }
.kana-overview div { min-width: 74px; padding: 12px 15px; border-radius: 13px; background: var(--ink); text-align: center; }
.kana-overview strong, .kana-overview span { display: block; }
.kana-overview strong { color: white; font-size: 22px; }
.kana-overview span { color: #afbec2; font-size: 9px; margin-top: 2px; }
.kana-level-guide { display: flex; align-items: center; justify-content: center; gap: 13px; padding: 18px; margin-bottom: 18px; }
.kana-level-guide div { display: grid; grid-template-columns: auto auto; gap: 3px 7px; align-items: center; }
.kana-level-guide div span { grid-column: 2; color: var(--muted); font-size: 9px; }
.kana-level-guide b { color: var(--muted); font-size: 10px; }
.kana-level-guide i { grid-row: 1 / 3; width: 12px; height: 12px; border-radius: 50%; }
.kana-level-guide .tricky { background: var(--red); }.kana-level-guide .known{background:var(--gold)}.kana-level-guide .mastered{background:var(--green)}
.kana-card { min-height: 540px; padding: clamp(24px,5vw,46px); position: relative; overflow: hidden; }
.kana-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 5px; background: linear-gradient(90deg,#75628d,var(--blue),var(--green)); }
.kana-status-row { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 28px; }
.kana-status-row span { padding: 6px 9px; border-radius: 8px; color: #6a547e; background: #f0e8f6; font-size: 10px; font-weight: 900; }
.kana-status-row small { color: var(--muted); }
.kana-prompt { margin: 4px 0 22px; text-align: center; font: 800 clamp(78px,14vw,126px)/1.2 "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif; }
.kana-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 620px; margin: 0 auto; }
.kana-choices button { min-height: 62px; padding: 12px; border: 2px solid var(--line); border-radius: 13px; background: white; font-size: 17px; cursor: pointer; }
.kana-choices button small { display: block; color: var(--muted); font-size: 10px; margin-top: 3px; }
.kana-feedback { max-width: 620px; margin: 20px auto 0; padding: 18px; border-radius: 14px; background: #eaf5f0; border: 1px solid #bfdbcf; text-align: center; }
.kana-feedback.wrong { background: #fff0ec; border-color: #f0c8bd; }
.kana-feedback strong, .kana-feedback p, .kana-feedback small { display: block; }
.kana-feedback p { margin: 7px 0; font-size: 21px; font-weight: 800; }
.kana-feedback small { color: var(--muted); }
.kana-feedback .primary-button { margin-top: 14px; }
.kana-start { display: block; margin: 26px auto 0; }

@media (max-width: 1040px) {
  .mode-grid { grid-template-columns: 1fr 1fr; }
  .special-modules { grid-template-columns: 1fr; }
  .hero-grid { grid-template-columns: 1.4fr 1fr; }
  .word-row { grid-template-columns: 1fr 1fr 72px 1.4fr 80px; }
  .word-row .group { display: none; }
}
@media (max-width: 760px) {
  body { background-size: 100% 25px; }
  .sidebar { display: none; }
  .main-content { margin: 0; padding: 82px 16px 92px; }
  .mobile-header { display: flex; position: fixed; z-index: 20; inset: 0 0 auto; height: 64px; align-items: center; justify-content: space-between; padding: 9px 16px; background: rgba(250,247,240,.93); border-bottom: 1px solid rgba(42,60,60,.09); backdrop-filter: blur(16px); }
  .brand.compact { padding: 0; gap: 9px; }.brand.compact .brand-mark{width:36px;height:36px;border-radius:11px;font-size:18px}.brand.compact strong{font-size:14px}
  .sound-toggle { width: 35px; height: 35px; border-radius: 50%; border: 1px solid var(--line); background: white; font-weight: 900; }
  .mobile-nav { display: grid; position: fixed; z-index: 20; inset: auto 0 0; grid-template-columns: repeat(4,1fr); height: 70px; padding: 7px 6px calc(7px + env(safe-area-inset-bottom)); background: rgba(255,253,248,.96); border-top: 1px solid var(--line); backdrop-filter: blur(14px); }
  .mobile-nav button { border: 0; background: none; color: var(--muted); font-size: 10px; font-weight: 800; }.mobile-nav button span{display:block;font-size:19px;margin-bottom:3px}.mobile-nav button.active{color:var(--red)}
  .page-head { display: block; margin-bottom: 25px; }.page-head > .outline-button{margin-top:16px}
  h1 { font-size: 34px; }.lede{font-size:13px}
  .hero-grid, .dashboard-grid, .settings-grid { grid-template-columns: 1fr; }
  .mastery-card { min-height: 190px; }
  .daily-card { min-height: 255px; }
  .mode-grid { grid-template-columns: 1fr; }
  .mode-card { min-height: 86px; }
  .special-module { grid-template-columns: auto 1fr; padding: 19px; }
  .special-module .outline-button { grid-column: 1 / -1; width: 100%; }
  .module-back-row { align-items: flex-start; }
  .course-summary { align-items: flex-start; }
  .course-layout { grid-template-columns: 1fr; }
  .course-path { grid-template-columns: repeat(2,1fr); max-height: 270px; }
  .course-options, .kana-choices { grid-template-columns: 1fr; }
  .kana-level-guide { align-items: stretch; flex-direction: column; }
  .kana-level-guide b { text-align: center; }
  .kana-overview { margin-top: 18px; }
  .quiz-card { min-height: calc(100vh - 185px); padding: 25px 18px; border-radius: 22px; }
  .feedback { margin: 25px -18px -25px; padding: 22px 18px 26px; }
  .choice-grid { grid-template-columns: 1fr; }
  .rating-row { grid-template-columns: 1fr 1fr; }
  .study-hint { display: none; }
  .filter-bar { grid-template-columns: 1fr 1fr; }.search-box{grid-column:1/-1}
  .word-row { grid-template-columns: 1fr auto; gap: 5px 12px; padding: 14px; }
  .word-row .reading { grid-column:1; }.word-row .meaning{grid-column:1/-1;white-space:normal;line-height:1.5}.word-row .level{grid-column:2;grid-row:1}.word-row .state{grid-column:2;grid-row:2}.word-row .group{display:none}
  .settings-card:last-child { grid-column: auto; }
  .setting-row { align-items: flex-start; }
  .button-stack { display: grid; }
  .button-stack > * { text-align: center; justify-content: center; }
  .activity-grid { gap: 4px; }
  .conjugation-head { display: block; }
  .conj-overview { width: max-content; margin-top: 18px; }
  .conj-tabs { width: 100%; }
  .conj-tabs button { flex: 1; padding: 10px 8px; font-size: 12px; }
  .conj-control { grid-template-columns: 1fr 1fr; }
  .conj-control .primary-button { grid-column: 1 / -1; }
  .conj-quiz, .cloze-card { min-height: 500px; padding: 24px 17px; }
  #conj-answer-form { grid-template-columns: 1fr; }
  .cloze-intro { display: grid; }
  .cloze-options, .rule-grid { grid-template-columns: 1fr; }
  .rule-toolbar { display: grid; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }
