:root {
  color-scheme: light;
  --sidebar-width: 224px;
  --bg: #f5f7ff;
  --bg-blue: #eaf6ff;
  --surface: rgba(255, 255, 255, 0.92);
  --sidebar: rgba(252, 252, 255, 0.96);
  --text: #151923;
  --muted: #626a79;
  --line: #e7e9ef;
  --blue: #246dd4;
  --blue-pale: #e9f2ff;
  --blue-line: #bfd6fa;
  --shadow: 0 22px 60px rgba(80, 112, 178, 0.14);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-width: 320px; min-height: 100%; }

body {
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  background: var(--bg);
}

button, textarea { font: inherit; }

button { color: inherit; }

svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.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;
}

.app-shell { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  padding: 20px 10px 12px;
  border-right: 1px solid rgba(225, 227, 234, 0.85);
  background: var(--sidebar);
  backdrop-filter: blur(18px);
  transition: transform 220ms ease;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 0 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}

.brand-name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;
}

.brand-mark {
  display: block;
  flex: 0 0 40px;
  width: 40px;
  height: 36px;
  overflow: hidden;
}
.brand-mark img { display: block; width: 100%; height: 100%; object-fit: contain; transform: scale(1.25); }
body.dark .brand-mark img { filter: brightness(0) invert(1); }

