:root {
  --bg: #f5f1e8;
  --paper: #fffdf8;
  --ink: #2d2926;
  --ink-soft: #58514c;
  --muted: #918981;
  --line: rgba(65,54,45,.11);
  --coral: #ff765f;
  --coral-deep: #e85845;
  --coral-soft: #ffe5dd;
  --orange: #ffb55d;
  --yellow: #ffd86f;
  --mint: #8dd7b6;
  --mint-deep: #27a67b;
  --mint-soft: #dcf6e9;
  --blue: #7ea8ff;
  --blue-soft: #e6eeff;
  --lavender: #b79cf4;
  --lavender-soft: #eee7ff;
  --red: #df5349;
  --red-soft: #ffe7e3;
  --shadow-sm: 0 8px 24px rgba(64,50,39,.06);
  --shadow-md: 0 16px 50px rgba(64,50,39,.1);
  --shadow-lg: 0 26px 80px rgba(54,41,32,.16);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; color: var(--ink); background: radial-gradient(circle at 15% 8%,rgba(255,207,160,.3),transparent 24rem),radial-gradient(circle at 90% 20%,rgba(141,215,182,.2),transparent 27rem),var(--bg); font-family: "PingFang SC","Microsoft YaHei","Noto Sans SC",ui-sans-serif,system-ui,sans-serif; -webkit-font-smoothing: antialiased; }
