:root {
  --bg: #EEF3FB;
  --bg-aurora: radial-gradient(48rem 34rem at 12% -10%, rgba(99,102,241,.13), transparent 60%),
               radial-gradient(42rem 30rem at 96% 16%, rgba(16,185,129,.09), transparent 60%),
               radial-gradient(50rem 36rem at 70% 108%, rgba(245,158,11,.09), transparent 62%);
  --bg-grad: linear-gradient(172deg, #E7EFFC 0%, #F3F8FF 42%, #FBF5FF 78%, #F0FAF6 100%);
  --bg-stars: radial-gradient(1px 1px at 20% 30%, rgba(120,140,190,.12), transparent),
              radial-gradient(1px 1px at 40% 70%, rgba(120,140,190,.1), transparent),
              radial-gradient(1.5px 1.5px at 60% 15%, rgba(120,140,190,.12), transparent),
              radial-gradient(1px 1px at 80% 50%, rgba(120,140,190,.08), transparent),
              radial-gradient(1px 1px at 10% 90%, rgba(120,140,190,.1), transparent),
              radial-gradient(1px 1px at 33% 55%, rgba(130,120,220,.14), transparent),
              radial-gradient(1.5px 1.5px at 90% 80%, rgba(120,140,190,.1), transparent),
              radial-gradient(1px 1px at 70% 22%, rgba(120,140,190,.14), transparent);
  --card: rgba(255,255,255,.72);
  --card-hover: rgba(255,255,255,.88);
  --card-border: rgba(100,116,139,.18);
  --card-shadow: 0 4px 24px rgba(30,64,175,.08);
  --text-primary: #1E293B;
  --text-secondary: #475569;
  --text-muted: #7690AC;
  --primary: #6366F1;
  --primary-light: #8A9BF9;
  --primary-dark: #4F46E5;
  --primary-glow: rgba(99,102,241,.22);
  --emerald: #10B981;
  --emerald-glow: rgba(16,185,129,.18);
  --amber: #F59E0B;
  --amber-glow: rgba(245,158,11,.2);
  --purple: #8B5CF6;
  --purple-glow: rgba(139,92,246,.18);
  --ai-glow: rgba(139,92,246,.2);
  --ai-grad: linear-gradient(135deg, #8B5CF6 0%, #6366F1 50%, #14B8A6 100%);
  --ai-grad-soft: linear-gradient(135deg, rgba(139,92,246,.1), rgba(99,102,241,.06) 50%, rgba(20,184,166,.06));
  --shadow-soft: 0 10px 30px -12px rgba(30,64,175,.16);
  --blue: #3B82F6;
  --red: #EF4444;
  --red-glow: rgba(239,68,68,.16);
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --header-h: 56px;
  --nav-h: 56px;
  --cp-axis: 680px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}
@supports not (padding: env(safe-area-inset-top)) { :root { --safe-top: 0px; --safe-bottom: 0px; --safe-left: 0px; --safe-right: 0px; } }
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif; background: var(--bg-aurora), var(--bg-grad); background-attachment: fixed; color: var(--text-primary); -webkit-font-smoothing: antialiased; font-size: 14px; line-height: 1.5; min-height: 100vh; min-height: 100dvh; }
body::before { content: ''; position: fixed; inset: 0; background: var(--bg-stars); pointer-events: none; z-index: 0; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: rgba(148,163,184,.15); border-radius: 3px; }
::-webkit-scrollbar-track { background: transparent; }
[v-cloak] { display: none !important; }
input, textarea, select { font-family: inherit; font-size: 14px; }
input:focus, textarea:focus, select:focus { outline: none; }
input::placeholder, textarea::placeholder { color: var(--text-muted); }
button { font-family: inherit; -webkit-tap-highlight-color: transparent; }
.cp-hero-progress-text, .cp-greet-stat b, .cp-ch-chip-badge, .cp-pending-badge, .cp-quick-stat-val, .cp-task-pct, .cp-task-progress-info, .cp-task-target b, .cp-milestone-tag b, .cp-weekly-meta, .cp-diag-meta { font-variant-numeric: tabular-nums; }

.glass { background: var(--card); backdrop-filter: blur(18px) saturate(160%); -webkit-backdrop-filter: blur(18px) saturate(160%); border: 1px solid var(--card-border); border-radius: var(--radius-lg); box-shadow: var(--card-shadow); }
.glass-card { background: var(--card); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--card-border); border-radius: var(--radius); box-shadow: 0 2px 8px rgba(30,64,175,.06), var(--shadow-soft); transition: transform .18s ease, box-shadow .18s ease; }

