/* Relay — warm paper, ink, and a focused creation surface. */
:root {
  font-family: "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  color: #252521; background: #faf9f6; font-synthesis: none;
  --ink: #252521; --muted: #706e65; --line: #e4e1d9;
  --teal: #252521; --soft: #efede6; --paper: #fffefa;
}
* { box-sizing: border-box; }
body { margin: 0; background: #faf9f6; font-size: 14px; line-height: 1.7; }
button, input, textarea, select { font: inherit; }
a { color: var(--ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 4px; }
button, a, input, textarea, select, summary { -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { color: var(--ink); background: var(--paper); border: 1px solid #dcd8ce; border-radius: 8px; }
button { cursor: pointer; padding: 9px 13px; line-height: 1.5; transition: background .15s, border-color .15s; }
button:hover:not(:disabled) { background: #efede6; border-color: #bdb6a8; }
button:disabled, input:disabled, select:disabled, textarea:disabled { color: #7a776e; background: #eeece5; border-color: var(--line); cursor: not-allowed; opacity: 1; }
input, select { width: 100%; min-width: 0; min-height: 43px; padding: 9px 12px; }
select { padding-right: 26px; }
input[type="checkbox"] { width: 16px; height: 16px; min-height: 0; accent-color: var(--ink); vertical-align: -2px; margin: 0 5px 0 0; }
input::placeholder, textarea::placeholder { color: #706e65; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid #716455; outline-offset: 3px; }
textarea { display: block; width: 100%; min-width: 0; padding: 12px; line-height: 1.9; resize: vertical; max-height: 600px; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 5; width: 224px; overflow-y: auto; padding: 28px 16px; background: #f0eee8; border-right: 1px solid #e8e5dd; scrollbar-width: thin; }
.brand { display: flex; align-items: center; gap: 11px; margin: 0 10px 33px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-symbol { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 10px; background: var(--ink); color: #faf9f6; font: 27px Georgia, "Times New Roman", serif; }
.brand-text { font: 28px/1.1 Georgia, "Times New Roman", serif; letter-spacing: -.7px; }
.brand small { display: block; margin-top: 5px; color: var(--muted); font: 12px/1.4 "Segoe UI", "Microsoft YaHei UI", sans-serif; letter-spacing: 0; }
nav { display: grid; gap: 5px; }
nav a { display: block; padding: 10px 13px; color: #69675f; border: 1px solid transparent; border-radius: 8px; }
nav a:hover { background: #e9e6dd; color: var(--ink); text-decoration: none; }
nav a.selected { background: #fffefa; color: var(--ink); font-weight: 600; border-color: #e2ded3; box-shadow: 0 2px 3px #30281706; }
.conversation-panel { margin-top: 30px; padding: 18px 10px 0; border-top: 1px solid #dedad0; }
.conversation-panel summary { cursor: pointer; color: #55534b; font-size: 13px; font-weight: 500; }
.draft-heading { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin: 20px 0 10px; }
.draft-heading h2 { margin: 0; font-size: 13px; font-weight: 500; }
.draft-heading button { padding: 4px 7px; font-size: 12px; }
.draft-list { overflow: auto; max-height: 240px; margin-top: 10px; scrollbar-width: thin; }
.draft-item { display: block; width: 100%; min-width: 0; margin: 0 0 5px; padding: 9px; text-align: left; background: transparent; border-color: transparent; overflow: hidden; }
.draft-item.active { background: var(--paper); border-color: #ded8cc; }
.draft-item strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 500; }
.draft-item small { color: var(--muted); font-size: 12px; }
.empty { color: var(--muted); padding: 8px 0; font-size: 13px; }
.memory-note { margin: 16px 0 10px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.8; }
.conversation-panel > button { width: 100%; margin-top: 7px; font-size: 12px; }
#cloud-list > div { padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
#cloud-list > div > button:last-child { padding: 4px 8px; font-size: 12px; }
#save-status { overflow-wrap: anywhere; }
.console-return { display: block; margin: 24px 10px 0; padding-top: 17px; border-top: 1px solid #dedad0; color: var(--muted); font-size: 12px; }
main { margin-left: 224px; min-height: 100vh; max-width: 1680px; padding: 32px 38px 24px; }
header { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 36px; }
.eyebrow { margin: 0 0 10px; color: var(--muted); font-size: 12px; font-weight: 400; letter-spacing: 0; }
h1 { margin: 0; font-size: 28px; font-weight: 500; line-height: 1.5; letter-spacing: -.7px; }
.workspace-description { margin: 9px 0 0; color: var(--muted); font-size: 14px; }
.status-pill { flex-shrink: 0; display: inline-flex; align-items: center; margin-top: 3px; padding: 5px 10px; border: 1px solid #e4e0d6; border-radius: 20px; background: #f2f0e9; color: #67655b; font-size: 12px; white-space: nowrap; }
.status-pill b { font-weight: 400; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 264px; align-items: start; gap: 32px; }
.editor { min-width: 0; }
.mode-switch { display: flex; align-items: stretch; gap: 3px; width: fit-content; max-width: 100%; margin: 0 auto 17px; padding: 4px; border: 1px solid #e6e2d8; border-radius: 11px; background: #eeece5; }
.mode-switch button { padding: 8px 17px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: #716e63; white-space: nowrap; }
.mode-switch button:hover:not(:disabled) { color: var(--ink); background: #f6f4ee; border-color: transparent; }
.mode-switch button[aria-pressed="true"] { color: var(--ink); background: #fffefa; border-color: #e3ded3; box-shadow: 0 2px 4px #29271f0a; font-weight: 600; }
.creative-tools { margin: 0; padding: 10px 3px; color: var(--muted); font-size: 13px; }
.creative-tools summary { width: fit-content; max-width: 100%; cursor: pointer; color: #716b5f; font-size: 13px; font-weight: 400; }
.creative-tools[open] { margin: 10px 0 16px; padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: #f1efe8; }
.creative-tools[open] summary { margin-bottom: 14px; color: var(--ink); font-weight: 500; }
.creative-tools label { display: block; margin-top: 14px; color: #555148; }
.creative-tools input:not([type="checkbox"]), .creative-tools textarea, .creative-tools select { margin: 7px 0; }
.creative-tools button { margin: 6px 8px 6px 0; font-size: 13px; }
.creative-tools > p { margin: 9px 0; }
.intro { padding: 28px 8px 30px; text-align: center; }
.mode-icon { display: grid; place-items: center; width: 44px; height: 44px; margin: 0 auto 13px; font-size: 0; }
.mode-icon::before { content: "✳"; font: 38px/1 Georgia, serif; color: #a86b45; }
.intro .eyebrow { display: none; }
.intro h2 { margin: 0; font-size: 29px; font-weight: 500; line-height: 1.5; letter-spacing: -.7px; }
.intro > p:last-child { margin: 10px 0 0; color: var(--muted); font-size: 14px; line-height: 1.8; }
.composer { padding: 19px 22px 16px; border: 1px solid #dcd8ce; border-radius: 17px; background: var(--paper); box-shadow: 0 6px 24px #30271908, 0 1px 2px #30271904; }
.composer:focus-within { border-color: #9a8c78; outline: 2px solid #716455; outline-offset: 2px; }
.composer-label { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: #686256; font-size: 13px; }
.composer-label span { color: #706e65; font-size: 12px; font-variant-numeric: tabular-nums; }
#prompt { min-height: 176px; margin: 15px 0 8px; padding: 0; border: 0; border-radius: 0; background: transparent; font-size: 15px; }
#prompt:focus-visible { outline: none; }
.composer-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.composer-actions button { padding: 6px 10px; font-size: 13px; }
.composer-actions span { color: var(--muted); font-size: 12px; }
.attachments { display: flex; flex-wrap: wrap; gap: 8px; }
.attachment { position: relative; width: 100%; min-width: 0; padding: 10px 34px 10px 12px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 8px; background: #f4f1e9; }
.attachment strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 500; }
.attachment small { display: block; font-size: 12px; color: var(--muted); }
.attachment button { position: absolute; right: 6px; top: 8px; padding: 2px 6px; }
#compare-tools { margin-top: 16px; }
.feedback { margin: 12px 0; color: #875b30; font-size: 13px; white-space: pre-line; overflow-wrap: anywhere; }
.feedback:empty { margin: 0; }
.editor-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; padding: 14px 2px 0; border-top: 1px solid #eae6dc; color: #706e65; font-size: 12px; }
.editor-footer button { flex-shrink: 0; padding: 5px 8px; color: #797266; background: transparent; border-color: transparent; font-size: 12px; }
.settings { min-width: 0; padding: 22px; border: 1px solid #e5e1d7; border-radius: 15px; background: #f3f1eb; }
.settings > .eyebrow { display: none; }
.settings h2 { margin: 0 0 22px; font-size: 17px; font-weight: 500; }
.settings label { display: block; margin: 17px 0 7px; color: #555148; font-size: 13px; font-weight: 500; }
.settings select { font-size: 14px; }
.field-note { margin: 9px 0 13px; color: var(--muted); font-size: 12px; line-height: 1.8; }
.service-note { margin: 22px 0 10px; padding-top: 18px; border-top: 1px solid #ded9cd; }
.service-note > span { display: none; }
.service-note h3 { margin: 0; font-size: 13px; font-weight: 500; }
.service-note p { margin: 8px 0 0; color: #71695d; font-size: 13px; line-height: 1.8; }
.generate { width: 100%; min-height: 44px; margin-top: 8px; padding: 10px 12px; background: var(--ink); border-color: var(--ink); border-radius: 9px; color: #fffefa; font-weight: 500; box-shadow: 0 2px 4px #25252112; }
.generate:hover:not(:disabled) { background: #424139; border-color: #424139; color: #fffefa; }
.generate:disabled { color: #827a6b; background: #e5e0d6; border-color: #ded8cc; box-shadow: none; }
#stop, #retry-service { display: block; width: 100%; margin: 8px 0; padding: 8px 10px; font-size: 13px; }
#retry-service { border-color: transparent; background: transparent; color: #776e60; text-decoration: underline; text-underline-offset: 4px; }
#login-link { display: block; padding: 10px; margin: 13px 0 8px; border: 1px solid #d7cfbf; border-radius: 8px; background: #fffefa; text-align: center; font-size: 13px; }
.limit-note { margin: 17px 0 0; padding-top: 14px; border-top: 1px solid #ded9cd; color: var(--muted); font-size: 12px; line-height: 1.9; text-align: left; }
.transcript { max-height: 480px; overflow: auto; scrollbar-width: thin; }
.chat-message { margin: 0 0 15px; padding: 18px 20px; border: 1px solid #e6e0d4; border-radius: 12px; background: var(--paper); }
.chat-message strong { color: #8a664c; font-size: 12px; font-weight: 500; }
.chat-message p { margin: 9px 0 0; font-size: 15px; line-height: 1.9; white-space: pre-wrap; overflow-wrap: anywhere; }
#image-result, #video-reference { margin-bottom: 22px; }
#image-result img { display: block; width: auto; max-width: 100%; max-height: 65vh; object-fit: contain; margin: 0 auto 14px; border-radius: 12px; }
#image-result a { display: inline-block; margin: 4px 8px 4px 0; padding: 8px 13px; border: 1px solid #d8cfbf; border-radius: 8px; background: var(--paper); }
#image-result button { margin: 4px 0; font-size: 13px; }
#image-result p, #video-reference p { color: var(--muted); font-size: 13px; line-height: 1.8; }
#video-reference img { display: block; max-width: 100%; max-height: 220px; border-radius: 10px; }
.compare-results { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 20px; }
.compare-results > * { min-width: 0; }
.compare-results p { white-space: pre-wrap; overflow-wrap: anywhere; }
#favorite-list button { max-width: 100%; overflow-wrap: anywhere; }
footer { display: flex; justify-content: space-between; gap: 16px; margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--line); color: #706e65; font-size: 12px; }
footer a { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
@media (min-width: 1500px) {
  main { padding: 38px 52px 28px; }
  .workspace { grid-template-columns: minmax(0, 1fr) 282px; gap: 40px; }
  .intro { padding-top: 45px; padding-bottom: 38px; }
  #prompt { min-height: 208px; }
}
@media (max-width: 1180px) {
  main { padding: 28px 26px 24px; }
  .workspace { gap: 24px; grid-template-columns: minmax(0, 1fr) 248px; }
  .settings { padding: 19px; }
  h1 { font-size: 25px; }
  .intro h2 { font-size: 27px; }
  .mode-switch button { padding-right: 13px; padding-left: 13px; }
}
@media (max-width: 999px) {
  .sidebar { position: static; width: auto; padding: 19px 24px 14px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { margin: 0 0 16px; }
  .brand-text { display: flex; align-items: baseline; gap: 10px; font-size: 27px; }
  .brand small { margin-top: 0; }
  .brand-symbol { width: 33px; height: 34px; border-radius: 8px; font-size: 24px; }
  nav { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
  nav a { flex-shrink: 0; white-space: nowrap; padding: 8px 12px; font-size: 13px; }
  .conversation-panel { margin-top: 12px; padding: 12px 0 0; }
  .conversation-panel > button { width: auto; margin-right: 6px; }
  .draft-list { max-height: 180px; }
  .console-return { margin: 12px 0 0; padding-top: 12px; }
  main { margin-left: 0; min-height: 0; }
  header { flex-wrap: wrap; }
}
@media (max-width: 800px) {
  .workspace { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  .settings { padding: 24px; }
  .settings .field-note, .limit-note { font-size: 13px; }
  .settings label, .settings select, #stop, #retry-service { font-size: 14px; }
  #prompt { min-height: 180px; }
}
@media (max-width: 480px) {
  .sidebar { padding: 14px 16px 10px; }
  .brand { margin-bottom: 10px; }
  .conversation-panel { margin-top: 8px; padding-top: 8px; }
  .console-return { margin-top: 8px; padding-top: 8px; }
  main { padding: 20px 18px; }
  header { gap: 8px; margin-bottom: 18px; }
  h1 { font-size: 22px; }
  .workspace-description { font-size: 13px; line-height: 1.7; }
  .mode-switch { width: 100%; margin-bottom: 14px; }
  .mode-switch button { flex: 1; padding: 8px 9px; font-size: 13px; }
  .intro { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 4px 10px; padding: 20px 0; text-align: left; }
  .mode-icon { grid-column: 1; grid-row: 1 / 3; align-self: center; width: 30px; height: 36px; margin: 0; }
  .mode-icon::before { font-size: 30px; }
  .intro h2 { grid-column: 2; font-size: 24px; }
  .intro > p:last-child { grid-column: 2; margin: 0; font-size: 13px; }
  .composer { padding: 16px; border-radius: 14px; }
  .creative-tools[open] { padding: 16px; }
  .creative-tools input:not([type="checkbox"]), .creative-tools textarea, .creative-tools select, #prompt, .settings select { font-size: 16px; }
  .editor-footer { flex-wrap: wrap; gap: 6px; }
  footer { flex-direction: column; gap: 5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
