:root{--c-primary: #4F6EF7;--c-primary-dark: #3A54D4;--c-accent: #FF6B6B;--c-success: #2ECC71;--c-warning: #F39C12;--c-danger: #E74C3C;--c-bg: #F2F3F7;--c-surface: #FFFFFF;--c-text: #1A1A2E;--c-text-secondary: #6B7280;--c-text-muted: #9CA3AF;--c-border: #E5E7EB;--c-border-light: #F3F4F6;--c-tab-active: #4F6EF7;--c-tab-inactive: rgba(255,255,255,.55);--radius: 10px;--radius-lg: 16px;--shadow: 0 2px 8px rgba(0,0,0,.06);--shadow-lg: 0 8px 24px rgba(0,0,0,.1);--font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;--font-mono: "SF Mono", "Fira Code", monospace;--header-h: 52px;--tabbar-h: 58px;--chat-input-h: 62px;--safe-bottom: env(safe-area-inset-bottom, 0px)}*,*:before,*:after{margin:0;padding:0;box-sizing:border-box}html{font-size:16px}body{font-family:var(--font);background:var(--c-bg);color:var(--c-text);line-height:1.6;-webkit-font-smoothing:antialiased;transition:background .3s,color .3s}#root{height:100vh;display:flex;flex-direction:column;overflow:hidden}.app-root{display:flex;flex-direction:column;height:100vh;background:var(--c-bg)}.app-header{height:var(--header-h);min-height:var(--header-h);background:var(--c-header-bg);display:flex;align-items:center;justify-content:center;position:relative;z-index:10;padding:0 16px;transition:background .3s}.app-header h1{font-size:1.05rem;font-weight:700;color:var(--c-header-text);letter-spacing:.5px}.app-header .header-left,.app-header .header-right{position:absolute;top:50%;transform:translateY(-50%)}.app-header .header-left{left:16px}.app-header .header-right{right:16px}.app-body{flex:1;overflow-y:auto;overflow-x:hidden;padding:16px;padding-bottom:calc(var(--tabbar-h) + var(--safe-bottom) + 16px);-webkit-overflow-scrolling:touch}.app-tabbar{position:fixed;bottom:0;left:0;right:0;height:calc(var(--tabbar-h) + var(--safe-bottom));padding-bottom:var(--safe-bottom);background:var(--c-tabbar-bg);border-top:1px solid var(--c-border-light);display:flex;align-items:center;justify-content:space-around;z-index:100;box-shadow:0 -2px 10px #0000000a;transition:background .3s;gap:0}.app-tabbar a,.app-tabbar button{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;height:100%;border:none;background:none;cursor:pointer;text-decoration:none;color:var(--c-tab-inactive);font-size:.72rem;font-weight:500;font-family:var(--font);transition:color .15s;margin:0;padding:0}.app-tabbar a.active,.app-tabbar button.active{color:#fff;background:#fff3}.app-tabbar .tab-icon{font-size:1.15rem;line-height:1}.card{background:var(--c-surface);border-radius:var(--radius-lg);padding:16px;margin-bottom:12px;box-shadow:var(--shadow)}.card-header{font-size:.9rem;font-weight:600;margin-bottom:12px;padding-bottom:10px;border-bottom:1px solid var(--c-border-light)}.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;height:40px;padding:0 18px;border:none;border-radius:20px;font-size:.88rem;font-weight:500;cursor:pointer;transition:all .15s;font-family:var(--font);box-sizing:border-box}.btn svg{width:18px;height:18px}.btn:disabled{opacity:.4;cursor:not-allowed}.btn-primary{background:var(--c-primary);color:#fff}.btn-primary:hover:not(:disabled){background:var(--c-primary-dark);filter:brightness(.9)}.btn-accent{background:var(--c-accent);color:#fff}.btn-success{background:var(--c-success);color:#fff}.btn-outline{background:#fff;border:1.5px solid var(--c-border);color:var(--c-text)}.btn-outline:hover:not(:disabled){border-color:var(--c-primary);color:var(--c-primary)}.btn-ghost{background:transparent;color:var(--c-text-secondary)}.btn-ghost:hover:not(:disabled){background:#f5f5f5}.btn-danger{background:var(--c-danger);color:#fff}.btn-sm{height:32px;padding:0 12px;font-size:.78rem;border-radius:16px}.btn-sm svg{width:14px;height:14px}.btn-lg{height:48px;padding:0 24px;font-size:.95rem;border-radius:24px}.btn-lg svg{width:20px;height:20px}.btn-block{width:100%}.input{width:100%;height:40px;padding:0 14px;border:1.5px solid var(--c-border);border-radius:20px;font-size:.88rem;font-family:var(--font);background:#fff;color:var(--c-text);outline:none;transition:border .15s;box-sizing:border-box}.input:focus{border-color:var(--c-primary)}.input::placeholder{color:var(--c-text-muted)}textarea.input{resize:vertical;height:auto;padding:10px 14px;border-radius:var(--radius)}.label{display:block;font-size:.78rem;font-weight:500;color:var(--c-text-secondary);margin-bottom:4px}.chat-container{display:flex;flex-direction:column;height:calc(100vh - var(--header-h) - var(--tabbar-h) - 32px)}.chat-messages{flex:1;overflow-y:auto;padding:4px 0}.chat-msg{display:flex;align-items:flex-start;gap:4px;margin-bottom:4px}.chat-msg.user{flex-direction:row-reverse}.chat-avatar{width:28px;height:28px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:.7rem;flex-shrink:0}.chat-avatar.agent{background:#eef0ff}.chat-avatar.user{background:#e8f8f0}.chat-bubble{max-width:74%;width:fit-content!important;min-width:0!important;min-height:0!important;height:fit-content!important;padding:7px 11px!important;border-radius:10px;font-size:.82rem;line-height:1.5!important;word-break:break-word;flex-shrink:0;flex-grow:0}.chat-bubble p,.chat-bubble div{margin:0!important;padding:0!important;line-height:1.5!important;width:fit-content!important;min-width:0!important;min-height:0!important}.chat-bubble ul,.chat-bubble ol{margin:0!important;padding-left:16px!important;line-height:1.5!important}.chat-bubble li{margin:0!important;line-height:1.5!important}.chat-bubble.agent{background:var(--c-surface);border:1px solid var(--c-border);border-top-left-radius:3px}.chat-bubble.user{background:var(--c-primary);color:#fff;border-top-right-radius:3px}.chat-bubble pre{background:#1e293b;color:#e2e8f0;border-radius:8px;padding:8px;overflow-x:auto;margin:4px 0!important;font-size:.78rem;font-family:var(--font-mono)}.chat-bubble code{background:#f1f5f9;padding:1px 3px;border-radius:2px;font-size:.75em}.chat-bubble.user code{background:#fff3;color:#fff}.chat-bar{display:flex;gap:8px;padding:8px 0;border-top:1px solid var(--c-border-light)}.chat-bar .input{flex:1}.profile-avatar{width:72px;height:72px;border-radius:50%;background:linear-gradient(135deg,var(--c-primary),var(--c-profile-grad));display:flex;align-items:center;justify-content:center;font-size:2rem;color:#fff;margin:0 auto 12px}.profile-name{font-size:1.15rem;font-weight:700;text-align:center;margin-bottom:2px}.profile-role{font-size:.8rem;color:var(--c-text-secondary);text-align:center;margin-bottom:4px}.profile-id{font-size:.75rem;color:var(--c-text-muted);text-align:center}.stat-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px}.stat-row-2{display:grid;grid-template-columns:1fr 1fr;gap:10px}.stat-item{background:var(--c-primary-light);border-radius:var(--radius);padding:12px;text-align:center;transition:background .3s}.stat-item .val{font-size:1.5rem;font-weight:700;color:var(--c-primary)}.stat-item .lbl{font-size:.74rem;color:var(--c-text-muted);margin-top:2px}.settings-list{list-style:none}.settings-list li{display:flex;align-items:center;justify-content:space-between;padding:14px 0;border-bottom:1px solid var(--c-border-light);cursor:pointer;font-size:.88rem;transition:background .1s}.settings-list li:active{background:#f9fafb}.settings-list .item-left{display:flex;align-items:center;gap:12px}.settings-list .item-left .icon{font-size:1.1rem;width:24px;text-align:center}.settings-list .arrow{color:var(--c-text-muted);font-size:.8rem}.toggle-switch{position:relative;width:44px;height:26px;border-radius:13px;border:none;cursor:pointer;padding:0;flex-shrink:0;transition:background .18s}.toggle-switch .toggle-knob{position:absolute;top:3px;left:3px;width:20px;height:20px;border-radius:50%;background:#fff;box-shadow:0 1px 3px #00000040;transition:transform .18s}.toggle-switch.on .toggle-knob{transform:translate(18px)}.tag{display:inline-block;padding:3px 10px;border-radius:20px;font-size:.76rem;font-weight:500}.tag-blue{background:#eef0ff;color:var(--c-primary)}.tag-red{background:#fef0f0;color:var(--c-danger)}.tag-green{background:#ecfdf5;color:var(--c-success)}.inline-tabs{display:flex;gap:0;border-radius:var(--radius);overflow:hidden;border:1px solid var(--c-border)}.inline-tabs button{flex:1;padding:8px 16px;border:none;cursor:pointer;font-size:.82rem;font-weight:500;font-family:var(--font);background:#fff;color:var(--c-text-secondary);display:flex;align-items:center;justify-content:center;gap:4px}.inline-tabs button.active{background:var(--c-primary);color:#fff}.level-radio{flex:1;padding:14px 8px;text-align:center;border-radius:var(--radius);border:2px solid var(--c-border);cursor:pointer;transition:.15s;background:#fff;display:flex;flex-direction:column;align-items:center;gap:6px}.level-radio.selected{border-color:var(--c-primary);background:#eef0ff}.level-radio .icon{font-size:1.3rem;display:flex;align-items:center;justify-content:center;color:var(--c-text-secondary)}.level-radio.selected .icon{color:var(--c-primary)}.level-radio .txt{font-size:.8rem;font-weight:500}.progress-bar{height:6px;background:#e5e7eb;border-radius:3px;overflow:hidden}.progress-bar .fill{height:100%;border-radius:3px;background:linear-gradient(90deg,var(--c-primary),var(--c-profile-grad));transition:width .4s}.tl-row{display:flex;gap:12px}.tl-dot-col{display:flex;flex-direction:column;align-items:center;width:28px;flex-shrink:0}.tl-dot{width:24px;height:24px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:.68rem;font-weight:600;color:#fff;background:var(--c-text-muted)}.tl-dot.done{background:var(--c-success)}.tl-dot.current{background:var(--c-primary);box-shadow:0 0 0 4px #4f6ef726}.tl-line{width:2px;flex:1;min-height:20px;background:var(--c-border-light)}.tl-line.done{background:var(--c-success)}.chart-box{background:#fff;border-radius:var(--radius-lg);padding:14px;box-shadow:var(--shadow)}.modal-overlay{position:fixed;top:0;right:0;bottom:0;left:0;background:#000c;-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);display:flex;align-items:center;justify-content:center;z-index:200;padding:20px}.modal-card{background:#fff;border-radius:var(--radius-lg);padding:24px;width:100%;max-width:400px;max-height:80vh;overflow-y:auto}.modal-card h3{font-size:1rem;margin-bottom:16px;text-align:center}.toast-host{position:fixed;left:50%;transform:translate(-50%);bottom:calc(var(--tabbar-h) + var(--safe-bottom) + 14px);z-index:3000;display:flex;flex-direction:column;gap:8px;align-items:center;max-width:calc(100vw - 32px);pointer-events:none}.toast{display:flex;align-items:center;gap:8px;max-width:100%;padding:9px 14px;border-radius:10px;background:var(--c-surface);border:1px solid var(--c-border);border-left-width:3px;box-shadow:0 6px 20px #0000001f;font-size:.82rem;line-height:1.45;color:var(--c-text);cursor:pointer;pointer-events:auto;animation:toast-in .18s ease-out;word-break:break-word}.toast-badge{flex:none;width:16px;height:16px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:10px;font-weight:700;color:#fff;background:var(--c-primary)}.toast-success{border-left-color:var(--c-success)}.toast-success .toast-badge{background:var(--c-success)}.toast-error{border-left-color:var(--c-danger)}.toast-error .toast-badge{background:var(--c-danger)}.toast-warning{border-left-color:var(--c-warning)}.toast-warning .toast-badge{background:var(--c-warning)}.toast-info{border-left-color:var(--c-primary)}@keyframes toast-in{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}.page-loading{display:flex;align-items:center;justify-content:center;gap:6px;min-height:240px;color:var(--c-text-muted);font-size:.82rem}.page-loading-dot{width:6px;height:6px;border-radius:50%;background:var(--c-primary);opacity:.35;animation:page-loading-pulse 1s ease-in-out infinite}.page-loading-dot:nth-child(2){animation-delay:.15s}.page-loading-dot:nth-child(3){animation-delay:.3s}.page-loading-text{margin-left:6px}@keyframes page-loading-pulse{0%,to{opacity:.25;transform:translateY(0)}50%{opacity:1;transform:translateY(-3px)}}@media(prefers-reduced-motion:reduce){.page-loading-dot{animation:none}}.chat-toolbar{display:flex;justify-content:flex-end;align-items:center;padding:0 10px 2px;flex:0 0 auto}.chat-toolbar .btn{font-size:.74rem;height:28px;padding:0 10px}.page-error{display:flex;align-items:center;justify-content:center;min-height:320px;padding:24px 16px}.page-error-card{max-width:460px;width:100%;text-align:center;background:#fff;border:1px solid var(--c-border);border-radius:var(--radius-lg, 16px);padding:28px 22px}.page-error-emoji{font-size:2.4rem;line-height:1;margin-bottom:10px}.page-error-title{font-size:1rem;font-weight:600;color:var(--c-text);margin:0 0 8px}.page-error-desc{font-size:.82rem;line-height:1.6;color:var(--c-text-secondary);margin:0 0 16px}.page-error-detail{text-align:left;font-size:.7rem;line-height:1.5;color:var(--c-danger);background:#fef2f2;border-radius:8px;padding:8px 10px;margin:0 0 16px;max-height:120px;overflow:auto;white-space:pre-wrap;word-break:break-all}.page-error-actions{display:flex;gap:10px;justify-content:center}.offline-banner{background:#fef3c7;color:#92400e;text-align:center;padding:6px;font-size:.8rem}.login-page{display:flex;align-items:flex-start;justify-content:center;min-height:100vh;background:linear-gradient(135deg,var(--c-primary-light) 0%,var(--c-bg) 100%);padding:20px;transition:background .3s;overflow-y:auto}.login-card{width:100%;max-width:420px;background:#fff;border-radius:var(--radius-lg);box-shadow:0 16px 48px #0000001a;padding:32px 24px}.login-card h1{font-size:1.2rem;font-weight:700;text-align:center}.login-card .sub{text-align:center;color:var(--c-text-secondary);font-size:.78rem;margin:4px 0 24px}.dashboard{padding:0}.hero-card{background:linear-gradient(135deg,var(--c-primary) 0%,#6366F1 100%);border-radius:0 0 24px 24px;padding:24px 16px;margin-bottom:16px;color:#fff}.hero-content{display:flex;justify-content:space-between;align-items:flex-start}.hero-text h1{font-size:1.15rem;font-weight:700;margin-bottom:4px}.hero-subtitle{font-size:.8rem;opacity:.85}.hero-badge{display:flex;flex-direction:column;gap:6px;align-items:flex-end}.notif-bell{position:relative;width:38px;height:38px;border-radius:50%;border:1px solid rgba(255,255,255,.45);background:#ffffff38;cursor:pointer;font-size:17px;line-height:1;display:flex;align-items:center;justify-content:center;flex-shrink:0;transition:transform .15s ease,background .15s ease}.notif-bell:hover{transform:scale(1.1);background:#ffffff59}.notif-bell.active{background:#fff6}.notif-badge{position:absolute;top:-5px;right:-5px;min-width:17px;height:17px;border-radius:9px;background:var(--c-danger, #ef4444);color:#fff;font-size:10px;line-height:17px;padding:0 4px;font-weight:700;box-shadow:0 1px 4px #0003}.notif-item{display:flex;gap:10px;padding:10px 2px;border-bottom:1px solid var(--c-border-light);align-items:flex-start}.notif-item:last-child{border-bottom:none}.notif-icon{width:32px;height:32px;border-radius:50%;display:flex;align-items:center;justify-content:center;flex-shrink:0;font-size:15px}.badge-level{background:#fff3;padding:4px 10px;border-radius:12px;font-size:.72rem;font-weight:600}.badge-points{font-size:.76rem;opacity:.9}.stat-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-bottom:16px}.stat-card{background:var(--c-surface);border-radius:var(--radius-lg);padding:12px 8px;text-align:center;box-shadow:var(--shadow)}.stat-icon{font-size:1.25rem;margin-bottom:4px}.stat-value{font-size:1.25rem;font-weight:700;color:var(--c-text)}.stat-label{font-size:.74rem;color:var(--c-text-muted);margin-top:2px}.stat-blue .stat-value{color:#3b82f6}.stat-green .stat-value{color:#22c55e}.stat-purple .stat-value{color:#8b5cf6}.stat-orange .stat-value{color:#f97316}.main-content{display:flex;flex-direction:column;gap:12px}.panel{background:var(--c-surface);border-radius:var(--radius-lg);padding:14px;box-shadow:var(--shadow)}.panel.full-width{grid-column:1 / -1}.panel-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px;padding-bottom:8px;border-bottom:1px solid var(--c-border-light)}.panel-header h2{font-size:.88rem;font-weight:600}.chart-section{margin-bottom:12px}.today-study{display:flex;align-items:center;gap:24px;flex-wrap:wrap}.today-study-main{flex-shrink:0;min-width:180px}.today-duration{font-size:2rem;font-weight:800;color:var(--c-primary-dark);line-height:1.15;letter-spacing:-.5px}.today-duration-label{font-size:.74rem;color:var(--c-text-muted);margin-top:4px}.today-study-side{flex:1;min-width:200px}.week-bars{display:flex;align-items:flex-end;justify-content:space-between;gap:8px;margin-top:18px;padding-top:14px;border-top:1px solid var(--c-border-light)}.week-bar-col{flex:1;display:flex;flex-direction:column;align-items:center;gap:4px}.week-bar-val{font-size:.6rem;color:var(--c-text-muted);min-height:22px;white-space:normal;text-align:center;line-height:1.2;word-break:break-all}.week-bar{width:100%;max-width:34px;border-radius:4px 4px 0 0;transition:height .3s}.week-bar-day{font-size:.64rem;color:var(--c-text-secondary)}.kp-list{padding:6px 20px 16px;display:flex;flex-direction:column;gap:10px}.kp-row{display:flex;align-items:center;gap:10px}.kp-name{width:190px;flex-shrink:0;font-size:.8rem;display:flex;align-items:center;gap:6px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.kp-wrong{font-size:.62rem;color:#c97f7e;background:#e8908f1f;padding:1px 6px;border-radius:8px;flex-shrink:0}.kp-bar-wrap{flex:1;height:8px;border-radius:4px;background:var(--c-border-light);overflow:hidden}.kp-bar{height:100%;border-radius:4px;transition:width .4s}.kp-pct{width:40px;text-align:right;font-size:.74rem;font-weight:600;flex-shrink:0}@media(max-width:767px){.today-study{gap:14px}.today-duration{font-size:1.7rem}.kp-name{width:116px;font-size:.76rem}.kp-list{padding:4px 14px 14px;gap:8px}}.weak-tips{display:flex;align-items:center;gap:6px;padding:10px 12px;background:#fef3c7;border-radius:var(--radius);font-size:.8rem;color:#92400e}.tip-icon{font-size:.9rem}.action-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:8px}.action-card{background:linear-gradient(135deg,#f8fafc,#f1f5f9);border:1px solid var(--c-border-light);border-radius:var(--radius);padding:14px 12px;text-align:center;cursor:pointer;transition:all .15s;border:none}.action-card:hover{transform:translateY(-2px);box-shadow:0 4px 12px #00000014}.action-icon{font-size:1.5rem;margin-bottom:6px}.action-text{font-size:.84rem;font-weight:600;color:var(--c-text);margin-bottom:2px}.action-desc{font-size:.72rem;color:var(--c-text-muted)}.resource-list{display:flex;flex-direction:column;gap:8px}.resource-item{display:flex;align-items:center;gap:10px;padding:10px 0;border-bottom:1px solid var(--c-border-light);cursor:pointer;transition:background .1s}.resource-item:last-child{border-bottom:none}.resource-item:hover{background:#f9fafb}.resource-icon{font-size:1.1rem;width:32px;height:32px;display:flex;align-items:center;justify-content:center;background:#f1f5f9;border-radius:8px}.resource-info{flex:1;min-width:0}.resource-title{font-size:.84rem;font-weight:500;color:var(--c-text);margin-bottom:2px}.resource-meta{display:flex;align-items:center;gap:8px}.resource-date{font-size:.74rem;color:var(--c-text-muted)}.resource-arrow{color:var(--c-text-muted);font-size:.8rem}@keyframes spin{to{transform:rotate(360deg)}}.spinner{width:32px;height:32px;border:3px solid #E5E7EB;border-top-color:var(--c-primary);border-radius:50%;animation:spin 1s linear infinite}@media(min-width:768px){html,body{height:100%;overflow:hidden}body{background:var(--c-bg)}#root{width:100%;height:100vh;display:flex}.app-root{width:100%;height:100vh;max-width:none;box-shadow:none}.desktop-layout{display:grid;grid-template-columns:216px minmax(0,1fr);grid-template-rows:var(--header-h) minmax(0,1fr);grid-template-areas:"header header" "side main"}.desktop-layout .app-header{grid-area:header;justify-content:flex-start;padding:0 28px}.desktop-layout .app-header h1{font-size:1.1rem}.desktop-layout .app-tabbar{grid-area:side;position:static;height:auto;flex-direction:column;align-items:stretch;justify-content:flex-start;gap:4px;padding:14px 10px;border-top:none;border-right:1px solid var(--c-border-light);box-shadow:none}.desktop-layout .app-tabbar a,.desktop-layout .app-tabbar button{flex:none;flex-direction:row;justify-content:flex-start;gap:12px;height:44px;padding:0 16px;border-radius:10px;font-size:.92rem}.desktop-layout .app-tabbar .tab-icon{font-size:1.15rem}.desktop-layout .app-tabbar a.active,.desktop-layout .app-tabbar button.active{background:#ffffff47}.desktop-layout .app-body{grid-area:main;min-height:0;overflow-y:auto;overflow-x:hidden;padding:24px 28px}.desktop-layout .app-body>*:not(.modal-overlay){max-width:1080px;margin-left:auto;margin-right:auto}.desktop-layout .chat-msg{gap:12px;margin-bottom:12px;align-items:flex-start}.desktop-layout .chat-avatar{width:40px;height:40px;font-size:1rem}.desktop-layout .chat-bubble{max-width:72%;padding:8px 13px!important;font-size:.88rem;line-height:1.55!important}.desktop-layout .chat-bubble pre{font-size:.8rem;padding:10px}.desktop-layout .card{padding:20px;margin-bottom:16px;border-radius:12px}.desktop-layout .panel{padding:20px}.desktop-layout .main-content{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(0,1fr);gap:16px;align-items:start}.desktop-layout .hero-card{border-radius:16px}.desktop-layout .stat-grid{gap:14px}.desktop-layout .stat-card{padding:18px 14px}.desktop-layout .stat-value{font-size:1.5rem}.desktop-layout .action-grid{gap:14px}.desktop-layout .action-card{padding:22px 16px}.login-page{align-items:center}}@media(min-width:768px){.toast-host{left:auto;right:24px;bottom:auto;top:calc(var(--header-h) + 16px);transform:none;align-items:flex-end;max-width:380px}}
