﻿:root {
  color-scheme: light;
  --ink: #101014;
  --muted: #6e6e73;
  --line: #dedee3;
  --soft: #f5f5f7;
  --paper: #ffffff;
  --blue: #0066cc;
  --blue-soft: #eaf3ff;
  --green: #24a36b;
  --orange: #ff8a3d;
  --pink: #f25f7a;
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.12);
  --app-shell-width: min(1440px, calc(100vw - 48px));
  --app-shell-gap: clamp(14px, 1.55vw, 24px);
  --app-shell-padding: clamp(16px, 1.35vw, 24px);
  --app-shell-min-height: clamp(560px, calc(100svh - 250px), 820px);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

:root {
  --topbar-height: 54px;
}

body {
  margin: 0;
  background: var(--soft);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

body.modal-open {
  overflow: hidden;
}

#top {
  display: grid;
  align-items: center;
  min-height: calc(100svh - 108px);
  padding: 28px 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

pre,
code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 80;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(210px, 1fr) auto minmax(210px, 1fr);
  align-items: center;
  height: var(--topbar-height);
  min-height: var(--topbar-height);
  padding: 0 44px;
  border-bottom: 1px solid rgba(222, 222, 227, 0.72);
  background: rgba(245, 245, 247, 0.82);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  font-size: 14px;
  font-weight: 800;
}

.brand-text {
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
  justify-self: start;
  color: var(--ink);
  font-family: Inter, "SF Pro Text", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0;
}

.brand-name-cn {
  font-weight: 760;
}

.brand-name-ai {
  display: inline-block;
  color: rgba(17, 17, 20, 0.82);
  font-size: 13px;
  font-weight: 430;
  letter-spacing: 0;
  transform: translateY(0.2px);
}

.brand-logo {
  display: block;
  width: 18px;
  height: auto;
}

.topbar-spacer {
  min-width: 1px;
}

.brand-mark {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  background: var(--ink);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  height: 54px;
  width: 348px;
  color: #515154;
  font-size: 13px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 72px;
  width: 72px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  color: #515154;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  white-space: nowrap;
}

.nav-link:visited,
.nav-link:hover,
.nav-link.active {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
}

.nav-link.active {
  color: var(--ink);
}

.nav a:hover,
.auth-link:hover {
  color: var(--blue);
}

.auth-actions {
  position: relative;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.06);
}

.member-link {
  min-width: 72px;
  min-height: 38px;
  border-color: var(--ink);
  background: var(--ink);
  color: #ffffff;
}

.member-link:hover {
  border-color: var(--ink);
  color: #ffffff;
  background: #2a2a2f;
}

.auth-link.active {
  border-color: #c9c9cf;
  background: #f5f5f7;
}

.points-stack {
  display: grid;
  gap: 1px;
  line-height: 1;
  text-align: left;
}

.points-stack span,
.points-stack strong {
  display: block;
}

.points-stack span {
  font-size: 11px;
  font-weight: 800;
}

.points-stack strong {
  color: inherit;
  font-size: 13px;
  font-weight: 900;
}

.top-icon {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
}

.works-icon {
  background:
    linear-gradient(currentColor, currentColor) center / 1.4px 11px no-repeat,
    linear-gradient(currentColor, currentColor) center / 11px 1.4px no-repeat;
}

.works-icon::before,
.works-icon::after {
  content: "";
  position: absolute;
}

.works-icon::before {
  inset: 2px;
  border: 1.4px solid currentColor;
  border-radius: 3px;
}

.works-icon::after {
  display: none;
}

.plus-icon::before,
.plus-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transform: translate(-50%, -50%);
}

.plus-icon::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.user-menu {
  position: relative;
}

.user-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 2px 9px 2px 3px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.avatar-logo {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  overflow: hidden;
  border: 1.6px solid var(--ink);
  border-radius: 50%;
  background: #ffffff;
  color: var(--ink);
}

.avatar-default {
  border-color: var(--ink);
  background: var(--ink);
  color: #ffffff;
}

.avatar-logo::before,
.avatar-logo::after {
  content: "";
  position: absolute;
  box-sizing: border-box;
}

.avatar-logo::before {
  top: 6px;
  left: 50%;
  width: 10px;
  height: 10px;
  border: 1.6px solid currentColor;
  border-radius: 50%;
  background: transparent;
  transform: translateX(-50%);
}

.avatar-logo::after {
  left: 50%;
  bottom: 4px;
  width: 18px;
  height: 10px;
  border: 1.6px solid currentColor;
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  transform: translateX(-50%);
}

.user-arrow {
  color: #8a8a92;
  font-size: 12px;
  line-height: 1;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 60;
  display: none;
  width: 210px;
  overflow: hidden;
  border: 1px solid rgba(222, 222, 227, 0.76);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.16);
}

.user-menu.open .user-dropdown {
  display: block;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 18px 16px;
}

.user-profile div {
  min-width: 0;
}

.user-profile strong,
.user-profile span,
.user-profile small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-profile strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.25;
}

.user-profile span,
.user-profile small {
  color: #8a8a92;
  font-size: 12px;
  line-height: 1.55;
}

.user-menu-list {
  padding: 6px;
}

.user-menu-item,
.logout-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  border-radius: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.user-menu-item {
  padding: 0 10px;
}

.user-menu-item:first-child {
  background: #f5f5f7;
}

.user-menu-item:hover,
.logout-link:hover {
  background: #f5f5f7;
}

.menu-icon {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  color: var(--ink);
}

.menu-icon::before,
.menu-icon::after {
  content: "";
  position: absolute;
  box-sizing: border-box;
}

.login-menu-icon::before {
  top: 3px;
  left: 2px;
  width: 8px;
  height: 10px;
  border: 1.5px solid currentColor;
  border-radius: 2px;
}

.login-menu-icon::after {
  top: 7px;
  right: 2px;
  width: 8px;
  height: 1.6px;
  border-radius: 2px;
  background: currentColor;
  box-shadow: 3px -3px 0 -1px currentColor, 3px 3px 0 -1px currentColor;
}

.account-menu-icon::before {
  top: 2px;
  left: 5px;
  width: 6px;
  height: 6px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
}

.account-menu-icon::after {
  left: 3px;
  bottom: 2px;
  width: 10px;
  height: 6px;
  border: 1.5px solid currentColor;
  border-top: 0;
  border-radius: 0 0 8px 8px;
}

.plus-menu-icon::before,
.plus-menu-icon::after {
  top: 7px;
  left: 4px;
  width: 8px;
  height: 1.6px;
  border-radius: 2px;
  background: currentColor;
}

.plus-menu-icon::after {
  transform: rotate(90deg);
}

.clock-menu-icon::before {
  inset: 2px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
}

.clock-menu-icon::after {
  top: 4px;
  left: 7px;
  width: 4px;
  height: 5px;
  border-left: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
}

.bag-menu-icon::before {
  left: 3px;
  bottom: 2px;
  width: 10px;
  height: 10px;
  border: 1.5px solid currentColor;
  border-radius: 3px;
}

.bag-menu-icon::after {
  top: 2px;
  left: 5px;
  width: 6px;
  height: 5px;
  border: 1.5px solid currentColor;
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
}

.chat-menu-icon::before {
  top: 3px;
  left: 2px;
  width: 12px;
  height: 9px;
  border: 1.5px solid currentColor;
  border-radius: 7px;
}

.chat-menu-icon::after {
  left: 5px;
  bottom: 2px;
  width: 5px;
  height: 5px;
  border-left: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-18deg);
}

.doc-menu-icon::before {
  inset: 2px 3px;
  border: 1.5px solid currentColor;
  border-radius: 2px;
}

.doc-menu-icon::after {
  top: 5px;
  left: 6px;
  width: 5px;
  height: 1.5px;
  background: currentColor;
  box-shadow: 0 4px 0 currentColor;
}

.help-menu-icon::before {
  inset: 2px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
}

.help-menu-icon::after {
  content: "?";
  top: 1px;
  left: 0;
  width: 16px;
  color: currentColor;
  font-size: 11px;
  font-weight: 900;
  line-height: 16px;
  text-align: center;
}

.menu-next {
  margin-left: auto;
  color: #8a8a92;
  font-size: 16px;
}

.logout-link {
  margin: 10px 14px;
  padding: 0 6px;
  color: #ff3b30;
}

.login-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  place-items: center;
  padding: 24px;
}

.login-modal.is-open {
  display: grid;
}

.history-confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 180;
  display: none;
  place-items: center;
  padding: 24px;
}

.history-confirm-modal.is-open {
  display: grid;
}

.history-confirm-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(17, 17, 20, 0.12);
}

.history-confirm-card {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 18px;
  width: min(420px, calc(100vw - 32px));
  padding: 24px;
  border: 1px solid #e1e1e6;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.18);
}

.history-confirm-card h2 {
  margin: 0;
  color: #111114;
  font-size: 18px;
  font-weight: 650;
  line-height: 1.35;
}

.history-confirm-card p {
  margin: 0;
  color: #303036;
  font-size: 14px;
  line-height: 1.7;
}

.history-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.history-confirm-actions button {
  min-width: 62px;
  min-height: 36px;
  padding: 0 15px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 560;
}

.history-confirm-primary {
  border: 0;
  background: #111114;
  color: #ffffff;
}

.history-confirm-secondary {
  border: 1px solid #dedee3;
  background: #ffffff;
  color: #303036;
}

.history-confirm-primary:hover {
  background: #2a2a2f;
}

.history-confirm-secondary:hover {
  background: #f3f3f5;
}

.login-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(16, 16, 20, 0.38);
  backdrop-filter: blur(12px);
}

.login-card {
  position: relative;
  z-index: 1;
  width: min(430px, 100%);
  padding: 24px;
  border: 1px solid rgba(222, 222, 227, 0.8);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.22);
}

.login-close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #ffffff;
  color: #6e6e73;
  font-size: 20px;
  line-height: 1;
}

.login-head {
  padding-right: 38px;
}