button,input,textarea,select { font: inherit; }
button { color: inherit; }
button,a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
p,h1,h2,h3,h4 { margin-top: 0; }
svg { display: block; }
[hidden] { display: none !important; }
button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible { outline: 3px solid rgba(126,168,255,.5); outline-offset: 2px; }
.ambient { position: fixed; z-index: -1; border-radius: 50%; pointer-events: none; }
.ambient-one { width: 18rem; height: 18rem; left: -7rem; bottom: 12%; background: radial-gradient(circle,rgba(183,156,244,.16),transparent 68%); }
.ambient-two { width: 23rem; height: 23rem; right: -8rem; top: -8rem; background: radial-gradient(circle,rgba(255,181,93,.15),transparent 68%); }
.app-shell { display: grid; grid-template-columns: 236px minmax(0,1fr); height: 100dvh; overflow: hidden; }
.sidebar { display: flex; flex-direction: column; height: 100dvh; padding: 24px 18px 20px; border-right: 1px solid var(--line); background: rgba(255,253,248,.72); backdrop-filter: blur(18px); }
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 0; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 40px; color: var(--coral); }
.brand-mark svg { width: 100%; height: 100%; }
.brand b { display: block; font-size: 17px; letter-spacing: -.02em; }
.brand small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.sidebar-capture { display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 10px; width: 100%; margin: 26px 0 18px; padding: 13px; border: 0; border-radius: 19px; color: #fff; text-align: left; cursor: pointer; background: linear-gradient(135deg,#ff846c,#ff6a58); box-shadow: 0 12px 28px rgba(232,88,69,.24); }
.capture-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 13px; background: rgba(255,255,255,.18); }
.capture-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.sidebar-capture b { display: block; font-size: 14px; }
.sidebar-capture small { display: block; margin-top: 2px; color: rgba(255,255,255,.72); font-size: 10px; }
.shortcut { display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid rgba(255,255,255,.2); border-radius: 8px; color: rgba(255,255,255,.7); font-size: 9px; }
.side-nav { display: flex; flex-direction: column; gap: 5px; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 12px; border: 0; border-radius: 15px; color: var(--ink-soft); background: transparent; font-size: 13px; font-weight: 600; text-align: left; cursor: pointer; }
.nav-item:hover { background: rgba(45,41,38,.045); }
.nav-item.active { color: var(--coral-deep); background: var(--coral-soft); }
.nav-item svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.nav-dot { width: 5px; height: 5px; margin-left: auto; border-radius: 50%; background: currentColor; opacity: 0; }
.nav-item.active .nav-dot { opacity: 1; }
.sidebar-footer { margin-top: auto; }
.sidebar-note { margin-bottom: 14px; padding: 14px; border: 1px solid rgba(255,181,93,.24); border-radius: 18px; background: linear-gradient(145deg,rgba(255,240,210,.9),rgba(255,250,239,.75)); }
.sidebar-note span { color: #dc9c31; font-size: 16px; }
.sidebar-note p { margin: 7px 0 0; color: #796248; font-size: 11px; line-height: 1.7; }
.ghost-link { display: block; padding: 7px 12px; border: 0; color: var(--muted); background: transparent; font-size: 11px; cursor: pointer; }
.main-shell { min-width: 0; height: 100dvh; overflow-y: auto; }
.topbar { position: sticky; z-index: 30; top: 0; display: flex; align-items: center; justify-content: flex-end; height: 74px; padding: 0 clamp(18px,3vw,38px); background: linear-gradient(to bottom,rgba(245,241,232,.95) 65%,rgba(245,241,232,0)); backdrop-filter: blur(12px); }
.mobile-brand { display: none; }
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.score-pill { display: flex; align-items: center; gap: 5px; height: 38px; padding: 0 14px; border: 1px solid rgba(255,181,93,.32); border-radius: 99px; background: rgba(255,251,239,.88); box-shadow: var(--shadow-sm); cursor: pointer; }
.score-pill span:not(.score-spark) { font-size: 16px; font-weight: 800; }
.score-pill small { color: var(--muted); font-size: 10px; }
.score-spark { color: var(--orange); }
.icon-btn,.avatar-btn { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: rgba(255,253,248,.82); cursor: pointer; }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: var(--ink-soft); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.avatar-btn { border-color: rgba(141,215,182,.45); background: var(--mint-soft); }
.avatar-face { color: var(--mint-deep); font-size: 17px; font-weight: 800; }
.page-content { width: 100%; max-width: 1240px; margin: 0 auto; padding: 12px clamp(18px,3vw,38px) 46px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 8px 0 22px; }
.page-head h1 { margin: 4px 0 7px; font-size: clamp(28px,3vw,38px); line-height: 1.14; letter-spacing: -.045em; }
.page-head p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.eyebrow { margin: 0; color: var(--coral-deep); font-size: 10px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.date-chip { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 99px; color: var(--ink-soft); background: rgba(255,253,248,.75); font-size: 11px; white-space: nowrap; }
.date-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--mint); }
.stack { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.card { border: 1px solid var(--line); border-radius: 30px; background: rgba(255,253,248,.88); box-shadow: var(--shadow-sm); }
.card-pad { padding: 24px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.card-head h3 { margin: 2px 0 0; font-size: 17px; }
.card-head p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.text-link { display: inline-flex; align-items: center; gap: 4px; padding: 5px 0; border: 0; color: var(--muted); background: transparent; font-size: 10px; font-weight: 700; cursor: pointer; }
.text-link svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 17px; border: 1px solid transparent; border-radius: 14px; font-size: 11px; font-weight: 800; cursor: pointer; }
.button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.button-primary { color: #fff; background: linear-gradient(135deg,#ff8069,var(--coral-deep)); box-shadow: 0 10px 22px rgba(232,88,69,.2); }
.button-secondary { color: var(--ink-soft); border-color: var(--line); background: rgba(255,255,255,.68); }
.button-mint { color: #fff; background: linear-gradient(135deg,#60c69c,#27a67b); box-shadow: 0 10px 22px rgba(39,166,123,.18); }
.button-blue { color: #fff; background: linear-gradient(135deg,#8db4ff,#5f8bea); }
.button-danger-soft { color: var(--red); background: var(--red-soft); }
.button-block { width: 100%; }
.button-large { min-height: 49px; padding: 0 21px; border-radius: 16px; font-size: 12px; }
.button:disabled { opacity: .45; cursor: not-allowed; }

.home-hero { position: relative; display: grid; grid-template-columns: minmax(0,1.1fr) minmax(300px,.9fr); min-height: 350px; overflow: hidden; border-radius: 38px; background: radial-gradient(circle at 75% 30%,rgba(255,255,255,.5),transparent 16rem),linear-gradient(125deg,#fff0df,#ffe5d7 42%,#f8ddd0); box-shadow: var(--shadow-md); }
.home-hero::before { content: ""; position: absolute; width: 320px; height: 320px; right: -100px; bottom: -170px; border: 42px solid rgba(255,255,255,.22); border-radius: 50%; }
.home-hero::after { content: ""; position: absolute; width: 100px; height: 100px; left: 44%; top: -52px; border: 22px solid rgba(255,255,255,.24); border-radius: 50%; }
.hero-copy { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: clamp(28px,4vw,48px); }
.hero-badge { display: inline-flex; align-items: center; gap: 8px; padding: 8px 11px; border: 1px solid rgba(232,88,69,.13); border-radius: 99px; color: var(--coral-deep); background: rgba(255,255,255,.55); font-size: 10px; font-weight: 700; }
.pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--coral); animation: pulse 2s infinite; }
.hero-copy h2 { margin: 18px 0 12px; font-size: clamp(35px,4.2vw,56px); line-height: 1.04; letter-spacing: -.06em; }
.hero-copy h2 .accent { color: var(--coral-deep); }
.hero-copy > p { max-width: 470px; margin: 0; color: #79685d; font-size: 13px; line-height: 1.8; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 23px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 21px; margin-top: 28px; }
.hero-stat b { display: block; font-size: 18px; }
.hero-stat span { display: block; margin-top: 3px; color: #917e72; font-size: 9px; }
.hero-pet { position: relative; z-index: 1; display: grid; place-items: center; min-height: 330px; padding: 22px; }
.pet-scene { position: relative; width: min(100%,390px); aspect-ratio: 1.12; display: grid; place-items: center; }
.pet-scene::before { content: ""; position: absolute; width: 68%; height: 68%; border-radius: 50%; background: radial-gradient(circle,rgba(255,255,255,.85),rgba(255,255,255,.22) 58%,transparent 74%); }
.orbit { position: absolute; inset: 9% 4%; border: 1px dashed rgba(166,120,91,.18); border-radius: 50%; transform: rotate(-9deg); }
.orbit::before,.orbit::after { content: ""; position: absolute; width: 7px; height: 7px; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 0 5px rgba(255,216,111,.18); }
.orbit::before { left: 18%; top: 9%; }
.orbit::after { right: 10%; bottom: 22%; background: var(--lavender); }
.pet-tap-zone { z-index: 3; border: 0; background: transparent; padding: 0; }
.pet-svg { position: relative; z-index: 2; width: 72%; height: auto; overflow: visible; cursor: pointer; animation: petFloat 3.5s ease-in-out infinite; filter: drop-shadow(0 20px 20px rgba(113,68,48,.12)); }
.pet-svg.stage-1 { width: 62%; }.pet-svg.stage-2 { width: 64%; }.pet-svg.stage-3 { width: 67%; }.pet-svg.stage-4 { width: 70%; }.pet-svg.stage-5 { width: 73%; }.pet-svg.stage-6 { width: 76%; }.pet-svg.stage-7 { width: 79%; }.pet-svg.stage-8 { width: 83%; }
.pet-svg.sad { animation: petSad 2.8s ease-in-out infinite; }
.pet-svg.celebrate { animation: petCelebrate 1.15s ease-in-out infinite; }
.pet-ear-left,.pet-ear-right { transform-box: fill-box; transform-origin: center; animation: earTwitch 4s ease-in-out infinite; }
.pet-eye { transform-box: fill-box; transform-origin: center; animation: blink 4.3s infinite; }
.pet-crown { animation: crownGlow 3s ease-in-out infinite; }
.pet-star { position: absolute; z-index: 4; color: var(--orange); animation: sparkle 3.2s ease-in-out infinite; }
.pet-star.one { left: 10%; top: 22%; font-size: 18px; }
.pet-star.two { right: 8%; top: 31%; font-size: 12px; color: var(--lavender); animation-delay: -1.1s; }
.pet-star.three { right: 19%; bottom: 13%; font-size: 16px; color: var(--mint-deep); animation-delay: -2.2s; }
.pet-name-tag { position: absolute; z-index: 5; right: 4%; bottom: 3%; display: flex; align-items: center; gap: 7px; padding: 8px 11px; border: 1px solid rgba(255,255,255,.8); border-radius: 99px; background: rgba(255,253,248,.78); box-shadow: var(--shadow-sm); backdrop-filter: blur(8px); font-size: 10px; font-weight: 700; }
.mood-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mint-deep); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(300px,.65fr); gap: 20px; margin-top: 20px; }
.recent-list { display: flex; flex-direction: column; gap: 4px; }
.mistake-row { display: grid; grid-template-columns: 58px 1fr auto; align-items: center; gap: 13px; width: 100%; padding: 9px; border: 0; border-radius: 18px; text-align: left; background: transparent; cursor: pointer; }
.mistake-row:hover { background: rgba(45,41,38,.035); }
.question-thumb { position: relative; width: 58px; height: 58px; overflow: hidden; border-radius: 15px; background: #f3ede3; }
.question-thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-subject { position: absolute; left: 5px; top: 5px; padding: 2px 5px; border-radius: 5px; color: #fff; background: rgba(45,41,38,.72); font-size: 7px; font-weight: 700; }
.mistake-row-copy { min-width: 0; }
.mistake-row-copy b,.mistake-row-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mistake-row-copy b { font-size: 12px; }
.mistake-row-copy span { margin-top: 5px; color: var(--muted); font-size: 9px; }
.status-dot { display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: var(--orange); }
.status-dot.corrected { background: var(--blue); }
.status-dot.mastered { background: var(--mint-deep); }
.status-dot.review { background: var(--red); }
.row-delta { color: var(--red); font-size: 10px; font-weight: 700; white-space: nowrap; }
.row-delta.positive { color: var(--mint-deep); }
.score-card { position: relative; overflow: hidden; padding: 24px; border: 1px solid rgba(141,215,182,.24); border-radius: 30px; background: linear-gradient(145deg,#eafaf2,#f9fffc); box-shadow: var(--shadow-sm); }
.score-card-head { display: flex; justify-content: space-between; align-items: flex-start; }
.score-card-head span { color: #548c75; font-size: 10px; font-weight: 700; }
.score-card-head b { display: block; margin-top: 4px; font-size: 33px; letter-spacing: -.06em; }
.score-card-head b small { margin-left: 4px; color: #74a18d; font-size: 10px; }
.level-pill { padding: 6px 9px; border-radius: 99px; color: var(--mint-deep); background: rgba(255,255,255,.7); font-size: 9px; font-weight: 800; }
.xp-row { margin-top: 18px; }
.xp-label,.score-foot { display: flex; justify-content: space-between; align-items: center; color: #6a9481; font-size: 9px; }
.xp-track { height: 7px; margin-top: 7px; overflow: hidden; border-radius: 99px; background: rgba(54,142,108,.12); }
.xp-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--mint),var(--mint-deep)); }
.score-foot { margin-top: 15px; }
.score-foot button { padding: 6px 9px; border: 0; border-radius: 99px; color: var(--mint-deep); background: #fff; font-size: 9px; font-weight: 800; cursor: pointer; }
.week-chart { display: flex; align-items: flex-end; justify-content: space-between; gap: 7px; height: 78px; margin-top: 12px; }
.chart-day { display: flex; flex: 1; flex-direction: column; align-items: center; gap: 6px; }
.chart-bar-wrap { display: flex; align-items: flex-end; width: 100%; height: 54px; border-radius: 7px; background: rgba(45,41,38,.035); }
.chart-bar { width: 100%; min-height: 3px; border-radius: 7px; background: linear-gradient(to top,var(--orange),var(--yellow)); }
.chart-day.today .chart-bar { background: linear-gradient(to top,var(--coral),#ff9a76); }
.chart-day span { color: var(--muted); font-size: 8px; }
.quiz-card { position: relative; overflow: hidden; padding: 23px; border: 1px solid rgba(126,168,255,.2); border-radius: 30px; background: linear-gradient(145deg,#eef3ff,#fbfdff); box-shadow: var(--shadow-sm); }
.quiz-card::before { content: "?"; position: absolute; right: 15px; bottom: -31px; color: rgba(126,168,255,.13); font-family: Georgia,serif; font-size: 120px; font-weight: 700; }
.quiz-card-top { display: flex; align-items: center; gap: 10px; }
.quiz-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 14px; color: var(--blue); background: #fff; }
.quiz-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.quiz-card h3 { position: relative; z-index: 1; margin: 15px 0 7px; font-size: 17px; }
.quiz-card p { position: relative; z-index: 1; margin: 0; color: #74849e; font-size: 10px; line-height: 1.7; }
.quiz-status-line { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 7px; margin-top: 15px; }
.quiz-status-line span { padding: 6px 8px; border-radius: 8px; color: #6f7e96; background: rgba(255,255,255,.7); font-size: 9px; }
.tip-card { display: flex; gap: 12px; padding: 18px; border: 1px dashed rgba(183,156,244,.34); border-radius: 22px; background: rgba(238,231,255,.38); }
.tip-symbol { display: grid; place-items: center; flex: 0 0 32px; width: 32px; height: 32px; border-radius: 11px; color: #8f75d0; background: #fff; }
.tip-card b { font-size: 11px; }
.tip-card p { margin: 5px 0 0; color: #7f7690; font-size: 9px; line-height: 1.7; }
.empty-state { display: grid; place-items: center; min-height: 300px; padding: 30px; text-align: center; border: 1px dashed var(--line); border-radius: 30px; background: rgba(255,253,248,.55); }
.empty-illustration { display: grid; place-items: center; width: 92px; height: 92px; margin: 0 auto 17px; border-radius: 32px; color: var(--blue); background: var(--blue-soft); }
.empty-illustration svg { width: 42px; height: 42px; fill: none; stroke: currentColor; }
.empty-state h3 { margin: 0 0 7px; font-size: 17px; }
.empty-state p { max-width: 300px; margin: 0 auto 18px; color: var(--muted); font-size: 10px; line-height: 1.7; }

.library-summary { display: grid; grid-template-columns: 1.4fr repeat(3,minmax(100px,.5fr)); gap: 12px; margin-bottom: 20px; }
.library-intro { min-height: 124px; padding: 22px 24px; border-radius: 30px; color: #fff; background: radial-gradient(circle at 88% 18%,rgba(255,255,255,.22),transparent 7rem),linear-gradient(135deg,#ff8e76,#eb6553); box-shadow: 0 16px 36px rgba(232,88,69,.18); }
.library-intro h2 { margin: 9px 0 7px; font-size: 23px; }
.library-intro p { margin: 0; color: rgba(255,255,255,.78); font-size: 10px; line-height: 1.7; }
.library-stat { display: flex; flex-direction: column; justify-content: space-between; min-height: 124px; padding: 20px; border: 1px solid var(--line); border-radius: 30px; background: rgba(255,253,248,.84); box-shadow: var(--shadow-sm); }
.library-stat span,.library-stat small { color: var(--muted); font-size: 10px; }
.library-stat b { font-size: 28px; }
.library-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 20px 0 14px; }
.filter-group { display: flex; flex-wrap: wrap; gap: 7px; }
.filter-chip { padding: 8px 12px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); background: rgba(255,253,248,.7); font-size: 10px; font-weight: 700; cursor: pointer; }
.filter-chip.active { color: #fff; border-color: var(--ink); background: var(--ink); }
.library-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 15px; }
.mistake-card { overflow: hidden; border: 1px solid var(--line); border-radius: 24px; background: var(--paper); box-shadow: var(--shadow-sm); }
.mistake-image { position: relative; width: 100%; height: 168px; overflow: hidden; background: #f0ebe2; cursor: pointer; }
.mistake-image img { width: 100%; height: 100%; object-fit: cover; }
.subject-tag { position: absolute; left: 12px; top: 12px; padding: 5px 8px; border-radius: 8px; color: #fff; background: rgba(45,41,38,.75); font-size: 8px; font-weight: 800; }
.card-points { position: absolute; right: 12px; top: 12px; padding: 5px 8px; border-radius: 8px; color: var(--red); background: rgba(255,248,245,.92); font-size: 8px; font-weight: 800; }
.mistake-body { padding: 15px 16px 16px; }
.mistake-meta,.mistake-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.status-badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 7px; border-radius: 99px; color: #b56a2e; background: #fff0d8; font-size: 8px; font-weight: 800; }
.status-badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-badge.corrected { color: #5d7fc5; background: #eaf0ff; }
.status-badge.mastered { color: var(--mint-deep); background: var(--mint-soft); }
.status-badge.review { color: var(--red); background: var(--red-soft); }
.mistake-date,.mistake-foot span { color: var(--muted); font-size: 8px; }
.mistake-body h3 { margin: 11px 0 6px; overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.mistake-body > p { min-height: 30px; margin: 0 0 13px; overflow: hidden; color: var(--muted); font-size: 9px; line-height: 1.65; }
.mistake-action { display: inline-flex; align-items: center; gap: 5px; padding: 7px 10px; border: 0; border-radius: 10px; color: var(--coral-deep); background: var(--coral-soft); font-size: 9px; font-weight: 800; cursor: pointer; }
.mistake-action svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; }
.quiz-page-grid { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(280px,.8fr); gap: 20px; }
.quiz-hero { position: relative; overflow: hidden; min-height: 340px; padding: 34px; border-radius: 38px; color: #fff; background: radial-gradient(circle at 85% 18%,rgba(255,255,255,.16),transparent 12rem),linear-gradient(135deg,#7ea8ff,#617dd7 65%,#6d73ca); box-shadow: 0 24px 55px rgba(91,119,203,.22); }
.quiz-hero::after { content: "?"; position: absolute; right: 18px; bottom: -88px; color: rgba(255,255,255,.08); font-family: Georgia,serif; font-size: 280px; font-weight: 700; }
.quiz-hero .eyebrow { color: rgba(255,255,255,.7); }
.quiz-hero h1 { position: relative; z-index: 1; margin: 12px 0; font-size: clamp(32px,4vw,48px); line-height: 1.08; letter-spacing: -.055em; }
.quiz-hero > p { position: relative; z-index: 1; margin: 0; color: rgba(255,255,255,.72); font-size: 11px; line-height: 1.8; }
.quiz-hero-actions { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 23px; }
.quiz-hero .button-secondary { color: #fff; border-color: rgba(255,255,255,.26); background: rgba(255,255,255,.12); }
.paper-preview { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 7px; margin-top: 24px; }
.paper-chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 9px; border: 1px solid rgba(255,255,255,.14); border-radius: 9px; color: rgba(255,255,255,.75); background: rgba(255,255,255,.08); font-size: 8px; }
.paper-chip i { display: grid; place-items: center; width: 15px; height: 15px; border-radius: 5px; background: rgba(255,255,255,.14); font-style: normal; }
.rules-mini { padding: 24px; }
.rule-row { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 11px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.rule-row:last-child { border-bottom: 0; }
.rule-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 13px; color: var(--red); background: var(--red-soft); font-weight: 800; }
.rule-row:nth-child(3) .rule-icon,.rule-row:nth-child(4) .rule-icon { color: var(--mint-deep); background: var(--mint-soft); }
.rule-copy b { display: block; font-size: 11px; }
.rule-copy span { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; }
.rule-points { color: var(--red); font-size: 12px; font-weight: 900; }
.rule-points.plus { color: var(--mint-deep); }
.quiz-info-card { padding: 22px; }
.quiz-info-card h3 { font-size: 14px; }
.quiz-info-card p { color: var(--muted); font-size: 9px; line-height: 1.8; }
.quiz-info-card ul { margin: 12px 0 0; padding: 0; list-style: none; }
.quiz-info-card li { padding: 7px 0; color: var(--ink-soft); font-size: 9px; }
.quiz-info-card li::before { content: "✓"; margin-right: 8px; color: var(--mint-deep); font-weight: 900; }
.quiz-runner { max-width: 820px; margin: 0 auto; }
.quiz-progress-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; }
.quiz-progress-head b { font-size: 13px; }
.quiz-progress-head span { color: var(--muted); font-size: 10px; }
.quiz-progress { display: flex; gap: 6px; margin-bottom: 18px; }
.progress-segment { flex: 1; height: 7px; overflow: hidden; border-radius: 99px; background: rgba(45,41,38,.08); }
.progress-segment i { display: block; width: 0; height: 100%; background: var(--blue); }
.progress-segment.done i { width: 100%; background: var(--mint); }
.progress-segment.current i { width: 52%; }
.quiz-question-card { overflow: hidden; border: 1px solid var(--line); border-radius: 38px; background: var(--paper); box-shadow: var(--shadow-md); }
.quiz-question-image { display: block; width: 100%; max-height: 430px; object-fit: contain; background: #f1ece3; }
.quiz-question-body { padding: 26px; }
.quiz-question-meta { display: flex; align-items: center; gap: 8px; }
.quiz-question-body h2 { margin: 12px 0 7px; font-size: 22px; }
.quiz-question-body p { color: var(--muted); font-size: 10px; line-height: 1.7; }
.quiz-answer-prompt { margin: 23px 0 11px; font-weight: 800; }
.quiz-answer-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quiz-answer-actions .button { min-height: 54px; }
.quiz-finish-card { padding: clamp(28px,5vw,48px); text-align: center; }
.result-orb { display: grid; place-items: center; width: 86px; height: 86px; margin: 0 auto 18px; border-radius: 30px; color: #fff; background: linear-gradient(135deg,var(--mint),var(--mint-deep)); box-shadow: 0 18px 34px rgba(39,166,123,.2); }
.result-orb.not-perfect { background: linear-gradient(135deg,var(--orange),var(--coral)); }
.result-orb svg { width: 42px; height: 42px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.quiz-finish-card h2 { margin-bottom: 8px; font-size: 30px; }
.quiz-finish-card > p { max-width: 430px; margin: 0 auto 22px; color: var(--muted); font-size: 11px; line-height: 1.8; }
.result-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; max-width: 480px; margin: 0 auto 24px; }
.result-stat { padding: 14px 8px; border-radius: 15px; background: rgba(45,41,38,.04); }
.result-stat b { display: block; font-size: 21px; }
.result-stat span { color: var(--muted); font-size: 8px; }
.result-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; }

.pet-page-hero { position: relative; display: grid; grid-template-columns: minmax(0,1fr) minmax(330px,.82fr); min-height: 400px; overflow: hidden; border: 1px solid rgba(141,215,182,.3); border-radius: 38px; background: radial-gradient(circle at 25% 24%,rgba(255,255,255,.72),transparent 14rem),linear-gradient(135deg,#e6f8ef,#e8f3ff 58%,#eee8ff); box-shadow: var(--shadow-md); }
.pet-page-copy { position: relative; z-index: 2; display: flex; flex-direction: column; justify-content: center; padding: clamp(28px,4vw,48px); }
.pet-page-copy h1 { margin: 12px 0 9px; font-size: clamp(34px,4vw,50px); line-height: 1.06; letter-spacing: -.055em; }
.pet-page-copy h1 span { color: var(--mint-deep); }
.pet-page-copy > p { max-width: 450px; margin: 0; color: #6a8077; font-size: 11px; line-height: 1.8; }
.pet-level-row { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 21px; }
.pet-level-pill { padding: 8px 11px; border-radius: 99px; color: #51816d; background: rgba(255,255,255,.7); font-size: 9px; font-weight: 800; }
.pet-level-pill.xp { color: #6e78a0; }
.bamboo-pill { color: #8f641f !important; background: #fff2cc !important; }
.bamboo-balance { display: inline-flex; gap: 5px; padding: 7px 10px; border-radius: 99px; color: #8f641f; background: #fff2cc; font-size: 11px; font-weight: 800; }
.pet-template-picker { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; width: 100%; max-width: 430px; margin-top: 18px; }
.pet-template-card { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 7px; border: 1px solid var(--line); border-radius: 15px; color: var(--ink-soft); background: rgba(255,255,255,.65); cursor: pointer; }
.pet-template-card span { font-size: 23px; }
.pet-template-card b { font-size: 10px; }
.mini-panda { position: relative; display: block; width: 34px; height: 29px; border: 2px solid #292624; border-radius: 48% 48% 46% 46%; background: #fffdf8; }
.mini-panda::before,.mini-panda::after { content: ""; position: absolute; top: -5px; width: 13px; height: 13px; border-radius: 50%; background: #292624; }
.mini-panda::before { left: -2px; }.mini-panda::after { right: -2px; }
.mini-panda i { position: absolute; left: 6px; top: 8px; width: 7px; height: 9px; border-radius: 50%; background: #292624; box-shadow: 12px 0 0 #292624; }
.mini-panda.mini-bamboo { border-color: #30463a; background: #fbfff9; }.mini-panda.mini-bamboo::before,.mini-panda.mini-bamboo::after,.mini-panda.mini-bamboo i { background: #30463a; }
.mini-panda.mini-peach { border-color: #4b3539; background: #fff9f9; }.mini-panda.mini-peach::before,.mini-panda.mini-peach::after,.mini-panda.mini-peach i { background: #4b3539; }
.mini-panda.mini-peach { box-shadow: inset 0 -5px 0 rgba(255,140,164,.22); }
.pet-template-card small { color: var(--muted); font-size: 7px; }
.pet-template-card.active { color: var(--mint-deep); border-color: rgba(39,166,123,.36); background: var(--mint-soft); }
.pet-care-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 18px; }
.pet-stage-large { position: relative; z-index: 1; display: grid; place-items: center; padding: 15px 30px 15px 0; }
.pet-stage-large .pet-scene { width: min(100%,440px); }
.pet-stage-large .pet-svg { width: 82%; }
.pet-lower-grid { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(280px,.8fr); gap: 20px; margin-top: 20px; }
.pet-progress-card,.pet-food-card { padding: 25px; }
.pet-xp-track { height: 11px; overflow: hidden; border-radius: 99px; background: rgba(39,166,123,.1); }
.pet-xp-fill { height: 100%; background: linear-gradient(90deg,var(--mint),var(--mint-deep)); }
.pet-xp-labels { display: flex; justify-content: space-between; margin-top: 8px; color: var(--muted); font-size: 8px; }
.pet-stats-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; margin-top: 18px; }
.pet-stat { padding: 12px 8px; border-radius: 14px; text-align: center; background: rgba(45,41,38,.035); }
.pet-stat b { display: block; font-size: 18px; }
.pet-stat span { color: var(--muted); font-size: 8px; }
.level-psychology { margin: 14px 0 0; padding: 10px 12px; border-radius: 12px; color: #6e8179; background: rgba(141,215,182,.13); font-size: 8px; line-height: 1.7; }
.food-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; }
.food-card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 8px 12px; border: 1px solid var(--line); border-radius: 17px; color: var(--ink-soft); background: linear-gradient(145deg,#fffdf8,#f7f2e8); cursor: pointer; }
.food-card:disabled { opacity: .42; cursor: not-allowed; }
.food-icon { font-size: 27px; }
.food-card b { font-size: 10px; }
.food-card small { color: var(--mint-deep); font-size: 8px; font-weight: 800; }
.food-card em { color: #9a7136; font-size: 8px; font-style: normal; }
.food-hint { margin: 12px 0 0; color: var(--muted); font-size: 8px; line-height: 1.7; }
.unlock-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; }
.unlock-item { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 120px; padding: 13px 8px; border: 1px solid var(--line); border-radius: 18px; text-align: center; background: rgba(255,253,248,.72); }
.unlock-icon { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 8px; border-radius: 15px; background: var(--lavender-soft); font-size: 18px; }
.unlock-item b { font-size: 9px; }
.unlock-item span { margin-top: 4px; color: var(--muted); font-size: 7px; }
.unlock-item.locked { opacity: .55; filter: grayscale(.8); }
.unlock-item.locked::after { content: "Lv." attr(data-level); position: absolute; right: 7px; top: 7px; padding: 3px 5px; border-radius: 5px; color: var(--muted); background: rgba(45,41,38,.05); font-size: 7px; }
.pet-diary { display: flex; flex-direction: column; }
.diary-item { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.diary-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; color: var(--mint-deep); background: var(--mint-soft); }
.diary-item b { font-size: 10px; }
.diary-item span { color: var(--muted); font-size: 8px; }
.diary-points { color: var(--mint-deep); font-size: 10px; font-weight: 800; }
.pet-talks { display: flex; flex-direction: column; gap: 8px; }
.talk-bubble { padding: 11px 13px; border-radius: 5px 16px 16px 16px; color: #657c72; background: #eff9f4; font-size: 9px; line-height: 1.7; }
.bottom-nav { display: none; }
.modal-backdrop { position: fixed; z-index: 100; inset: 0; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(38,32,28,.4); backdrop-filter: blur(8px); animation: fadeIn .18s ease both; }
.modal-sheet { width: min(680px,100%); max-height: min(92dvh,920px); overflow-y: auto; border: 1px solid rgba(255,255,255,.7); border-radius: 30px; background: #fbf8f1; box-shadow: var(--shadow-lg); animation: sheetIn .25s ease both; }
.modal-sheet.narrow { width: min(530px,100%); }
.modal-sheet.wide { width: min(850px,100%); }
.modal-handle { display: none; }
.modal-head { display: flex; justify-content: space-between; gap: 20px; padding: 26px 27px 18px; }
.modal-head h2 { margin: 3px 0 5px; font-size: 24px; }
.modal-head p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.modal-close { display: grid; place-items: center; flex: 0 0 34px; width: 34px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); background: #fff; font-size: 20px; cursor: pointer; }
.modal-body { padding: 0 27px 28px; }
.modal-footer { position: sticky; z-index: 6; bottom: 0; display: flex; gap: 9px; padding: 15px 27px 22px; border-top: 1px solid var(--line); background: rgba(251,248,241,.96); backdrop-filter: blur(10px); }
.modal-footer .button { flex: 1; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; margin-top: 18px; }
.form-field.full { grid-column: 1/-1; }
.form-field label { display: block; margin-bottom: 7px; color: var(--ink-soft); font-size: 9px; font-weight: 800; }
.form-field input,.form-field select,.form-field textarea { width: 100%; min-height: 43px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: rgba(255,255,255,.75); font-size: 11px; }
.form-field textarea { min-height: 77px; resize: vertical; }
.subject-options { display: flex; flex-wrap: wrap; gap: 7px; }
.subject-option { padding: 7px 11px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); background: #fff; font-size: 9px; font-weight: 700; cursor: pointer; }
.subject-option.active { color: var(--coral-deep); border-color: rgba(255,118,95,.25); background: var(--coral-soft); }

.capture-zone { display: grid; place-items: center; width: 100%; min-height: 220px; padding: 24px; overflow: hidden; border: 1.5px dashed rgba(255,118,95,.35); border-radius: 22px; text-align: center; background: radial-gradient(circle at 90% 12%,rgba(255,181,93,.15),transparent 7rem),#fffaf4; }
.capture-big-icon { display: grid; place-items: center; width: 62px; height: 62px; margin: 0 auto 12px; border-radius: 21px; color: #fff; background: linear-gradient(135deg,#ff8b73,var(--coral-deep)); box-shadow: 0 14px 26px rgba(232,88,69,.22); cursor: pointer; }
.capture-big-icon svg { width: 29px; height: 29px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.capture-choice-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 9px; margin-top: 17px; }
.capture-choice-row .button { min-width: 125px; min-height: 45px; cursor: pointer; }
.capture-zone b { display: block; font-size: 14px; }
.capture-zone span { display: block; margin-top: 6px; color: var(--muted); font-size: 9px; }
.capture-preview { position: relative; overflow: hidden; max-height: 300px; border-radius: 20px; background: #eae4da; }
.capture-preview img { display: block; width: 100%; max-height: 300px; object-fit: contain; }
.capture-replace-group { position: absolute; right: 10px; bottom: 10px; display: flex; gap: 6px; }
.capture-replace { padding: 7px 10px; border: 1px solid rgba(255,255,255,.4); border-radius: 9px; color: #fff; background: rgba(36,31,27,.72); font-size: 8px; font-weight: 700; cursor: pointer; }
.capture-replace.album { background: rgba(39,166,123,.92); }
.clean-badge { position: absolute; left: 10px; top: 10px; padding: 6px 9px; border-radius: 8px; color: #fff; background: rgba(39,166,123,.9); font-size: 8px; font-weight: 800; }
.capture-tool-row { display: grid; grid-template-columns: 1fr; gap: 9px; margin: 12px 0; }
.clean-entry { display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 12px; width: 100%; min-height: 68px; padding: 12px 15px; border: 1px solid rgba(232,88,69,.22); border-radius: 18px; color: var(--coral-deep); text-align: left; background: linear-gradient(135deg,#fff4ee,#ffe9e1); cursor: pointer; }
.clean-entry-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 15px; color: #fff; background: linear-gradient(135deg,#ff8b72,var(--coral-deep)); font-size: 21px; }
.clean-entry-copy b { display: block; font-size: 14px; }
.clean-entry-copy small { display: block; margin-top: 4px; color: #916f66; font-size: 9px; }
.clean-entry-arrow { font-size: 20px; font-weight: 700; }
.capture-note { display: flex; gap: 8px; margin-top: 15px; padding: 11px 12px; border-radius: 12px; color: #7b716a; background: rgba(45,41,38,.04); font-size: 8px; line-height: 1.7; }
.capture-note span { color: var(--coral); }
.capture-result { text-align: center; }
.cleanup-canvas-wrap { display: grid; place-items: center; max-height: 40vh; overflow: auto; padding: 10px; border: 1px solid var(--line); border-radius: 19px; background: #e9e4db; }
.cleanup-canvas-stack { position: relative; display: inline-block; max-width: 100%; line-height: 0; border-radius: 10px; overflow: hidden; box-shadow: 0 8px 26px rgba(55,44,36,.12); }
#cleanupCanvas,#cleanupOverlay { display: block; width: auto; max-width: 100%; height: auto; max-height: 36vh; background: #fff; touch-action: none; }
.cleanup-canvas-wrap.zoomed { place-items: start; align-items: start; }
.cleanup-canvas-wrap.pan-mode { cursor: grab; }
.cleanup-canvas-wrap.pan-mode #cleanupOverlay { cursor: grab; }
.cleanup-canvas-wrap.zoomed .cleanup-canvas-stack { width: 175%; max-width: none; flex: 0 0 auto; }
.cleanup-canvas-wrap.zoomed #cleanupCanvas,
.cleanup-canvas-wrap.zoomed #cleanupOverlay { width: 100%; max-width: none; max-height: none; }
#cleanupOverlay { position: absolute; inset: 0; width: 100%; height: 100%; background: transparent; cursor: crosshair; }
.cleanup-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,253,248,.96); }
.cleanup-toolbar .button { min-height: 42px; padding: 0 12px; font-size: 10px; font-weight: 800; }
.cleanup-toolbar .button.active { color: #fff; border-color: var(--coral-deep); background: var(--coral-deep); }
.brush-control { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); background: #fff; font-size: 9px; }
.brush-control input { width: 90px; accent-color: var(--coral); }
.crop-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; padding: 10px 12px; border-radius: 13px; color: var(--muted); background: rgba(255,255,255,.68); font-size: 9px; }
.crop-actions .button { min-height: 34px; padding: 0 11px; font-size: 9px; }
.detail-hero { max-height: 440px; overflow: hidden; border-radius: 22px; background: #eae5db; }
.detail-hero img { display: block; width: 100%; max-height: 440px; object-fit: contain; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 7px; margin: 17px 0 13px; }
.detail-meta span { padding: 6px 8px; border-radius: 8px; color: var(--muted); background: rgba(45,41,38,.045); font-size: 8px; }
.detail-title { margin: 0 0 8px; font-size: 21px; }
.detail-note { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.75; }
.detail-section { margin-top: 21px; padding-top: 18px; border-top: 1px solid var(--line); }
.detail-section h3 { margin-bottom: 12px; font-size: 12px; }
.detail-timeline { display: flex; flex-direction: column; }
.timeline-item { position: relative; display: grid; grid-template-columns: 16px 1fr auto; gap: 9px; padding-bottom: 14px; }
.timeline-dot { width: 9px; height: 9px; margin-top: 3px; border-radius: 50%; background: var(--orange); }
.timeline-dot.plus { background: var(--mint-deep); }
.timeline-copy b { display: block; font-size: 10px; }
.timeline-copy span { color: var(--muted); font-size: 8px; }
.timeline-delta { color: var(--red); font-size: 9px; font-weight: 800; }
.timeline-delta.plus { color: var(--mint-deep); }
.detail-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.detail-actions .button { min-height: 48px; }
.detail-actions .wide { grid-column: 1/-1; }
.detail-status-callout { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; color: var(--mint-deep); background: var(--mint-soft); font-size: 9px; line-height: 1.6; }
.print-paper-list { display: flex; flex-direction: column; gap: 7px; }
.print-paper-row { display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 10px; padding: 10px 11px; border-radius: 13px; background: rgba(45,41,38,.035); }
.print-paper-row > span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; color: #fff; background: var(--ink); font-size: 8px; font-weight: 800; }
.print-paper-row b { display: block; font-size: 10px; }
.print-paper-row small { color: var(--muted); font-size: 8px; }
.rules-list { display: flex; flex-direction: column; gap: 10px; }
.rule-explain { padding: 15px 16px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.55); }
.rule-explain-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rule-explain b { font-size: 11px; }
.rule-explain strong { color: var(--red); font-size: 12px; }
.rule-explain strong.plus { color: var(--mint-deep); }
.rule-explain p { margin: 7px 0 0; color: var(--muted); font-size: 8px; line-height: 1.75; }
.sync-status-row { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.sync-status { padding:5px 8px; border-radius:99px; color:var(--muted); background:rgba(45,41,38,.05); font-size:8px; font-weight:800; }
.sync-status.synced { color:var(--mint-deep); background:var(--mint-soft); }
.sync-status.syncing { color:#5d7fc5; background:var(--blue-soft); }
.sync-status.conflict,.sync-status.error { color:var(--red); background:var(--red-soft); }
.sync-code-box { display:grid; grid-template-columns:1fr auto; gap:5px 10px; align-items:center; margin:12px 0; padding:11px 12px; border-radius:13px; background:#fff; border:1px solid var(--line); }
.sync-code-box span { color:var(--muted); font-size:8px; }
.sync-code-box strong { grid-column:1; font-size:15px; letter-spacing:.08em; }
.sync-code-box button { grid-column:2; grid-row:1 / span 2; }
.sync-last,.sync-message { margin:7px 0 0; color:var(--muted); font-size:8px; line-height:1.6; }
.sync-message { color:#5d7fc5; }
.sync-action-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-top:10px; }
.sync-action-grid .button { min-height:40px; }
.rule-philosophy { margin-top: 18px; padding: 16px; border-radius: 16px; color: #786c58; background: #fff4dd; font-size: 9px; line-height: 1.8; }
.toast-host { position: fixed; z-index: 300; left: 50%; bottom: 28px; display: flex; flex-direction: column; align-items: center; width: min(360px,calc(100% - 32px)); pointer-events: none; transform: translateX(-50%); }
.toast { padding: 11px 15px; border-radius: 12px; color: #fff; background: rgba(45,41,38,.92); box-shadow: var(--shadow-md); font-size: 10px; font-weight: 700; animation: toastIn .2s ease both; }
.toast.positive { background: rgba(39,166,123,.94); }
.toast.negative { background: rgba(202,77,65,.94); }
.toast.info { background: rgba(72,104,190,.94); }
.toast.leaving { animation: toastOut .18s ease forwards; }
.confetti-root { position: fixed; z-index: 250; inset: 0; overflow: hidden; pointer-events: none; }
.confetti-piece { position: absolute; top: -20px; width: 8px; height: 13px; border-radius: 2px; animation: confettiFall var(--duration) linear forwards; }
.floating-hearts { position: fixed; z-index: 200; pointer-events: none; color: var(--coral); font-size: 20px; animation: heartFloat 1.2s ease-out forwards; }
html.modal-open,html.modal-open body { overflow: hidden; }
html.modal-open .main-shell { overflow: hidden; }
@keyframes pulse { 0%{box-shadow:0 0 0 0 rgba(255,118,95,.4)} 60%{box-shadow:0 0 0 8px rgba(255,118,95,0)} 100%{box-shadow:0 0 0 0 rgba(255,118,95,0)} }
@keyframes petFloat { 0%,100%{transform:translateY(0) rotate(-1deg)} 50%{transform:translateY(-11px) rotate(1deg)} }
@keyframes petSad { 50%{transform:translateY(-4px)} }
@keyframes petCelebrate { 50%{transform:translateY(-17px) rotate(2deg) scale(1.025)} }
@keyframes blink { 0%,44%,50%,100%{transform:scaleY(1)} 47%,48%{transform:scaleY(.1)} }
@keyframes earTwitch { 94%{transform:rotate(-4deg)} 97%{transform:rotate(2deg)} }
@keyframes crownGlow { 50%{filter:drop-shadow(0 0 7px rgba(255,200,70,.55))} }
@keyframes sparkle { 50%{opacity:1;transform:scale(1.15) rotate(18deg)} }
@keyframes fadeIn { from{opacity:0} to{opacity:1} }
@keyframes sheetIn { from{opacity:0;transform:translateY(22px) scale(.985)} to{opacity:1;transform:none} }
@keyframes toastIn { from{opacity:0;transform:translateY(12px)} to{opacity:1;transform:none} }
@keyframes toastOut { to{opacity:0;transform:translateY(8px)} }
@keyframes heartFloat { 0%{opacity:0;transform:translate(-50%,0) scale(.6)} 15%{opacity:1} 100%{opacity:0;transform:translate(-50%,-85px) scale(1.2)} }
@keyframes confettiFall { to{transform:translate3d(var(--drift),105vh,0) rotate(var(--spin))} }
@keyframes mobileSheetIn { from{transform:translateY(100%)} to{transform:none} }

@media (max-width: 1100px) {
  body { background: var(--bg); }
  .app-shell { display: block; height: auto; min-height: 100dvh; overflow: visible; }
  .sidebar { display: none; }
  .main-shell { height: auto; min-height: 100dvh; overflow: visible; }
  .topbar { height: 66px; justify-content: space-between; padding: max(7px,env(safe-area-inset-top)) 17px 0; background: rgba(245,241,232,.92); }
  .mobile-brand { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 800; }
  .mobile-brand .brand-mark { width: 29px; height: 29px; flex-basis: 29px; }
  .topbar-actions { gap: 6px; }
  .score-pill { height: 34px; padding: 0 11px; }
  .score-pill span:not(.score-spark) { font-size: 14px; }
  .score-pill small { display: none; }
  .icon-btn { width: 34px; height: 34px; }
  .avatar-btn { width: 34px; height: 34px; }
  .page-content { padding: 12px 15px calc(105px + env(safe-area-inset-bottom)); }
  .page-head { margin: 4px 0 16px; }
  .page-head h1 { font-size: 29px; }
  .date-chip { display: none; }
  .home-hero { grid-template-columns: 1fr; min-height: auto; border-radius: 30px; }
  .hero-copy { padding: 27px 23px 8px; }
  .hero-copy h2 { max-width: 360px; font-size: 40px; }
  .hero-copy > p { max-width: 360px; font-size: 11px; }
  .hero-actions { width: 100%; }
  .hero-actions .button { flex: 1; }
  .hero-stats { gap: 24px; margin-top: 22px; }
  .hero-pet { min-height: 260px; padding: 0 20px 4px; }
  .pet-scene { width: min(100%,330px); }
  .dashboard-grid { grid-template-columns: 1fr; gap: 15px; margin-top: 15px; }
  .stack { gap: 15px; }
  .card-pad { padding: 20px; }
  .library-summary { grid-template-columns: repeat(3,1fr); gap: 8px; }
  .library-intro { grid-column: 1/-1; min-height: auto; }
  .library-stat { min-height: 92px; padding: 15px; }
  .library-stat b { font-size: 24px; }
  .library-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .mistake-image { height: 145px; }
  .quiz-page-grid { grid-template-columns: 1fr; gap: 15px; }
  .quiz-hero { min-height: auto; padding: 28px 24px; border-radius: 30px; }
  .quiz-hero h1 { font-size: 38px; }
  .pet-page-hero { grid-template-columns: 1fr; min-height: auto; border-radius: 30px; }
  .pet-page-copy { padding: 27px 24px 5px; }
  .pet-page-copy h1 { font-size: 39px; }
  .pet-stage-large { padding: 0 16px 6px; }
  .pet-lower-grid { grid-template-columns: 1fr; gap: 15px; margin-top: 15px; }
  .unlock-grid { grid-template-columns: repeat(2,1fr); }
  .bottom-nav { position: fixed; z-index: 70; left: 50%; bottom: calc(10px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(5,1fr); align-items: end; width: min(390px,calc(100% - 24px)); height: 68px; padding: 8px 7px 7px; border: 1px solid rgba(255,255,255,.62); border-radius: 23px; background: rgba(255,253,248,.9); box-shadow: 0 18px 50px rgba(54,41,32,.16); backdrop-filter: blur(18px); transform: translateX(-50%); }
  .mobile-nav-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; height: 52px; padding: 0; border: 0; border-radius: 15px; color: #8d857f; background: transparent; font-size: 8px; font-weight: 700; }
  .mobile-nav-item svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; }
  .mobile-nav-item.active { color: var(--coral-deep); background: var(--coral-soft); }
  .mobile-nav-capture { align-self: start; display: grid; place-items: center; width: 52px; height: 52px; margin: -24px auto 0; border: 5px solid var(--bg); border-radius: 19px; color: #fff; background: linear-gradient(135deg,#ff886f,var(--coral-deep)); box-shadow: 0 11px 24px rgba(232,88,69,.26); }
  .mobile-nav-capture svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; }
  .mobile-nav-capture span { display: none; }
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal-sheet { width: 100%; max-height: 94dvh; border-radius: 27px 27px 0 0; animation-name: mobileSheetIn; }
  .modal-handle { display: block; width: 38px; height: 4px; margin: 10px auto 0; border-radius: 99px; background: rgba(45,41,38,.14); }
  .modal-head { padding: 18px 20px 14px; }
  .modal-body { padding: 0 20px 23px; }
  .modal-footer { padding: 12px 20px calc(16px + env(safe-area-inset-bottom)); }
  .toast-host { bottom: calc(94px + env(safe-area-inset-bottom)); }
  html.modal-open .toast-host { top: max(16px,env(safe-area-inset-top)); bottom: auto; }
  .form-grid { grid-template-columns: 1fr; }
}
@media (min-width: 700px) and (max-width: 1100px) {
  .page-content { padding-left: 24px; padding-right: 24px; padding-bottom: 112px; }
  .home-hero { grid-template-columns: minmax(0,1.12fr) minmax(270px,.88fr); min-height: 370px; }
  .hero-copy { padding: 32px; }
  .hero-pet { min-height: 340px; padding: 18px 20px 8px 0; }
  .dashboard-grid { grid-template-columns: minmax(0,1.25fr) minmax(280px,.75fr); }
  .library-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .quiz-page-grid { grid-template-columns: minmax(0,1.18fr) minmax(280px,.82fr); }
  .pet-page-hero { grid-template-columns: minmax(0,1.05fr) minmax(310px,.95fr); }
  .pet-lower-grid { grid-template-columns: minmax(0,1.2fr) minmax(280px,.8fr); }
  .unlock-grid { grid-template-columns: repeat(4,1fr); }
  .modal-backdrop { align-items: center; padding: 24px; }
  .modal-sheet { max-height: 90dvh; border-radius: 30px; animation-name: sheetIn; }
  .modal-handle { display: none; }
  .bottom-nav { width: min(460px,calc(100% - 32px)); height: 72px; }
}
@media (max-width: 560px) {
  .hero-copy h2 { font-size: 35px; }
  .hero-actions .button { padding: 0 12px; font-size: 10px; }
  .library-grid { grid-template-columns: 1fr; }
  .mistake-image { height: 176px; }
  .quiz-answer-actions,.detail-actions { grid-template-columns: 1fr; }
  .detail-actions .wide { grid-column: auto; }
  .capture-tool-row,.crop-actions .button { grid-template-columns: 1fr; }
  .cleanup-toolbar { gap: 6px; }
  .cleanup-toolbar .button { flex: 1 1 auto; }
  .brush-control { width: 100%; justify-content: space-between; }
  .brush-control input { width: 150px; }
  .filter-group { width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 3px; }
  .filter-chip { flex: 0 0 auto; }
  .cleanup-canvas-wrap { max-height: 42vh; }
  #cleanupCanvas,#cleanupOverlay { max-height: 38vh; }
}
@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
