*{margin:0;padding:0;box-sizing:border-box}
body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI','PingFang SC','Microsoft YaHei',sans-serif;background:#f5f6fa;color:#1e293b;line-height:1.6;font-size:14px;-webkit-font-smoothing:antialiased}
a{color:#6366f1;text-decoration:none}a:hover{text-decoration:underline}

/* Buttons */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;border:none;font-size:13px;padding:8px 18px;border-radius:8px;cursor:pointer;font-weight:600;transition:all .2s;font-family:inherit;white-space:nowrap}
.btn-p{background:#6366f1;color:#fff;box-shadow:0 1px 2px rgba(99,102,241,.2)}.btn-p:hover{background:#5558e6;box-shadow:0 2px 8px rgba(99,102,241,.3)}
.btn-o{background:#fff;color:#6366f1;border:1px solid #e2e8f0}.btn-o:hover{background:#f8f7ff;border-color:#6366f1}
.btn-d{color:#ef4444;background:#fff;border:1px solid #fecaca}.btn-d:hover{background:#fef2f2}
.btn-sm{padding:5px 12px;font-size:12px;border-radius:6px}
.btn-lg{padding:10px 24px;font-size:14px;border-radius:10px}
.btn-ghost{background:transparent;color:#64748b}.btn-ghost:hover{background:#f1f5f9;color:#1e293b}

/* Inputs */
input,textarea,select{width:100%;padding:9px 13px;border:1px solid #e2e8f0;border-radius:8px;font-size:13px;background:#fff;color:#1e293b;font-family:inherit;transition:all .15s}
input:focus,textarea:focus,select:focus{outline:none;border-color:#6366f1;box-shadow:0 0 0 3px rgba(99,102,241,.1)}
textarea{resize:vertical;min-height:90px}
select{-webkit-appearance:none;appearance:none;background:#fff url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M6 8L1 3h10z' fill='%2394a3b8'/></svg>") no-repeat right 10px center;padding-right:32px}

/* Layout */
.layout{display:flex;height:100vh;overflow:hidden}
.sidebar{width:220px;min-width:220px;background:#fff;border-right:1px solid #edf0f5;display:flex;flex-direction:column;z-index:10;overflow-y:auto}
.sidebar-logo{padding:20px 18px 14px;font-size:16px;font-weight:700;color:#6366f1;display:flex;align-items:center;gap:8px;letter-spacing:-.01em}
.sidebar-nav{flex:1;padding:8px 0}
.sidebar-nav a{display:flex;align-items:center;gap:10px;padding:9px 18px;margin:1px 8px;color:#64748b;font-size:13px;font-weight:500;transition:all .15s;border-radius:8px;text-decoration:none}
.sidebar-nav a:hover{background:#f1f5f9;color:#1e293b;text-decoration:none}
.sidebar-nav a.active{background:#eef2ff;color:#6366f1;font-weight:600}
.sidebar-nav a span{font-size:17px;width:22px;text-align:center;flex-shrink:0}
.sidebar-user{margin:8px;padding:10px 12px;border-radius:8px;background:#f8fafc;display:flex;align-items:center;gap:8px;font-size:12px;color:#64748b}
.sidebar-user .avatar{width:28px;height:28px;border-radius:7px;background:linear-gradient(135deg,#6366f1,#8b5cf6);color:#fff;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:12px;flex-shrink:0}

.main-container{flex:1;overflow-y:auto;background:#f5f6fa;height:100vh}
.main{max-width:820px;margin:0 auto;padding:24px 32px 40px;}

/* Login page */
.login-page{min-height:100vh;display:flex;align-items:center;justify-content:center;background:linear-gradient(160deg,#f5f6fa 0%,#eef2ff 50%,#ede9fe 100%);padding:32px}
.login-card{background:#fff;border-radius:16px;padding:36px 32px;width:100%;max-width:380px;box-shadow:0 1px 3px rgba(0,0,0,.04),0 8px 24px rgba(0,0,0,.06)}
.login-card h2{font-size:20px;font-weight:700;color:#1e293b;text-align:center;margin-bottom:2px}
.login-card .subtitle{text-align:center;color:#94a3b8;font-size:13px;margin-bottom:20px}

/* Cards */
.card{background:#fff;border-radius:10px;padding:16px;margin-bottom:10px;box-shadow:0 1px 3px rgba(0,0,0,.05);border:1px solid #e5e7eb}
.card-flat{background:#fff;border-radius:10px;padding:16px;margin-bottom:10px;border:1px solid #edf0f5}

/* Page header */
.ph{margin-bottom:18px}.ph h1{font-size:20px;font-weight:700;letter-spacing:-.01em}.ph p{color:#94a3b8;font-size:13px;margin-top:2px}

/* Form group */
.fg{margin-bottom:12px}.fg label{display:block;margin-bottom:4px;font-weight:600;font-size:12px;color:#64748b}

/* Tags */
.tag{display:inline-flex;align-items:center;padding:2px 8px;border-radius:5px;font-size:11px;font-weight:600;line-height:1.5}
.tag-p{background:#eef2ff;color:#6366f1}.tag-s{background:#ecfdf5;color:#059669}.tag-w{background:#fffbeb;color:#d97706}

/* Calendar */
.calendar{display:grid;grid-template-columns:repeat(7,1fr);gap:2px;text-align:center;padding:4px}
.day-header{font-size:10px;color:#94a3b8;padding:6px 0;font-weight:500;text-transform:uppercase}
.day{aspect-ratio:1;display:flex;align-items:center;justify-content:center;border-radius:6px;font-size:12px;cursor:pointer;position:relative;font-weight:500;color:#475569;max-width:34px;max-height:34px;transition:all .12s}
.day:hover{background:#f1f5f9}
.day.today{background:#6366f1;color:#fff;font-weight:600}
.day.has-report::after{content:'';position:absolute;bottom:2px;width:4px;height:4px;border-radius:50%;background:#10b981}
.day.today.has-report::after{background:#fff}
.day.other-month{color:#cbd5e1}

/* Tables */
table{width:100%;border-collapse:collapse}
th,td{padding:10px 12px;text-align:left;border-bottom:1px solid #edf0f5;font-size:13px}
th{font-weight:600;color:#64748b;font-size:11px;text-transform:uppercase;letter-spacing:.03em}
tbody tr{transition:background .1s}tbody tr:hover{background:#f8fafc}

/* Grid */
.g2{display:grid;grid-template-columns:1fr 1fr;gap:12px}.g3{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}

/* Toast */
.toast-c{position:fixed;top:16px;right:16px;z-index:9999;display:flex;flex-direction:column;gap:6px;pointer-events:none}
.toast{padding:10px 16px;border-radius:8px;box-shadow:0 4px 16px rgba(0,0,0,.1);font-size:13px;font-weight:500;color:#fff;pointer-events:auto;animation:si .25s ease}
.toast-s{background:#10b981}.toast-e{background:#ef4444}.toast-i{background:#6366f1}
@keyframes si{from{transform:translateX(30px);opacity:0}to{transform:none;opacity:1}}

/* Empty */
.empty{text-align:center;padding:60px 20px;color:#94a3b8}.empty .icon{font-size:40px;margin-bottom:8px;opacity:.4}

/* Spinner */
.sp{display:inline-block;width:16px;height:16px;border:2px solid #e2e8f0;border-top-color:#6366f1;border-radius:50%;animation:sp .7s linear infinite}@keyframes sp{to{transform:rotate(360deg)}}

/* Modal */
.modal-overlay{position:fixed;inset:0;background:rgba(15,23,42,.3);z-index:100;display:flex;align-items:center;justify-content:center;animation:mo .15s}
.modal-box,.modal-sheet{background:#fff;border-radius:14px;box-shadow:0 20px 60px rgba(0,0,0,.12);max-width:460px;width:90%;max-height:80vh;overflow-y:auto;padding:22px;animation:su .2s ease}
@keyframes mo{from{opacity:0}}@keyframes su{from{transform:scale(.96);opacity:0}}

/* Topbar */
.topbar{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px;padding-bottom:12px;border-bottom:1px solid #edf0f5}
.topbar h2{font-size:18px;font-weight:700;letter-spacing:-.01em}
.topbar select{width:auto;font-size:12px;padding:6px 32px 6px 10px;border-radius:6px;border:1px solid #e2e8f0;background:#f8fafc}

/* Chat */
.chat-wrap{display:flex;flex-direction:column;height:calc(100vh - 200px)}
.chat-ms{flex:1;overflow-y:auto;padding:8px 0;display:flex;flex-direction:column;gap:8px}
.cm{display:flex;gap:8px;max-width:78%}.cm.u{align-self:flex-end;flex-direction:row-reverse}.cm.a{align-self:flex-start}
.ca{width:28px;height:28px;border-radius:7px;display:flex;align-items:center;justify-content:center;font-size:14px;flex-shrink:0}
.cm.u .ca{background:#6366f1;color:#fff}.cm.a .ca{background:#f1f5f9}
.cb{padding:9px 12px;border-radius:12px;font-size:13px;line-height:1.6;word-break:break-word}
.cm.u .cb{background:#6366f1;color:#fff;border-bottom-right-radius:4px}
.cm.a .cb{background:#f1f5f9;border-bottom-left-radius:4px}
.ci{display:flex;gap:8px;padding:10px 0;border-top:1px solid #edf0f5}
.ci input{flex:1;border-radius:20px;padding:9px 16px;background:#f8fafc;border:1px solid #e2e8f0}
.ci button{width:38px;height:38px;border-radius:50%;background:#6366f1;color:#fff;border:none;font-size:16px;cursor:pointer;flex-shrink:0;display:flex;align-items:center;justify-content:center}

/* Result box */
.result-box{max-height:55vh;overflow-y:auto;font-size:13px;line-height:1.8}
.result-box h1,.result-box h2,.result-box h3{font-size:14px;margin:10px 0 6px;font-weight:700}
.result-box ul,.result-box ol{padding-left:18px;margin:6px 0}
.result-box pre{background:#1e293b;color:#e2e8f0;padding:12px;border-radius:8px;overflow-x:auto;margin:8px 0;font-size:12px}

/* Session list */
.session-item{display:flex;justify-content:space-between;align-items:center;padding:10px 0;border-bottom:1px solid #edf0f5;cursor:pointer;transition:all .1s}
.session-item:hover{background:#f8fafc;margin:0 -8px;padding-left:8px;padding-right:8px;border-radius:6px}

/* Voice panel */
.voice-panel{background:linear-gradient(135deg,#6366f1,#8b5cf6);color:#fff;border-radius:12px;padding:22px;margin-bottom:12px;text-align:center}
.voice-panel button{background:rgba(255,255,255,.15);color:#fff;border:1px solid rgba(255,255,255,.2);border-radius:20px;padding:8px 24px;font-size:13px;cursor:pointer;transition:all .15s}
.voice-panel button:hover{background:rgba(255,255,255,.25)}