.login-head span {
  display: block;
  margin-bottom: 8px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.login-head h2 {
  margin-bottom: 8px;
  font-size: 30px;
}

.login-head p {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 14px;
}

.login-methods {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.login-method {
  display: grid;
  gap: 6px;
  justify-items: center;
  min-height: 70px;
  padding: 9px 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfbfd;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.login-method.active {
  border-color: #8bbcff;
  background: var(--blue-soft);
}

.login-method-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
}

.wechat-mark {
  background: linear-gradient(135deg, #13b96f 0%, #2fca82 100%);
}

.qq-mark {
  background: linear-gradient(135deg, #15191f 0%, #3b4655 100%);
}

.phone-mark,
.email-mark {
  position: relative;
}

.phone-mark::before {
  content: "";
  width: 11px;
  height: 17px;
  border: 1.7px solid #ffffff;
  border-radius: 4px;
}

.phone-mark::after {
  content: "";
  position: absolute;
  bottom: 6px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #ffffff;
}

.email-mark::before {
  content: "";
  width: 16px;
  height: 11px;
  border: 1.7px solid #ffffff;
  border-radius: 3px;
}

.email-mark::after {
  content: "";
  position: absolute;
  top: 10px;
  width: 12px;
  height: 8px;
  border-right: 1.7px solid #ffffff;
  border-bottom: 1.7px solid #ffffff;
  transform: rotate(45deg);
}

.login-panels {
  min-height: 246px;
}

.login-panel {
  display: none;
}

.login-panel.active {
  display: grid;
}

.login-panel:not(.form-panel) {
  justify-items: center;
  padding: 8px 0 0;
  text-align: center;
}

.qr-card {
  position: relative;
  display: grid;
  width: 168px;
  height: 168px;
  margin-bottom: 16px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    linear-gradient(90deg, rgba(16, 16, 20, 0.08) 1px, transparent 1px) 0 0 / 14px 14px,
    linear-gradient(rgba(16, 16, 20, 0.08) 1px, transparent 1px) 0 0 / 14px 14px,
    #ffffff;
}

.qr-card::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 8px solid var(--ink);
  border-radius: 8px;
  clip-path: polygon(0 0, 38% 0, 38% 18%, 18% 18%, 18% 38%, 0 38%, 0 0, 62% 0, 100% 0, 100% 38%, 82% 38%, 82% 18%, 62% 18%, 62% 0, 0 62%, 18% 62%, 18% 82%, 38% 82%, 38% 100%, 0 100%);
}

.qr-brand {
  position: relative;
  z-index: 1;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  font-size: 18px;
  font-weight: 900;
}

.login-panel strong {
  margin-bottom: 6px;
  font-size: 18px;
}

.login-panel p,
.login-tip {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.form-panel {
  gap: 12px;
}

.form-panel label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.form-panel input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfbfd;
  color: var(--ink);
  font: inherit;
  outline: 0;
}

.form-panel input:focus {
  border-color: #8bbcff;
  background: #ffffff;
}

.code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 8px;
}

.code-row button,
.login-submit {
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  background: var(--ink);
  color: #ffffff;
  font-size: 13px;
  font-weight: 850;
}

.login-submit {
  width: 100%;
  margin-top: 4px;
}

.login-tip {
  margin-top: 16px;
  text-align: center;
}

.hero {
  width: min(1040px, 100%);
  margin: 0 auto;
  padding: 56px 44px 32px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 860px;
  margin: 0 auto 18px;
  font-size: 50px;
  line-height: 1.12;
  font-weight: 850;
}

h2 {
  margin-bottom: 14px;
  font-size: 44px;
  line-height: 1.08;
  font-weight: 850;
}

h3 {
  margin-bottom: 10px;
  font-size: 22px;
  line-height: 1.15;
}

.hero-lead {
  max-width: 700px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(340px, 430px) minmax(0, 1fr);
  gap: var(--app-shell-gap);
  width: var(--app-shell-width);
  margin: 0 auto;
}

@media (min-width: 761px) {
  .workspace {
    min-height: var(--app-shell-min-height);
  }
}

.input-panel,
.output-panel,
.tool-grid article,
.api-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.input-panel,
.output-panel {
  min-height: var(--app-shell-min-height);
  padding: var(--app-shell-padding);
  box-shadow: var(--shadow);
}

.input-panel {
  overflow: visible;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 12px;
}

.panel-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.panel-head strong {
  font-size: 18px;
}

#output-title {
  display: none;
}

.setting-grid {
  position: relative;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -2px 0 12px;
}

.setting-card {
  position: relative;
  flex: 1 1 calc(50% - 4px);
  min-width: 0;
}

.setting-card[data-setting="ratio"],
.setting-card[data-setting="resolution"],
.setting-card[data-setting="modelChoice"],
.setting-card[data-setting="imageCount"] {
  flex-basis: calc(50% - 4px);
}

.setting-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbfd;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.04);
}

.setting-card.open .setting-trigger {
  border-color: #8bbcff;
  background: #ffffff;
}

.setting-value {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.setting-value span {
  overflow: hidden;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.setting-caret {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}

.setting-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  z-index: 30;
  display: none;
  min-width: max-content;
  overflow: hidden;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.14);
}

.setting-card.open .setting-menu {
  display: grid;
  gap: 2px;
}

.setting-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
}

.ui-icon {
  position: relative;
  flex: 0 0 auto;
  display: inline-block;
  width: 16px;
  height: 16px;
  color: var(--ink);
}

.ratio-icon::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 12px;
  border: 1.6px solid var(--ink);
  border-radius: 3px;
  transform: translate(-50%, -50%);
}

.resolution-icon::before {
  content: "HD";
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  width: 15px;
  height: 12px;
  place-items: center;
  border: 1.6px solid var(--ink);
  border-radius: 3px;
  color: var(--ink);
  font-size: 6px;
  font-weight: 800;
  line-height: 1;
  transform: translate(-50%, -50%);
}

.banana-icon::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 2px;
  width: 12px;
  height: 8px;
  border-bottom: 2px solid var(--ink);
  border-radius: 0 0 12px 12px;
  transform: rotate(-22deg);
}

.banana-icon::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 12px;
  width: 3px;
  height: 3px;
  border-top: 1.6px solid var(--ink);
  transform: rotate(-22deg);
}

.image-count-icon {
  background: url("assets/image-count-logo.svg") center / 16px 16px no-repeat;
}

.image-count-icon::before,
.image-count-icon::after {
  content: "";
  position: absolute;
  display: none;
}

.official-logo {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  object-fit: contain;
  background: transparent;
  border-radius: 0;
}

.ratio-icon[data-ratio-icon="3:4"]::before,
.ratio-icon[data-ratio-icon="9:16"]::before {
  width: 9px;
  height: 14px;
}

.ratio-icon[data-ratio-icon="4:3"]::before,
.ratio-icon[data-ratio-icon="16:9"]::before {
  width: 15px;
  height: 9px;
}

.ratio-icon[data-ratio-icon="custom"]::before {
  width: 13px;
  height: 10px;
  border-style: dashed;
}

.setting-menu-item:hover,
.setting-menu-item.active {
  background: #eef8f1;
}

.input-composer {
  overflow: visible;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfbfd;
}

.input-composer:focus-within {
  border-color: #8bbcff;
  box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.1);
}

.upload-box {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  min-height: 0;
  margin-bottom: 0;
  padding: 0;
  border: 1px solid #d8d8de;
  border-radius: 50%;
  background: #ffffff;
  text-align: center;
}

.upload-box:hover {
  border-color: #b9bbc4;
  background: #f5f5f7;
}

.upload-box input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.upload-icon {
  position: relative;
  display: block;
  width: 14px;
  height: 14px;
  margin-bottom: 0;
  border-radius: 0;
  background: transparent;
}

.upload-icon::before,
.upload-icon::after {
  content: "";
  position: absolute;
  background: var(--ink);
}

.upload-icon::before {
  top: 1px;
  left: 6px;
  width: 2px;
  height: 12px;
  border-radius: 8px;
}

.upload-icon::after {
  top: 6px;
  left: 1px;
  width: 12px;
  height: 2px;
  border-radius: 8px;
}

.upload-box strong {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.composer-actions {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 0 12px 10px;
}

.upload-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  flex: 1 1 auto;
  gap: 6px;
  min-width: 0;
  overflow: visible;
}

.upload-file-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 100%;
  max-width: none;
  min-height: 26px;
  min-width: 0;
  gap: 5px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink);
  font-size: 12px;
  line-height: 1;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.025);
}

.upload-file-name {
  overflow: hidden;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-file-remove {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #6e6e73;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}

.upload-file-remove:hover {
  background: #f0f0f2;
  color: var(--ink);
}

.upload-file-preview {
  pointer-events: none;
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  z-index: 30;
  display: block;
  width: 154px;
  height: 154px;
  overflow: hidden;
  border: 1px solid rgba(222, 222, 227, 0.9);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.14);
  opacity: 0;
  transform: translate(-50%, 6px) scale(0.98);
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.upload-file-chip:hover .upload-file-preview {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
  transition-delay: 0.5s;
}

.upload-file-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
  box-sizing: border-box;
}

.credit-pill {
  flex: 0 0 auto;
  margin-left: auto;
  min-width: 66px;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
  line-height: 30px;
  text-align: center;
  user-select: none;
}

.composer-actions small {
  max-width: 100%;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.composer-actions small:empty {
  display: none;
}

.prompt-box {
  display: grid;
  margin-bottom: 0;
  padding: 12px 14px 6px;
}

.prompt-box textarea {
  width: 100%;
  resize: vertical;
  min-height: clamp(190px, 22svh, 270px);
  padding: 0;
  border: 0;
  border-radius: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
}

.prompt-box textarea:focus {
  box-shadow: none;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.mode-card {
  min-height: 58px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
}

.mode-card strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}

.mode-card span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.mode-card.active,
.mode-card:hover {
  border-color: #d8d8de;
  background: #f1f1f3;
}

.generate-button {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: var(--ink);
  color: #ffffff;
  font-weight: 850;
}

.output-panel {
  display: grid;
  align-content: start;
}

.preview-stage {
  display: grid;
  grid-template-columns: minmax(260px, 0.95fr) minmax(260px, 1fr);
  gap: 14px;
  min-height: 326px;
}

.preview-stage.is-generating {
  grid-template-columns: 1fr;
}

.uploaded-preview,
.result-card {
  overflow: hidden;
  border-radius: 8px;
  background: #f5f5f7;
}

.uploaded-preview {
  display: grid;
  place-items: center;
  border: 1px solid #e7e7ea;
}

.preview-stage.is-generating .uploaded-preview {
  display: none;
}

.uploaded-preview.has-images {
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  align-content: start;
  gap: 6px;
  place-items: stretch;
  overflow-y: auto;
  padding: 6px;
}

.uploaded-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.uploaded-preview.has-images img {
  height: 96px;
  min-height: 0;
  border-radius: 8px;
}

.placeholder-product {
  display: grid;
  place-items: center;
  width: 150px;
  height: 190px;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.1);
}

.placeholder-product span {
  width: 78px;
  height: 78px;
  border-radius: 8px;
  background: var(--ink);
}

.result-card {
  position: relative;
  display: grid;
  align-content: end;
  min-height: 100%;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(16, 16, 20, 0.88) 72%),
    linear-gradient(135deg, #dceaff 0%, #ffffff 46%, #ffe2d2 100%);
  color: #ffffff;
}

.generated-image {
  position: absolute;
  inset: 0;
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.result-card.has-generated .generated-image {
  display: block;
}

.result-card.has-generated::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(16, 16, 20, 0.05) 0%, rgba(16, 16, 20, 0.82) 78%);
}

