:root{font-family:Inter,"Microsoft YaHei",system-ui,sans-serif;color:#e1ebf4;background:#152331;color-scheme:dark;--border:#3b5366;--ice:#a8d8f1;--panel:#1e3041}*{box-sizing:border-box}body{margin:0;min-height:100dvh;display:grid;grid-template-rows:auto auto 1fr}header{display:flex;align-items:center;gap:16px;min-height:54px;padding:8px 16px;background:#111d28;border-bottom:1px solid var(--border);flex-wrap:wrap}header strong{font-size:16px;letter-spacing:.08em}header strong span,small{color:var(--ice)}header small{margin-left:auto}#nav,.bar{display:flex;gap:6px;align-items:center;flex-wrap:wrap}#notice:not(:empty){padding:8px 14px;background:#4c332a;color:#ffdbca}main{min-height:0;padding:12px}button,input,select,textarea{font:inherit;font-size:14px;border:1px solid var(--border);border-radius:6px;color:inherit;background:#182837;padding:7px 10px}button{cursor:pointer}button:hover,button:focus-visible{border-color:var(--ice)}button.primary{background:#a8d8f1;color:#122637;border-color:#a8d8f1;font-weight:700}input,textarea,select{min-width:0;max-width:100%}label{display:grid;gap:4px;color:#d4e1ed;font-size:13px}h1,h2,h3{margin:0 0 10px;font-size:17px}h1{font-size:21px}.panel{background:var(--panel);border:1px solid var(--border);border-radius:8px;padding:12px;min-width:0}.login{max-width:380px;margin:36px auto}.stack{display:grid;gap:9px}.grid{display:grid;gap:10px;grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr))}.workspace{display:grid;grid-template-columns:minmax(185px,255px) minmax(0,1fr);gap:10px;align-items:start}.thread{display:grid;grid-template-rows:auto minmax(100px,1fr) auto;gap:8px;height:calc(100dvh - 82px);min-height:0}.scroll{overflow:auto;max-height:calc(100dvh - 180px)}.bubble{padding:8px 10px;border-radius:8px;background:#243e52;max-width:85%;margin:5px 0;overflow-wrap:anywhere;white-space:pre-wrap}.bubble.mine{background:#315771;margin-left:auto}.bubble.internal{background:#534731}.bubble small{display:block;margin-bottom:4px}.bubble img,.bubble video{display:block;max-width:100%;max-height:260px}.queue button{text-align:left;width:100%;display:flex;justify-content:space-between;gap:5px}.status{font-size:12px;font-weight:700}.waiting{color:#ff9e9e}.active{color:#ffe079}.closed{color:#a3e5ac}.muted{color:#bdccda;font-size:13px}.table{overflow:auto}table{border-collapse:collapse;width:100%;font-size:13px}td,th{padding:7px 8px;text-align:left;border-bottom:1px solid var(--border);white-space:pre-wrap;overflow-wrap:anywhere}textarea{width:100%;resize:vertical}.compose{display:grid;gap:5px}.file{max-width:220px}a{color:var(--ice)}@media(max-width:660px){main{padding:6px}.workspace{grid-template-columns:1fr}.queue{max-height:150px;overflow:auto}.thread{height:calc(100dvh - 175px);min-height:230px}.compose input,.compose textarea{font-size:16px}header{gap:8px;padding:6px 8px}}

.status{display:inline-block;width:max-content;max-width:100%;border-radius:999px;padding:3px 8px;line-height:1.35;white-space:nowrap}
.status.waiting{background:#fce4e4;color:#a82020}
.status.active{background:#fff0b8;color:#805500}
.status.closed{background:#d9f5e3;color:#176b3a}
.queue button{align-items:center;min-width:0}
.queue button>span:first-child{min-width:0;overflow-wrap:anywhere}
.thread{grid-template-rows:auto minmax(0,1fr) auto}
.thread-head{align-items:center}
#messages{min-height:0;max-height:none;overscroll-behavior:contain;padding:2px 4px}
.message-row{display:flex;flex-direction:column;align-items:flex-start;gap:2px;margin:0 0 10px}
.message-row.member-message{align-items:flex-end}
.message-meta{color:#b4c7d6;font-size:11px;line-height:1.25}
.bubble{width:fit-content;max-width:min(calc(15em + 20px),83%);margin:0;border-radius:4px 11px 11px 11px;background:#294258;overflow-wrap:anywhere;white-space:pre-wrap}
.member-message .bubble{background:#365c77;border-radius:11px 4px 11px 11px}
.bubble.internal{background:#534731}
.bubble audio{display:block;max-width:100%}
.compose{gap:6px;min-width:0}
.order-area,.chat-area{min-width:0;border:1px solid var(--border);border-radius:8px;padding:6px 8px;display:grid;gap:5px}
.order-area{background:#182837;grid-template-columns:max-content minmax(0,1fr);align-items:center;font-size:13px}
.order-area input{flex:1;width:0;min-width:5em}
.order-area button{white-space:nowrap}
.order-area small{grid-column:2}
.order-area small:empty,.chat-area small:empty,.chat-area>div:empty{display:none}
.chat-area{background:#23394b}
.chat-area textarea{min-height:44px;max-height:110px}
.chat-area .file{display:none}
.mobile-back{display:none}
.member-page{color:#352e25;background:#fffdf5;color-scheme:light;--border:#e8dfc9;--panel:#fff;--ice:#285876}
.member-page header,.member-page .order-area{background:#fff7e6}
.member-page button,.member-page input,.member-page select,.member-page textarea{background:#fff;color:#352e25}
.member-page button.primary{background:#a8d8f1;color:#163750;border-color:#a8d8f1}
.member-page .chat-area{background:#fffdf5}
.member-page .bubble{background:#f6eddb}
.member-page .member-message .bubble{background:#dceff9}
.member-page .message-meta,.member-page .muted{color:#665b4b}
.member-page a{color:#285876}
@media(max-width:660px){
  .thread{min-height:0;height:min(650px,calc(100dvh - 245px));min-height:240px}
  .member-page:has(.in-thread){height:var(--visible-height,100dvh);min-height:0;overflow:hidden}
  .member-page .in-thread{height:100%;grid-template-rows:minmax(0,1fr);align-items:stretch}
  .member-page .in-thread>.panel:first-child{display:none}
  .member-page .in-thread .thread{height:100%;min-height:0;padding:7px;gap:5px}
  .member-page .mobile-back{display:inline-block}
  .member-page .thread-head select{max-width:48%}
  .member-page .thread-head button,.chat-area button,.order-area button{padding:5px 7px}
  .member-page #notice:not(:empty){padding:4px 8px;font-size:12px}
  .order-area,.chat-area{padding:4px 6px}
  .order-area input{font-size:16px}
  .chat-area textarea{padding:5px 7px}
}

header strong{display:flex;align-items:center;gap:7px}
header strong img{width:24px;height:24px;object-fit:contain}
.member-page header{border-bottom-color:var(--brand-accent,var(--border))}
.payment-address{overflow-wrap:anywhere;margin:4px 0}
canvas{max-width:100%;height:auto}
.panel code{overflow-wrap:anywhere}
