/* v3：全站深色、青綠重點色、共用卡片與線條圖示。 */
:root{color-scheme:dark;--bg:#0b1014;--surface:#151d24;--surface-raised:#1d2831;--line:#2b3943;--line-strong:#465b68;--ink:#edf5f7;--ink-dim:#c0ced6;--muted:#98abb8;--accent:#63dec1;--accent-soft:rgba(99,222,193,.11);--radius:18px;--control-radius:12px;--gold:#e5c07b;--ok:#63dec1}
body{background:var(--bg);color:var(--ink);font-size:14px;line-height:1.65}
button,input,select,textarea{font-family:inherit}
button,a,input,select,textarea{-webkit-tap-highlight-color:transparent}
:where(button,a,input,select,textarea):focus-visible{outline:2px solid var(--accent);outline-offset:3px}
button:disabled{opacity:.5;cursor:not-allowed}
.ic{stroke-width:1.8;overflow:visible}.inline-icon{width:18px;height:18px;vertical-align:-3px;margin-right:3px}
.main{padding-top:64px}.main>h2,.life h2{font-size:23px;font-weight:650;letter-spacing:.02em}
.topbar{height:44px;background:rgba(11,16,20,.94);border-bottom:1px solid var(--line)}
.topbar-inner{height:44px;padding-right:92px!important}.page-title{font-size:16px;line-height:44px;background:none;color:var(--ink);font-weight:650}
.status-row{margin-right:12px}.topbar-time{color:var(--muted)}
.master-btn.profile-entry{right:10px;top:4px;width:auto;min-width:76px;height:36px;gap:6px;padding:0 11px;border-radius:12px;background:var(--surface);border:1px solid var(--line);color:var(--ink-dim);font-size:13px;text-decoration:none}
.master-btn.profile-entry:hover,.master-btn.profile-entry.active{background:var(--accent-soft);color:var(--accent);border-color:var(--accent)}
.master-btn.profile-entry .ic{width:19px;height:19px}
.bottom-nav{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));align-items:center;background:rgba(15,22,28,.97);border-color:var(--line);gap:0;padding:5px 4px calc(5px + env(safe-area-inset-bottom,0px));min-height:66px}
.bottom-nav a{min-width:0;min-height:54px;padding:5px 0;gap:3px;border-radius:12px;font-size:12px;line-height:1.4;color:var(--muted)}
.bottom-nav a .ic{width:23px;height:23px}.bottom-nav a.active{background:var(--accent-soft);color:var(--accent)}
.bottom-nav a:hover{color:var(--ink)}.bottom-nav a.active:hover{color:var(--accent)}
.nav-plus{justify-self:center;width:44px;height:44px;margin:0;background:var(--accent);color:var(--on-accent);border:0;border-radius:15px;box-shadow:0 3px 16px rgba(0,0,0,.22)}
.nav-plus:hover{background:#95edd8}.nav-plus[aria-expanded=true]{box-shadow:0 0 0 3px var(--line-strong)}
.quick-sheet{background:var(--surface);border-color:var(--line);max-width:696px;margin:0 auto}.qs-item{background:var(--surface-raised);color:var(--ink)}.qs-item.qs-primary{background:var(--accent);color:var(--bg)}
.card,.life .life-card,.pg-card,.eve,.preset-card,.me-head,.me-list,.me-status{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius)}
.card-header{padding:17px 18px}.card-header h3{font-size:15px;color:var(--ink);font-weight:600}.card-header h3>.ic{color:var(--accent)}
.card-detail{font-size:14px;border-color:var(--line);padding:12px 18px 18px}
.card:hover{border-color:var(--line-strong)}.card-header:hover{background:rgba(99,222,193,.035);border-left-color:var(--accent)}
.ho-input,.ho-select,.form-field input,.form-field select,.life input,.life select{min-height:44px;background:var(--bg);color:var(--ink);border:1px solid var(--line);border-radius:var(--control-radius);font-size:15px}
.ho-input:focus,.ho-select:focus,.form-field input:focus,.form-field select:focus{border-color:var(--accent)}
.ho-btn,.life button,.life-link,.ghost-btn,.water-btn,.template-btn,.preset-load,.pb-pill,.me-row{border-radius:var(--control-radius);font-size:14px}
.ho-btn,.life button,.life-link{min-height:44px;border:1px solid var(--line);background:var(--surface-raised);color:var(--ink)}
.ho-btn.primary,.life button.primary,.start-pill,.pb-pill.on{background:var(--accent);border-color:transparent;color:var(--on-accent);font-weight:650}
.ho-btn.primary:hover,.life button.primary:hover{background:#95edd8}
.ho-btn.danger{background:rgba(229,115,115,.12);border-color:rgba(229,115,115,.4);color:#f19c9c}
.text-muted,.life .muted,.me-code,.me-group,.me-tag,.drawer-line,.drawer-foot,.chain-days{color:var(--muted)}
.life{padding:0;margin:16px auto}.life .muted,.life label{font-size:14px}.life .life-card{padding:18px;margin-bottom:16px}.life-grid{gap:16px}.life h3{font-size:16px;font-weight:600}
.life h3 .ic{color:var(--accent)}.life .fields{grid-template-columns:repeat(2,minmax(0,1fr))}.life .fields input{width:100%;min-width:0}.life button:focus-visible,.life input:focus-visible,.life select:focus-visible,.life-link:focus-visible{outline-color:var(--accent)}
.life-tabs{position:relative;gap:8px}.life-link{border-radius:999px;padding:8px 18px}.life-link:hover{color:var(--accent);border-color:var(--accent)}
.life .entry{border-color:var(--line)}.life .entry strong{font-size:15px}.body-grid{grid-template-columns:repeat(auto-fit,minmax(min(100%,320px),1fr))}
.stat-box,.growth-card,.ex,.history-item,.program-exercise-card,.preset-card{border-color:var(--line);border-radius:12px;background:var(--surface)}
.me-head{margin-top:8px;padding:22px}.me-avatar{background:var(--accent-soft);border-color:rgba(99,222,193,.4);color:var(--accent)}.me-name{font-size:19px}.me-code{font-size:13px}.me-group{font-size:13px;margin-top:24px}.me-role{color:var(--accent);background:var(--accent-soft)}
.me-list .me-row{border-radius:0;min-height:58px}.me-row .ic{color:var(--accent)}.me-row .chev{width:16px;height:16px;color:var(--muted)}.me-row.off,.me-row.off .ic{color:var(--muted)}.me-tag{font-size:12px}
.me-status{padding:18px}.me-status .drawer-name{display:none}.me-status .drawer-acct{margin:0 0 12px;padding:0 0 12px;border-color:var(--line)}.me-status .drawer-chains{padding:0;margin:0;border:0}.drawer-chain,.drawer-line{font-size:14px}.chain-days{font-size:12px}
body[data-page=me] .drawer-foot{margin-top:24px;font-size:12px;border-color:var(--line)}.drawer-logout{font-size:14px;padding:10px 18px;border-radius:12px}
.calendar-toolbar{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:14px}.calendar-toolbar h3{margin:0;display:flex;align-items:center;gap:7px;font-variant-numeric:tabular-nums}
.calendar-controls{display:flex;align-items:center;gap:5px}.calendar-controls button{padding:6px;min-width:36px;min-height:36px;border-radius:10px}.calendar-controls #calendarToday{padding:6px 10px;font-size:13px}.calendar-controls .ic{width:18px;height:18px}
.calendar-week,.calendar-days{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:4px}.calendar-week{color:var(--muted);text-align:center;font-size:12px;margin-bottom:8px}
.life .calendar-day{display:flex;align-items:center;justify-content:center;flex-direction:column;gap:4px;height:50px;min-height:44px;padding:3px 0;border:1px solid transparent;background:transparent;border-radius:12px;font-size:15px;font-variant-numeric:tabular-nums}
.life .calendar-day:hover{background:var(--surface-raised)}.life .calendar-day.outside{color:var(--muted)}.life .calendar-day.today{border-color:var(--line-strong);color:var(--accent)}.life .calendar-day.selected{background:var(--accent);color:var(--on-accent);font-weight:700;border-color:var(--accent)}
.calendar-dot{display:inline-block;width:4px;height:4px;border-radius:50%;background:var(--accent);flex-shrink:0}.calendar-day.selected .calendar-dot{background:var(--bg)}.calendar-dot.empty{visibility:hidden}
.life .calendar-legend{display:flex;align-items:center;gap:6px;margin:14px 0;color:var(--muted);font-size:12px}.calendar-agenda{border-top:1px solid var(--line);padding-top:16px}.calendar-agenda h3{margin-bottom:12px}.calendar-item{display:flex;gap:12px;padding:10px 0;border-top:1px solid var(--line)}.calendar-item:first-child{border:0}.calendar-item time{font-size:13px;color:var(--accent);min-width:94px;font-variant-numeric:tabular-nums}.calendar-item strong{font-size:14px;overflow-wrap:anywhere}.calendar-item small{display:block;color:var(--muted);font-size:12px}.calendar-empty{color:var(--muted);font-size:14px}
body.login-page{background:var(--bg);padding-bottom:0;font-size:14px}.login-page .card{background:var(--surface);border-color:var(--line);border-radius:24px}.login-page input{background:var(--bg);border-color:var(--line);color:var(--ink);border-radius:12px}.login-page .submit{background:var(--accent);color:var(--on-accent);border-color:transparent;border-radius:12px}.login-page .brand-sub,.login-page .foot{color:var(--muted)}
@media(min-width:641px){.bottom-nav{max-width:720px;border-radius:20px 20px 0 0}.main{padding-bottom:32px}.life .calendar-day{height:58px}}
@media(max-width:640px){.main{padding:58px 14px 90px}.topbar .status-row{display:none}.life .life-card{padding:15px}.life{margin-top:12px}.calendar-toolbar h3{font-size:15px}}
@media(max-width:380px){.life .fields{grid-template-columns:1fr}.calendar-controls{gap:3px}.calendar-controls button{min-width:30px;padding:4px}.calendar-toolbar h3{font-size:14px}.calendar-toolbar{gap:4px}.calendar-toolbar h3>.ic{display:none}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;animation-duration:.01ms!important;transition-duration:.01ms!important}}

.main>.card{margin-bottom:16px}.qs-scrim{z-index:1300}.quick-sheet{z-index:1310}

/* v3：全站共享日夜色板。 */
:root{--neutral-rgb:255,255,255;--inset:rgba(0,0,0,.24);--overlay-surface:rgba(11,16,20,.98);--floating:rgba(21,29,36,.92);--nav-surface:rgba(15,22,28,.97);--on-accent:#08251e;--info:#82baff;--ok:#63dec1;--warning:#eac777;--danger-ink:#ff989b;--purple:#c1a3ff;--button-hover:#95edd8;--shadow:0 3px 14px rgba(0,0,0,.16)}
:root[data-theme="light"]{color-scheme:light;--bg:#f3f6f8;--surface:#ffffff;--surface-raised:#eaf0f3;--line:#d6e0e5;--line-strong:#9bb0bd;--ink:#182c38;--ink-dim:#384f5c;--muted:#526a78;--accent:#087861;--accent-soft:rgba(8,120,97,.10);--neutral-rgb:24,44,56;--inset:#eaf0f3;--overlay-surface:rgba(243,246,248,.98);--floating:rgba(255,255,255,.94);--nav-surface:rgba(255,255,255,.97);--on-accent:#ffffff;--info:#1e5fa5;--ok:#087861;--warning:#865b08;--danger-ink:#b42332;--purple:#7543b0;--gold:#865b08;--button-hover:#086551;--shadow:0 3px 14px rgba(24,44,56,.10)}
body{background:var(--bg);color:var(--ink)}
body .main{padding-top:calc(60px + env(safe-area-inset-top,0px))}
.page-actions{position:fixed;top:calc(8px + env(safe-area-inset-top,0px));right:calc(12px + env(safe-area-inset-right,0px));z-index:800;display:flex;align-items:center;gap:8px}
.page-actions .theme-toggle,.page-actions .master-btn.profile-entry{position:relative;inset:auto;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;height:44px;border:1px solid var(--line-strong);background:var(--floating);color:var(--ink);box-shadow:var(--shadow);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);cursor:pointer;text-decoration:none}
.page-actions .theme-toggle{width:44px;padding:10px;border-radius:50%}.page-actions .theme-toggle .ic{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.page-actions .master-btn.profile-entry{min-width:84px;width:auto;padding:0 12px;gap:6px;border-radius:999px;font-size:14px}
.page-actions .profile-entry.active{border-color:var(--accent);color:var(--accent);background:var(--surface)}
.page-actions button:hover,.page-actions a:hover{border-color:var(--accent);color:var(--accent)}
.theme-toggle .theme-sun{display:none}:root[data-theme="light"] .theme-toggle .theme-sun{display:block}:root[data-theme="light"] .theme-toggle .theme-moon{display:none}
body.training-immersive .page-actions{display:none!important}
body[data-page="gym"] .page-actions{z-index:1100}
.bottom-nav{background:var(--nav-surface)}.bottom-nav a:hover{color:var(--ink)}
.nav-plus{color:var(--on-accent)}.nav-plus:hover,.ho-btn.primary:hover,.life button.primary:hover,.login-page .submit:hover{background:var(--button-hover);color:var(--on-accent)}
.card-header h3,.me-name,.me-row,.brand-text,.pwa-veil-brand{color:var(--ink)}
.start-pill,.ho-btn.primary,.life button.primary,.pb-pill.on,.login-page .submit,.recovery-records .btn-secondary{color:var(--on-accent)}
.life .calendar-day.selected{color:var(--on-accent)}.calendar-day.selected .calendar-dot{background:var(--on-accent)}
.life .notice{color:var(--warning)}.life .message.error,.ho-btn.danger{color:var(--danger-ink)}
.login-page label{color:var(--muted)}.login-page .brand svg{stroke:var(--accent)}.login-page .pwa-veil{background:var(--bg)}
.login-page .page-actions{z-index:410}.pwa-emergency{color:var(--muted)}
.me-status .drawer-name{display:none}.me-head{margin-top:0}.life{margin-top:8px}
:root[data-theme="light"] #bodyMap .body-region{fill:#aec3cc;stroke:#526a78}:root[data-theme="light"] #bodyMap .body-decoration{fill:#728b98}
:root[data-theme="light"] #bodyMap .body-region:hover,:root[data-theme="light"] #bodyMap .body-region:focus-visible{fill:#81b8b0;stroke:var(--ink)}
:root[data-theme="light"] .body-map-legend i{background:#aec3cc}:root[data-theme="light"] .body-map-legend .chosen{background:var(--accent)}
:root[data-theme="light"] .toast{color:var(--ink);background:var(--surface)}

.theme-choices{display:flex;gap:6px;padding:5px;border:1px solid var(--line);border-radius:16px;background:var(--surface)}.theme-choices button{flex:1;min-height:44px;padding:8px;border:0;border-radius:11px;background:transparent;color:var(--muted);font:inherit;cursor:pointer}.theme-choices button[aria-pressed=true]{background:var(--accent);color:var(--on-accent);font-weight:650}

:root[data-theme="light"] #bodyMap .body-region.selected{fill:var(--accent);stroke:#045342}