.result-card span {
  position: relative;
  z-index: 1;
  margin-bottom: 12px;
  color: rgba(255, 255, 255, 0.74);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.result-card strong {
  position: relative;
  z-index: 1;
  margin-bottom: 10px;
  font-size: 23px;
  line-height: 1.16;
}

.result-card p {
  position: relative;
  z-index: 1;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.65;
  white-space: pre-line;
}

.output-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.output-list article {
  min-height: 64px;
  padding: 12px;
  border-radius: 8px;
  background: #fbfbfd;
}

.output-list span {
  display: block;
  margin-bottom: 8px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.output-list strong {
  font-size: 15px;
}

.section {
  padding: 78px 44px;
}

.section-head {
  width: min(900px, 100%);
  margin: 0 auto 34px;
  text-align: center;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  width: min(1180px, 100%);
  margin: 0 auto;
}

.tool-grid article {
  min-height: 190px;
  padding: 20px;
}

.tool-grid span {
  display: inline-flex;
  margin-bottom: 36px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.tool-grid p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
}

.api {
  padding-top: 0;
}

.pricing {
  width: min(1040px, calc(100% - 40px));
  margin: 0 auto;
  padding: 8px 0 54px;
}

.recharge-page {
  min-height: calc(100vh - 110px);
}

.page-hero {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 62px 28px 24px;
  text-align: center;
}

.page-hero h1 {
  margin-bottom: 14px;
  font-size: 48px;
}

.page-hero p:not(.eyebrow) {
  max-width: 680px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}

.recharge-head {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.price-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  margin: 0 auto;
}

.price-grid article {
  min-height: 118px;
  padding: 22px 16px;
  border: 1px solid #dedee3;
  border-radius: 8px;
  background: #ffffff;
  text-align: center;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.05);
}

.price-grid article.featured {
  border-color: #8bbcff;
  background: linear-gradient(180deg, #ffffff 0%, #eef5ff 100%);
}

.price-grid span {
  display: block;
  margin-bottom: 14px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  text-transform: none;
}

.price-grid strong {
  display: block;
  margin: 0 0 12px;
  color: var(--blue);
  font-size: 25px;
  line-height: 1.2;
}

.price-grid p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.recharge-note {
  display: grid;
  gap: 4px;
  margin: 18px auto 12px;
  text-align: center;
}

.recharge-note strong {
  color: #e60012;
  font-size: 16px;
}

.recharge-note span {
  color: var(--muted);
  font-size: 13px;
}

.pay-panel {
  display: grid;
  justify-items: center;
  gap: 8px;
  width: min(360px, 100%);
  margin: 24px auto 0;
  padding: 22px 20px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.06);
  text-align: center;
}

.pay-panel strong {
  color: #e60012;
  font-size: 20px;
  line-height: 1;
}

.pay-panel span,
.pay-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.pay-methods {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  margin-top: 6px;
}

.pay-methods button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #ffffff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.pay-methods button.active,
.pay-methods button:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: #ffffff;
}

.pay-qr {
  width: 148px;
  height: 148px;
  margin-bottom: 4px;
  border: 1px solid #d4e0f2;
  border-radius: 8px;
  background:
    linear-gradient(90deg, #111 9px, transparent 9px) 0 0 / 18px 18px,
    linear-gradient(#111 9px, transparent 9px) 0 0 / 18px 18px,
    linear-gradient(90deg, transparent 5px, #fff 5px 13px, transparent 13px) 0 0 / 18px 18px,
    linear-gradient(transparent 5px, #fff 5px 13px, transparent 13px) 0 0 / 18px 18px,
  #ffffff;
  box-shadow: inset 0 0 0 10px #ffffff;
}

.site-footer {
  width: 100%;
  margin: 0;
  color: #6e6e73;
  font-size: 12px;
}

.footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 54px;
  padding: 0 44px;
  border-top: 1px solid rgba(222, 222, 227, 0.72);
  border-bottom: 1px solid rgba(222, 222, 227, 0.72);
  background: rgba(245, 245, 247, 0.82);
  backdrop-filter: blur(18px);
}

.footer-title {
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 18px;
}

.footer-links a {
  color: #63636a;
  font-weight: 700;
}

.footer-links a:hover {
  color: var(--blue);
}

.footer-company {
  margin: 12px 44px 28px;
  color: #9a9aa2;
  text-align: center;
}

.simple-topbar {
  grid-template-columns: minmax(210px, 1fr) auto minmax(210px, 1fr);
}

.legal-page {
  width: min(900px, calc(100% - 48px));
  min-height: calc(100vh - 180px);
  margin: 0 auto;
  padding: 70px 0 44px;
}

.legal-hero {
  margin-bottom: 26px;
}

.legal-hero h1 {
  margin: 0 0 14px;
  font-size: 46px;
  letter-spacing: 0;
}

.legal-hero p:not(.eyebrow) {
  max-width: 720px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}

.legal-card {
  margin-top: 12px;
  padding: 24px 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.04);
}

.legal-card h2 {
  margin: 0 0 12px;
  font-size: 22px;
}

.legal-card p {
  margin: 0;
  color: #4f4f56;
  font-size: 15px;
  line-height: 1.85;
}

.legal-card p + p {
  margin-top: 8px;
}

.works-page {
  display: grid;
  align-items: center;
  width: 100%;
  min-height: calc(100svh - 108px);
  margin: 0;
  padding: 28px 0;
}

.works-shell {
  display: grid;
  grid-template-columns: clamp(240px, 18vw, 280px) minmax(0, 1fr);
  gap: var(--app-shell-gap);
  width: var(--app-shell-width);
  min-height: var(--app-shell-min-height);
  margin: 0 auto;
}

@media (min-width: 761px) {
  .works-shell {
    align-items: stretch;
  }
}

.works-sidebar,
.works-content {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.04);
}

.works-sidebar {
  display: grid;
  gap: 18px;
  align-self: stretch;
  padding: var(--app-shell-padding);
}

.works-sidebar h1 {
  margin: 0;
  font-size: 30px;
}

.retention-note {
  display: grid;
  gap: 4px;
  padding: 14px;
  border-radius: 8px;
  background: #f5f5f7;
}

.retention-note strong {
  color: var(--ink);
  font-size: 13px;
}

.retention-note span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.date-list {
  display: grid;
  gap: 8px;
}

.date-list button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: #515154;
  font: inherit;
  cursor: pointer;
}

.date-list button.active,
.date-list button:hover {
  border-color: #8bbcff;
  background: var(--blue-soft);
  color: var(--ink);
}

.date-list strong {
  color: var(--blue);
  font-size: 12px;
}

.works-content {
  display: flex;
  flex-direction: column;
  height: var(--app-shell-min-height);
  min-height: 0;
  overflow: hidden;
  padding: var(--app-shell-padding);
}

.works-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.works-toolbar div {
  display: grid;
  gap: 3px;
}

.works-toolbar strong {
  font-size: 20px;
}

.works-toolbar span {
  color: var(--muted);
  font-size: 13px;
}

.new-work-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 16px;
  border-radius: 18px;
  background: var(--ink);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
}

.works-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  flex: 1;
  gap: 10px;
  min-height: 0;
  overflow: hidden;
}

.work-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  cursor: pointer;
}

.work-card:hover {
  border-color: #bfc1ca;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.08);
}

.single-work-card {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
  min-height: 0;
}

.work-card img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 420px;
  object-fit: contain;
  background: #f5f5f7;
}

.gallery-work-card img {
  height: 100%;
  min-height: 0;
  padding: 14px;
  box-sizing: border-box;
  object-fit: contain;
  background: #fbfbfc;
  transition: transform 0.18s ease;
}

.gallery-work-card[data-orientation="portrait"] img {
  padding: 12px 26px;
}

.gallery-work-card[data-orientation="landscape"] img {
  padding: 26px 12px;
}

.gallery-work-card[data-orientation="square"] img {
  padding: 16px;
}

.gallery-work-card:hover img {
  transform: scale(1.01);
}

.work-card-body {
  align-content: center;
  display: grid;
  gap: 12px;
  padding: 24px;
}

.work-card-body span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.work-card-body strong {
  font-size: 22px;
}

.work-card-body p {
  min-height: 0;
  margin: 0;
  color: #6e6e73;
  font-size: 14px;
  line-height: 1.65;
}

.work-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  z-index: 2;
  opacity: 1;
  pointer-events: auto;
  transform: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.icon-action {
  position: relative;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(16, 16, 20, 0.12);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.9);
  color: #000000;
  cursor: pointer;
  backdrop-filter: blur(12px);
}

.work-card:hover .work-actions,
.work-card:focus-within .work-actions {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

@media (hover: none) {
  .work-actions {
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }
}

.icon-action:hover {
  border-color: var(--ink);
  background: #ffffff;
}

.gallery-work-card .work-actions {
  top: 12px;
  right: 12px;
}

.work-action-logo {
  display: block;
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.eye-icon,
.trash-icon,
.download-icon,
.share-icon {
  position: relative;
  display: block;
  width: 16px;
  height: 16px;
}

.download-icon::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 2px;
  width: 2px;
  height: 8px;
  border-radius: 2px;
  background: currentColor;
}

.download-icon::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 7px;
  width: 8px;
  height: 8px;
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: rotate(45deg);
}

.share-icon::before,
.share-icon::after {
  content: "";
  position: absolute;
}

.share-icon::before {
  inset: 2px 3px 8px 8px;
  border-top: 1.6px solid currentColor;
  border-right: 1.6px solid currentColor;
  transform: rotate(28deg);
  transform-origin: right top;
}

.share-icon::after {
  right: 2px;
  top: 2px;
  width: 6px;
  height: 6px;
  border-top: 1.6px solid currentColor;
  border-right: 1.6px solid currentColor;
}

.eye-icon::before {
  content: "";
  position: absolute;
  inset: 3px 1px;
  border: 1.6px solid currentColor;
  border-radius: 50% / 55%;
}

.eye-icon::after {
  content: "";
  position: absolute;
  top: 6px;
  left: 6px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}

.trash-icon::before {
  content: "";
  position: absolute;
  left: 4px;
  bottom: 2px;
  width: 8px;
  height: 10px;
  border: 1.6px solid currentColor;
  border-top: 0;
  border-radius: 0 0 2px 2px;
}

.trash-icon::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 10px;
  height: 1.6px;
  border-radius: 2px;
  background: currentColor;
  box-shadow: 3px -3px 0 -0.4px currentColor;
}

.works-empty {
  display: grid;
  grid-column: 1 / -1;
  place-items: center;
  align-content: center;
  min-height: 100%;
  gap: 8px;
  border: 1px dashed #d8d8dd;
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.works-empty strong {
  color: var(--ink);
  font-size: 18px;
}

.works-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 36px;
  margin-top: 14px;
}

.works-pagination button {
  display: grid;
  place-items: center;
  min-width: 34px;
  height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #ffffff;
  color: #515154;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

.works-pagination button.active,
.works-pagination button:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: #ffffff;
}

.work-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  place-items: center;
  padding: 20px;
}

.work-modal.is-open {
  display: grid;
}

.work-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(10, 10, 14, 0.28);
}

.work-modal-card {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(260px, 1fr);
  gap: 22px;
  width: min(820px, 100%);
  padding: 22px;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.18);
}

.work-modal-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  background: #f5f5f7;
}

.work-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: #f5f5f7;
  color: var(--ink);
  font-size: 20px;
  cursor: pointer;
}

.work-modal-card h2 {
  margin-bottom: 8px;
  font-size: 26px;
}

.work-modal-card p {
  color: var(--muted);
  line-height: 1.7;
}

.keyword-box {
  margin: 18px 0;
  padding: 14px;
  border-radius: 8px;
  background: #f5f5f7;
  color: var(--ink);
  font-weight: 800;
  line-height: 1.65;
}

.work-modal-prompt {
  margin-bottom: 0;
}