.cp-header { position: sticky; top: 0; z-index: 50; height: var(--header-h); display: flex; align-items: center; justify-content: center; padding: 0 16px; background: rgba(255,255,255,.78); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid var(--card-border); }
.cp-header-inner { width: 100%; max-width: var(--cp-axis, 680px); display: flex; align-items: center; justify-content: space-between; }
.cp-logo { display: flex; align-items: center; gap: 10px; }
.cp-logo-icon { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--purple)); display: flex; align-items: center; justify-content: center; font-size: 17px; color: #fff; box-shadow: 0 0 24px var(--primary-glow); position: relative; }
.cp-logo-icon::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 1.5px solid rgba(129,140,248,.2); border-top-color: var(--primary-light); animation: orbit 3s linear infinite; }
@keyframes orbit { to { transform: rotate(360deg); } }
.cp-logo-wrap { display: flex; flex-direction: column; line-height: 1.2; }
.cp-logo-text { font-size: 17px; font-weight: 800; background: linear-gradient(135deg, var(--text-primary), var(--primary-light)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.cp-logo-tag { font-size: 9px; color: var(--text-muted); letter-spacing: 1px; }
.cp-header-right { display: flex; align-items: center; gap: 10px; }
.cp-user-name { font-size: 13px; color: var(--text-secondary); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cp-main { padding: 16px 16px calc(var(--nav-h) + 28px + env(safe-area-inset-bottom)); position: relative; z-index: 1; }
.cp-container { max-width: var(--cp-axis, 680px); margin: 0 auto; }

.cp-bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); display: flex; align-items: stretch; justify-content: center; background: rgba(255,255,255,.85); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--card-border); z-index: 50; box-shadow: 0 -4px 20px rgba(30,64,175,.06); }
.cp-nav-inner { width: 100%; max-width: var(--cp-axis, 680px); display: flex; align-items: stretch; justify-content: space-around; }
.cp-nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 11px; transition: color .2s, transform .2s; position: relative; }
.cp-nav-item.active { color: var(--primary); }
.cp-nav-item.active::before { content: ''; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: linear-gradient(90deg, var(--primary), var(--purple)); }
.cp-nav-item i { font-size: 19px; transition: transform .2s; }
.cp-nav-item:active i { transform: scale(1.25); }
.cp-nav-item.active i { animation: nav-bounce .3s ease; }
@keyframes nav-bounce { 0% { transform: scale(1); } 50% { transform: scale(1.3) translateY(-2px); } 100% { transform: scale(1); } }

