* { box-sizing: border-box; }

:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #6b7280;
  --line: #e6e9ef;
  --soft: #f7f8fb;
  --blue: #425ee8;
  --blue-dark: #344dcc;
  --radius: 18px;
}

body {
  margin: 0;
  background: #f6f7fa;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.llm-site-layout {
  min-height: 100vh;
  background: #f6f7fa;
}

.llm-main {
  /* 左侧菜单固定宽度 240px */
  width: calc(100% - 240px);
  min-width: 0;
  margin-left: 240px;
  min-height: 100vh;
  padding: 42px 34px 56px;
}

.llm-container { width: 100%; max-width: 1040px; margin: 0 auto; }

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.eyebrow, .section-kicker {
  color: #7b8496;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .16em;
}

.page-header h1 { margin: 9px 0 7px; font-size: clamp(27px, 3vw, 36px); letter-spacing: -.045em; }
.page-subtitle { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
.price-chip {
  flex: 0 0 auto;
  display: flex;
  align-items: baseline;
  gap: 5px;
  padding: 12px 16px;
  border: 1px solid #e3e7ff;
  border-radius: 13px;
  background: #f0f2ff;
  color: #384dc7;
}
.price-chip strong { font-size: 21px; letter-spacing: -.04em; }
.price-chip span { color: #6874bf; font-size: 12px; }

.account-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
  padding: 17px 20px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 3px 12px rgba(23, 32, 51, .025);
}
.account-main { display: flex; align-items: center; gap: 12px; }
.account-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #f0f2ff;
  color: var(--blue);
  font-size: 22px;
  font-weight: 700;
}
.account-copy { display: flex; flex-direction: column; gap: 3px; }
.account-label { color: var(--muted); font-size: 12px; }
.balance-line { display: flex; align-items: baseline; gap: 5px; }
.balance-line strong { font-size: 22px; font-variant-numeric: tabular-nums; letter-spacing: -.04em; }
.balance-line span { color: var(--muted); font-size: 12px; }
.balance-refresh {
  display: inline-grid;
  place-items: center;
  width: 27px;
  height: 27px;
  margin-left: 5px;
  padding: 0;
  border: 1px solid #e6e9ef;
  border-radius: 8px;
  background: #fff;
  color: #64718a;
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  transition: background .18s ease, color .18s ease;
}

.balance-refresh:hover {
  background: #f0f2ff;
  color: var(--blue);
}

.balance-refresh:disabled {
  opacity: .5;
  cursor: wait;
}

.balance-refresh.is-refreshing {
  animation: balance-rotate .8s linear infinite;
}