.share-sheet {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: none;
  place-items: center;
  padding: 24px;
}

.share-sheet.is-open {
  display: grid;
}

.share-sheet-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(10, 10, 14, 0.34);
  backdrop-filter: blur(12px);
}

.share-sheet-card {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 18px;
  width: min(420px, 100%);
  padding: 18px;
  border: 1px solid rgba(222, 222, 227, 0.82);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.22);
}

.share-sheet-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #ffffff;
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
}

.share-sheet-preview {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding-right: 34px;
}

.share-sheet-preview img {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  background: #f5f5f7;
  object-fit: cover;
}

.share-sheet-preview h2 {
  display: -webkit-box;
  overflow: hidden;
  margin: 2px 0 4px;
  font-size: 18px;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.share-sheet-preview span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.share-options {
  display: grid;
  gap: 10px;
}

.share-option {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbfd;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.share-option:hover {
  border-color: var(--ink);
  background: #ffffff;
}

.share-target-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
}

.xhs-mark {
  background: #ff2442;
}

.xhs-mark::before {
  content: "红";
}

.douyin-mark {
  background: #101014;
}

.douyin-mark::before {
  content: "抖";
}

.wechat-mark {
  background: #07c160;
}

.wechat-mark::before {
  content: "微";
}

.work-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 120;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 12px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(16, 16, 20, 0.92);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
}

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

.keywords-page {
  width: var(--app-shell-width);
  min-height: calc(100vh - 150px);
  margin: 0 auto;
  padding: 44px 0 54px;
}

.keywords-hero {
  display: grid;
  justify-items: center;
  gap: 9px;
  max-width: 680px;
  margin: 0 auto 24px;
  text-align: center;
}

.keywords-hero h1 {
  margin: 0;
  font-size: 44px;
  line-height: 1.08;
}

.keywords-hero p:not(.eyebrow) {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.keywords-shell {
  min-height: var(--app-shell-min-height);
  padding: var(--app-shell-padding);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.04);
}

.keyword-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.keyword-filter button {
  min-height: 34px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fbfbfd;
  color: #515154;
  font-size: 13px;
  font-weight: 800;
}

.keyword-filter button.active,
.keyword-filter button:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: #ffffff;
}

.keyword-gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.keyword-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.keyword-card:hover {
  border-color: #bfc1ca;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.keyword-image-wrap {
  overflow: hidden;
  background: #f5f5f7;
}

.keyword-preview-trigger {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.keyword-image-wrap img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.prompt-keyword-card {
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: 392px;
}

.prompt-card-trigger {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 326px;
  padding: 16px;
  color: var(--ink);
  text-align: left;
  cursor: zoom-in;
}

.prompt-card-image {
  display: block;
  overflow: hidden;
  margin: -16px -16px 0;
  background: #f5f5f7;
}

.prompt-card-image img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.prompt-keyword-card.no-image {
  min-height: 268px;
}

.prompt-keyword-card.no-image .prompt-card-trigger {
  min-height: 202px;
}

.prompt-card-trigger h2 {
  display: -webkit-box;
  overflow: hidden;
  min-height: 42px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.prompt-card-trigger p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: #515154;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.58;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  word-break: break-word;
}

.prompt-keyword-card.no-image .prompt-card-trigger p {
  -webkit-line-clamp: 5;
}

.keyword-card-body {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  padding: 12px;
}

.keyword-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.keyword-card-head span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.keyword-card h2 {
  margin: 0;
  font-size: 15px;
  line-height: 1.22;
  text-align: left;
}

.keyword-preview-content h2:empty {
  display: none;
}

.keyword-copy {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfbfd;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.keyword-copy:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: #ffffff;
}

.keyword-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.keyword-tags-compact {
  max-height: 53px;
  overflow: hidden;
}

.keyword-tags button,
.keyword-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid #e5e5ea;
  border-radius: 12px;
  background: #f8f8fa;
  color: #33333a;
  font-size: 11px;
  font-weight: 750;
}

.keyword-tags button {
  cursor: pointer;
}

.keyword-tags button:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: #ffffff;
}

.keyword-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  place-items: center;
  padding: 28px;
}

.keyword-preview-modal.is-open {
  display: grid;
}

.keyword-preview-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(16, 16, 20, 0.36);
  backdrop-filter: blur(14px);
}

.keyword-preview-card {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(320px, 0.72fr);
  gap: 24px;
  width: min(1040px, 100%);
  max-height: calc(100vh - 56px);
  overflow: auto;
  padding: 22px;
  border: 1px solid rgba(222, 222, 227, 0.78);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 36px 100px rgba(0, 0, 0, 0.24);
}

.keyword-preview-card.no-image {
  grid-template-columns: minmax(0, 1fr);
  width: min(920px, 100%);
}

.keyword-preview-card.no-image .keyword-preview-content {
  padding-right: 44px;
}

.keyword-preview-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
}

.keyword-preview-image {
  overflow: hidden;
  border-radius: 10px;
  background: #f5f5f7;
}

.keyword-preview-image img {
  display: block;
  width: 100%;
  max-height: calc(100vh - 120px);
  object-fit: contain;
  background: #f5f5f7;
}

.keyword-preview-content {
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 12px 4px 4px;
}

.keyword-preview-content > span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.keyword-preview-content h2 {
  margin: 0;
  font-size: 30px;
  line-height: 1.16;
}

.keyword-preview-tags {
  max-height: min(48vh, 520px);
  overflow: auto;
  padding: 14px;
  border: 1px solid #e2e2e7;
  border-radius: 10px;
  background: #f8f8fa;
  color: var(--ink);
  font-size: 14px;
  font-weight: 750;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
}

.keyword-preview-tags[data-density="short"] {
  font-size: 15px;
  line-height: 1.9;
}

.keyword-preview-tags[data-density="long"] {
  font-size: 13px;
  line-height: 1.75;
}

.keyword-preview-copy {
  justify-self: start;
  min-height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: 20px;
  background: var(--ink);
  color: #ffffff;
  font-size: 13px;
  font-weight: 850;
}