.top-icon, .mobile-menu, .bottom-dock button {
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.primary-nav { display: grid; gap: 6px; margin-top: 8px; }

.nav-item {
  display: flex;
  width: 100%;
  height: 39px;
  align-items: center;
  gap: 14px;
  padding: 0 14px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: #5d6370;
  cursor: pointer;
  font-size: 15px;
  text-align: left;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav-item svg { width: 21px; height: 21px; }
.nav-item:hover { background: #f1f3f8; color: #313744; }
.nav-item:active { transform: scale(0.99); }
.nav-item.is-active { background: #e2efff; color: #246dd4; }

.history {
  margin: 26px 6px 0;
  padding: 20px 0;
  border-top: 1px solid var(--line);
}

.history-title { display: flex; justify-content: space-between; color: #6d7380; font-size: 13px; }
.history-title button { padding: 0; border: 0; background: none; color: inherit; cursor: pointer; }
.history p { margin: 27px 4px 0; color: #737987; font-size: 13px; }

.local-note { margin: auto 6px 0; color: #757c89; font-size: 9px; }

.workspace {
  position: relative;
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  overflow: hidden;
  background:
    radial-gradient(circle at 52% 15%, rgba(255, 255, 255, 0.9), transparent 30%),
    linear-gradient(117deg, #f1f2ff 0%, #eef6ff 61%, #eaf7ff 100%);
}

.topbar {
  position: relative;
  z-index: 10;
  display: flex;
  height: 67px;
  align-items: center;
  justify-content: flex-end;
  padding: 12px 22px;
}

.topbar-actions { display: flex; align-items: center; gap: 10px; }

.top-icon {
  width: 43px;
  height: 38px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.84);
  color: #303744;
  box-shadow: inset 0 0 0 1px rgba(227, 230, 238, 0.82);
}

.top-icon svg { width: 21px; }
.sun-icon { display: none; }



.mobile-menu { display: none; }

.hero {
  display: flex;
  align-items: center;
  flex-direction: column;
  padding-top: 50px;
  text-align: center;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #3b77d3;
  font-size: 13px;
  letter-spacing: 2px;
}

.eyebrow svg { width: 18px; height: 18px; }

.hero h1 {
  margin: 23px 0 14px;
  font-size: clamp(34px, 3.35vw, 48px);
  line-height: 1.06;
  letter-spacing: -2.6px;
}

.hero-subtitle { margin: 0; color: #656d7b; font-size: 15px; }

.showcase {
  position: relative;
  display: flex;
  width: min(635px, 60vw);
  height: 230px;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
  padding: 12px 0;
}

.showcase-card {
  position: relative;
  width: 150px;
  height: 176px;
  flex: 0 0 150px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 5px solid rgba(255, 255, 255, 0.95);
  border-radius: 14px;
  background-image: url("assets/inspiration.jpg");
  background-repeat: no-repeat;
  background-size: 710px 533px;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(34, 43, 55, 0.1);
}

.showcase-card + .showcase-card { margin-left: -6px; }
.card-one { background-position: -283px -214px; transform: rotate(-9deg) translateY(5px); }
.card-two { background-position: 0 -179px; z-index: 2; transform: rotate(-3deg) translateY(-5px); }
.card-three { background-position: -426px -352px; z-index: 1; transform: rotate(4deg); }
.card-four { background-position: -284px 0; transform: rotate(10deg) translateY(8px); }
.showcase-card span {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 25px 10px 8px;
  border-radius: 0 0 10px 10px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.533));
  color: white;
  font-size: 10px;
  line-height: 16px;
  text-align: left;
}
.showcase-card span svg { width: 12px; height: 12px; }
.showcase-card:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }

.composer-wrap {
  position: relative;
  z-index: 4;
  width: min(900px, calc(100vw - var(--sidebar-width) - 88px));
  margin: 2px auto 0;
}

.composer {
  position: relative;
  height: 193px;
  padding: 9px 15px 12px;
  border: 1px solid var(--blue-line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.91);
  box-shadow: var(--shadow);
}

.composer-tabs { display: flex; align-items: center; gap: 5px; }

.tab {
  display: flex;
  height: 35px;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: #202630;
  cursor: pointer;
  font-size: 13px;
}

.tab svg { width: 18px; height: 18px; }
.tab.is-active { background: #e8f1ff; color: #246dd4; }

.composer textarea {
  width: 100%;
  height: 92px;
  padding: 15px 7px 0;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
}

.composer textarea::placeholder { color: #696f7b; opacity: 1; }

.composer-footer { display: flex; align-items: center; justify-content: space-between; }
.left-tools, .right-tools { display: flex; align-items: center; gap: 12px; }

.text-tool, .model-select {
  display: flex;
  align-items: center;
  gap: 7px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
}

.text-tool { padding: 6px 3px; }
.text-tool svg { width: 20px; height: 20px; }
.model-select { padding: 8px 0; }
.model-select svg { width: 16px; height: 16px; }

.send-btn {
  display: grid;
  width: 39px;
  height: 39px;
  place-items: center;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(145deg, #9bb3ff, #bca6ff);
  color: white;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(132, 130, 240, 0.22);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.send-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 23px rgba(132, 130, 240, 0.3); }
.send-btn svg { width: 22px; height: 22px; }

.composer-caption { margin: 7px 0 0; color: #757c89; font-size: 11px; text-align: center; }

.suggestions { display: flex; justify-content: center; gap: 10px; margin-top: 18px; }
.suggestions button {
  height: 31px;
  padding: 0 16px;
  border: 1px solid #e1e5ef;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  color: #717887;
  cursor: pointer;
  font-size: 12px;
}

.bottom-dock {
  position: fixed;
  z-index: 7;
  right: 34px;
  bottom: -4px;
  display: flex;
  height: 34px;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid #e7e8ee;
  border-radius: 18px 18px 0 0;
  background: rgba(255, 255, 255, 0.86);
}

.bottom-dock button { width: 21px; height: 25px; }
.bottom-dock svg { width: 18px; height: 18px; }
.bottom-dock span { width: 1px; height: 22px; background: #ececf0; }

.toast {
  position: fixed;
  z-index: 50;
  left: calc(50% + var(--sidebar-width) / 2);
  bottom: 26px;
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(28, 32, 42, 0.9);
  color: white;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

body.dark {
  color-scheme: dark;
  --text: #f1f3f8;
  --muted: #aab2c1;
  --line: #2a3140;
  --sidebar: rgba(23, 27, 36, 0.97);
  --surface: rgba(26, 31, 42, 0.94);
  --blue-pale: #2c385e;
}

body.dark .workspace { background: radial-gradient(circle at 52% 15%, #28324a, transparent 34%), linear-gradient(120deg, #181b2a, #172634); }
body.dark .composer, body.dark .top-icon, body.dark .suggestions button { background: rgba(26, 31, 42, 0.9); }
body.dark .nav-item:hover { background: #242b38; color: white; }
body.dark .nav-item { color: #bdc7d8; }
body.dark .nav-item.is-active { background: #293759; color: #9fc3ff; }
body.dark .composer textarea { color: white; }
body.dark .composer textarea::placeholder { color: #aeb9ca; }
body.dark .hero-subtitle, body.dark .composer-caption { color: #b4bfd0; }
body.dark .suggestions button { color: #d2d9e6; border-color: #3b4557; }
body.dark .bottom-dock { color: #e4ebf6; background: #252c39; border-color: #3b4557; }
body.dark .sun-icon { display: block; }
body.dark .moon-icon { display: none; }
body.dark .brand { color: white; }

@media (max-height: 780px) and (min-width: 900px) {
  .hero { padding-top: 25px; }
  .hero h1 { margin-top: 20px; }
  .showcase { height: 203px; margin-top: 18px; }
  .composer-wrap { margin-top: 14px; }
  .composer { height: 191px; }
  .suggestions { margin-top: 10px; }
}

@media (max-width: 980px) {
  :root { --sidebar-width: 210px; }
  .composer-wrap { width: calc(100vw - var(--sidebar-width) - 40px); }
  .showcase { width: min(600px, calc(100vw - var(--sidebar-width) - 24px)); }
  .showcase-card { width: 105px; flex-basis: 105px; height: 135px; }
  .bottom-dock { display: none; }
}

@media (max-width: 760px) {
  :root { --sidebar-width: 224px; }
  .sidebar { box-shadow: 18px 0 45px rgba(35, 51, 87, 0.18); transform: translateX(-103%); }
  .sidebar.is-open { transform: translateX(0); }
  .workspace { margin-left: 0; overflow: visible; }
  .topbar { height: 62px; justify-content: space-between; padding: 10px 14px; }
  .mobile-menu { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 11px; background: rgba(255, 255, 255, 0.76); }
  .hero { padding: 24px 15px 0; }
  .hero h1 { margin: 18px 0 12px; font-size: 34px; letter-spacing: -1.7px; }
  .hero-subtitle { font-size: 14px; }
  .showcase { width: 100%; height: 182px; margin-top: 17px; }
  .showcase-card { width: 75px; flex-basis: 75px; height: 110px; border-width: 3px; }
  .showcase-card span { padding: 20px 5px 6px; }
  .composer-wrap { width: calc(100% - 24px); margin-top: 2px; padding-bottom: 40px; }
  .composer { height: 214px; padding-inline: 12px; }
  .composer textarea { height: 110px; font-size: 15px; }
  .suggestions { overflow-x: auto; justify-content: flex-start; padding-bottom: 5px; scrollbar-width: none; }
  .suggestions button { flex: 0 0 auto; }
  .toast { left: 50%; }
}

@media (max-width: 430px) {
  .showcase { height: 160px; }
  .hero h1 { font-size: 30px; }
  .tab { padding: 0 9px; }
  .left-tools { gap: 4px; }
  .text-tool { font-size: 12px; }
  .model-select { font-size: 12px; }
}

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