@keyframes balance-rotate {
  to {
    transform: rotate(360deg);
  }
}
.account-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 17px; }
.login-status { color: var(--muted); font-size: 12px; }
.text-link { color: #4657c7; font-size: 13px; font-weight: 650; text-decoration: none; }
.text-link:hover { color: #263cae; }
.text-link span { margin-left: 3px; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
  transition: background .18s ease, transform .18s ease, border-color .18s ease;
}
.button:active:not(:disabled) { transform: translateY(1px); }
.button-dark { background: #20283b; color: #fff; }
.button-dark:hover { background: #303a52; }
.button-light { border-color: #e0e4ec; background: #fff; color: #30394b; }
.button-light:hover { background: #f7f8fb; }
.button-primary { min-width: 145px; background: var(--blue); color: #fff; }
.button-primary:hover:not(:disabled) { background: var(--blue-dark); }
.button:disabled { opacity: .48; cursor: not-allowed; }

.editor-card, .result-card {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 8px 28px rgba(23, 32, 51, .035);
}
.editor-heading, .result-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.editor-heading h2, .result-heading h2 { margin: 5px 0 0; font-size: 20px; letter-spacing: -.025em; }
.privacy-note { display: inline-flex; align-items: center; gap: 7px; color: #7a8292; font-size: 11px; }
.privacy-dot, .cost-dot { width: 7px; height: 7px; border-radius: 50%; background: #43ad83; }
.login-lock {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 18px;
  border: 1px solid #e8ebf3;
  border-radius: 13px;
  background: #fafbfe;
}
.lock-symbol {
  display: grid;
  place-items: center;
  flex: 0 0 40px;
  height: 40px;
  border-radius: 12px;
  background: #edf0ff;
  color: #4a5dd2;
  font-size: 23px;
}
.login-lock strong { font-size: 14px; }
.login-lock p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.login-lock .button { margin-left: auto; flex: 0 0 auto; }

.upload-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 218px;
  padding: 28px 20px;
  border: 1.5px dashed #cfd5e3;
  border-radius: 14px;
  background: #fafbfe;
  text-align: center;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease;
}
.upload-dropzone:hover, .upload-dropzone.is-dragging { border-color: #7180e8; background: #f5f6ff; }
.upload-dropzone.is-disabled { opacity: .58; cursor: not-allowed; }
.upload-dropzone.has-image { min-height: 0; padding: 15px; margin-bottom: 18px; flex-direction: row; justify-content: flex-start; gap: 12px; text-align: left; }
.upload-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 14px;
  border-radius: 15px;
  background: #eef1ff;
  color: var(--blue);
}
.upload-icon svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.upload-dropzone strong { color: #293246; font-size: 14px; font-weight: 650; }
.upload-dropzone > span:not(.upload-icon) { color: #8991a1; font-size: 11px; line-height: 1.7; }
.upload-dropzone .upload-browse { margin-top: 15px; padding: 8px 15px; border: 1px solid #dce1f3; border-radius: 8px; background: #fff; color: #4657c7 !important; font-size: 12px !important; font-weight: 650; }
.upload-dropzone.has-image .upload-icon { width: 34px; height: 34px; margin: 0; border-radius: 10px; }
.upload-dropzone.has-image .upload-icon svg { width: 20px; height: 20px; }
.upload-dropzone.has-image #upload-subtitle { margin-left: auto; }
.upload-dropzone.has-image .upload-browse { margin: 0; }

.preview-panel { margin: 22px 0; }
.preview-topline { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.preview-topline > div { display: flex; flex-direction: column; gap: 4px; }
.preview-topline strong { font-size: 12px; color: #626c7e; font-weight: 550; }
.preview-stage, .result-preview { display: flex; align-items: center; justify-content: center; min-height: 140px; max-height: 540px; overflow: hidden; border: 1px solid #e8ebf1; border-radius: 12px; background-color: #f7f8fa; background-image: linear-gradient(45deg,#edf0f4 25%,transparent 25%),linear-gradient(-45deg,#edf0f4 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#edf0f4 75%),linear-gradient(-45deg,transparent 75%,#edf0f4 75%); background-size: 18px 18px; background-position: 0 0,0 9px,9px -9px,-9px 0; }
.preview-stage img, .result-preview img { display: block; max-width: 100%; max-height: 520px; object-fit: contain; }

/* ===== AI 证件照：底色选择区块 ===== */
.background-block { margin-top: 23px; }
.background-label { display: block; margin-bottom: 10px; color: #252e41; font-size: 13px; font-weight: 700; }
.background-options { display: flex; flex-wrap: wrap; gap: 12px; }
.background-option {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 8px 16px 8px 10px;
  border: 1.5px solid #dfe3eb;
  border-radius: 11px;
  background: #fff;
  color: #30394b;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.background-option:hover:not(:disabled) { border-color: #8390ed; background: #fafbff; }
.background-option:disabled { opacity: .48; cursor: not-allowed; }
.background-option.is-selected {
  border-color: var(--blue);
  background: #f0f2ff;
  color: #384dc7;
  box-shadow: 0 0 0 3px rgba(66, 94, 232, .09);
}
.background-swatch {
  display: inline-block;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1px solid rgba(23, 32, 51, .12);
}
.background-swatch-white { background: #FFFFFF; }
.background-swatch-red { background: #FF0000; }
.background-swatch-blue { background: #438EDB; }
.background-foot { margin: 8px 0 0; color: #969dac; font-size: 11px; }

.submit-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 22px; }
.submit-note { display: flex; align-items: center; gap: 8px; color: #7b8392; font-size: 12px; }
.submit-note strong { color: #30394b; }
.cost-dot { background: #7886ed; }
.status-message { min-height: 20px; margin: 13px 0 0; color: #828a99; font-size: 12px; line-height: 1.7; }
.status-message.success { color: #16845c; }
.status-message.error { color: #bf3939; }
.is-loading { pointer-events: none; }

.result-card { margin-top: 22px; }
.result-heading { margin-bottom: 17px; }
.result-info { margin: 12px 0 0; color: #16845c; font-size: 12px; }

.product-notes { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 24px; padding: 5px 3px; }
.note-item { display: flex; align-items: flex-start; gap: 12px; }
.note-icon { display: grid; place-items: center; flex: 0 0 32px; height: 32px; border: 1px solid #e2e6f4; border-radius: 10px; background: #fff; color: #6675db; font-size: 15px; }
.note-item strong { display: block; margin: 1px 0 5px; color: #384153; font-size: 12px; }
.note-item p { margin: 0; color: #8a92a0; font-size: 11px; line-height: 1.75; }
.fine-print { margin: 18px 0 0; color: #a0a6b1; font-size: 10px; line-height: 1.7; }

[hidden] { display: none !important; }

@media (max-width: 900px) {
  .llm-main { padding: 30px 22px 42px; }
  .account-bar { align-items: flex-start; }
  .account-actions { gap: 12px; }
}
@media (max-width: 768px) {
  .llm-main {
    width: 100%;
    margin-left: 0;
  }
}

@media (max-width: 680px) {
  .llm-main { padding: 24px 14px 34px; }
  .page-header { align-items: flex-start; gap: 10px; margin-bottom: 20px; }
  .page-header h1 { font-size: 27px; }
  .price-chip { padding: 9px 11px; }
  .price-chip strong { font-size: 18px; }
  .account-bar { flex-direction: column; padding: 15px; gap: 14px; }
  .account-actions { width: 100%; justify-content: flex-start; }
  .editor-card, .result-card { padding: 18px 14px; border-radius: 15px; }
  .editor-heading { align-items: flex-start; flex-direction: column; gap: 10px; margin-bottom: 17px; }
  .login-lock { align-items: flex-start; flex-wrap: wrap; padding: 14px; }
  .login-lock .button { margin-left: 55px; }
  .upload-dropzone { min-height: 190px; padding: 20px 12px; }
  .upload-dropzone.has-image { flex-wrap: wrap; }
  .upload-dropzone.has-image #upload-subtitle { width: 100%; margin-left: 46px; }
  .upload-dropzone.has-image .upload-browse { margin-left: 46px; }
  .background-options { gap: 9px; }
  .background-option { flex: 1 1 calc(50% - 5px); }
  .submit-row { align-items: stretch; flex-direction: column; gap: 13px; }
  .button-primary { width: 100%; min-height: 46px; }
  .product-notes { grid-template-columns: 1fr; gap: 16px; }
  .preview-topline { align-items: flex-start; }
}