.keyword-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 110;
  pointer-events: none;
  opacity: 0;
  min-height: 38px;
  padding: 0 16px;
  border-radius: 19px;
  background: rgba(16, 16, 20, 0.92);
  color: #ffffff;
  font-size: 13px;
  font-weight: 850;
  line-height: 38px;
  transform: translate(-50%, 14px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

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

@media (min-width: 1360px) {
  .keyword-gallery {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (min-width: 1600px) and (min-height: 850px) {
  .workspace {
    --app-shell-gap: 28px;
    --app-shell-padding: 26px;
    --app-shell-min-height: clamp(680px, calc(100svh - 188px), 940px);
    grid-template-columns: minmax(380px, 480px) minmax(0, 1fr);
    width: min(1680px, calc(100vw - 72px));
    min-height: var(--app-shell-min-height);
  }

  .works-shell {
    --app-shell-gap: 22px;
    --app-shell-padding: 20px;
    --app-shell-min-height: clamp(600px, calc(100svh - 240px), 860px);
    grid-template-columns: clamp(220px, 15vw, 260px) minmax(0, 1fr);
    width: min(1540px, calc(100vw - 104px));
    min-height: var(--app-shell-min-height);
  }

  .works-content {
    height: var(--app-shell-min-height);
  }

  .workspace .prompt-box textarea {
    min-height: clamp(240px, 27svh, 340px);
  }
}

.api-card {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(420px, 1.15fr);
  gap: 26px;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 28px;
}

.api-card p {
  color: var(--muted);
}

pre {
  overflow: auto;
  min-height: 260px;
  margin: 0;
  padding: 18px;
  border-radius: 8px;
  background: #101014;
  color: #f5f5f7;
  font-size: 13px;
  line-height: 1.55;
}

@media (max-width: 1080px) {
  h1 {
    font-size: 56px;
  }

  .workspace,
  .api-card {
    grid-template-columns: 1fr;
  }

  .tool-grid,
  .price-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .works-shell {
    grid-template-columns: 1fr;
  }

  .works-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(4, minmax(0, 1fr));
  }

  .keyword-gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .keyword-preview-card {
    grid-template-columns: 1fr;
    width: min(760px, 100%);
  }
}

@media (max-width: 760px) {
  #top {
    min-height: calc(100svh - 154px);
    padding: 18px 0;
  }

  .topbar {
    grid-template-columns: auto 1fr auto;
    height: 54px;
    padding: 0 20px;
  }

  .topbar-spacer {
    display: none;
  }

  .nav {
    display: flex;
    gap: 10px;
    width: 282px;
    font-size: 12px;
  }

  .nav-link {
    flex-basis: 64px;
    width: 64px;
    font-size: 12px;
  }

  .nav-link:visited,
  .nav-link:hover,
  .nav-link.active {
    font-size: 12px;
  }

  .brand-text {
    font-size: 13px;
  }

  .hero,
  .section {
    padding-right: 20px;
    padding-left: 20px;
  }

  .hero {
    padding-top: 54px;
  }

  h1 {
    font-size: 42px;
  }

  h2 {
    font-size: 32px;
  }

  .hero-lead {
    font-size: 17px;
  }

  .workspace {
    width: calc(100vw - 24px);
    min-height: 0;
    margin: 12px auto 20px;
  }

  .input-panel,
  .output-panel {
    min-height: 0;
    padding: 14px;
  }

  .preview-stage,
  .output-list,
  .tool-grid,
  .price-grid {
    grid-template-columns: 1fr;
  }

  .preview-stage {
    min-height: 0;
  }

  .setting-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .works-page {
    width: 100%;
    min-height: calc(100svh - 154px);
    padding: 18px 0 20px;
  }

  .works-shell {
    width: calc(100vw - 24px);
    min-height: 0;
  }

  .keywords-page {
    width: calc(100vw - 24px);
    padding: 28px 0 40px;
  }

  .keywords-hero h1 {
    font-size: 34px;
  }

  .keywords-shell {
    min-height: 0;
    padding: 14px;
  }

  .keyword-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .keyword-preview-modal {
    padding: 14px;
  }

  .keyword-preview-card {
    max-height: calc(100vh - 28px);
    padding: 14px;
  }

  .keyword-preview-content h2 {
    font-size: 24px;
  }

  .works-content,
  .works-sidebar {
    min-height: 0;
    padding: 16px;
  }

  .works-content {
    height: auto;
    min-height: 560px;
    overflow: visible;
  }

  .works-grid {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    overflow: visible;
    padding-right: 0;
  }

  .single-work-card {
    grid-template-columns: 1fr;
  }

  .work-card img {
    height: auto;
    min-height: 0;
  }

  .work-modal-card {
    grid-template-columns: 1fr;
  }

  .site-footer {
    width: 100%;
  }

  .footer-bar {
    justify-content: center;
    padding: 12px 20px;
    flex-direction: column;
  }

  .footer-company {
    margin-right: 20px;
    margin-left: 20px;
    text-align: center;
  }

  .legal-page {
    width: calc(100% - 40px);
    padding-top: 48px;
  }

  .legal-hero h1 {
    font-size: 38px;
  }

  .auth-actions {
    gap: 2px;
  }

  .auth-link {
    padding: 0 8px;
  }
}

@media (max-width: 520px) {
  .topbar {
    height: 50px;
    min-height: 50px;
    padding: 0 10px;
  }

  .brand {
    font-size: 13px;
  }

  .brand-logo {
    width: 18px;
  }

  .brand-mark {
    width: 14px;
    height: 14px;
    border-radius: 4px;
  }

  .auth-actions {
    gap: 5px;
  }

  .auth-link {
    width: 34px;
    height: 34px;
    min-height: 34px;
    padding: 0;
    border-radius: 50%;
  }

  .auth-link span:last-child {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .member-link {
    width: 46px;
    min-width: 46px;
    border-radius: 17px;
  }

  .member-link .points-stack {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
  }

  .member-link .points-stack span {
    font-size: 9px;
  }

  .member-link .points-stack strong {
    font-size: 11px;
  }

  .user-trigger {
    min-height: 34px;
    padding: 2px;
  }

  .user-arrow {
    display: none;
  }

  .user-dropdown {
    right: -4px;
    width: min(210px, calc(100vw - 20px));
  }

  .workspace {
    width: calc(100vw - 16px);
  }

  .mode-card {
    min-height: 54px;
  }

  .login-card {
    padding: 18px;
  }

  .login-methods {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-links {
    gap: 12px;
  }

  .legal-page {
    width: calc(100% - 24px);
  }

  .legal-card {
    padding: 20px;
  }

  .keyword-gallery {
    grid-template-columns: 1fr;
  }

  .keyword-preview-image img {
    max-height: 58vh;
  }
}

/* Chat-style workspace refresh */
#top {
  align-items: start;
  min-height: calc(100svh - 64px);
  padding: 0;
}

.workspace {
  grid-template-columns: 1fr;
  align-content: end;
  gap: 18px;
  width: min(1180px, calc(100vw - 48px));
  min-height: calc(100svh - 108px);
  padding: clamp(32px, 7vh, 70px) 0 clamp(28px, 7vh, 68px);
}

.welcome-panel {
  display: grid;
  place-items: center;
  min-height: clamp(220px, 38vh, 370px);
  text-align: center;
}

.welcome-panel h1 {
  max-width: min(860px, calc(100vw - 44px));
  margin: 0;
  color: #111114;
  font-size: clamp(32px, 4.2vw, 56px);
  font-weight: 720;
  line-height: 1.18;
  letter-spacing: 0;
}

.input-panel {
  min-height: 0;
  order: 3;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.input-composer {
  width: min(860px, 100%);
  margin: 0 auto;
  overflow: visible;
  border: 1px solid #d8d8de;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.05);
}

.input-composer:focus-within {
  border-color: #c9c9d0;
  box-shadow: 0 0 0 3px rgba(17, 17, 20, 0.04), 0 18px 48px rgba(0, 0, 0, 0.06);
}

.prompt-box {
  padding: 17px 19px 6px;
}

.prompt-box textarea {
  min-height: 34px;
  max-height: 148px;
  resize: none;
  color: #111111;
  font-size: 16px;
  line-height: 1.45;
}

.prompt-box textarea::placeholder {
  color: #9b9ba1;
}

.prompt-box textarea:disabled {
  opacity: 1;
  background: transparent;
  color: #111111;
}

.composer-actions {
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 10px 10px 17px;
}

.composer-tools,
.composer-submit {
  display: flex;
  align-items: center;
  min-width: 0;
}

.composer-tools {
  flex: 1 1 auto;
  gap: 12px;
}

.composer-submit {
  flex: 0 0 auto;
  gap: 8px;
}

.composer-divider {
  flex: 0 0 auto;
  width: 1px;
  height: 20px;
  background: #e4e4e8;
}

.upload-box {
  width: 26px;
  height: 26px;
  border: 0;
  background: transparent;
}

.upload-box:hover {
  background: #f1f1f3;
}

.upload-icon {
  width: 16px;
  height: 16px;
}

.upload-icon::before {
  left: 7px;
  height: 14px;
}

.upload-icon::after {
  top: 7px;
  width: 14px;
}

.mode-grid {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  margin: 0;
  overflow: visible;
}

.mode-measure {
  position: absolute;
  top: -10000px;
  left: -10000px;
  z-index: -1;
  flex-wrap: nowrap;
  width: max-content;
  max-width: none;
  pointer-events: none;
  visibility: hidden;
}

.mode-card,
.mode-more-item {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 7px;
  min-height: 30px;
  min-width: 0;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: #151517;
  font-size: 14px;
  line-height: 1;
  text-align: left;
  white-space: nowrap;
  transition: background 0.16s ease, color 0.16s ease, transform 0.12s ease, box-shadow 0.16s ease;
}

.mode-card::before,
.mode-more-item::before {
  content: "";
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
}

.mode-card[data-id="image"]::before,
.mode-more-item[data-id="image"]::before {
  border: 1.7px solid currentColor;
  border-radius: 4px;
  background: linear-gradient(135deg, transparent 48%, currentColor 49%, currentColor 58%, transparent 59%);
}

.mode-card[data-id="extend"]::before,
.mode-more-item[data-id="extend"]::before {
  border: 1.7px solid currentColor;
  border-radius: 4px;
  box-shadow: inset 4px 0 0 rgba(0, 0, 0, 0.08), inset -4px 0 0 rgba(0, 0, 0, 0.08);
}

.mode-card[data-id="cutout"]::before,
.mode-more-item[data-id="cutout"]::before {
  border: 1.7px dashed currentColor;
  border-radius: 50%;
}

.mode-card[data-id="clean"]::before,
.mode-more-item[data-id="clean"]::before {
  border: 1.7px solid currentColor;
  border-radius: 4px;
  background: linear-gradient(135deg, transparent 45%, currentColor 46%, currentColor 56%, transparent 57%);
  transform: rotate(-10deg);
}

.mode-card[data-id="retouch"]::before,
.mode-more-item[data-id="retouch"]::before {
  border: 1.7px solid currentColor;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, currentColor 0 2px, transparent 2.5px);
}

.mode-card[data-id="background"]::before,
.mode-more-item[data-id="background"]::before {
  border: 1.7px solid currentColor;
  border-radius: 4px;
  background: linear-gradient(90deg, transparent 45%, currentColor 46%, currentColor 55%, transparent 56%);
}

.mode-more-trigger::before {
  width: 4px;
  height: 4px;
  margin: 0 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: -6px 0 0 currentColor, 6px 0 0 currentColor, 0 6px 0 currentColor;
}

.mode-card strong,
.mode-more-item strong {
  overflow: visible;
  min-width: 0;
  color: inherit;
  font-size: inherit;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
}

.mode-card span {
  display: none;
}

.mode-card:hover,
.mode-more.active > .mode-more-trigger,
.mode-more.open > .mode-more-trigger {
  background: #f1f1f3;
  color: #111111;
}

.mode-card.active,
.mode-more-item.active {
  border-color: #111111;
  background: #f1f1f3;
  color: #151517;
}

.mode-card:active,
.mode-more-item:active {
  transform: scale(0.96);
}

.mode-more {
  position: relative;
  flex: 0 0 auto;
}

.mode-more-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  left: auto;
  z-index: 40;
  display: none;
  width: 226px;
  padding: 8px;
  border: 1px solid #dedee3;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 22px 58px rgba(0, 0, 0, 0.16);
}

.mode-more.open .mode-more-menu {
  display: grid;
  gap: 4px;
}

.mode-more-item {
  width: 100%;
  min-height: 42px;
  justify-content: flex-start;
  padding: 0 10px 0 12px;
  border-radius: 8px;
}

.mode-more-item span {
  margin-left: auto;
  overflow: hidden;
  max-width: 112px;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mode-more-item:hover,
.mode-more-item.active:hover {
  background: #f1f1f3;
  color: #151517;
}

.mode-more-item:hover {
  background: #f1f1f3;
  color: #111111;
}

.mode-card .mode-clear,
.mode-more-item .mode-clear {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  margin-left: -2px;
  color: currentColor;
  font-size: 14px;
  font-weight: 650;
  line-height: 1;
}

.credit-pill {
  min-width: 58px;
  min-height: 28px;
  padding: 0 10px;
  border-color: transparent;
  background: #f6f6f7;
  color: #3d3d42;
  font-size: 12px;
  line-height: 28px;
}

.generate-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #f1f1f3;
  color: #111111;
  font-size: 20px;
  font-weight: 750;
  line-height: 1;
}

.generate-button:hover {
  background: #e6e6ea;
  color: #111111;
}

.generate-button.is-stopping {
  background: #111114;
  color: #ffffff;
}

.generate-button.is-stopping::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: currentColor;
}

.generate-button.is-stopping:hover {
  background: #303034;
  color: #ffffff;
}

.generate-button:disabled {
  cursor: wait;
  color: #7a7a80;
}

.upload-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 0 16px 12px;
}

.upload-list:empty {
  display: none;
}

.upload-file-chip {
  width: auto;
  max-width: 220px;
  min-height: 28px;
  padding: 0 8px 0 10px;
  border-radius: 999px;
  font-size: 12px;
}

.setting-grid {
  z-index: 120;
  justify-content: center;
  width: min(860px, 100%);
  gap: 10px;
  margin: 10px auto 0;
}

.setting-card,
.setting-card[data-setting="ratio"],
.setting-card[data-setting="resolution"],
.setting-card[data-setting="imageCount"] {
  flex: 0 0 96px;
}

.setting-card[data-setting="modelChoice"] {
  flex: 0 0 auto;
  width: auto;
}

.setting-trigger {
  justify-content: center;
  width: 100%;
  min-height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: none;
}

.setting-card[data-setting="modelChoice"] .setting-trigger {
  width: max-content;
  min-width: 112px;
}

.setting-trigger .setting-value {
  flex: 0 0 auto;
  overflow: visible;
  text-overflow: clip;
}

.setting-trigger .setting-value span {
  overflow: visible;
  text-overflow: clip;
}

.setting-trigger .setting-caret {
  margin-left: 0;
}

.setting-menu {
  top: auto;
  bottom: calc(100% + 8px);
  z-index: 220;
}

.setting-card.open {
  z-index: 230;
}

.output-panel {
  order: 2;
  width: 100%;
  display: none;
  min-height: 0;
  padding: clamp(16px, 2vw, 24px);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 42px rgba(0, 0, 0, 0.05);
}

.workspace.has-output .output-panel {
  display: grid;
}

.workspace.has-output {
  align-content: start;
}

.workspace.has-output .welcome-panel {
  min-height: 78px;
}

.workspace.has-output .welcome-panel h1 {
  font-size: clamp(24px, 2.6vw, 36px);
}

.preview-stage {
  min-height: clamp(300px, 34vh, 430px);
}

@media (min-width: 1600px) and (min-height: 850px) {
  .workspace {
    grid-template-columns: 1fr;
    width: min(1240px, calc(100vw - 72px));
    min-height: calc(100svh - 108px);
  }

  .workspace .prompt-box textarea {
    min-height: 34px;
  }
}