.cp-btn-primary { padding: 13px; border: none; border-radius: var(--radius-sm); background: linear-gradient(135deg, var(--primary), var(--purple)); color: #fff; font-weight: 600; font-size: 15px; cursor: pointer; width: 100%; transition: all .2s; display: flex; align-items: center; justify-content: center; gap: 6px; box-shadow: 0 4px 20px var(--primary-glow); }
.cp-btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 26px var(--primary-glow); }
.cp-btn-primary:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.cp-btn-ghost { padding: 9px 14px; border: 1px solid var(--card-border); border-radius: var(--radius-sm); background: rgba(148,163,184,.06); color: var(--text-secondary); cursor: pointer; font-size: 13px; transition: all .2s; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.cp-btn-ghost:hover { background: rgba(148,163,184,.12); color: var(--text-primary); }
.cp-btn-ghost.danger { color: var(--red); border-color: rgba(248,113,113,.25); }
.cp-btn-ghost.danger:hover { background: rgba(248,113,113,.12); }
.cp-btn-ghost:disabled { opacity: .45; cursor: not-allowed; }

.cp-field { background: rgba(148,163,184,.06); border: 1px solid var(--card-border); border-radius: var(--radius-sm); color: var(--text-primary); padding: 11px 14px; width: 100%; transition: all .2s; }
.cp-field:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.cp-label { display: block; font-size: 12px; color: var(--text-secondary); margin-bottom: 6px; font-weight: 500; }
.cp-pick-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.cp-pick-btn { padding: 8px 16px; border-radius: var(--radius-sm); border: 1px solid var(--card-border); background: rgba(148,163,184,.06); color: var(--text-secondary); cursor: pointer; font-size: 13px; transition: all .2s; }
.cp-pick-btn:hover { background: rgba(148,163,184,.12); }
.cp-pick-btn.active { background: linear-gradient(135deg, var(--primary), var(--purple)); color: #fff; border-color: transparent; }

.cp-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.cp-modal { width: 100%; max-width: 480px; max-height: 88vh; display: flex; flex-direction: column; overflow: hidden; }
.cp-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--card-border); flex-shrink: 0; background: rgba(255,255,255,.9); backdrop-filter: blur(12px); z-index: 2; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.cp-modal-header h3 { font-size: 17px; font-weight: 700; }
.cp-modal-close { background: none; border: none; color: var(--text-muted); font-size: 20px; cursor: pointer; padding: 4px 8px; }
.cp-modal-body { padding: 20px; flex: 1 1 auto; min-height: 0; overflow-y: auto; }

.cp-toast { position: fixed; top: calc(var(--header-h) + 14px); left: 50%; transform: translateX(-50%); z-index: 300; padding: 11px 20px; max-width: 88%; font-size: 13px; line-height: 1.6; border-radius: var(--radius); text-align: center; background: rgba(255,255,255,.94); backdrop-filter: blur(12px); border: 1px solid var(--card-border); color: var(--text-primary); box-shadow: 0 4px 24px rgba(30,64,175,.14); }
.toast-enter-active, .toast-leave-active { transition: all .35s ease; }
.toast-enter-from, .toast-leave-to { transform: translate(-50%, -16px); opacity: 0; }

.cp-skeleton-card { padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.cp-skel-row { display: flex; align-items: center; gap: 16px; }
.cp-skel-circle { width: 84px; height: 84px; border-radius: 50%; background: rgba(148,163,184,.08); animation: shimmer 1.5s ease-in-out infinite; flex-shrink: 0; }
.cp-skel-lines { flex: 1; }
.cp-skel-line { height: 14px; border-radius: 4px; background: rgba(148,163,184,.08); margin-bottom: 10px; animation: shimmer 1.5s ease-in-out infinite; }
.cp-skel-line.w60 { width: 60%; } .cp-skel-line.w40 { width: 40%; } .cp-skel-line.w80 { width: 80%; }
@keyframes shimmer { 0%, 100% { opacity: .4; } 50% { opacity: .85; } }

.cp-empty { display: flex; flex-direction: column; align-items: center; padding: 36px 20px; text-align: center; }
.cp-empty-icon { font-size: 52px; margin-bottom: 14px; }
.cp-empty h2 { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.cp-empty > p { color: var(--text-secondary); margin-bottom: 22px; }

.cp-section-title { font-size: 14px; font-weight: 600; margin-bottom: 12px; display: flex; align-items: center; gap: 6px; color: var(--text-primary); }
.cp-weight-hint { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; line-height: 1.5; }
.cp-weight-svg { width: 100%; height: 110px; }
.cp-weight-line { fill: none; stroke: var(--primary); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.cp-weight-fill { fill: rgba(129,140,248,.12); }
.cp-weight-legend { display: flex; gap: 12px; font-size: 11px; color: var(--text-muted); margin-top: 6px; align-items: center; flex-wrap: wrap; }
.cp-lg-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
.cp-lg-dot.plan { background: repeating-linear-gradient(90deg, var(--primary-light) 0 3px, transparent 3px 6px); }
.cp-lg-dot.goal { background: var(--amber); }
.cp-lg-dot.actual { background: var(--primary); }
.cp-weight-guide .cp-weight-planline { stroke: var(--text-muted); stroke-width: 1.5; stroke-dasharray: 3 2; opacity: .7; }
.cp-weight-guide .cp-weight-goalline { stroke: var(--amber); stroke-width: 1.5; stroke-dasharray: 6 3; opacity: .8; }
.cp-error-box { padding: 14px 16px; border-radius: var(--radius); border: 1px solid rgba(248,113,113,.25); background: rgba(248,113,113,.08); color: var(--red); font-size: 13px; display: flex; align-items: flex-start; gap: 8px; line-height: 1.6; }
.cp-error-box button { margin-left: auto; flex-shrink: 0; }

.cp-templates { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 20px; width: 100%; }
.cp-template-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 14px; border-radius: var(--radius); border: 1px solid var(--card-border); background: rgba(255,255,255,.7); cursor: pointer; transition: all .2s; text-align: left; color: var(--text-primary); box-shadow: var(--card-shadow); }
.cp-template-card:hover { background: rgba(255,255,255,.92); border-color: var(--primary); transform: translateY(-2px); box-shadow: 0 6px 18px rgba(129,140,248,.18); }
.cp-template-icon { font-size: 24px; }
.cp-template-title { font-size: 13px; font-weight: 600; }
.cp-template-desc { font-size: 11px; color: var(--text-muted); }
.cp-template-days { font-size: 11px; color: var(--primary-light); background: rgba(129,140,248,.12); padding: 2px 8px; border-radius: 8px; }

.cp-celebrate { position: fixed; inset: 0; z-index: 200; pointer-events: none; display: flex; align-items: center; justify-content: center; }
.cp-celebrate-star { position: absolute; color: var(--amber); animation: star-fly 1.2s ease-out forwards; opacity: 0; }
@keyframes star-fly { 0% { opacity: 0; transform: translate(0, 0) scale(.3); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1.2) rotate(40deg); } }
.cp-celebrate-text { font-size: 22px; font-weight: 800; color: var(--text-primary); text-shadow: 0 0 24px var(--emerald-glow); animation: celebrate-pop .5s ease-out; }
@keyframes celebrate-pop { 0% { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.15); opacity: 1; } 100% { transform: scale(1); } }

/* Nebula glow animation */
@keyframes nebula-pulse { 0%, 100% { opacity: .6; } 50% { opacity: 1; } }
@keyframes twinkle { 0%, 100% { opacity: .3; } 50% { opacity: .8; } }
@keyframes streak-fire { 0%, 100% { filter: drop-shadow(0 0 8px rgba(245,158,11,.4)); } 50% { filter: drop-shadow(0 0 20px rgba(245,158,11,.7)); } }
@keyframes glow-ring { 0% { box-shadow: 0 0 0 0 rgba(129,140,248,.4); } 100% { box-shadow: 0 0 0 12px rgba(129,140,248,0); } }

/* Space-themed card variants */
.cp-nebula-card { position: relative; overflow: hidden; }
.cp-nebula-card::before { content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%; background: radial-gradient(ellipse at 30% 20%, rgba(129,140,248,.06) 0%, transparent 50%), radial-gradient(ellipse at 70% 80%, rgba(167,139,250,.04) 0%, transparent 50%); pointer-events: none; }

.cp-shield-break-icon { display: inline-block; font-size: 34px; line-height: 1; animation: shieldShatter .6s ease-out forwards; transform-origin: center; margin-bottom: 8px; filter: drop-shadow(0 2px 6px rgba(248,113,113,.3)); }
.cp-shield-mend-icon { display: inline-block; font-size: 34px; line-height: 1; animation: shieldMend .8s ease-out forwards, shieldMendGlow 1.2s ease-out .6s forwards; transform-origin: center; margin-bottom: 8px; }
.cp-shield-mend-card { border-color: rgba(52,211,153,.4) !important; background: rgba(52,211,153,.08) !important; animation: shieldMendGlow 1.2s ease-out .6s forwards; }
.cp-shield-active { animation: shieldGlow 1.8s ease-in-out infinite; }

@keyframes shieldShatter {
  0% { transform: scale(1) rotate(0); clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); opacity: 1; }
  30% { transform: scale(1.1) rotate(-2deg); }
  60% { clip-path: polygon(0 20%, 100% 0, 80% 100%, 20% 80%); opacity: 0.7; }
  100% { clip-path: polygon(20% 30%, 80% 10%, 60% 90%, 30% 70%); opacity: 0.4; transform: scale(0.95); }
}
@keyframes shieldMend {
  0% { clip-path: polygon(20% 30%, 80% 10%, 60% 90%, 30% 70%); opacity: 0.4; transform: scale(0.95); }
  50% { clip-path: polygon(0 20%, 100% 0, 80% 100%, 20% 80%); opacity: 0.7; }
  100% { transform: scale(1) rotate(0); clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); opacity: 1; }
}
@keyframes shieldGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(129,140,248,.4); }
  50% { box-shadow: 0 0 0 8px rgba(129,140,248,0); }
}
@keyframes shieldMendGlow {
  0% { box-shadow: 0 0 0 0 rgba(52,211,153,.5); }
  100% { box-shadow: 0 0 0 16px rgba(52,211,153,0); }
}

