:root {
  --bg: #f6f4ef;
  --paper: #fffdfa;
  --paper-2: #f0ece5;
  --line: #e6e0d7;
  --ink: #413a36;
  --muted: #8b8179;
  --faint: #b9aea5;
  --rose: #b96f79;
  --rose-soft: #f5e4e5;
  --blue: #6f94ac;
  --blue-soft: #e5eef3;
  --sage: #719279;
  --sage-soft: #e5eee6;
  --amber: #bf8e50;
  --amber-soft: #f7ecda;
  --purple: #9581a5;
  --shadow: 0 18px 55px rgba(70, 58, 48, .09);
  --shadow-sm: 0 6px 20px rgba(70, 58, 48, .05);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; color: var(--ink); background: var(--bg); font-family: ui-rounded, "SF Pro Rounded", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
.hidden { display: none !important; }
.kicker { display: block; color: var(--faint); font-size: 9px; font-weight: 800; letter-spacing: .17em; text-transform: uppercase; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.danger-text { color: #c56d71 !important; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 10; display: flex; width: 250px; flex-direction: column; padding: 29px 17px 18px; border-right: 1px solid var(--line); background: rgba(255,253,250,.86); backdrop-filter: blur(20px); }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 11px 38px; }
.brand-mark { display: grid; place-items: center; width: 43px; height: 43px; border-radius: 15px; color: #fffaf6; background: linear-gradient(145deg, #d7989f, #af6872); box-shadow: 0 11px 25px rgba(175,104,114,.24); font-size: 20px; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; letter-spacing: .02em; }
.brand small { margin-top: 4px; color: var(--faint); font-size: 10px; }
.side-nav { display: flex; min-height: 0; flex: 1; flex-direction: column; gap: 5px; }
.nav-button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 13px; border: 1px solid transparent; border-radius: 13px; color: var(--muted); background: transparent; text-align: left; transition: .18s ease; }
.nav-button i { display: grid; place-items: center; width: 23px; height: 23px; color: var(--faint); font-size: 16px; font-style: normal; }
.nav-button span { font-size: 12px; font-weight: 650; }
.nav-button:hover { color: var(--rose); background: var(--rose-soft); }
.nav-button.active { border-color: #edd3d5; color: var(--rose); background: var(--rose-soft); box-shadow: var(--shadow-sm); }
.nav-button.active i { color: var(--rose); }
.sidebar-note { padding: 16px 10px 0; border-top: 1px solid var(--line); }
.sidebar-note > span { display: block; margin-bottom: 13px; color: var(--faint); font-size: 9px; }
.profile-line { display: flex; align-items: center; gap: 8px; }
.profile-line i { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 10px; color: var(--rose); background: var(--rose-soft); font-size: 11px; font-style: normal; font-weight: 800; }
.profile-line strong { flex: 1; color: var(--muted); font-size: 11px; font-weight: 600; }
.profile-line button { border: 0; color: var(--faint); background: transparent; font-size: 16px; }
.profile-line button:hover { color: var(--rose); }
.main-shell { min-height: 100vh; margin-left: 250px; }
.topbar { position: sticky; top: 0; z-index: 8; display: flex; align-items: center; min-height: 71px; gap: 16px; padding: 0 42px; border-bottom: 1px solid rgba(230,224,215,.83); background: rgba(246,244,239,.84); backdrop-filter: blur(20px); }
.breadcrumb { display: flex; align-items: center; gap: 9px; min-width: 0; color: var(--faint); font-size: 11px; }
.breadcrumb b { color: #d4c9be; font-weight: 400; }
.breadcrumb strong { overflow: hidden; color: var(--ink); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { display: flex; align-items: center; gap: 11px; margin-left: auto; }
.sync-indicator { color: var(--sage); font-size: 10px; }
.sync-indicator.saving { color: var(--amber); }
.topbar-icon, .mobile-brand { border: 0; color: var(--muted); background: transparent; }
.topbar-icon { width: 30px; height: 30px; border-radius: 9px; }
.topbar-icon:hover { color: var(--rose); background: var(--rose-soft); }
.logout-button { padding: 6px 0; border: 0; color: var(--faint); background: transparent; font-size: 10px; }
.logout-button:hover { color: var(--rose); }
.mobile-brand { display: none; align-items: center; gap: 7px; font-weight: 800; }
.mobile-brand i { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; color: #fff; background: var(--rose); font-style: normal; }
.content { max-width: 1360px; margin: 0 auto; padding: 37px 42px 74px; }

.welcome, .page-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 25px; padding: 31px 32px; border: 1px solid var(--line); border-radius: 25px; background: linear-gradient(135deg, #fffdfa 9%, #f7e9e8 100%); box-shadow: var(--shadow); }
.page-hero.movie { background: linear-gradient(135deg, #fffdfa 9%, #e8f1f5 100%); }
.page-hero.item { background: linear-gradient(135deg, #fffdfa 9%, #f7eddd 100%); }
.page-hero.stats { background: linear-gradient(135deg, #fffdfa 9%, #f0eaf4 100%); }
.page-hero.settings { background: linear-gradient(135deg, #fffdfa 9%, #eaf1ea 100%); }
.welcome h1, .page-hero h1 { margin: 9px 0 7px; color: var(--ink); font-size: clamp(27px, 3vw, 39px); letter-spacing: -.055em; }
.welcome p, .page-hero p { max-width: 670px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.8; }
.welcome-mark { display: grid; place-items: center; width: 75px; height: 75px; flex: 0 0 75px; border: 1px solid rgba(255,255,255,.75); border-radius: 25px; color: var(--rose); background: rgba(255,255,255,.52); transform: rotate(7deg); }
.welcome-mark strong { font-size: 27px; font-weight: 400; }
.welcome-mark small { margin-top: 2px; color: var(--muted); font-size: 8px; letter-spacing: .14em; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 0 15px; border: 1px solid transparent; border-radius: 11px; font-size: 11px; font-weight: 750; transition: .18s ease; white-space: nowrap; }
.button.primary { color: white; background: var(--rose); box-shadow: 0 9px 20px rgba(185,111,121,.2); }
.button.primary:hover { background: #a96069; transform: translateY(-1px); }
.button.secondary { color: var(--rose); border-color: #ecd3d5; background: var(--paper); }
.button.secondary:hover { background: var(--rose-soft); }
.button.danger { color: white; background: #d07879; }
.button.ghost { color: var(--muted); border-color: var(--line); background: transparent; }
.button.ghost:hover { color: var(--rose); background: var(--paper); }
.text-button { padding: 2px 0; border: 0; color: var(--rose); background: transparent; font-size: 10px; }
.text-button:hover { text-decoration: underline; }
.quick-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 11px; margin: 17px 0 27px; }
.quick-card { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 15px 16px; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); background: var(--paper); text-align: left; transition: .18s ease; }
.quick-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.quick-card > i { display: grid; place-items: center; width: 39px; height: 39px; flex: 0 0 39px; border-radius: 12px; font-size: 17px; font-style: normal; }
.quick-card > span { min-width: 0; flex: 1; }
.quick-card strong, .quick-card small { display: block; }
.quick-card strong { font-size: 12px; }
.quick-card small { margin-top: 4px; color: var(--faint); font-size: 9px; }
.quick-card > b { color: var(--faint); font-size: 18px; font-weight: 400; }
.quick-card.reading > i { color: var(--rose); background: var(--rose-soft); }
.quick-card.movie > i { color: var(--blue); background: var(--blue-soft); }
.quick-card.item > i { color: var(--amber); background: var(--amber-soft); }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 11px; margin: 17px 0; }
.metrics.four { grid-template-columns: repeat(4, minmax(0,1fr)); }
.metric { min-width: 0; padding: 17px 18px 15px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); box-shadow: var(--shadow-sm); }
.metric > span, .metric > small { display: block; color: var(--muted); font-size: 10px; }
.metric strong { display: block; margin: 8px 0 5px; color: var(--ink); font-size: 22px; letter-spacing: -.045em; }
.metric > small { color: var(--faint); font-size: 9px; }
.metric.rose { border-top: 3px solid var(--rose); }
.metric.blue { border-top: 3px solid var(--blue); }
.metric.sage { border-top: 3px solid var(--sage); }
.metric.amber { border-top: 3px solid var(--amber); }
.metric.purple { border-top: 3px solid var(--purple); }
.home-panels { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px; }
.panel { min-width: 0; padding: 21px; border: 1px solid var(--line); border-radius: 19px; background: var(--paper); box-shadow: var(--shadow-sm); }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 13px; }
.section-heading h2 { margin: 4px 0 0; color: var(--ink); font-size: 17px; letter-spacing: -.035em; }
.section-heading > span { color: var(--faint); font-size: 9px; }
.mini-list { display: grid; gap: 5px; margin-top: 16px; }
.mini-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border: 1px solid transparent; border-radius: 11px; color: var(--ink); background: transparent; text-align: left; }
.mini-row:hover { border-color: var(--line); background: var(--paper-2); }
.mini-row > span { min-width: 0; flex: 1; }
.mini-row strong, .mini-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-row strong { font-size: 11px; }
.mini-row small { margin-top: 4px; color: var(--faint); font-size: 9px; }
.mini-row em { color: var(--muted); font-size: 9px; font-style: normal; }
.mini-cover { width: 33px; height: 43px; flex: 0 0 33px; border-radius: 7px !important; }
.active-timer { display: flex; align-items: center; gap: 15px; margin: 17px 0 0; padding: 13px 17px; border: 1px solid #ecd1d3; border-radius: 14px; color: var(--rose); background: var(--rose-soft); }
.active-timer > div { display: grid; gap: 2px; }
.active-timer strong { font-size: 12px; }
.active-timer-time { margin-left: auto; color: var(--ink); font-size: 22px; font-variant-numeric: tabular-nums; font-weight: 750; }
.timer-ribbon { position: sticky; top: 71px; z-index: 7; display: flex; align-items: center; gap: 15px; padding: 8px 42px; border-bottom: 1px solid #ecd1d3; color: var(--rose); background: var(--rose-soft); }
.timer-ribbon > span:first-child { margin-right: auto; font-size: 10px; }
.timer-ribbon strong { color: var(--ink); font-size: 14px; font-variant-numeric: tabular-nums; }
.timer-ribbon button { padding: 4px 0; border: 0; color: var(--rose); background: transparent; font-size: 10px; }
.timer-ribbon button.stop { padding: 6px 10px; border-radius: 8px; color: white; background: var(--rose); }

.library-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 13px; margin: 23px 2px 13px; }
.library-toolbar > div { display: flex; align-items: center; gap: 12px; }
.library-toolbar strong { color: var(--ink); font-size: 14px; }
.toolbar-filters { display: flex; gap: 7px; }
.toolbar-filters input, .toolbar-filters select, .stats-controls input { min-height: 33px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; outline: 0; color: var(--ink); background: var(--paper); font-size: 10px; }
.toolbar-filters input { width: 170px; }
.toolbar-filters input:focus, .toolbar-filters select:focus, .stats-controls input:focus { border-color: var(--rose); box-shadow: 0 0 0 3px rgba(185,111,121,.1); }
.library-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 13px; }
.library-card { position: relative; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: var(--paper); box-shadow: var(--shadow-sm); cursor: pointer; transition: .18s ease; }
.library-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.cover { display: grid; place-items: center; overflow: hidden; color: var(--ink); background: linear-gradient(145deg,#f3dfe0,#e8c1c5); }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover.empty { align-content: center; gap: 5px; }
.cover.empty b { font-size: 19px; font-weight: 400; }
.cover.empty small { color: rgba(128,71,78,.5); font-size: 8px; letter-spacing: .19em; }
.cover.movie { background: linear-gradient(145deg,#deebf0,#c7dfe9); }
.cover.item { background: linear-gradient(145deg,#f3e5cf,#e7cfaa); }
.library-card > .cover { width: 100%; height: 191px; border-radius: 0; }
.library-card.item > .cover { height: 153px; }
.library-body { min-width: 0; padding: 14px 15px 15px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { display: inline-flex; align-items: center; min-height: 19px; padding: 0 7px; border-radius: 6px; color: var(--muted); background: var(--paper-2); font-size: 8px; }
.chip.accent { color: var(--rose); background: var(--rose-soft); }
.library-card h3 { margin: 11px 0 3px; overflow: hidden; color: var(--ink); font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.card-subtitle { margin: 0; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.card-description { height: 37px; margin-top: 13px; overflow: hidden; color: var(--muted); font-size: 10px; line-height: 1.75; }
.card-progress { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.card-progress > i { height: 4px; flex: 1; overflow: hidden; border-radius: 5px; background: #eee8df; }
.card-progress > i b { display: block; height: 100%; border-radius: inherit; background: var(--rose); }
.card-progress > strong { color: var(--muted); font-size: 9px; font-weight: 500; }
.card-footer { display: flex; align-items: center; justify-content: space-between; gap: 7px; margin-top: 16px; color: var(--faint); font-size: 9px; }
.score { color: var(--amber); font-size: 10px; font-weight: 750; white-space: nowrap; }
.item-price { display: flex; align-items: baseline; gap: 8px; margin-top: 15px; }
.item-price strong { color: var(--ink); font-size: 20px; letter-spacing: -.04em; }
.item-price small { color: var(--amber); font-size: 9px; }
.card-actions { position: absolute; top: 10px; right: 10px; display: flex; gap: 4px; opacity: 0; transition: .18s ease; }
.library-card:hover .card-actions { opacity: 1; }
.card-actions button { padding: 5px 7px; border: 1px solid rgba(255,255,255,.8); border-radius: 7px; color: var(--ink); background: rgba(255,255,255,.9); font-size: 9px; }
.card-actions button:hover { color: var(--rose); }
.empty { display: grid; place-items: center; min-height: 260px; padding: 30px; border: 1px dashed #ddd5cb; border-radius: 18px; text-align: center; }
.empty-mark { display: grid; place-items: center; width: 47px; height: 47px; margin-bottom: 10px; border-radius: 16px; color: var(--rose); background: var(--rose-soft); font-size: 21px; }
.empty h3 { margin: 0; font-size: 15px; }
.empty p { max-width: 370px; margin: 7px 0 16px; color: var(--muted); font-size: 10px; line-height: 1.7; }

.detail-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 13px; margin-bottom: 19px; }
.back-button { padding: 5px 0; border: 0; color: var(--muted); background: transparent; font-size: 11px; }
.back-button:hover { color: var(--rose); }
.detail-actions { display: flex; align-items: center; gap: 13px; }
.detail-hero { display: flex; align-items: center; gap: 25px; padding: 25px; border: 1px solid var(--line); border-radius: 23px; background: linear-gradient(135deg,#fffdfa,#f7e9e8); box-shadow: var(--shadow); }
.detail-hero.movie { background: linear-gradient(135deg,#fffdfa,#e8f1f5); }
.detail-hero.item { background: linear-gradient(135deg,#fffdfa,#f7eddd); }
.detail-hero > .cover { width: 142px; height: 194px; flex: 0 0 142px; border-radius: 11px; box-shadow: 0 12px 27px rgba(92,74,62,.12); }
.detail-title { min-width: 0; flex: 1; }
.detail-title h1 { margin: 12px 0 7px; color: var(--ink); font-size: clamp(27px,4vw,44px); letter-spacing: -.06em; }
.detail-subtitle { margin: 0; color: var(--muted); font-size: 12px; }
.score-line { display: flex; align-items: center; gap: 14px; margin-top: 15px; }
.score-line > span:last-child { color: var(--faint); font-size: 10px; }
.progress { max-width: 590px; margin-top: 27px; }
.progress-head { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 10px; }
.progress-head strong { color: var(--ink); font-size: 10px; }
.progress-track { height: 7px; margin-top: 8px; overflow: hidden; border-radius: 8px; background: #eee5e1; }
.progress-track b { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--rose),#e5a9ae); }
.detail-copy { max-width: 650px; margin: 23px 0 0; color: var(--muted); font-size: 11px; line-height: 1.85; white-space: pre-wrap; }
.cost-highlight { display: flex; align-items: baseline; gap: 10px; margin-top: 23px; }
.cost-highlight strong { color: var(--amber); font-size: 32px; letter-spacing: -.05em; }
.cost-highlight span { color: var(--muted); font-size: 10px; }
.detail-layout { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(260px,.72fr); gap: 17px; margin-top: 17px; }
.detail-main, .detail-side { min-width: 0; }
.detail-side { display: grid; align-content: start; gap: 13px; }
.side-card, .info-panel { padding: 19px; border: 1px solid var(--line); border-radius: 17px; background: var(--paper); box-shadow: var(--shadow-sm); }
.side-card h3, .info-panel h2 { margin: 7px 0 9px; font-size: 15px; }
.side-card p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.85; white-space: pre-wrap; }
.side-card img { display: block; width: 100%; max-height: 310px; border-radius: 10px; object-fit: cover; }
.timer-box { display: flex; align-items: center; justify-content: space-between; gap: 17px; margin: 15px 0; padding: 15px; border: 1px solid var(--line); border-radius: 17px; background: var(--paper); }
.timer-face { display: grid; gap: 4px; }
.timer-face span { color: var(--faint); font-size: 9px; }
.timer-face strong { color: var(--ink); font-size: 21px; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.timer-face.running strong { color: var(--rose); }
.timer-actions { display: flex; gap: 7px; }
.session-list, .note-list, .companion-list, .moment-grid { display: grid; gap: 8px; }
.session-card { display: grid; grid-template-columns: 31px minmax(0,1fr); gap: 11px; align-items: start; padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); }
.session-number { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 9px; color: var(--rose); background: var(--rose-soft); font-size: 11px; font-weight: 750; }
.session-card.movie .session-number { color: var(--blue); background: var(--blue-soft); }
.session-card strong { display: block; color: var(--ink); font-size: 11px; }
.session-card p, .session-card small { display: block; margin: 4px 0 0; color: var(--muted); font-size: 9px; line-height: 1.6; }
.session-card small { color: var(--faint); white-space: pre-wrap; }
.note-heading { margin-top: 28px; }
.note-card { display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: var(--paper); }
.note-quote, .note-thought { min-width: 0; padding: 15px 17px 18px; }
.note-quote { background: #fffaf7; }
.note-thought { border-left: 1px solid var(--line); background: #fdfdfa; }
.note-card label { display: block; margin-bottom: 8px; color: var(--faint); font-size: 9px; font-weight: 750; letter-spacing: .08em; }
.note-card blockquote, .note-card p { margin: 0; color: var(--ink); font-size: 11px; line-height: 1.85; white-space: pre-wrap; }
.note-card blockquote { padding-left: 10px; border-left: 2px solid #e4b5ba; }
.note-actions { display: flex; grid-column: 1/-1; gap: 10px; padding: 7px 17px; border-top: 1px solid var(--line); background: var(--paper-2); }
.detail-list { display: grid; gap: 10px; margin: 15px 0 0; }
.detail-list > div { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }
.detail-list dt { color: var(--faint); font-size: 9px; }
.detail-list dd { margin: 0; color: var(--ink); font-size: 10px; text-align: right; }
.companions { margin-top: 28px; }
.companion-card { display: grid; grid-template-columns: 35px minmax(0,1fr) auto; align-items: start; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); }
.avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; color: var(--blue); background: var(--blue-soft); font-size: 12px; font-weight: 750; }
.companion-card strong { font-size: 11px; }
.companion-card p { margin: 5px 0 0; color: var(--muted); font-size: 9px; line-height: 1.6; white-space: pre-wrap; }
.companion-score { display: grid; justify-items: end; gap: 8px; }
.moment-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
.moment-card { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); }
.moment-card img { display: block; width: 100%; height: 145px; object-fit: cover; }
.moment-card p { min-height: 48px; margin: 0; padding: 10px; color: var(--ink); font-size: 10px; line-height: 1.7; white-space: pre-wrap; }
.moment-card > .text-button { margin: 0 10px 10px; }
.info-panel { margin-top: 15px; }
.info-panel h2 { margin-top: 4px; font-size: 17px; }
.detail-list.wide { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0; margin-top: 19px; }
.detail-list.wide > div { padding: 12px 0; border-top: 1px solid var(--line); }

.stats-tabs { display: grid; grid-template-columns: repeat(3,1fr); gap: 5px; margin: 17px 0 14px; padding: 5px; border: 1px solid var(--line); border-radius: 13px; background: var(--paper-2); }
.stats-tabs button { padding: 11px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; font-size: 11px; }
.stats-tabs button.active { color: var(--rose); background: var(--rose-soft); font-weight: 750; }
.stats-panel { margin-top: 14px; padding: 21px; border: 1px solid var(--line); border-radius: 19px; background: var(--paper); box-shadow: var(--shadow-sm); }
.stats-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.stats-toolbar h2 { margin: 4px 0 0; font-size: 17px; }
.stats-controls { display: flex; align-items: center; gap: 8px; }
.segmented { display: inline-flex; gap: 3px; padding: 3px; border-radius: 10px; background: var(--paper-2); }
.segmented button { min-width: 31px; padding: 7px 9px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; font-size: 9px; }
.segmented button.active { color: var(--rose); background: var(--paper); box-shadow: 0 3px 9px rgba(92,74,62,.06); font-weight: 750; }
.bars-wrap { margin-top: 25px; overflow-x: auto; padding: 15px 0 0; border-bottom: 1px solid var(--line); }
.bars { display: flex; align-items: flex-end; justify-content: space-around; gap: 9px; min-width: 430px; height: 190px; padding: 0 10px; }
.bars.month { min-width: 900px; gap: 4px; }
.bar-column { display: flex; min-width: 27px; height: 100%; flex: 1; flex-direction: column; align-items: center; justify-content: flex-end; gap: 5px; }
.bar-column i { display: block; width: min(25px,70%); min-height: 2px; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg,var(--rose),#e4a8ad); }
.bar-column b { min-height: 11px; color: var(--muted); font-size: 8px; font-weight: 500; }
.bar-column small { color: var(--faint); font-size: 8px; white-space: nowrap; }
.chart-caption { margin: 11px 0 0; color: var(--faint); font-size: 9px; }
.category-list { display: grid; gap: 13px; margin-top: 20px; }
.category-row { display: grid; grid-template-columns: 9px minmax(75px,.45fr) minmax(115px,1fr) minmax(80px,1.6fr) auto; align-items: center; gap: 9px; min-width: 0; }
.category-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--rose); }
.category-dot.blue { background: var(--blue); }
.category-dot.amber { background: var(--amber); }
.category-row strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.category-row small { color: var(--faint); font-size: 8px; }
.category-track { height: 5px; overflow: hidden; border-radius: 7px; background: var(--paper-2); }
.category-track i { display: block; height: 100%; border-radius: inherit; background: var(--rose); }
.category-row b { color: var(--muted); font-size: 9px; font-weight: 600; text-align: right; white-space: nowrap; }

.settings-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; margin-top: 17px; }
.settings-card { min-width: 0; padding: 21px; border: 1px solid var(--line); border-radius: 19px; background: var(--paper); box-shadow: var(--shadow-sm); }
.settings-card.account { background: linear-gradient(145deg,var(--paper),var(--sage-soft)); }
.category-editor { display: flex; gap: 7px; margin-top: 18px; }
.category-editor input { min-height: 33px; flex: 1; padding: 0 9px; border: 1px solid var(--line); border-radius: 9px; outline: 0; color: var(--ink); background: var(--paper); font-size: 10px; }
.category-editor input:focus { border-color: var(--rose); box-shadow: 0 0 0 3px rgba(185,111,121,.1); }
.category-editor .button { min-height: 33px; padding: 0 11px; }
.setting-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.setting-tags span { display: inline-flex; align-items: center; gap: 4px; padding: 6px 8px; border-radius: 7px; color: var(--muted); background: var(--paper-2); font-size: 9px; }
.setting-tags button { padding: 0; border: 0; color: var(--faint); background: transparent; font-size: 13px; line-height: 1; }
.setting-tags button:hover { color: var(--rose); }
.account-info { margin: 20px 0; color: var(--ink); font-size: 14px; line-height: 1.8; }
.account-info small { color: var(--muted); font-size: 10px; }

.modal-root:empty { display: none; }
.modal-backdrop { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 22px; background: rgba(67,53,47,.27); backdrop-filter: blur(4px); }
.modal { width: min(520px,100%); max-height: min(91vh,820px); overflow: auto; border: 1px solid rgba(255,255,255,.82); border-radius: 22px; background: var(--paper); box-shadow: 0 25px 80px rgba(67,53,47,.22); }
.modal.wide { width: min(770px,100%); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 21px 23px 15px; }
.modal-head h2 { margin: 4px 0 0; font-size: 20px; letter-spacing: -.04em; }
.close-button { display: grid; place-items: center; width: 31px; height: 31px; border: 0; border-radius: 9px; color: var(--muted); background: var(--paper-2); font-size: 19px; }
.close-button:hover { color: var(--rose); }
.modal-body { padding: 0 23px 23px; }
.form { display: grid; gap: 15px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; align-items: start; }
.form-grid .span-2 { grid-column: 1/-1; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .field > span { color: var(--muted); font-size: 10px; font-weight: 650; }
.field input, .field select, .field textarea { width: 100%; padding: 10px 11px; border: 1px solid var(--line); border-radius: 9px; outline: 0; color: var(--ink); background: var(--paper); font-size: 11px; }
.field textarea { min-height: 82px; resize: vertical; line-height: 1.7; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--rose); box-shadow: 0 0 0 3px rgba(185,111,121,.1); }
.form-intro, .session-banner { display: grid; gap: 4px; padding: 13px; border-radius: 12px; color: var(--muted); background: var(--rose-soft); font-size: 9px; line-height: 1.6; }
.form-intro strong { color: var(--ink); font-size: 11px; }
.form-intro.movie { background: var(--blue-soft); }
.form-intro.item { background: var(--amber-soft); }
.session-banner strong { color: var(--ink); font-size: 21px; }
.session-banner b { color: var(--rose); font-size: 9px; }
.form-section { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 14px; border-radius: 12px; background: var(--paper-2); }
.form-section h3 { margin: 4px 0 0; font-size: 12px; }
.rating-input { display: flex; align-items: center; gap: 11px; }
.rating-buttons { display: flex; flex-wrap: wrap; gap: 3px; }
.rating-buttons button { width: 23px; height: 23px; padding: 0; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: var(--paper); font-size: 9px; }
.rating-buttons button.active { border-color: var(--amber); color: white; background: var(--amber); }
.rating-input > strong { color: var(--amber); font-size: 18px; }
.rating-input > strong small { color: var(--faint); font-size: 9px; font-weight: 400; }
.image-field { display: grid; gap: 7px; align-content: start; }
.image-actions { display: flex; align-items: center; gap: 10px; }
.upload-button { display: inline-flex; align-items: center; justify-content: center; min-height: 28px; padding: 0 9px; border: 1px solid #ecd5d5; border-radius: 8px; color: var(--rose); background: var(--rose-soft); font-size: 9px; cursor: pointer; }
.upload-button input { display: none; }
.image-preview { width: 86px; height: 86px; border-radius: 10px; object-fit: cover; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 3px; }

.auth-shell, .loading-shell { display: grid; place-items: center; min-height: 100vh; padding: 24px; background: radial-gradient(circle at 15% 10%,#f3dfe0,transparent 34%),var(--bg); }
.auth-card { width: min(415px,100%); padding: 35px; border: 1px solid var(--line); border-radius: 24px; background: rgba(255,253,250,.9); box-shadow: var(--shadow); }
.auth-mark { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 23px; border-radius: 15px; color: #fffaf6; background: linear-gradient(145deg,#d7989f,#af6872); box-shadow: 0 11px 25px rgba(175,104,114,.24); font-size: 21px; }
.auth-card h1 { margin: 9px 0 8px; font-size: 28px; letter-spacing: -.055em; }
.auth-card > p { margin: 0 0 22px; color: var(--muted); font-size: 11px; line-height: 1.8; }
.auth-card .field { margin-top: 13px; }
.auth-switch { display: block; margin: 17px auto 0; padding: 0; border: 0; color: var(--rose); background: transparent; font-size: 10px; }
.auth-message { margin: 14px 0 0 !important; font-size: 10px !important; }
.auth-message.error { color: #c86e70; }
.auth-message.success { color: var(--sage); }
.loading-shell { align-content: center; gap: 12px; color: var(--muted); }
.loading-shell p { font-size: 11px; }
.toast { position: fixed; right: 26px; bottom: 24px; z-index: 50; max-width: min(420px,calc(100vw - 36px)); padding: 11px 14px; border: 1px solid #ead2d2; border-radius: 10px; color: var(--rose); background: var(--paper); box-shadow: var(--shadow); font-size: 10px; }

@media (max-width: 1120px) {
  .library-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .content { padding-right: 28px; padding-left: 28px; }
  .topbar { padding-right: 28px; padding-left: 28px; }
}
@media (max-width: 830px) {
  .sidebar { display: none; }
  .main-shell { margin-left: 0; }
  .topbar { min-height: 58px; padding: 0 15px; }
  .mobile-brand { display: flex; }
  .breadcrumb { display: none; }
  .sync-indicator { display: none; }
  .content { padding: 22px 14px 85px; }
  .welcome, .page-hero { align-items: flex-start; flex-direction: column; padding: 22px 19px; }
  .page-hero .button { width: 100%; }
  .welcome { flex-direction: row; align-items: center; }
  .welcome-mark { display: none; }
  .welcome h1 { font-size: 25px; }
  .metrics, .metrics.four { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .quick-grid, .home-panels, .detail-layout, .settings-grid { grid-template-columns: 1fr; }
  .library-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
  .library-card > .cover { height: 166px; }
  .library-card.item > .cover { height: 130px; }
  .card-actions { opacity: 1; }
  .timer-ribbon { top: 58px; padding: 8px 14px; }
  .timer-ribbon button:not(.stop) { display: none; }
  .detail-hero { align-items: flex-start; gap: 15px; padding: 18px; }
  .detail-hero > .cover { width: 105px; height: 145px; flex-basis: 105px; }
  .detail-title h1 { margin-top: 9px; font-size: 27px; }
  .detail-actions .text-button { display: none; }
  .timer-box { align-items: stretch; flex-direction: column; }
  .timer-actions { width: 100%; }
  .timer-actions .button { flex: 1; }
  .note-card { grid-template-columns: 1fr; }
  .note-thought { border-top: 1px solid var(--line); border-left: 0; }
  .moment-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .stats-toolbar { align-items: flex-start; flex-direction: column; }
  .stats-controls { width: 100%; flex-wrap: wrap; }
  .stats-controls input { flex: 1; }
  .category-row { grid-template-columns: 9px minmax(70px,.6fr) minmax(75px,1fr) auto; }
  .category-row small { display: none; }
  .mobile-nav { position: fixed; right: 0; bottom: 0; left: 0; z-index: 12; display: grid; grid-template-columns: repeat(5,1fr); gap: 2px; padding: 7px 8px 9px; border-top: 1px solid var(--line); background: rgba(255,253,250,.93); backdrop-filter: blur(18px); }
  .mobile-nav button { display: grid; justify-items: center; gap: 2px; padding: 4px 1px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; }
  .mobile-nav button i { font-size: 15px; font-style: normal; }
  .mobile-nav button span { font-size: 8px; }
  .mobile-nav button.active { color: var(--rose); background: var(--rose-soft); }
}
@media (min-width: 831px) { .mobile-nav { display: none; } }
@media (max-width: 540px) {
  .content { padding-right: 11px; padding-left: 11px; }
  .page-hero h1 { font-size: 28px; }
  .metric { padding: 13px; }
  .metric strong { font-size: 17px; }
  .library-toolbar { align-items: flex-start; flex-direction: column; }
  .library-toolbar > div { width: 100%; justify-content: space-between; }
  .toolbar-filters { width: 100%; }
  .toolbar-filters input, .toolbar-filters select { width: auto; flex: 1; }
  .library-card > .cover { height: 142px; }
  .library-card.item > .cover { height: 112px; }
  .library-body { padding: 10px; }
  .library-card h3 { font-size: 13px; }
  .card-footer { display: block; line-height: 1.8; }
  .card-footer .score { display: block; }
  .detail-toolbar { align-items: flex-start; }
  .detail-actions { gap: 7px; }
  .detail-actions .button { min-height: 31px; padding: 0 8px; font-size: 9px; }
  .detail-hero { gap: 11px; padding: 13px; }
  .detail-hero > .cover { width: 83px; height: 116px; flex-basis: 83px; }
  .detail-title h1 { font-size: 21px; }
  .chip { padding: 0 5px; font-size: 7px; }
  .score-line { gap: 8px; margin-top: 9px; }
  .progress { margin-top: 15px; }
  .progress-head { display: block; line-height: 1.7; }
  .progress-head strong { display: block; }
  .section-heading h2 { font-size: 15px; }
  .detail-list.wide { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .form-section { align-items: flex-start; flex-direction: column; }
  .rating-input { align-items: flex-start; flex-direction: column; }
  .modal-backdrop { align-items: end; padding: 0; }
  .modal, .modal.wide { max-height: 93vh; border-radius: 22px 22px 0 0; }
  .modal-head { padding: 17px 17px 12px; }
  .modal-body { padding: 0 17px 17px; }
  .moment-grid { grid-template-columns: 1fr; }
  .toast { right: 11px; bottom: 76px; left: 11px; max-width: none; text-align: center; }
  .auth-card { padding: 27px 20px; }
}