@media (max-width: 760px) {
  #top {
    align-items: start;
    min-height: calc(100svh - 54px);
    padding: 0;
  }

  .workspace {
    width: calc(100vw - 24px);
    min-height: calc(100svh - 54px);
    margin: 0 auto;
    padding: 28px 0 72px;
  }

  .welcome-panel {
    min-height: clamp(250px, 42vh, 360px);
  }

  .welcome-panel h1 {
    max-width: 12em;
    font-size: clamp(29px, 7.5vw, 40px);
    font-weight: 720;
  }

  .input-panel,
  .output-panel {
    padding: 0;
  }

  .output-panel {
    padding: 14px;
  }

  .input-composer {
    border-radius: 20px;
  }

  .prompt-box {
    padding: 14px 15px 4px;
  }

  .composer-actions {
    align-items: flex-end;
    padding: 6px 8px 8px 12px;
  }

  .composer-tools {
    gap: 8px;
  }

  .mode-grid {
    flex-wrap: nowrap;
    overflow: visible;
    max-width: none;
    padding-bottom: 0;
  }

  .mode-card,
  .mode-more-item {
    font-size: 13px;
  }

  .mode-more-menu {
    right: 0;
    left: auto;
  }

  .credit-pill {
    display: none;
  }

  .setting-grid {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    width: 100%;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .setting-grid::-webkit-scrollbar {
    display: none;
  }

  .preview-stage {
    grid-template-columns: 1fr;
    min-height: 0;
  }
}

@media (max-width: 520px) {
  .workspace {
    width: calc(100vw - 16px);
  }

  .composer-divider {
    display: none;
  }

  .mode-grid {
    max-width: none;
    gap: 4px;
  }

  .mode-card {
    padding: 0 5px;
    font-size: 12px;
  }

  .mode-card::before {
    display: none;
  }

  .upload-box {
    width: 22px;
    height: 22px;
  }

  .generate-button {
    width: 32px;
    height: 32px;
    min-height: 32px;
  }

  .upload-list {
    padding-right: 12px;
    padding-left: 12px;
  }
}

/* ChatGPT-style result conversation */
.workspace.has-output .output-panel {
  width: min(920px, 100%);
  margin: 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.chat-thread {
  display: grid;
  gap: 18px;
  width: 100%;
  min-width: 0;
  overflow-x: hidden;
}

.chat-message {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  min-width: 0;
}

.user-message {
  position: relative;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 7px;
}

.user-message.has-edit-action {
  padding-right: 0;
}

.assistant-message {
  align-items: flex-start;
  justify-content: flex-start;
}

.assistant-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  margin-top: 0;
  border-radius: 50%;
  background: #101014;
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
}

.chat-bubble {
  max-width: min(720px, 78%);
  border-radius: 18px;
  font-size: 15px;
  line-height: 1.7;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.user-bubble {
  max-width: min(720px, 100%);
  padding: 10px 14px;
  border-bottom-right-radius: 6px;
  background: #f4f4f5;
  color: #111114;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.user-bubble[contenteditable="true"] {
  cursor: text;
  outline: none;
}

.user-bubble[contenteditable="true"]:hover {
  background: #eeeeef;
}

.user-bubble.is-editing {
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(17, 17, 20, 0.04), 0 18px 48px rgba(0, 0, 0, 0.06);
}

.user-bubble.is-revising {
  width: min(640px, 100%);
  min-height: 54px;
  padding: 14px 16px;
  border: 1px solid #d8d8de;
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(17, 17, 20, 0.04), 0 18px 48px rgba(0, 0, 0, 0.06);
  line-height: 1.65;
  white-space: pre-wrap;
}

.user-bubble.is-revising:empty::before {
  content: "发消息...";
  color: #9a9aa0;
}

.user-message-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  min-height: 18px;
  margin-top: -8px;
  padding-right: 4px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 140ms ease, transform 140ms ease;
  transition-delay: 0s;
}

.user-message.has-edit-action:hover .user-message-actions,
.user-message.has-edit-action:focus-within .user-message-actions {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-4px);
  transition-delay: 0.5s;
}

.user-message.has-edit-action:not(:hover):not(:focus-within) .user-message-actions {
  transition-delay: 0s;
}

.user-copy-button,
.user-edit-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  min-height: 16px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #5f5f66;
}

.user-message > .user-edit-button {
  display: none;
}

.user-copy-button:hover,
.user-copy-button:focus-visible,
.user-edit-button:hover,
.user-edit-button:focus-visible {
  background: #eeeeef;
  color: #111114;
}

.user-copy-button::before,
.user-copy-button::after,
.user-edit-button::before,
.user-edit-button::after {
  content: "";
  position: absolute;
  display: block;
}

.user-copy-button::before {
  width: 7px;
  height: 7px;
  border: 1.2px solid currentColor;
  border-radius: 2px;
  transform: translate(1.5px, -1.5px);
}

.user-copy-button::after {
  width: 7px;
  height: 7px;
  border: 1.2px solid currentColor;
  border-radius: 2px;
  background: #f7f7f8;
  transform: translate(-1.5px, 1.5px);
}

.user-copy-button.is-copied::after {
  width: 4px;
  height: 7px;
  border-top: 0;
  border-left: 0;
  border-radius: 0;
  background: transparent;
  transform: translateY(-0.5px) rotate(45deg);
}

.user-edit-button::before {
  width: 8px;
  height: 3.5px;
  border: 1.2px solid currentColor;
  border-left: 0;
  border-radius: 1px 2px 2px 1px;
  transform: rotate(-38deg);
}

.user-edit-button::after {
  width: 3px;
  height: 3px;
  border-left: 1.2px solid currentColor;
  border-bottom: 1.2px solid currentColor;
  transform: translate(-4px, 3.5px) rotate(7deg);
}

.user-revision-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  width: min(640px, 76vw);
}

.user-revision-actions button {
  min-height: 32px;
  padding: 0 14px;
  border: 1px solid #dedee3;
  border-radius: 999px;
  background: #ffffff;
  color: #111114;
  font-size: 14px;
  font-weight: 560;
  line-height: 1;
}

.user-revision-actions button:hover {
  border-color: #c8c8ce;
  background: #f7f7f8;
}

.user-revision-submit {
  border-color: #111114 !important;
  background: #111114 !important;
  color: #ffffff !important;
}

.user-revision-submit:hover {
  background: #2a2a2d !important;
}

.assistant-bubble {
  flex: 1 1 auto;
  min-width: 0;
  max-width: min(720px, calc(100% - 44px));
  padding: 0;
  color: #111114;
}

.chat-thread .preview-stage {
  display: block;
  min-height: 0;
}

.chat-thread .uploaded-preview {
  display: none;
}

.chat-thread .uploaded-preview.has-images {
  display: grid;
  width: min(520px, 100%);
  margin-bottom: 10px;
}

.chat-thread .result-card {
  min-height: 0;
  padding: 0;
  overflow: visible;
  border-radius: 0;
  background: transparent;
  color: #111114;
}

.chat-thread .result-card.has-generated {
  display: grid;
  gap: 10px;
  width: min(560px, 100%);
}

.chat-thread .result-card.has-generated .generated-image {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  max-height: 560px;
  border-radius: 14px;
  object-fit: contain;
  background: #f5f5f7;
}

.chat-thread .result-card.has-generated::after,
.chat-thread .result-card::after {
  display: none;
}

.chat-thread .result-card span {
  display: none;
}

.chat-thread .result-card .answer-token {
  display: inline-block;
  margin: 0;
  color: #111114;
  font: inherit;
  line-height: inherit;
  text-transform: none;
}

.chat-thread .result-card strong {
  margin: 0 0 6px;
  color: #111114;
  font-size: 16px;
  line-height: 1.45;
}

.chat-thread .result-card strong:empty {
  display: none;
}

.chat-thread .result-card p {
  margin: 0;
  color: #111114;
  font-size: 15px;
  line-height: 1.75;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.chat-thread .answer-heading {
  font-weight: 760;
}

.chat-thread .completion-time {
  margin-top: 10px;
  color: #8a8a92;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
}

.assistant-message:not(.is-pending) .assistant-bubble {
  padding-top: 1px;
}

.chat-thread .result-card p.streaming-answer {
  position: relative;
}

.chat-thread .result-card p.streaming-answer::after {
  display: none;
  content: none;
}

.answer-token {
  display: inline-block;
  color: #111114;
  opacity: 0;
  transform: translateY(5px);
  animation: answerTokenIn 262ms ease forwards;
}

.chat-thread .result-card p:empty {
  display: none;
}

.chat-thread .result-card.is-loading {
  display: inline-grid;
  min-width: 54px;
  min-height: 34px;
  place-items: center;
  padding: 8px 12px;
  border-radius: 18px;
  background: #f4f4f5;
}

.chat-thread .result-card.is-loading::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #8d8d93;
  box-shadow: 12px 0 0 #b0b0b5, 24px 0 0 #d1d1d6;
  animation: typingDots 1s infinite ease-in-out;
}

@keyframes typingDots {
  0%, 100% {
    opacity: 0.45;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

@keyframes answerTokenIn {
  0% {
    opacity: 0;
    filter: blur(5px);
    transform: translateY(5px);
  }

  100% {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}

@keyframes streamCursor {
  0%, 100% {
    opacity: 0.22;
  }

  50% {
    opacity: 0.95;
  }
}

.chat-thread .output-list {
  display: none;
}

@media (max-width: 760px) {
  .workspace.has-output .output-panel {
    width: 100%;
  }

  .chat-bubble {
    max-width: min(100%, calc(100vw - 78px));
  }

  .assistant-avatar {
    width: 28px;
    height: 28px;
    font-size: 13px;
  }

  .chat-thread .result-card p {
    font-size: 14px;
  }
}

/* OpenAI-style shell and in-page composer */
.app-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100svh;
  padding-top: var(--topbar-height);
  background: #f7f7f8;
}

.main-column {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.history-sidebar {
  position: sticky;
  top: var(--topbar-height);
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-self: start;
  height: calc(100svh - var(--topbar-height));
  padding: 12px;
  overflow: hidden;
  border-right: 1px solid #e5e5e8;
  background: #f8f8f8;
  color: #1f1f22;
}

.history-sidebar-head {
  display: grid;
  gap: 10px;
}

.history-head-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 6px;
  align-items: center;
}

.history-brand {
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
  width: max-content;
  min-height: 34px;
  padding: 0 8px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
}

.history-brand:hover,
.history-nav-link:hover,
.sidebar-nav-link:hover,
.history-all-link:hover,
.new-chat-button:hover,
.sidebar-toggle-button:hover,
.sidebar-open-button:hover,
.history-item:hover,
.history-row.menu-open .history-item,
.history-section summary:hover {
  background: #ececf1;
}

.new-chat-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #1f1f22;
  text-align: left;
}

.new-chat-button span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #111114;
  color: #ffffff;
  font-size: 18px;
  font-weight: 500;
  line-height: 1;
}

.new-chat-button strong {
  font-size: 14px;
  font-weight: 620;
}

.sidebar-toggle-button,
.sidebar-open-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #4f4f55;
}

.sidebar-toggle-button span,
.sidebar-open-button span {
  position: relative;
  width: 17px;
  height: 15px;
  border: 1.5px solid currentColor;
  border-radius: 4px;
}

.sidebar-toggle-button span::before,
.sidebar-open-button span::before {
  content: "";
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 5px;
  border-left: 1.5px solid currentColor;
}