.modal-enter-active, .modal-leave-active { transition: opacity .25s; }
.modal-enter-from, .modal-leave-to { opacity: 0; }
.modal-enter-active .cp-modal, .modal-leave-active .cp-modal { transition: transform .25s, opacity .25s; }
.modal-enter-from .cp-modal, .modal-leave-to .cp-modal { transform: translateY(24px); opacity: 0; }

@media (max-width: 768px) {
  .cp-main { padding: 12px 12px calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)); }
  .cp-header { padding: 0 12px; }
  .cp-modal-overlay { padding: 0; align-items: flex-end; }
  .cp-modal { max-width: 100%; max-height: 94vh; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .cp-modal::before { content: ''; flex-shrink: 0; align-self: center; width: 42px; height: 4px; border-radius: 999px; background: rgba(100,116,139,.28); margin: 9px 0 2px; }
  .cp-modal-header { border-radius: 0; }
  .cp-templates { grid-template-columns: repeat(2, 1fr); }
  .container, .container-fluid { padding-left: 16px; padding-right: 16px; }
  .show-mobile { display: block !important; }
  button, .btn, [role="button"], a.btn, .cp-nav-item { min-height: 44px; min-width: 44px; }
  input, textarea, select { font-size: 16px !important; }
  .cp-modal-close { width: 44px; height: 44px; min-height: 44px; min-width: 44px; font-size: 18px; padding: 0; }
}
@media (min-width: 769px) { .show-mobile { display: none !important; } }
@media (pointer: coarse) {
  button, .btn, [role="button"], a.btn, .clickable, .cp-nav-item { min-height: 44px; min-width: 44px; }
  .tooltip:hover { display: none !important; }
}
body { padding-top: var(--safe-top); padding-bottom: var(--safe-bottom); padding-left: var(--safe-left); padding-right: var(--safe-right); }
img, video, canvas { max-width: 100%; height: auto; }
.full-height { height: 100vh; height: 100svh; height: 100dvh; min-height: 100vh; min-height: 100svh; min-height: 100dvh; }
.cp-modal-footer { padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); display: flex; gap: 12px; flex-shrink: 0; }
.cp-modal-footer .cp-btn-primary, .cp-modal-footer .cp-btn-ghost { flex: 1; min-height: 48px; }
@media (max-width: 480px) { .cp-ladder-grid { grid-template-columns: repeat(2,1fr) !important; } .cp-ladder-preview-inner { overflow-x: auto; -webkit-overflow-scrolling: touch; } }

@media (min-width: 1024px) {
  :root { --cp-axis: min(1120px, calc(100vw - 96px)); }
  .cp-nav-inner { max-width: 480px; }
}

.cp-pad16 { padding: 16px }
.cp-ic-primary { color: var(--primary-light) }
.cp-ic-emerald { color: var(--emerald) }
.cp-ic-amber { color: var(--amber) }
.cp-note-xs { font-size: 12px; color: var(--text-muted) }
.cp-empty-tip { font-size: 13px; color: var(--text-muted); margin: 12px 0 }
.cp-block { width: 100% }
.cp-btn-inline { width: auto; padding: 11px 18px }
.cp-input-row { display: flex; gap: 8px }
.cp-input-row .cp-field { flex: 1; min-width: 0 }
.cp-mb0 { margin-bottom: 0 }
.cp-row-center { display: flex; justify-content: center }