:root {
  --bg: #282724;
  --bg-deep: #22211f;
  --panel: #302f2b;
  --panel-soft: #353430;
  --line: #46433d;
  --text: #ddd7cf;
  --text-soft: #a8a097;
  --accent: #d26b43;
  --shadow: 0 20px 80px rgba(0, 0, 0, 0.45);
  --radius: 8px;
  --sidebar-open: 286px;
  --sidebar-collapsed: 68px;
  --browser-h: 90px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; background: #16242b; color: var(--text); }
body { overflow: hidden; }
button, textarea { font: inherit; }
button { color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
textarea { resize: none; border: 0; outline: none; background: transparent; color: var(--text); }
.hidden { display: none !important; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.accent { color: var(--accent); }

.desktop {
  position: relative; min-height: 100vh; padding: 30px; display: flex; align-items: center; justify-content: center; overflow: hidden;
  background: linear-gradient(180deg, rgba(15, 19, 21, 0.28), rgba(15, 19, 21, 0.54)), #25353b;
}
.desktop-backdrop {
  position: absolute; inset: -40px; background:
    linear-gradient(130deg, rgba(138, 29, 40, 0.35), transparent 30%),
    linear-gradient(240deg, rgba(50, 124, 153, 0.44), transparent 40%),
    url("./QQ20260405-215516.jpg") center/cover no-repeat;
  filter: blur(26px) saturate(1.05); transform: scale(1.16); opacity: .72; pointer-events: none;
}
.window-shell {
  position: relative; width: min(1540px, calc(100vw - 48px)); height: min(920px, calc(100vh - 48px)); min-height: 700px;
  border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); background: #1f1e1b; border: 1px solid rgba(255,255,255,.08);
}

.browser-frame {
  height: var(--browser-h); padding: 6px 18px 12px; display: flex; flex-direction: column; gap: 10px; background: rgba(33,32,30,.94);
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.browser-tabs, .browser-toolbar, .browser-nav, .browser-actions, .sidebar-brand, .topbar-actions, .feature-panel-header, .composer-actions, .model-selector, .menu-item, .toggle-row, .profile-button, .workspace-topbar, .feedback-row { display: flex; align-items: center; }
.browser-tabs { gap: 10px; }
.browser-handle, .new-tab, .browser-icon, .icon-button, .download-chip, .voice-button, .send-button, .composer-add {
  display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius);
  transition: background-color .18s ease, border-color .18s ease, color .18s ease, opacity .18s ease;
}
.browser-handle { width: 36px; height: 36px; background: #31302c; color: var(--text-soft); }
.browser-handle svg { width: 14px; height: 14px; transform: rotate(180deg); }
.tab {
  min-width: 250px; max-width: 300px; height: 40px; padding: 0 14px; border-radius: 10px 10px 0 0; background: #242321;
  border: 1px solid rgba(255,255,255,.06); display: flex; align-items: center; gap: 10px; font-size: 18px;
}
.tab-logo { width: 15px; height: 15px; }
.tab span { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tab-close, .new-tab, .browser-icon { color: var(--text-soft); }
.tab-close { font-size: 24px; line-height: 1; }
.new-tab { width: 32px; height: 32px; font-size: 26px; }
.browser-toolbar { gap: 14px; }
.browser-nav { gap: 8px; color: #b6b0aa; }
.browser-icon { width: 28px; height: 28px; font-size: 18px; }
.url-bar {
  flex: 1; min-width: 0; height: 34px; border-radius: 999px; background: #2d2c29; border: 1px solid rgba(255,255,255,.06);
  display: flex; align-items: center; gap: 10px; padding: 0 14px; color: #d7d1ca; font-size: 16px;
}
.url-badge {
  width: 22px; height: 22px; border-radius: 999px; background: rgba(255,255,255,.08); display: inline-flex; align-items: center; justify-content: center; font-size: 12px;
}
.browser-actions { gap: 8px; }
.browser-profile {
  width: 28px; height: 28px; border-radius: 999px; background: linear-gradient(135deg, #dad6d1, #8ea6b7); color: #121212;
  font-size: 13px; display: flex; align-items: center; justify-content: center; font-weight: 700;
}

.app-shell { display: flex; height: calc(100% - var(--browser-h)); background: var(--bg); }
.sidebar {
  position: relative; width: var(--sidebar-collapsed); flex: 0 0 auto; background: linear-gradient(180deg, #242320 0%, #22211f 100%);
  border-right: 1px solid rgba(255,255,255,.07); transition: width .24s ease; display: flex; flex-direction: column; justify-content: space-between;
}
.sidebar.open { width: var(--sidebar-open); }
.sidebar-top { min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.sidebar-brand { height: 62px; padding: 12px 16px; justify-content: space-between; }
.sidebar-toggle, .download-chip, .icon-button { width: 32px; height: 32px; color: var(--text-soft); }
.sidebar-toggle:hover, .download-chip:hover, .icon-button:hover, .browser-icon:hover, .browser-handle:hover, .new-tab:hover, .voice-button:hover, .composer-add:hover {
  background: rgba(255,255,255,.06);
}
.brand-copy { opacity: 0; width: 0; overflow: hidden; transition: opacity .18s ease, width .18s ease; }
.sidebar.open .brand-copy { opacity: 1; width: auto; }
.brand-title { font-family: Georgia, "Times New Roman", "Songti SC", serif; font-size: 24px; color: #f3efe9; }
.sidebar-nav { padding: 4px 10px 0; display: flex; flex-direction: column; gap: 4px; }
.nav-item, .mode-pill, .ghost-button, .model-button, .thread-title { border: 1px solid transparent; }
.nav-item {
  height: 40px; width: 100%; padding: 0 12px; border-radius: var(--radius); color: #cbc5be; display: flex; align-items: center; gap: 14px; font-size: 15px; text-align: left;
}
.nav-item span, .profile-meta, .profile-chevron, .sidebar-lists { opacity: 0; transition: opacity .18s ease; }
.sidebar.open .nav-item span, .sidebar.open .profile-meta, .sidebar.open .profile-chevron, .sidebar.open .sidebar-lists { opacity: 1; }
.nav-item:hover, .nav-item.active, .mode-pill:hover, .mode-pill.active, .ghost-button:hover, .model-button:hover, .thread-title:hover, .menu-item:hover {
  background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.08);
}
.nav-item svg { flex: 0 0 auto; }
.sidebar-lists { padding: 18px 16px 0; overflow-y: auto; min-height: 0; }
.sidebar-lists section + section { margin-top: 22px; }
.sidebar-lists h3 { margin: 0 0 10px; font-size: 14px; font-weight: 600; color: var(--text-soft); }
.sidebar-lists ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.sidebar-lists li {
  font-size: 14px; line-height: 1.35; color: #c9c3bc; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.sidebar-bottom { padding: 12px 10px; border-top: 1px solid rgba(255,255,255,.05); display: flex; align-items: center; gap: 10px; }
.profile-button { flex: 1; min-width: 0; height: 48px; padding: 0 8px; gap: 10px; border-radius: var(--radius); }
.profile-button:hover { background: rgba(255,255,255,.05); }
.profile-avatar {
  width: 38px; height: 38px; border-radius: 999px; background: #d5d2cb; color: #2b2824; font-weight: 700; display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.profile-meta { display: flex; flex-direction: column; min-width: 0; text-align: left; }
.profile-meta strong { font-size: 15px; font-weight: 600; }
.profile-meta span { font-size: 13px; color: var(--text-soft); }
.profile-chevron { width: 14px; height: 14px; color: var(--text-soft); }

.workspace { position: relative; flex: 1; min-width: 0; padding: 12px 18px 18px; display: flex; flex-direction: column; overflow: hidden; }
.workspace-topbar { height: 44px; justify-content: space-between; gap: 12px; }
.conversation-pill { font-size: 15px; color: var(--text-soft); max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { gap: 10px; }
.ghost-button { height: 30px; padding: 0 14px; gap: 8px; border-radius: var(--radius); color: #e6e2dc; }
.workspace-body { position: relative; flex: 1; min-height: 0; }
.landing-view, .chat-view { height: 100%; }
.landing-view {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 34px 20px 110px;
}
.hero-copy { display: flex; align-items: center; gap: 12px; margin-top: -58px; }
.hero-mark svg { width: 38px; height: 38px; }
.hero-copy h1 {
  margin: 0; font-family: Georgia, "Times New Roman", "Songti SC", serif; font-weight: 400; font-size: clamp(54px, 5vw, 72px); line-height: 1; color: #d6d0c8;
}
.landing-composer-slot, .chat-composer-slot { width: min(980px, 100%); }
.chat-composer-slot { position: sticky; bottom: 0; padding: 12px 0 0; background: linear-gradient(180deg, rgba(40,39,36,0), rgba(40,39,36,.92) 18%, rgba(40,39,36,1) 40%); }

.composer-panel {
  width: min(980px, 100%); min-height: 154px; padding: 22px 24px 18px; border-radius: 24px; background: #34332f;
  border: 1px solid rgba(255,255,255,.08); box-shadow: inset 0 1px 0 rgba(255,255,255,.02); display: flex; flex-direction: column; justify-content: space-between; gap: 18px;
}
.composer-input-wrap { position: relative; }
.composer-panel textarea { width: 100%; min-height: 66px; max-height: 220px; padding-right: 8px; font-size: 18px; line-height: 1.5; color: #ebe7e1; }
.composer-panel textarea::placeholder { color: #a49d95; }
.composer-add { position: absolute; left: -6px; bottom: -4px; width: 36px; height: 36px; color: #d0c8c1; }
.composer-actions { justify-content: space-between; gap: 16px; }
.model-selector { margin-left: auto; gap: 8px; }
.model-button {
  height: 42px; padding: 0 16px; border-radius: 10px; gap: 8px; background: rgba(18,18,18,.28); color: #e3ddd6;
}
.model-button svg { width: 14px; height: 14px; }
.voice-button { width: 42px; height: 42px; color: #b9b1a8; }
.voice-button.active { color: var(--accent); background: rgba(210,107,67,.14); }
.send-button {
  width: 46px; height: 46px; border-radius: 12px; background: var(--accent); color: #f7f0ea; opacity: 0; pointer-events: none; transform: translateY(6px);
  transition: opacity .18s ease, transform .18s ease, background-color .18s ease;
}
.send-button.ready { opacity: 1; pointer-events: auto; transform: translateY(0); }
.send-button:disabled { background: #8e5d49; cursor: wait; }
.mode-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.mode-pill { height: 42px; padding: 0 16px; border-radius: 10px; gap: 8px; color: #cfc9c1; display: inline-flex; align-items: center; }
.mode-pill.active { color: #f0ece6; border-color: rgba(255,255,255,.11); }

.chat-view { display: flex; flex-direction: column; gap: 18px; padding: 8px 18px 0; }
.chat-thread-header { min-height: 38px; display: flex; align-items: center; }
.thread-title { min-height: 30px; padding: 0 10px; border-radius: var(--radius); color: #d8d3cb; font-size: 18px; }
.message-list { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 4px 0 0; display: flex; flex-direction: column; gap: 28px; }
.message { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 16px; }
.message.user { grid-template-columns: minmax(0, 1fr); }
.message-badge {
  width: 34px; height: 34px; border-radius: 999px; background: rgba(210,107,67,.12); color: var(--accent); display: flex; align-items: center; justify-content: center;
}
.message-content { max-width: min(820px, 100%); }
.message.user .message-content {
  margin-left: auto; width: min(760px, 100%); padding: 18px 20px; border-radius: 16px; background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.06);
}
.message-content p, .message-content li { margin: 0 0 14px; font-size: 18px; line-height: 1.78; color: #ddd7cf; word-break: break-word; }
.message-content p:last-child, .message-content li:last-child { margin-bottom: 0; }
.message-content pre {
  margin: 16px 0; padding: 18px; background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.08); border-radius: 10px; overflow-x: auto;
  font-size: 15px; line-height: 1.6; color: #d5dfef;
}
.message-content code { font-family: "Cascadia Code", Consolas, monospace; }
.feedback-row { gap: 8px; margin-top: 14px; }
.feedback-button {
  width: 28px; height: 28px; border-radius: 6px; color: var(--text-soft); display: inline-flex; align-items: center; justify-content: center;
}
.feedback-button:hover { background: rgba(255,255,255,.06); }
.typing-indicator { display: inline-flex; gap: 6px; align-items: center; padding: 4px 0; }
.typing-indicator span { width: 7px; height: 7px; border-radius: 999px; background: #bdb5ac; animation: blink 1s infinite; }
.typing-indicator span:nth-child(2) { animation-delay: .15s; }
.typing-indicator span:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%,80%,100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }
.composer-footnote { margin: 0; text-align: center; font-size: 13px; color: #938c84; padding-bottom: 8px; }

.feature-panel {
  position: absolute; top: 52px; right: 18px; width: min(420px, calc(100% - 36px)); padding: 20px; border-radius: 18px;
  background: rgba(47,46,42,.96); border: 1px solid rgba(255,255,255,.08); box-shadow: 0 24px 48px rgba(0,0,0,.35); backdrop-filter: blur(12px); z-index: 8;
}
.feature-panel-header { justify-content: space-between; gap: 16px; }
.feature-panel-header h2 { margin: 6px 0 0; font-size: 26px; font-weight: 600; }
.eyebrow { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-soft); }
.feature-panel p { margin: 12px 0 16px; color: #d3cdc5; line-height: 1.6; }
.feature-preview-grid { display: grid; gap: 12px; }
.feature-card { padding: 14px 16px; border-radius: 12px; background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.06); }
.feature-card strong { display: block; margin-bottom: 6px; font-size: 15px; }
.feature-card span { color: var(--text-soft); line-height: 1.45; font-size: 14px; }

.menu-card {
  position: absolute; background: rgba(50,49,45,.98); border: 1px solid rgba(255,255,255,.08); border-radius: 18px;
  box-shadow: 0 18px 48px rgba(0,0,0,.35); backdrop-filter: blur(14px); z-index: 10;
}
#modelMenu { right: 72px; bottom: 140px; width: 332px; padding: 12px; }
.model-options, .language-options, .menu-section { display: grid; }
.model-option { padding: 12px 14px; border-radius: 12px; display: grid; gap: 4px; }
.model-option.active { background: rgba(0,0,0,.38); }
.model-option-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.model-option strong, .toggle-row strong { font-size: 15px; font-weight: 600; }
.model-option span, .toggle-row span, .menu-email { font-size: 13px; color: var(--text-soft); }
.menu-divider { height: 1px; margin: 10px 0; background: rgba(255,255,255,.08); }
.toggle-row { justify-content: space-between; gap: 18px; padding: 6px 4px 4px; }
.toggle-row > div { display: grid; gap: 4px; }
.switch {
  width: 42px; height: 24px; padding: 2px; border-radius: 999px; background: rgba(0,0,0,.52); border: 1px solid rgba(255,255,255,.08); display: flex; align-items: center;
}
.switch span { width: 18px; height: 18px; border-radius: 999px; background: #fff; transform: translateX(0); transition: transform .18s ease; }
.switch[aria-pressed="true"] { background: rgba(210,107,67,.65); }
.switch[aria-pressed="true"] span { transform: translateX(18px); }
#profileMenu { left: 18px; bottom: 86px; width: 264px; padding: 12px; }
.menu-email { padding: 4px 10px 12px; }
.menu-item {
  width: 100%; min-height: 40px; padding: 0 10px; justify-content: flex-start; gap: 10px; border-radius: 10px; color: #d8d2cb;
}
.menu-item.has-chevron { justify-content: space-between; }
.menu-item.has-chevron span { flex: 1; text-align: left; }
.menu-chevron { width: 14px; height: 14px; color: var(--text-soft); }
.language-menu { left: 278px; bottom: 168px; width: 224px; padding: 10px; }
.language-option {
  height: 40px; padding: 0 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-radius: 10px; color: #ddd7cf;
}
.language-option.active, .language-option:hover, .model-option:hover { background: rgba(0,0,0,.35); }

.message-list::-webkit-scrollbar, .sidebar-lists::-webkit-scrollbar { width: 10px; }
.message-list::-webkit-scrollbar-thumb, .sidebar-lists::-webkit-scrollbar-thumb { background: rgba(255,255,255,.09); border-radius: 999px; }

@media (max-width: 1180px) {
  .browser-frame { height: 74px; padding-inline: 12px; }
  .tab { min-width: 0; width: 210px; font-size: 16px; }
  .app-shell { height: calc(100% - 74px); }
  .hero-copy h1 { font-size: clamp(44px, 5vw, 60px); }
}

@media (max-width: 940px) {
  body { overflow: auto; }
  .desktop { padding: 0; }
  .window-shell { width: 100vw; height: 100vh; min-height: 100vh; border-radius: 0; }
  .browser-frame { display: none; }
  .app-shell { height: 100%; }
  .sidebar {
    position: absolute; top: 0; bottom: 0; left: 0; z-index: 12; box-shadow: 24px 0 40px rgba(0,0,0,.32);
    transform: translateX(calc(-100% + var(--sidebar-collapsed))); transition: transform .24s ease, width .24s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .workspace { padding-inline: 14px; }
  .landing-view { padding-inline: 8px; }
  .hero-copy { margin-top: -18px; }
  .hero-copy h1 { font-size: clamp(34px, 8vw, 44px); }
  .composer-panel { min-height: 142px; padding-inline: 18px; }
  .feature-panel { right: 14px; left: 14px; width: auto; }
  #profileMenu { left: 12px; }
  .language-menu { left: 12px; bottom: 352px; }
}

@media (max-width: 620px) {
  .workspace { padding: 10px 10px 14px; }
  .workspace-topbar { height: auto; }
  .conversation-pill { max-width: 180px; font-size: 13px; }
  .hero-copy { gap: 10px; flex-direction: column; text-align: center; }
  .hero-copy h1 { font-size: clamp(30px, 9vw, 40px); }
  .landing-view { padding-bottom: 64px; }
  .composer-panel { min-height: 132px; border-radius: 22px; gap: 14px; }
  .composer-panel textarea, .message-content p, .message-content li { font-size: 16px; }
  .composer-actions { align-items: flex-end; }
  .model-selector { gap: 6px; }
  .model-button { padding-inline: 12px; }
  #modelMenu { right: 10px; left: 10px; bottom: 118px; width: auto; }
}