.sidebar-open-button {
  display: none;
  justify-self: start;
}

.top-new-chat-button {
  display: none;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(222, 222, 227, 0.9);
  border-radius: 999px;
  background: #ffffff;
  color: #111114;
  font-size: 13px;
  font-weight: 700;
}

.top-new-chat-button span {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #111114;
  color: #ffffff;
  font-size: 15px;
  line-height: 1;
}

.history-nav {
  display: grid;
  gap: 2px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e5e5e8;
}

.history-nav-link,
.history-all-link {
  display: flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  color: #303034;
  font-size: 14px;
  font-weight: 540;
}

.history-nav-link.active {
  background: #ececf1;
  color: #111114;
}

.sidebar-quick-nav {
  display: grid;
  gap: 2px;
  padding: 2px 0 8px;
  border-bottom: 1px solid #e7e7ea;
}

.sidebar-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #222226;
  text-align: left;
  text-decoration: none;
}

.sidebar-nav-link strong {
  font-size: 14px;
  font-weight: 520;
}

.sidebar-nav-icon {
  position: relative;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  color: #222226;
}

.search-chat-icon::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 9px;
  height: 9px;
  border: 1.6px solid currentColor;
  border-radius: 50%;
}

.search-chat-icon::after {
  content: "";
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 7px;
  border-top: 1.6px solid currentColor;
  transform: rotate(45deg);
  transform-origin: center;
}

.image-chat-icon::before {
  content: "";
  position: absolute;
  inset: 3px 2px;
  border: 1.5px solid currentColor;
  border-radius: 4px;
}

.image-chat-icon::after {
  content: "";
  position: absolute;
  left: 5px;
  right: 5px;
  bottom: 5px;
  height: 6px;
  border-left: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: skewX(-18deg);
}

.sidebar-history {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

.sidebar-history h2 {
  margin: 4px 8px 6px;
  color: #77777d;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.2;
}

.history-list {
  display: grid;
  gap: 2px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: thin;
}

.history-section {
  display: grid;
  gap: 2px;
}

.history-section summary {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  margin: 6px 0 2px;
  padding: 0 8px;
  border-radius: 8px;
  color: #77777d;
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
  list-style: none;
}

.history-section summary::-webkit-details-marker {
  display: none;
}

.history-section summary::before {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 160ms ease;
}

.history-section[open] summary::before {
  transform: rotate(45deg);
}

.history-section summary span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-section summary small {
  margin-left: auto;
  color: #9b9ba1;
  font-size: 11px;
  font-weight: 600;
}

.history-section-list {
  display: grid;
  gap: 2px;
}

.history-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  align-items: center;
  border-radius: 8px;
}

.history-item {
  display: grid;
  gap: 2px;
  width: 100%;
  min-height: 42px;
  padding: 7px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #202124;
  text-align: left;
}

.history-more-button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #68686f;
  opacity: 0.45;
}

.history-more-button span {
  display: block;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  transform: translateY(-2px);
}

.history-row:hover .history-more-button,
.history-row.menu-open .history-more-button {
  opacity: 1;
}

.history-more-button:hover {
  background: #e1e1e6;
  color: #111114;
}

.history-action-menu {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 140;
  display: none;
  width: 190px;
  padding: 8px;
  border: 1px solid #dedee3;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.14);
}

.history-row.menu-open .history-action-menu {
  display: grid;
  gap: 2px;
}

.history-action-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 0 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #232326;
  text-align: left;
  font-size: 14px;
  font-weight: 460;
}

.history-action-menu button:hover {
  background: #f2f2f4;
}

.history-action-menu button.danger {
  color: #d33131;
}

.history-menu-icon {
  display: inline-grid;
  place-items: center;
  width: 18px;
  color: currentColor;
  font-size: 15px;
  line-height: 1;
}

.history-item strong,
.history-item span {
  overflow: hidden;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-item strong {
  font-size: 14px;
  font-weight: 520;
  line-height: 1.25;
}

.history-item span {
  color: #707076;
  font-size: 12px;
}

.history-empty {
  margin: 8px;
  padding: 10px;
  border-radius: 8px;
  color: #77777d;
  font-size: 13px;
}

.history-all-link {
  flex: 0 0 auto;
  border-top: 1px solid #e5e5e8;
  border-radius: 0;
  padding-top: 12px;
}

.app-layout .topbar {
  grid-template-columns: minmax(84px, 1fr) auto minmax(84px, 1fr);
  padding: 0 28px;
  background: rgba(247, 247, 248, 0.86);
}

.app-layout .topbar .brand-text {
  display: inline-flex;
}

.app-layout .topbar .nav {
  display: flex;
  width: auto;
  gap: 10px;
}

.app-layout .auth-actions {
  justify-self: end;
}

.workspace {
  width: min(1120px, calc(100% - 48px));
  min-height: calc(100svh - 54px);
  padding-bottom: clamp(34px, 7vh, 72px);
}

.input-panel {
  position: relative;
  left: auto;
  bottom: auto;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  transform: none;
}

.input-composer {
  order: 2;
  width: min(860px, 100%);
}

.setting-grid {
  order: 1;
  width: min(860px, 100%);
  margin: 0 auto 12px;
}

.workspace.has-output {
  align-content: stretch;
  grid-template-rows: auto minmax(150px, 1fr) auto;
}

.workspace.has-output .output-panel {
  margin-bottom: 0;
}

@media (max-width: 980px) {
  .app-layout {
    display: block;
  }

  .history-sidebar {
    display: none;
  }

  .top-new-chat-button {
    display: inline-flex;
  }

  .app-layout .topbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: 0 12px;
  }

  .app-layout .topbar .brand-text {
    display: inline-flex;
  }

  .app-layout .topbar .nav {
    display: flex;
    justify-self: center;
    width: auto;
    gap: 4px;
  }

  .app-layout .topbar .nav .brand,
  .app-layout .topbar .nav .nav-link[href="works.html"] {
    display: none;
  }

  .app-layout .topbar .nav-link {
    flex: 0 0 auto;
    width: auto;
    min-width: 42px;
    padding: 0 4px;
    font-size: 12px;
  }

  .app-layout .workspace {
    width: calc(100vw - 24px);
  }
}

@media (max-width: 760px) {
  .workspace {
    min-height: calc(100svh - 54px);
    padding-bottom: 18px;
  }

  .setting-grid {
    padding: 0 1px 2px;
  }
}

@media (max-width: 520px) {
  .app-layout .workspace {
    width: calc(100vw - 16px);
  }

  .top-new-chat-button {
    width: 30px;
    padding: 0;
    justify-content: center;
  }

  .top-new-chat-button strong {
    display: none;
  }
}

/* Top welcome title refresh */
.workspace {
  align-content: stretch;
  grid-template-rows: clamp(104px, 17vh, 148px) minmax(180px, 1fr) auto;
  padding-top: clamp(18px, 3.4vh, 34px);
  padding-bottom: clamp(18px, 3vh, 30px);
}

.welcome-panel {
  align-self: stretch;
  min-height: 0;
  place-items: center;
}

.welcome-title {
  position: relative;
  display: grid;
  gap: 4px;
  justify-items: center;
  max-width: min(900px, 100%);
  margin: 0 auto;
  color: transparent;
  text-align: center;
}

.welcome-title::after {
  content: "";
  width: min(220px, 42vw);
  height: 1px;
  margin-top: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(0, 102, 204, 0.42), rgba(255, 111, 97, 0.34), transparent);
  opacity: 0;
  transform: scaleX(0.55);
  animation: welcomeLine 900ms ease 620ms forwards;
}

.welcome-hello,
.welcome-question {
  display: block;
  background: linear-gradient(115deg, #111114 0%, #1b1b20 30%, #5d6b86 52%, #111114 74%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-family: "SF Pro Display", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-weight: 640;
  letter-spacing: 0;
  line-height: 1.08;
  opacity: 0;
  transform: translateY(16px) scale(0.985);
  animation: welcomeRise 850ms cubic-bezier(0.16, 1, 0.3, 1) forwards, welcomeShine 4.8s ease-in-out 1s infinite;
}

.welcome-hello {
  font-size: clamp(27px, 3.2vw, 46px);
  font-weight: 640;
  animation-delay: 80ms, 1.1s;
}

.welcome-question {
  font-size: clamp(27px, 3.2vw, 46px);
  font-weight: 640;
  animation-delay: 220ms, 1.25s;
}

.input-panel {
  align-self: end;
}

.workspace.has-output {
  grid-template-rows: clamp(78px, 12vh, 108px) minmax(170px, 1fr) auto;
}

.workspace.has-output .welcome-title {
  gap: 1px;
}

.workspace.has-output .welcome-title::after {
  display: none;
}

.workspace.has-output .welcome-hello {
  display: none;
}

.workspace.has-output .welcome-question {
  font-size: clamp(22px, 2.2vw, 32px);
}

@keyframes welcomeRise {
  0% {
    opacity: 0;
    filter: blur(14px);
    transform: translateY(18px) scale(0.985);
  }

  100% {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) scale(1);
  }
}

