:root {
  color-scheme: light;
  --ink:#4A342E; --muted:#8A6E66; --accent:#E8899A; --accent-deep:#D56B80;
  --wash:#F8E6DC; --side:#FFF8F2; --paper:#FFFCF8; --line:#F0D9CE;
  --select:#FDE8EE; --error:#C0544C; --shadow:#C47A5A22;
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  color:var(--ink); background:var(--wash); font-synthesis:none;
}
*,*::before,*::after{box-sizing:border-box}
html,body{margin:0;height:100%}
body{font-size:14px;line-height:1.55;background:
  radial-gradient(1200px 500px at 10% -10%, #FDE3EA 0%, transparent 55%),
  radial-gradient(900px 400px at 100% 0%, #F8E0C8 0%, transparent 50%),
  var(--wash)}
button,input,textarea,select{font:inherit;color:inherit}
button,a,input,textarea,select{-webkit-tap-highlight-color:transparent}
button,a{touch-action:manipulation}
button{cursor:pointer}
button:disabled{cursor:default;opacity:.5}
button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline:2px solid #E8899A;outline-offset:3px}
input,textarea{caret-color:var(--accent-deep)}
::selection{background:#F8C9D2;color:#4A342E}
[hidden]{display:none!important}
a{color:var(--accent-deep);text-underline-offset:3px}
svg.icon{height:18px;width:18px;display:block;flex:none;stroke:currentColor;fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
button{border:0;background:transparent;padding:0}
.brand{display:inline-flex;align-items:center;gap:10px;font-weight:720;letter-spacing:.02em;font-size:18px}
.brand-mascot,.brand-mark{width:36px;height:36px;flex:none;border-radius:50%;background:#fff;box-shadow:0 4px 10px var(--shadow);object-fit:contain}
.brand-mark{display:grid;place-items:center;overflow:hidden}
.brand-mark .icon{width:28px;height:28px}
.loading-page{display:grid;place-content:center;justify-items:center;height:100vh;color:var(--muted);gap:12px}
.loading-page .brand-mascot{width:72px;height:72px}
.auth-page{min-height:100vh;display:grid;grid-template-columns:minmax(300px,1.05fr) minmax(340px,.95fr)}
.auth-illustration{padding:48px;display:flex;flex-direction:column;justify-content:space-between;overflow:hidden;min-height:100vh}
.auth-illustration h1{font-size:clamp(30px,4vw,52px);letter-spacing:-.03em;line-height:1.2;margin:0 0 15px;font-weight:720;max-width:12em}
.auth-illustration p{font-size:16px;color:var(--muted);margin:0;max-width:30em}
.auth-content{display:grid;place-items:center;padding:44px 28px}
.auth-card{width:100%;max-width:400px;background:var(--paper);border:1px solid var(--line);border-radius:28px;padding:32px 28px;box-shadow:0 18px 40px var(--shadow)}
.auth-form{width:100%;max-width:400px}
.auth-form h2,.auth-card h2{font-size:26px;letter-spacing:-.03em;margin:0 0 6px}
.auth-form>p,.auth-card>p{margin:0 0 26px;color:var(--muted)}
.auth-form form,.auth-card form{display:grid;gap:14px}
.auth-form .auth-switch,.auth-card .auth-switch{margin:20px 0 0;font-size:13px}
.auth-demo{margin:32px 0 24px;max-width:540px;border:1px solid var(--line);border-radius:24px;overflow:hidden;display:grid;grid-template-columns:155px 1fr;box-shadow:0 16px 32px var(--shadow);background:var(--paper)}
.demo-side{padding:17px 12px;background:#FFF4EC;border-right:1px solid var(--line)}
.demo-side .muted{font-size:11px}
.demo-person{display:flex;gap:7px;align-items:center;margin-top:14px;font-size:12px}
.demo-body{padding:15px;background:#FFF8F2;display:flex;flex-direction:column;gap:10px}
.demo-top{display:flex;gap:7px;align-items:center;border-bottom:1px solid var(--line);padding-bottom:10px;font-size:13px}
.demo-bubble{align-self:flex-start;background:#fff;border-radius:16px 16px 16px 6px;padding:9px 11px;max-width:100%;font-size:12px;box-shadow:0 2px 8px var(--shadow)}
.demo-bubble.mine{align-self:flex-end;background:#E8899A;color:#fff;border-radius:16px 16px 6px 16px}
.demo-compose{margin-top:5px;border:1px solid var(--line);background:white;border-radius:14px;padding:8px;color:var(--muted);font-size:11px}
.auth-footer{color:var(--muted);font-size:12px}
label.field{display:grid;gap:6px;font-weight:620;font-size:13px}
.field input,.field textarea,.field select,.select-model{width:100%;border:1px solid var(--line);border-radius:14px;background:#fff;padding:10px 12px;min-height:42px;font-weight:400}
.field textarea{min-height:92px;resize:vertical}
.field small{font-weight:400;color:var(--muted)}
.primary,.secondary,.quiet,.icon-button{display:inline-flex;align-items:center;justify-content:center;gap:7px;border-radius:999px;min-height:36px;padding:7px 14px;font-weight:620;white-space:nowrap}
.primary{background:var(--accent);color:white;box-shadow:0 6px 14px #E8899A33}
.primary:hover:not(:disabled){background:var(--accent-deep)}
.secondary{border:1px solid var(--line);background:var(--paper)}
.secondary:hover:not(:disabled),.quiet:hover:not(:disabled),.icon-button:hover:not(:disabled){background:var(--select)}
.quiet{color:var(--accent-deep)}
.icon-button{padding:8px;min-width:36px;border-radius:50%}
.full{width:100%;min-height:44px}
.muted{color:var(--muted)}
.error{font-size:13px;color:var(--error);margin:0}
.notice{color:#7A4A42;background:#FDE8EE;border:1px solid #F3CBD4;border-radius:16px;padding:10px 13px;font-size:13px}
.workspace-shell{height:100vh;height:100dvh;min-height:0;display:grid;grid-template-columns:292px minmax(0,1fr);overflow:hidden}
.sidebar{display:flex;flex-direction:column;background:var(--side);border-right:1px solid var(--line);min-height:0;min-width:0}
.sidebar-top{padding:16px 14px 4px;display:flex;align-items:center;justify-content:space-between;gap:6px}
.sidebar-top .brand{font-size:17px}
.sidebar-tools{display:flex;align-items:center;gap:6px;margin:8px 12px 10px}
.search{position:relative;flex:1;min-width:0}
.search .icon{position:absolute;left:11px;top:10px;width:16px;height:16px;color:var(--muted)}
.search input{width:100%;border:1px solid var(--line);border-radius:999px;padding:8px 12px 8px 34px;background:#fff;box-shadow:0 2px 0 #fff inset}
.sidebar-tools .icon-button{background:#fff;border:1px solid var(--line);box-shadow:0 4px 10px var(--shadow)}
.rail-scroll{padding:0 8px;overflow:auto;flex:1;min-height:0;scrollbar-width:thin;scrollbar-color:#E8C4B8 transparent}
.rail-title{display:flex;align-items:center;justify-content:space-between;margin:10px 8px 4px;color:var(--muted);font-size:12px;font-weight:650}
.rail-row{width:100%;display:flex;align-items:center;gap:11px;min-height:58px;padding:8px 10px;border-radius:18px;text-align:left;min-width:0}
.rail-row:hover,.rail-row.active{background:var(--select)}
.rail-row.active{font-weight:680}
.rail-row .row-copy{min-width:0;flex:1}
.rail-row .row-label{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%;font-size:14px}
.rail-row .row-preview{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%;color:var(--muted);font-size:12px;margin-top:2px;font-weight:400}
.avatar{width:40px;height:40px;border-radius:50%;display:inline-grid;place-items:center;flex:none;background:#F2A0B0;color:#fff;font-weight:700;box-shadow:0 4px 10px var(--shadow)}
.avatar.small{width:28px;height:28px;font-size:12px}
.avatar.large{width:72px;height:72px;font-size:28px;box-shadow:0 10px 24px var(--shadow)}
.avatar[data-color="0"]{background:#F2A0B0}
.avatar[data-color="1"]{background:#8EC9C0}
.avatar[data-color="2"]{background:#F2C14E}
.avatar[data-color="3"]{background:#C9A4E8}
.avatar[data-color="4"]{background:#F5A05B}
.avatar[data-color="5"]{background:#7EB0E4}
.rail-bottom{padding:8px 8px 12px;border-top:1px solid var(--line);background:linear-gradient(#FFF8F2,#FFEFE6)}
.rail-bottom .rail-row{min-height:42px}
.rail-bottom .icon{color:var(--muted)}
.account{display:flex;align-items:center;gap:8px;padding:8px 8px 2px;margin-top:4px}
.account .account-label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px}
.main{min-width:0;min-height:0;display:flex;flex-direction:column;background:transparent}
.toolbar{min-height:62px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 22px}
.toolbar-title,.toolbar-actions{display:flex;align-items:center;gap:8px;min-width:0}
.toolbar-title strong{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:16px}
.toolbar-actions{flex:none}
.select-model{width:auto;max-width:205px;min-height:34px;font-size:12px;padding:6px 12px;background:#fff;border-radius:999px}
.mobile-menu,.mobile-overlay{display:none}
.chat-body{flex:1;min-height:0;overflow:auto;scrollbar-width:thin;scrollbar-color:#E8C4B8 transparent}
.messages{margin:0 auto;max-width:860px;padding:10px clamp(14px,4vw,40px) 24px;display:flex;flex-direction:column;gap:14px}
.message{display:flex;align-items:flex-end;gap:8px;max-width:min(86%,720px);min-width:0}
.message.mine{align-self:flex-end;max-width:min(80%,680px)}
.bubble{min-width:0;border-radius:22px 22px 22px 8px;background:#fff;padding:11px 15px;white-space:pre-wrap;overflow-wrap:anywhere;box-shadow:0 6px 16px var(--shadow)}
.mine .bubble{background:#E8899A;color:#fff;border-radius:22px 22px 8px 22px}
.empty-chat{min-height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:28px 20px;gap:8px}
.empty-chat .greeting-card{background:var(--paper);border-radius:28px;padding:28px 24px 22px;box-shadow:0 16px 36px var(--shadow);max-width:420px}
.empty-chat h1{font-size:22px;letter-spacing:-.03em;margin:10px 0 0}
.empty-chat p{margin:0;color:var(--muted);max-width:35em}
.empty-chat .suggestions{margin-top:14px;display:flex;gap:8px;flex-wrap:wrap;justify-content:center}
.suggestions button{font-size:12px}
.composer-wrap{padding:0 clamp(12px,4vw,48px) 16px}
.composer-wrap>div{max-width:820px;margin:auto}
.composer{display:flex;align-items:flex-end;gap:10px;padding:10px 10px 10px 16px;border-radius:24px;background:#fff;border:1px solid var(--line);box-shadow:0 10px 24px var(--shadow)}
.composer textarea{width:100%;border:0;resize:vertical;min-height:40px;max-height:180px;padding:8px 0;background:transparent}
.composer textarea:focus-visible{outline-offset:0}
.composer .primary{width:38px;min-width:38px;height:38px;min-height:38px;padding:0;border-radius:50%;margin-bottom:1px}
.composer-hint{display:flex;justify-content:space-between;gap:8px;color:var(--muted);font-size:11px;margin:8px 8px 0}
.run-note{max-width:820px;margin:0 auto 8px!important}
.sheet-scroll{min-height:0;overflow:auto;flex:1}
.sheet{width:min(100%,1030px);margin:auto;padding:16px clamp(14px,4vw,38px) 50px}
.sheet h1{margin:0 0 4px;font-size:26px;letter-spacing:-.03em}
.sheet h2{font-size:17px;margin:25px 0 10px}
.sheet p{margin:0 0 12px}
.sheet .notice{margin-top:14px}
.sheet-top{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}
.list-group,.table-wrap{border:1px solid var(--line);border-radius:20px;overflow:auto;background:var(--paper);box-shadow:0 8px 20px var(--shadow)}
.data-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:13px 15px;border-bottom:1px solid var(--line)}
.data-row:last-child{border-bottom:0}
.data-row>div{min-width:0}
.data-row .row-detail{font-size:12px;color:var(--muted);margin-top:2px;overflow-wrap:anywhere}
.data-row .right{text-align:right}
.agent-detail{display:flex;align-items:center;gap:10px}
.price{font-size:17px;font-weight:700;font-variant-numeric:tabular-nums}
.empty{padding:18px;color:var(--muted);font-size:13px}
table{border-collapse:collapse;width:100%;font-size:13px;text-align:left}
td,th{padding:10px 13px;border-bottom:1px solid var(--line);white-space:nowrap}
th{background:#FFF4EC;font-weight:650;color:#7A4A42}
tr:last-child td{border-bottom:0}
dialog{max-width:min(430px,calc(100% - 30px));width:100%;border:1px solid var(--line);border-radius:24px;padding:18px;background:var(--paper);color:var(--ink);box-shadow:0 22px 60px var(--shadow)}
dialog::backdrop{background:#4A342E40}
dialog h2{font-size:18px;margin:0}
dialog header,dialog footer{display:flex;align-items:center;justify-content:space-between;gap:10px}
dialog form{display:grid;gap:12px;margin-top:12px}
dialog footer{justify-content:flex-end;margin-top:4px}
#toast{position:fixed;right:18px;bottom:18px;max-width:min(360px,calc(100% - 36px));padding:10px 14px;border-radius:16px;color:white;background:#4A342E;z-index:5;box-shadow:0 8px 24px var(--shadow)}
.denied-page{min-height:100vh;display:grid;place-content:center;justify-items:center;text-align:center;gap:10px;padding:32px}
.denied-page .brand-mascot{width:72px;height:72px}
@media(max-width:760px){
  .auth-page{grid-template-columns:1fr}
  .auth-illustration{min-height:auto;padding:24px}
  .auth-illustration h1{font-size:27px;margin-top:20px}
  .auth-demo,.auth-footer{display:none}
  .auth-content{padding:30px 22px 40px}
  .workspace-shell{grid-template-columns:1fr}
  .sidebar{display:none}
  .workspace-shell.rail-open .sidebar{display:flex;position:absolute;top:0;left:0;bottom:0;width:min(82vw,320px);z-index:3;box-shadow:8px 0 32px var(--shadow)}
  .workspace-shell.rail-open .mobile-overlay{display:block;position:absolute;top:0;left:0;right:0;bottom:0;background:#4A342E40;z-index:2}
  .mobile-menu{display:inline-flex}
  .toolbar{padding:7px 8px;gap:5px}
  .toolbar-title,.toolbar-actions{gap:4px}
  .toolbar-title .avatar{display:none}
  .toolbar-title strong{max-width:35vw;font-size:13px}
  .select-model{max-width:132px}
  .composer-hint{font-size:10px}
}
.legacy-dialog{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);z-index:6;margin:0;box-shadow:0 0 0 100vmax #4A342E40}
.history-messages{margin-top:12px;border:1px solid var(--line);border-radius:20px;background:var(--paper)}
.history-message{padding:13px 16px;border-bottom:1px solid var(--line)}
.history-message:last-child{border-bottom:0}
.history-message header{display:flex;justify-content:space-between;gap:10px}
.history-message time{font-size:12px;color:var(--muted)}
.history-message p{white-space:pre-wrap;overflow-wrap:anywhere;margin:6px 0 0}
