:root {
  --ink: #071a21;
  --panel: #0b242c;
  --panel-2: #10313a;
  --paper: #f3f7f6;
  --white: #ffffff;
  --mist: #dce9e7;
  --muted: #6f8587;
  --cyan: #64d7d0;
  --green: #9ce2ad;
  --gold: #c9a867;
  --line: rgba(155, 205, 204, .19);
  --shadow: 0 28px 80px rgba(2, 22, 27, .18);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--ink);
  color: var(--ink);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, textarea { font: inherit; }
button { color: inherit; }

.shell { display: grid; grid-template-columns: 278px minmax(0, 1fr); min-height: 100dvh; }
.rail {
  position: relative; display: flex; flex-direction: column; padding: 28px 22px 20px;
  color: #eaf7f5; background:
    radial-gradient(circle at 20% 4%, rgba(100,215,208,.15), transparent 23%),
    linear-gradient(160deg, #0b252d, #06171d 75%);
  border-right: 1px solid var(--line);
}
.rail::after { content: ""; position: absolute; inset: auto 0 17% 0; height: 1px; background: linear-gradient(90deg, transparent, var(--line), transparent); }
.brand { display: flex; align-items: center; gap: 13px; margin-bottom: 32px; }
.brand-mark { width: 38px; height: 38px; flex: 0 0 38px; display: block; position: relative; overflow: hidden; border: 1px solid rgba(100,215,208,.38); border-radius: 50%; }
.brand-mark i { position: absolute; left: 50%; bottom: 8px; width: 4px; height: 15px; margin-left: -2px; border-radius: 10px; background: var(--cyan); transform-origin: 50% 100%; }
.brand-mark i:nth-child(1) { transform: rotate(-42deg); }
.brand-mark i:nth-child(2) { transform: rotate(0); }
.brand-mark i:nth-child(3) { transform: rotate(42deg); }
.brand strong { display: block; font-size: 16px; letter-spacing: .06em; }
.brand span { display: block; margin-top: 3px; color: #92aaa9; font-size: 11px; }
.new-chat { width: 100%; border: 1px solid rgba(100,215,208,.28); border-radius: 8px; padding: 12px 14px; text-align: left; color: #eafffc; background: rgba(100,215,208,.08); cursor: pointer; }
.new-chat span { display: inline-block; margin-right: 9px; color: var(--cyan); font-size: 18px; }
.quota-card { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 13px; border: 1px solid rgba(201,168,103,.22); border-radius: 10px; background: linear-gradient(120deg, rgba(201,168,103,.09), rgba(100,215,208,.035)); }
.quota-ring { --quota-degree: 0deg; position: relative; flex: none; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--gold) var(--quota-degree), rgba(255,255,255,.09) 0); color: white; font-size: 14px; font-weight: 650; }
.quota-ring::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: #0a2027; }
.quota-ring span { position: relative; z-index: 1; }
.quota-card strong, .quota-card small { display: block; }
.quota-card strong { color: #dceae8; font-size: 11px; font-weight: 500; }
.quota-card small { margin-top: 5px; color: #779293; font-size: 10px; }
.history-section { min-height: 0; margin-top: 24px; }
.history-head { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 8px 10px; }
.history-head p { margin: 0; color: #708e90; font-size: 11px; letter-spacing: .12em; }
.history-head button { width: 25px; height: 25px; border: 0; border-radius: 50%; color: #779798; background: transparent; cursor: pointer; }
.history-head button:hover { color: white; background: rgba(255,255,255,.07); }
.history-list { max-height: min(31vh, 280px); overflow-y: auto; padding-right: 2px; scrollbar-width: thin; scrollbar-color: rgba(100,215,208,.26) transparent; }
.history-list > small { display: block; padding: 10px; color: #688486; font-size: 10px; line-height: 1.5; }
.history-item { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 5px; margin-bottom: 3px; padding: 8px 7px 8px 10px; border-radius: 7px; }
.history-item.active { background: rgba(100,215,208,.10); box-shadow: inset 2px 0 var(--cyan); }
.history-open { min-width: 0; padding: 0; border: 0; color: #b8cccb; background: transparent; text-align: left; cursor: pointer; }
.history-open strong, .history-open small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-open strong { font-size: 12px; font-weight: 500; }
.history-open small { margin-top: 4px; color: #668486; font-size: 9px; }
.history-actions { display: flex; gap: 2px; opacity: .35; transition: opacity .2s; }
.history-item:hover .history-actions, .history-item:focus-within .history-actions { opacity: 1; }
.history-actions button { width: 25px; height: 25px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 5px; color: #8ba5a4; background: transparent; cursor: pointer; font-size: 12px; }
.history-actions button:hover { color: white; background: rgba(255,255,255,.08); }
.rail-section { margin-top: 30px; }
.rail-section p { margin: 0 0 10px 10px; color: #708e90; font-size: 11px; letter-spacing: .12em; }
.preset { cursor: pointer; }
.rail-section button { display: block; width: 100%; border: 0; border-radius: 7px; padding: 11px 10px; color: #b9cbca; background: transparent; text-align: left; font-size: 13px; }
.rail-section button:hover, .rail-section button:focus-visible { background: rgba(255,255,255,.06); color: white; outline: none; }
.rail-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 15px 10px 4px; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(156,226,173,.10); }
.rail-foot strong, .rail-foot small { display: block; }
.rail-foot strong { font-size: 12px; font-weight: 500; }
.rail-foot small { margin-top: 3px; color: #718f90; font-size: 10px; }

.workspace { min-width: 0; min-height: 100dvh; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: var(--paper); }
.topbar { height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 0 30px; border-bottom: 1px solid #d9e5e3; background: rgba(243,247,246,.91); backdrop-filter: blur(16px); z-index: 3; }
.context span, .context small { display: block; }
.context span { font-size: 13px; font-weight: 600; letter-spacing: .05em; }
.context small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.context small b { display: inline-block; width: 5px; height: 5px; margin-right: 5px; border-radius: 50%; background: #36b56b; vertical-align: 1px; }
.icon-btn { display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.icon-btn:hover { background: #e2ecea; }
.icon-btn svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.menu-btn { display: none; }
.top-actions { position: relative; display: flex; align-items: center; gap: 9px; }
.account-chip { display: flex; align-items: center; gap: 9px; min-width: 150px; padding: 5px 10px 5px 5px; border: 1px solid #d2dfdd; border-radius: 24px; background: rgba(255,255,255,.7); cursor: pointer; text-align: left; }
.account-avatar { width: 31px; height: 31px; flex: 0 0 31px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; color: #dffaf6; background: linear-gradient(145deg, #0b3037, #176a68); font-size: 12px; line-height: 1; box-shadow: inset 0 0 0 1px rgba(255,255,255,.16); }
.account-chip strong, .account-chip small { display: block; max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-chip strong { font-size: 11px; }
.account-chip small { margin-top: 2px; color: #7a9090; font-size: 9px; }
.account-menu { position: absolute; right: 0; top: calc(100% + 9px); min-width: 180px; padding: 6px; border: 1px solid #d4e1df; border-radius: 10px; background: white; box-shadow: 0 18px 50px rgba(6,31,37,.16); }
.account-menu button { display: block; width: 100%; padding: 10px; border: 0; border-radius: 6px; background: transparent; text-align: left; font-size: 12px; cursor: pointer; }
.account-menu button:hover { background: #edf5f4; }

.conversation { position: relative; min-height: 0; overflow-y: auto; padding: 42px clamp(22px, 5vw, 76px) 34px; scroll-behavior: smooth; }
.conversation::before { content: ""; position: fixed; right: -8vw; top: 18vh; width: 38vw; height: 38vw; border-radius: 50%; background: radial-gradient(circle, rgba(100,215,208,.11), transparent 67%); pointer-events: none; }
.welcome { max-width: 880px; margin: clamp(20px, 6vh, 82px) auto 0; }
.signal { display: flex; align-items: end; gap: 4px; width: 38px; height: 25px; margin-bottom: 25px; }
.signal span { width: 3px; border-radius: 3px; background: #279e9a; animation: pulse 1.9s ease-in-out infinite; }
.signal span:nth-child(1) { height: 8px; animation-delay: -.3s; }
.signal span:nth-child(2) { height: 19px; animation-delay: -.6s; }
.signal span:nth-child(3) { height: 13px; animation-delay: -.9s; }
.signal span:nth-child(4) { height: 23px; animation-delay: -1.2s; }
@keyframes pulse { 50% { height: 7px; opacity: .45; } }
.welcome-kicker { margin: 0 0 15px; color: #23877f; font-size: 13px; letter-spacing: .12em; }
.welcome h1 { max-width: 720px; margin: 0; font-size: clamp(38px, 5.2vw, 72px); line-height: 1.12; letter-spacing: -.055em; font-weight: 650; }
.welcome-copy { max-width: 590px; margin: 24px 0 36px; color: #607679; font-size: 15px; line-height: 1.8; }
.starter-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; max-width: 850px; background: #cadad8; border: 1px solid #cadad8; }
.starter { min-height: 108px; padding: 18px; border: 0; background: rgba(255,255,255,.72); text-align: left; font-size: 13px; line-height: 1.55; }
.starter:hover { background: white; }
.starter span { display: block; margin-bottom: 14px; color: #31877f; font-size: 10px; letter-spacing: .1em; }
.messages { width: min(880px, 100%); margin: 0 auto; }
.message { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 15px; margin: 0 0 30px; }
.message.user { grid-template-columns: minmax(0, 1fr); justify-items: end; }
.avatar { width: 38px; height: 38px; align-self: start; display: grid; place-items: center; overflow: hidden; border-radius: 50%; color: var(--cyan); background: var(--panel); font-size: 11px; line-height: 1; }
.bubble { max-width: 760px; color: #233b40; font-size: 15px; line-height: 1.8; }
.user .bubble { max-width: 680px; padding: 13px 17px; border-radius: 16px 16px 4px 16px; color: white; background: var(--panel); box-shadow: 0 10px 30px rgba(8,36,44,.12); }
.bubble p { margin: 0 0 12px; }
.bubble p:last-child { margin-bottom: 0; }
.bubble ul, .bubble ol { padding-left: 1.4em; }
.bubble img { display: block; max-width: min(360px, 100%); max-height: 320px; margin: 8px 0; border-radius: 10px; object-fit: contain; }
.message-meta { margin-top: 10px; color: #809394; font-size: 10px; }
.broadcast-btn{display:inline-flex;align-items:center;gap:7px;margin-left:10px;padding:6px 10px;border:1px solid #c7dcda;border-radius:999px;color:#397a76;background:rgba(255,255,255,.72);font-size:10px;cursor:pointer}.broadcast-btn i{width:12px;height:12px;border-radius:50%;background:radial-gradient(circle at center,#4fb4ad 0 2px,transparent 3px),conic-gradient(from 90deg,#4fb4ad,transparent,#4fb4ad)}.broadcast-btn.speaking{color:#fff;border-color:#176e6a;background:#176e6a}.broadcast-btn.speaking i{border-radius:1px;background:linear-gradient(90deg,#fff 0 3px,transparent 3px 5px,#fff 5px 8px,transparent 8px 10px,#fff 10px)}
.thinking { display: inline-flex; align-items: center; gap: 7px; color: #617778; }
.thinking i { width: 5px; height: 5px; border-radius: 50%; background: #3eaaa1; animation: dots 1.2s infinite; }
.thinking i:nth-child(2) { animation-delay: .15s; }
.thinking i:nth-child(3) { animation-delay: .3s; }
@keyframes dots { 50% { transform: translateY(-4px); opacity: .4; } }
.source-panel { margin-top: 17px; border-left: 2px solid #55bdb4; padding: 6px 0 6px 13px; color: #6c8081; font-size: 12px; line-height: 1.55; }
.error-bubble { color: #8a3f38; }

.composer-wrap { position: relative; padding: 12px clamp(20px, 5vw, 76px) calc(15px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, rgba(243,247,246,.15), #f3f7f6 24%); z-index: 4; }
.composer { display: flex; align-items: flex-end; gap: 10px; width: min(880px, 100%); margin: 0 auto; padding: 9px 10px; border: 1px solid #c9d9d7; border-radius: 14px; background: white; box-shadow: var(--shadow); }
.composer:focus-within { border-color: #62bdb6; box-shadow: 0 0 0 3px rgba(100,215,208,.14), var(--shadow); }
.composer.file-dragging{position:relative;border-color:#35aaa2;background:#eefaf8;box-shadow:0 0 0 4px rgba(53,170,162,.14),var(--shadow)}.composer.file-dragging::after{content:"释放文件，加入本轮问答";position:absolute;inset:4px;z-index:5;display:grid;place-items:center;border:1px dashed #35aaa2;border-radius:10px;color:#176e6a;background:rgba(238,250,248,.94);font-size:13px;font-weight:600;pointer-events:none}
.composer textarea { flex: 1; min-height: 40px; max-height: 150px; resize: none; border: 0; outline: 0; padding: 9px 4px 7px; color: #153036; background: transparent; line-height: 1.55; }
.composer textarea::placeholder { color: #93a5a5; }
.attach-btn, .voice-btn, .send-btn { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; cursor: pointer; }
.attach-btn { color: #547174; background: #edf4f3; }
.attach-btn svg, .voice-btn svg, .send-btn svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.voice-btn { position:relative;border:0;color:#347a77;background:#e7f3f1;touch-action:none;user-select:none;-webkit-user-select:none }.voice-btn.recording{color:white;background:#d64f4f;box-shadow:0 0 0 6px rgba(214,79,79,.13);animation:voicePulse 1.2s ease-in-out infinite}.voice-btn.unsupported{opacity:.45}.voice-status{display:flex;align-items:center;gap:9px;width:min(880px,100%);margin:8px auto 0;padding:9px 13px;border:1px solid rgba(214,79,79,.18);border-radius:10px;color:#753f3f;background:#fff7f6;font-size:11px}.voice-status[hidden]{display:none}.voice-status i{width:8px;height:8px;flex:none;border-radius:50%;background:#df5656;box-shadow:0 0 0 5px rgba(223,86,86,.1);animation:voicePulse 1.2s infinite}.voice-status span{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.voice-status b{color:#a47b76;font-size:9px;font-weight:500}@keyframes voicePulse{50%{transform:scale(.94);opacity:.72}}
.send-btn { border: 0; color: #eafffc; background: var(--panel); }
.send-btn:disabled { opacity: .45; cursor: wait; }
.composer-note { margin: 9px auto 0; color: #8a9a9a; text-align: center; font-size: 10px; }
.attachment-preview { width: min(880px, 100%); margin: 0 auto 8px; display:flex;flex-wrap:wrap;gap:6px }
.attachment-chip { display: inline-flex; align-items: center; gap: 9px; padding: 7px 9px; border: 1px solid #cadbd8; border-radius: 9px; background: white; font-size: 11px; }
.attachment-chip img { width: 30px; height: 30px; border-radius: 5px; object-fit: cover; }
.attachment-chip.document>b{display:grid;place-items:center;width:30px;height:30px;border-radius:5px;color:#e8fbf8;background:#176e6a;font-size:8px;letter-spacing:.05em}.message-file{display:block;margin:0 0 8px;padding:7px 10px;border-radius:7px;color:#dff8f5;background:rgba(255,255,255,.1);font-size:11px}
.attachment-chip button { border: 0; color: #6f8384; background: transparent; cursor: pointer; }
.scrim { display: none; }

.auth-gate { position: fixed; inset: 0; z-index: 50; display: grid; grid-template-columns: 1.08fr .92fr; color: white; background: #06191f; }
.auth-gate[hidden], .modal[hidden], .toast[hidden] { display: none; }
.auth-visual { position: relative; display: flex; flex-direction: column; justify-content: center; overflow: hidden; padding: clamp(44px, 8vw, 120px); background: radial-gradient(circle at 18% 25%, rgba(89,212,201,.22), transparent 30%), linear-gradient(145deg, #0c3038, #06181e 70%); }
.auth-visual::after { content: ""; position: absolute; width: 70vh; height: 70vh; right: -20vh; bottom: -34vh; border: 1px solid rgba(134,224,216,.18); border-radius: 50%; box-shadow: 0 0 0 70px rgba(134,224,216,.025), 0 0 0 140px rgba(134,224,216,.018); }
.auth-seal { width: 58px; height: 58px; display: grid; place-items: center; border: 1px solid rgba(116,222,214,.45); border-radius: 50%; color: var(--cyan); font-size: 23px; }
.auth-visual p { margin: 35px 0 15px; color: #83aba9; font-size: 13px; letter-spacing: .18em; }
.auth-visual h2 { position: relative; z-index: 1; margin: 0; max-width: 580px; font-size: clamp(46px, 6vw, 86px); line-height: 1.1; letter-spacing: -.055em; font-weight: 620; }
.auth-lines { display: flex; gap: 6px; margin-top: 46px; }
.auth-lines i { width: 52px; height: 2px; background: var(--cyan); opacity: .75; }
.auth-lines i:nth-child(2) { width: 18px; background: var(--gold); }
.auth-lines i:nth-child(3) { width: 7px; opacity: .35; }
.login-panel { display: flex; flex-direction: column; justify-content: center; width: min(430px, calc(100% - 60px)); margin: auto; color: #0e2b32; }
.login-heading span, .admin-panel header span { color: #3a8f88; font-size: 11px; letter-spacing: .12em; }
.login-heading h1 { margin: 13px 0 9px; font-size: 31px; letter-spacing: -.035em; }
.login-heading p { margin: 0 0 36px; color: #718687; font-size: 13px; }
.login-panel label, .create-user label { display: grid; gap: 8px; margin-bottom: 17px; color: #607778; font-size: 11px; }
.login-panel input, .create-user input, .limit-field input { width: 100%; border: 1px solid #c8d8d6; border-radius: 8px; padding: 12px 13px; outline: 0; color: #143138; background: rgba(255,255,255,.88); }
.login-panel input:focus, .create-user input:focus, .limit-field input:focus { border-color: #4bb8ae; box-shadow: 0 0 0 3px rgba(75,184,174,.11); }
.primary-action { border: 0; border-radius: 8px; padding: 13px 18px; color: #effffb; background: linear-gradient(110deg, #0b3138, #176e6a); box-shadow: 0 12px 30px rgba(9,62,64,.18); cursor: pointer; }
.primary-action.compact { padding: 10px 18px; }
.primary-action:disabled { opacity: .5; }
.form-error { min-height: 18px; margin: 0 0 8px; color: #aa4f48; font-size: 11px; }
.login-note { margin-top: 22px; color: #8b9d9d; text-align: center; font-size: 10px; }

.modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 24px; }
.modal-backdrop { position: absolute; inset: 0; z-index: 0; background: rgba(4,22,27,.62); backdrop-filter: blur(7px); }
.admin-panel { position: relative; z-index: 1; width: min(1040px, 96vw); max-height: 90vh; overflow: hidden; border: 1px solid rgba(255,255,255,.55); border-radius: 18px; background: #f5f8f7; box-shadow: 0 35px 100px rgba(1,17,21,.35); }
.admin-panel header { display: flex; justify-content: space-between; align-items: center; padding: 24px 28px; border-bottom: 1px solid #d7e3e1; background: rgba(255,255,255,.72); }
.admin-panel header h2 { margin: 5px 0 0; font-size: 24px; }
.modal-close { width: 38px; height: 38px; border: 0; border-radius: 50%; background: #e8f0ef; color: #587172; font-size: 22px; cursor: pointer; }
.admin-body { max-height: calc(90vh - 90px); overflow: auto; padding: 25px 28px 32px; }
.create-user { padding: 22px; border: 1px solid #d7e3e1; border-radius: 12px; background: white; }
.create-user h3, .user-list-head h3 { margin: 0 0 17px; font-size: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1.1fr 1.2fr .65fr; gap: 13px; }
.create-user label { margin: 0; }
.form-row { display: flex; justify-content: flex-end; align-items: end; gap: 20px; margin-top: 15px; }
.form-row .form-error { flex: 1; margin: 0; }
.user-list-head { display: flex; align-items: center; justify-content: space-between; margin: 28px 3px 12px; }
.user-list-head h3 { margin: 0; }
.user-list-head span { color: #789090; font-size: 11px; }
.user-list { display: grid; gap: 1px; overflow: hidden; border: 1px solid #d7e3e1; border-radius: 12px; background: #d7e3e1; }
.user-row { display: grid; grid-template-columns: minmax(170px,1.2fr) minmax(140px,1fr) 96px 86px 62px 50px; align-items: center; gap: 13px; padding: 15px 18px; background: white; }
.user-identity { display: flex; align-items: center; gap: 11px; min-width: 0; }
.user-identity > span { width: 36px; height: 36px; display: grid; place-items: center; flex: none; border-radius: 50%; color: #dff9f5; background: #123a41; font-size: 12px; }
.user-identity strong, .user-identity small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-identity strong { font-size: 12px; }
.user-identity small { margin-top: 4px; color: #819393; font-size: 9px; }
.usage-track > div { display: flex; justify-content: space-between; color: #75898a; font-size: 9px; }
.usage-track b { color: #3f5f61; font-weight: 600; }
.usage-track > i { display: block; height: 4px; margin-top: 7px; border-radius: 4px; background: #e2ebea; overflow: hidden; }
.usage-track em { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #42b5ac, var(--gold)); }
.limit-field { display: grid; gap: 4px; color: #7a9091; font-size: 9px; }
.limit-field input { padding: 7px 8px; }
.switch { display: flex; align-items: center; gap: 6px; color: #6f8384; font-size: 9px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch i { position: relative; width: 30px; height: 17px; border-radius: 20px; background: #bdccca; }
.switch i::after { content: ""; position: absolute; width: 13px; height: 13px; left: 2px; top: 2px; border-radius: 50%; background: white; transition: transform .2s; }
.switch input:checked + i { background: #45a99f; }
.switch input:checked + i::after { transform: translateX(13px); }
.save-user, .reset-password { padding: 7px 7px; border: 1px solid #cad9d7; border-radius: 6px; background: white; font-size: 9px; cursor: pointer; white-space: nowrap; }
.reset-password { color: #6c7f7f; background: #f3f7f6; }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 80; transform: translateX(-50%); padding: 10px 16px; border-radius: 8px; color: #eafffb; background: #0b2d34; box-shadow: 0 12px 40px rgba(0,0,0,.2); font-size: 12px; }
.command-panel { position: relative; z-index: 1; width: min(1220px, 96vw); max-height: 94vh; overflow: hidden; border: 1px solid rgba(104,217,255,.25); border-radius: 18px; color: #dff7f5; background: #071b22; box-shadow: 0 35px 110px rgba(0,0,0,.55); }
.command-panel > header { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 20px; padding: 21px 26px; border-bottom: 1px solid rgba(100,215,208,.16); background: linear-gradient(90deg, rgba(100,215,208,.09), transparent); }
.command-panel header span { color: #68bdb9; font-size: 9px; letter-spacing: .16em; }.command-panel header h2 { margin: 4px 0 0; font-size: 23px; }
.command-live { color: #85c9c5; font-size: 10px; }.command-live i { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: #72eda0; box-shadow: 0 0 10px #72eda0; }
.command-panel .modal-close { color: #b8d1d0; background: rgba(255,255,255,.06); }.command-body { max-height: calc(94vh - 82px); overflow: auto; padding: 22px 25px 30px; }
.command-loading,.command-error{grid-column:1/-1;min-height:126px;display:flex;align-items:center;justify-content:center;border:1px solid rgba(104,217,255,.14);border-radius:14px;background:rgba(7,38,47,.72);color:#94c7c5;letter-spacing:.08em}.command-error{flex-direction:column;gap:8px;color:#f1b7a9}.command-error strong{font-size:16px;color:#ffe3dc}.command-error span{max-width:680px;text-align:center;letter-spacing:0}.command-error button{margin-top:4px;padding:8px 16px;border:1px solid rgba(104,217,255,.32);border-radius:999px;background:rgba(104,217,255,.08);color:#c8f5f1;cursor:pointer}
.metric-grid { display: grid; grid-template-columns: repeat(6,1fr); gap: 10px; }.metric { padding: 16px; border: 1px solid rgba(100,215,208,.14); border-radius: 10px; background: linear-gradient(145deg, rgba(19,61,69,.72), rgba(8,31,38,.82)); }.metric span,.metric small { display:block;color:#789c9d;font-size:9px }.metric strong { display:block;margin:8px 0 5px;color:#eafffb;font-size:25px;font-weight:560 }.metric em { color:#6fd5ce;font-size:10px;font-style:normal }
.command-grid { display:grid;grid-template-columns:1.55fr 1fr 1fr 1fr;gap:10px;margin-top:10px }.data-card { min-height:260px;padding:17px;border:1px solid rgba(100,215,208,.13);border-radius:10px;background:rgba(9,35,43,.8) }.data-card > header { display:flex;justify-content:space-between;align-items:center }.data-card h3,.upload-center h3 { margin:0;font-size:13px }.data-card header span { color:#6d9293;font-size:9px }.trend-chart { height:195px;display:flex;align-items:end;gap:6px;padding-top:25px }.trend-bar { flex:1;min-width:5px;border-radius:3px 3px 0 0;background:linear-gradient(#70ddd4,#245a60);position:relative }.trend-bar:hover::after { content:attr(data-tip);position:absolute;bottom:calc(100% + 6px);left:50%;transform:translateX(-50%);white-space:nowrap;padding:4px 6px;border-radius:4px;background:#102f38;font-size:8px }.risk-chart,.rank-list { margin-top:17px }.risk-row,.rank-row { display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;margin:11px 0;color:#a9c1c1;font-size:10px }.risk-row i { grid-column:1/-1;height:4px;border-radius:4px;background:#163941;overflow:hidden }.risk-row i b { display:block;height:100%;background:linear-gradient(90deg,#5ad2cb,#c5a663) }.rank-row span { overflow:hidden;text-overflow:ellipsis;white-space:nowrap }.rank-row b { color:#6fd5ce;font-weight:500 }
.upload-center { display:grid;grid-template-columns:1fr 1.25fr;gap:18px;margin-top:10px;padding:20px;border:1px solid rgba(201,168,103,.22);border-radius:11px;background:linear-gradient(110deg,rgba(201,168,103,.08),rgba(100,215,208,.05)) }.upload-center > div:first-child span{color:#a99163;font-size:9px;letter-spacing:.14em}.upload-center h3{margin-top:7px;font-size:17px}.upload-center p{max-width:420px;color:#779798;font-size:11px;line-height:1.7}.drop-zone { min-height:110px;display:grid;place-items:center;align-content:center;border:1px dashed #457a7d;border-radius:10px;color:#a8c1c1;cursor:pointer;background:rgba(4,21,27,.35)}.drop-zone.dragging{border-color:#67dbd4;background:rgba(100,215,208,.09)}.drop-zone b{font-size:25px;color:#62cfc8}.drop-zone strong{font-size:12px}.drop-zone small{margin-top:5px;color:#638788;font-size:9px}.upload-queue{grid-column:1/-1;display:grid;gap:5px}.upload-file{display:flex;justify-content:space-between;padding:8px 10px;border-radius:6px;background:rgba(255,255,255,.04);font-size:10px}.upload-submit{grid-column:2;justify-self:end}

@media (max-width: 820px) {
  .shell { display: block; }
  .rail { position: fixed; inset: 0 auto 0 0; width: min(82vw, 300px); z-index: 20; transform: translateX(-102%); transition: transform .25s ease; box-shadow: 16px 0 50px rgba(0,0,0,.25); }
  .history-list { max-height: 30vh; }
  .rail.open { transform: translateX(0); }
  .scrim { position: fixed; inset: 0; z-index: 19; background: rgba(3,18,22,.46); backdrop-filter: blur(2px); }
  .scrim.open { display: block; }
  .menu-btn { display: grid; }
  .topbar { height: 62px; padding: 0 12px; }
  .top-actions { gap: 3px; }
  .account-chip { width: 40px; min-width: 40px; height: 40px; justify-content: center; padding: 4px; border-radius: 50%; }
  .account-avatar { width: 30px; height: 30px; flex-basis: 30px; }
  .account-chip > span:last-child { display: none; }
  .context span { max-width: 42vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
  .conversation { padding: 25px 16px 22px; }
  .welcome { margin-top: 25px; }
  .welcome h1 { font-size: clamp(34px, 10.5vw, 48px); line-height: 1.18; letter-spacing: -.045em; }
  .welcome-copy { margin: 18px 0 27px; font-size: 15px; line-height: 1.75; text-align: justify; text-justify: inter-ideograph; }
  .starter-grid { grid-template-columns: 1fr; }
  .starter { min-height: 72px; padding: 15px 16px; font-size: 14px; line-height: 1.6; }
  .starter span { margin-bottom: 7px; }
  .composer-wrap { padding: 8px 10px calc(9px + env(safe-area-inset-bottom)); }
  .composer { gap: 7px; padding: 7px 8px; border-radius: 14px; }
  .composer textarea { min-width: 0; min-height: 48px; max-height: 120px; padding: 7px 2px 5px; font-size: 16px; line-height: 1.5; }
  .attach-btn, .voice-btn, .send-btn { width: 38px; height: 38px; margin-bottom: 5px; }
  .voice-status{margin-top:6px;padding:8px 10px}.voice-status b{display:none}.broadcast-btn{min-height:34px;margin-left:8px;padding:7px 11px;font-size:11px}
  .composer-note { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .messages { width: 100%; }
  .message { gap: 9px; grid-template-columns: 31px minmax(0, 1fr); margin-bottom: 25px; }
  .avatar { width: 31px; height: 31px; font-size: 10px; }
  .bubble { max-width: 100%; font-size: 16px; line-height: 1.78; overflow-wrap: anywhere; word-break: break-word; }
  .user .bubble { max-width: 92%; padding: 12px 14px; border-radius: 15px 15px 4px 15px; line-height: 1.65; }
  .bubble p { margin-bottom: 14px; }
  .bubble h2 { margin: 22px 0 10px; font-size: 19px; line-height: 1.45; }
  .bubble h3 { margin: 19px 0 9px; font-size: 17px; line-height: 1.5; }
  .bubble ul, .bubble ol { margin: 10px 0 16px; padding-left: 1.25em; }
  .bubble li { margin: 7px 0; padding-left: .15em; }
  .source-panel { font-size: 13px; line-height: 1.65; }
  .auth-gate { display: block; overflow: auto; background: #f3f7f6; }
  .auth-visual { min-height: 38vh; padding: 38px 28px 55px; }
  .auth-visual p { margin: 24px 0 10px; }
  .auth-visual h2 { font-size: 42px; }
  .auth-lines { display: none; }
  .login-panel { width: calc(100% - 40px); margin: -24px auto 30px; padding: 28px 24px; border-radius: 16px; background: white; box-shadow: 0 22px 60px rgba(4,30,35,.18); }
  .login-heading p { margin-bottom: 25px; }
  .modal { padding: 0; align-items: end; }
  .command-panel { width:100%;max-height:96vh;border-radius:18px 18px 0 0 }.command-panel > header{grid-template-columns:1fr auto;padding:16px}.command-live{display:none}.command-body{padding:14px}.metric-grid{grid-template-columns:repeat(2,1fr)}.command-grid{grid-template-columns:1fr}.upload-center{grid-template-columns:1fr}.upload-submit{grid-column:1;width:100%}
  .admin-panel { width: 100%; max-height: 94vh; border-radius: 18px 18px 0 0; }
  .admin-panel header, .admin-body { padding-left: 18px; padding-right: 18px; }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .user-row { grid-template-columns: 1fr 80px; gap: 12px; }
  .usage-track { grid-column: 1 / -1; grid-row: 2; }
  .limit-field { grid-column: 1; }
  .switch { grid-column: 2; justify-self: end; }
  .save-user { grid-column: 2; justify-self: end; }
  .reset-password { grid-column: 1; justify-self: start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