@keyframes welcomeShine {
  0%, 100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

@keyframes welcomeLine {
  100% {
    opacity: 1;
    transform: scaleX(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .welcome-hello,
  .welcome-question,
  .welcome-title::after {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 760px) {
  .workspace {
    grid-template-rows: clamp(108px, 22vh, 148px) minmax(160px, 1fr) auto;
    padding-top: 20px;
    padding-bottom: 18px;
  }

  .welcome-question {
    font-size: clamp(24px, 6.2vw, 32px);
  }

  .welcome-hello {
    font-size: clamp(24px, 6.2vw, 32px);
  }
}

/* Single-line artistic welcome */
.workspace {
  grid-template-rows: clamp(142px, 23vh, 196px) minmax(150px, 1fr) auto;
  padding-top: clamp(30px, 5.8vh, 60px);
}

.welcome-panel {
  align-items: end;
  padding-bottom: clamp(8px, 1.4vh, 18px);
}

.welcome-title {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.18em;
  width: min(1000px, 100%);
  white-space: nowrap;
}

.welcome-hello,
.welcome-question {
  display: inline-block;
  background: linear-gradient(108deg, #101014 0%, #2d374d 34%, #7a5b45 52%, #141418 76%, #101014 100%);
  background-size: 240% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  font-family: "STKaiti", "KaiTi", "FangSong", "Microsoft YaHei", system-ui, sans-serif;
  font-size: clamp(30px, 4.2vw, 58px);
  font-weight: 650;
  line-height: 1.06;
  text-shadow: 0 18px 38px rgba(20, 20, 24, 0.11);
}

.welcome-hello {
  font-size: clamp(30px, 4.2vw, 58px);
  font-weight: 650;
}

.welcome-question {
  font-size: clamp(30px, 4.2vw, 58px);
  font-weight: 650;
}

.welcome-title::after {
  position: absolute;
  right: clamp(40px, 15%, 190px);
  bottom: -10px;
  width: clamp(110px, 18vw, 210px);
  height: 2px;
  margin-top: 0;
  background: linear-gradient(90deg, transparent, rgba(122, 91, 69, 0.58), rgba(0, 102, 204, 0.38), transparent);
}

.workspace.has-output {
  grid-template-rows: clamp(82px, 13vh, 116px) minmax(170px, 1fr) auto;
}

.workspace.has-output .welcome-hello {
  display: inline-block;
}

.workspace.has-output .welcome-hello,
.workspace.has-output .welcome-question {
  font-size: clamp(20px, 2.1vw, 30px);
}

@media (max-width: 760px) {
  .workspace {
    grid-template-rows: clamp(142px, 23vh, 178px) minmax(140px, 1fr) auto;
    padding-top: 30px;
  }

  .welcome-title {
    gap: 0.12em;
  }

  .welcome-hello,
  .welcome-question {
    font-size: clamp(22px, 5.3vw, 30px);
  }
}

/* Hide welcome title once a conversation starts */
.workspace.has-output {
  grid-template-rows: minmax(170px, 1fr) auto;
}

.workspace.has-output .welcome-panel {
  display: none;
}

@media (max-width: 760px) {
  .workspace.has-output {
    grid-template-rows: minmax(160px, 1fr) auto;
  }
}

/* Reference-style opening welcome */
.welcome-title {
  display: grid;
  justify-items: center;
  gap: 20px;
  width: min(1120px, 100%);
  max-width: 100%;
}

.welcome-title::after {
  display: none;
}

.welcome-main {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  width: 100%;
  color: #17171b;
  font-family: "Source Han Sans SC", "Noto Sans CJK SC", "思源黑体", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 44px;
  font-weight: 400;
  line-height: 1;
  text-shadow: 0 10px 24px rgba(17, 17, 20, 0.04);
  animation: welcomeInkIn 820ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.welcome-main span {
  display: inline-block;
  min-width: 0.66em;
  text-align: center;
}

.welcome-subtitle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #5d5d66;
  font-family: "Source Han Sans SC", "Noto Sans CJK SC", "思源黑体", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 400;
  line-height: 1;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(8px);
  animation: welcomeSubtitleIn 720ms ease 220ms forwards;
}

.welcome-subtitle span {
  display: inline-block;
  min-width: 0.42em;
  text-align: center;
}

.welcome-subtitle .welcome-space {
  width: 8px;
  min-width: 8px;
}

@keyframes welcomeInkIn {
  0% {
    opacity: 0;
    filter: blur(10px);
    transform: translateY(12px);
  }

  100% {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}

@keyframes welcomeSubtitleIn {
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .welcome-title {
    gap: 18px;
  }

  .welcome-main {
    gap: 14px;
    font-size: 38px;
  }

  .welcome-subtitle {
    gap: 7px;
    font-size: 12px;
  }

  .welcome-subtitle .welcome-space {
    width: 7px;
    min-width: 7px;
  }
}

@media (max-width: 760px) {
  .welcome-title {
    gap: 14px;
  }

  .welcome-main {
    gap: 6px;
    font-size: 28px;
  }

  .welcome-subtitle {
    gap: 4px;
    font-size: 10px;
  }

  .welcome-subtitle .welcome-space {
    width: 4px;
    min-width: 4px;
  }
}

/* Fixed composer with independently scrollable conversation */
.workspace.has-output {
  height: calc(100svh - 54px);
  min-height: calc(100svh - 54px);
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
  padding-top: clamp(12px, 2vh, 22px);
  padding-bottom: clamp(10px, 1.8vh, 18px);
}

.workspace.has-output .output-panel {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding: 0 0 clamp(16px, 2.6vh, 26px);
  scrollbar-width: thin;
}

.workspace.has-output .output-panel::-webkit-scrollbar {
  width: 8px;
}

.workspace.has-output .output-panel::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(17, 17, 20, 0.18);
}

.workspace.has-output .chat-thread {
  min-height: 100%;
  align-content: start;
  padding: 4px 2px 12px;
}

.workspace.has-output .input-panel {
  position: relative;
  z-index: 30;
  align-self: end;
  padding-top: 12px;
  background: linear-gradient(180deg, rgba(247, 247, 248, 0), #f7f7f8 42%, #f7f7f8 100%);
}

.assistant-thinking {
  display: none;
  align-self: flex-start;
  gap: 0;
  padding-top: 0;
  color: #6e6e73;
  font-size: 14px;
  font-weight: 350;
  line-height: 1.35;
}

.assistant-thinking-main,
.assistant-thinking-elapsed {
  display: block;
}

.assistant-thinking-main {
  color: #4f4f55;
  font-weight: 360;
  line-height: 28px;
}

.assistant-thinking-elapsed {
  color: #9a9aa0;
  font-size: 12px;
  font-weight: 350;
  line-height: 16px;
}

.assistant-message.is-pending .assistant-thinking {
  display: grid;
}

.assistant-message.is-pending {
  align-items: flex-start;
}

.assistant-message.is-pending .assistant-bubble {
  display: none;
}

.assistant-message.is-pending .assistant-avatar {
  display: grid;
  width: 28px;
  height: 28px;
  margin-top: 0;
  border: 1px solid #e2e2e7;
  background: #ffffff;
  color: #111114;
  font-size: 13px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
  font-weight: 750;
}

@media (max-width: 760px) {
  .workspace.has-output {
    height: calc(100svh - 54px);
    min-height: calc(100svh - 54px);
    padding-top: 10px;
    padding-bottom: 12px;
  }

  .workspace.has-output .output-panel {
    padding-bottom: 14px;
  }
}

/* Keep the ChatGPT-like history rail visible below the global header on tablet/desktop widths. */
@media (min-width: 521px) {
  .app-layout {
    display: grid;
    grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
  }

  .history-sidebar {
    display: flex;
  }

  .top-new-chat-button {
    display: none;
  }
}

@media (max-width: 520px) {
  .app-layout {
    display: grid;
    grid-template-columns: minmax(150px, 36vw) minmax(0, 1fr);
  }

  .history-sidebar {
    display: flex;
    gap: 8px;
    padding: 8px;
  }

  .top-new-chat-button {
    display: none;
  }

  .history-brand {
    min-height: 28px;
    font-size: 13px;
  }

  .new-chat-button {
    min-height: 34px;
    padding: 0 7px;
  }

  .new-chat-button strong,
  .history-nav-link,
  .history-all-link,
  .history-item strong {
    font-size: 12px;
  }

  .history-item {
    min-height: 38px;
    padding: 6px 7px;
  }

  .history-item span {
    font-size: 11px;
  }
}

.app-layout.sidebar-collapsed {
  grid-template-columns: 48px minmax(0, 1fr);
}

.app-layout.sidebar-collapsed .history-sidebar {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 5px;
  overflow: visible;
}

.app-layout.sidebar-collapsed .history-sidebar-head {
  display: grid;
  justify-items: center;
  gap: 8px;
  width: 100%;
}

.app-layout.sidebar-collapsed .history-head-row {
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  width: 100%;
}

.app-layout.sidebar-collapsed .new-chat-button,
.app-layout.sidebar-collapsed .sidebar-toggle-button,
.app-layout.sidebar-collapsed .sidebar-nav-link {
  position: relative;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 8px;
}

.app-layout.sidebar-collapsed .new-chat-button strong,
.app-layout.sidebar-collapsed .sidebar-nav-link strong,
.app-layout.sidebar-collapsed .sidebar-history,
.app-layout.sidebar-collapsed .history-all-link {
  display: none;
}

.app-layout.sidebar-collapsed .new-chat-button span {
  position: relative;
  width: 20px;
  height: 20px;
  border-radius: 0;
  background: transparent;
  color: transparent;
  font-size: 16px;
}

.app-layout.sidebar-collapsed .new-chat-button span::before,
.app-layout.sidebar-collapsed .new-chat-button span::after {
  content: "";
  position: absolute;
  display: block;
  color: #222226;
}

.app-layout.sidebar-collapsed .new-chat-button span::before {
  width: 12px;
  height: 5px;
  border: 1.6px solid currentColor;
  border-left: 0;
  border-radius: 1px 2px 2px 1px;
  transform: translate(2px, 4px) rotate(-38deg);
}

.app-layout.sidebar-collapsed .new-chat-button span::after {
  width: 4px;
  height: 4px;
  border-left: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: translate(1px, 12px) rotate(7deg);
}

.app-layout.sidebar-collapsed .sidebar-quick-nav {
  display: grid;
  justify-items: center;
  gap: 8px;
  width: 100%;
  padding: 0;
  border-bottom: 0;
}

.app-layout.sidebar-collapsed .sidebar-nav-icon {
  width: 19px;
  height: 19px;
}

.app-layout.sidebar-collapsed .sidebar-open-button {
  display: none;
}

.app-layout.sidebar-collapsed .topbar {
  grid-template-columns: minmax(84px, 1fr) auto minmax(84px, 1fr);
}

.app-layout.sidebar-collapsed .sidebar-toggle-button::after,
.app-layout.sidebar-collapsed .new-chat-button::after,
.app-layout.sidebar-collapsed .sidebar-nav-link::after {
  content: attr(aria-label);
  position: absolute;
  top: 50%;
  left: calc(100% + 9px);
  z-index: 120;
  width: max-content;
  max-width: 120px;
  padding: 4px 8px;
  border-radius: 7px;
  background: #050507;
  color: #ffffff;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.3;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) translateX(-3px);
  transition: opacity 120ms ease 0.5s, transform 120ms ease 0.5s;
}

.app-layout.sidebar-collapsed .sidebar-toggle-button:hover::after,
.app-layout.sidebar-collapsed .sidebar-toggle-button:focus-visible::after,
.app-layout.sidebar-collapsed .new-chat-button:hover::after,
.app-layout.sidebar-collapsed .new-chat-button:focus-visible::after,
.app-layout.sidebar-collapsed .sidebar-nav-link:hover::after,
.app-layout.sidebar-collapsed .sidebar-nav-link:focus-visible::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

@media (min-width: 521px) {
  .app-layout.sidebar-collapsed {
    grid-template-columns: 48px minmax(0, 1fr);
  }
}

@media (max-width: 520px) {
  .app-layout.sidebar-collapsed {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .app-layout.sidebar-collapsed .history-sidebar {
    padding: 8px 4px;
  }

  .app-layout.sidebar-collapsed .new-chat-button,
  .app-layout.sidebar-collapsed .sidebar-toggle-button,
  .app-layout.sidebar-collapsed .sidebar-nav-link {
    width: 32px;
    height: 32px;
    min-height: 32px;
  }
}

/* Uploaded image chip above the message box */
.input-composer > .upload-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  width: min(22%, 190px);
  min-width: 120px;
  padding: 12px 18px 0;
}

.input-composer > .upload-list:empty {
  display: none;
}

.input-composer > .upload-list .upload-file-chip {
  width: 100%;
  max-width: none;
  cursor: pointer;
}

.input-composer > .upload-list .upload-file-chip:focus-visible {
  outline: 2px solid #8bbcff;
  outline-offset: 2px;
}

.input-composer > .upload-list .upload-file-preview {
  z-index: 220;
}

@media (max-width: 760px) {
  .input-composer > .upload-list {
    width: min(46%, 170px);
    min-width: 112px;
    padding: 10px 14px 0;
  }
}

