:root {
  --ink: #20221a;
  --muted: #74776a;
  --olive: #606b2e;
  --olive-dark: #46501f;
  --olive-pale: #eef0df;
  --paper: #f7f4eb;
  --card: #fffefa;
  --line: #deddd2;
  --accent: #e9bb36;
  --shadow: 0 18px 50px rgba(54, 57, 36, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: #f1f1eb;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }

.hero {
  min-height: 690px;
  overflow: hidden;
  background:
    radial-gradient(circle at 80% 40%, rgba(202, 191, 142, .27), transparent 28%),
    linear-gradient(125deg, #fbf8ef 0%, #f5f1e6 62%, #ecebdc 100%);
}
.nav {
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(96, 107, 46, .13);
}
.brand { display: flex; gap: 11px; align-items: center; color: var(--ink); font-weight: 800; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; color: white; border-radius: 10px; background: var(--olive); }
.local-badge { color: var(--muted); font-size: 13px; }
.local-badge span { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 99px; background: #7d9636; }
.hero-content { min-height: 608px; display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: 70px; }
.eyebrow { margin: 0 0 16px; color: var(--olive); font-size: 12px; font-weight: 800; letter-spacing: .2em; }
h1 { margin: 0; max-width: 680px; font-size: clamp(48px, 5vw, 72px); line-height: 1.12; letter-spacing: -.055em; }
h1 em { position: relative; color: var(--olive); font-style: normal; }
h1 em::after { content: ""; position: absolute; left: 0; right: 0; bottom: -8px; height: 8px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 14'%3E%3Cpath d='M3 8C80 1 135 12 204 7s126-1 193 2' fill='none' stroke='%23e9bb36' stroke-width='5' stroke-linecap='round'/%3E%3C/svg%3E") center/100% 100% no-repeat; }
.hero-copy { margin: 30px 0 34px; color: #5f6256; font-size: 17px; line-height: 1.9; }
.primary { border: 0; color: white; background: var(--olive); cursor: pointer; transition: .2s ease; }
.primary:hover { background: var(--olive-dark); transform: translateY(-1px); }
.hero-button { display: inline-flex; align-items: center; gap: 34px; padding: 15px 20px 15px 24px; border-radius: 10px; color: white; font-weight: 700; text-decoration: none; box-shadow: 0 10px 22px rgba(96, 107, 46, .18); }
.hero-visual { position: relative; height: 450px; }
.visual-glow { position: absolute; inset: 20px; border-radius: 50%; background: rgba(255,255,255,.6); filter: blur(18px); }
.visual-card { position: absolute; padding: 24px; border: 1px solid rgba(255,255,255,.8); border-radius: 20px; background: rgba(255,255,252,.84); box-shadow: 0 28px 70px rgba(60, 60, 37, .14); backdrop-filter: blur(8px); }
.card-back { right: 0; top: 45px; width: 260px; height: 340px; transform: rotate(6deg); opacity: .7; }
.card-front { left: 20px; top: 15px; width: 300px; height: 400px; transform: rotate(-3deg); }
.mock-label { color: var(--olive); font-size: 9px; font-weight: 800; letter-spacing: .18em; }
.mock-title { width: 72%; height: 16px; margin: 18px 0 12px; border-radius: 4px; background: var(--ink); }
.mock-line { height: 7px; margin: 10px 0; border-radius: 10px; background: #d9d7ca; }
.mock-line.short { width: 48%; }
.mock-image { height: 220px; margin-top: 26px; border-radius: 12px; background: linear-gradient(145deg, #e5deca, #b7ad8d); }
.product-shape { position: absolute; left: 45px; right: 45px; bottom: 32px; height: 240px; border-radius: 12px 12px 20px 20px; background: linear-gradient(125deg, #f0eee6, #c8c3b4); box-shadow: 18px 22px 30px rgba(58,53,40,.12); }
.screen { position: absolute; left: 18px; top: 18px; width: 40px; height: 62px; border-radius: 5px; background: #252820; }
.spout { position: absolute; left: 0; top: 70px; width: 80px; height: 18px; background: #d9d5c9; }
.glass { position: absolute; left: 21px; bottom: 12px; width: 46px; height: 58px; border: 2px solid rgba(255,255,255,.8); border-radius: 4px 4px 12px 12px; }
.floating-note { position: absolute; right: 8px; bottom: 8px; padding: 13px 17px; border: 1px solid rgba(96,107,46,.16); border-radius: 12px; color: var(--olive-dark); background: rgba(255,254,250,.94); font-size: 13px; font-weight: 700; box-shadow: var(--shadow); }

.workspace { padding: 90px 0 110px; }
.section-heading { margin-bottom: 34px; }
.section-heading h2 { margin: 0 0 10px; font-size: clamp(32px, 4vw, 45px); letter-spacing: -.035em; }
.section-heading > p:last-child { margin: 0; color: var(--muted); }
.tool-layout { display: grid; grid-template-columns: 390px minmax(0, 1fr); align-items: start; gap: 20px; }
.panel { border: 1px solid #e0e0d6; border-radius: 16px; background: var(--card); box-shadow: var(--shadow); }
.input-panel { position: sticky; top: 16px; padding: 24px; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; padding-bottom: 20px; }
.panel-heading > div { display: flex; align-items: center; gap: 10px; }
.panel-heading h3 { margin: 0; font-size: 19px; }
.step { display: grid; place-items: center; width: 29px; height: 29px; color: var(--olive); border-radius: 9px; background: var(--olive-pale); font-size: 10px; font-weight: 800; }
.text-button { padding: 5px; border: 0; color: var(--olive); background: transparent; cursor: pointer; font-size: 13px; }
label { display: block; margin-bottom: 17px; }
label > span { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 13px; font-weight: 700; }
label b { color: #a87f23; font-size: 10px; font-weight: 600; }
.upload-field { cursor: pointer; }
.upload-field > input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.upload-box { display: flex; align-items: center; justify-content: flex-start; gap: 12px; min-height: 82px; padding: 10px; border: 1px dashed #bcc19e; border-radius: 10px; background: #f8f8ef; transition: .18s; }
.upload-field:hover .upload-box { border-color: var(--olive); background: #f4f5e8; }
.upload-preview { width: 60px; height: 60px; flex: 0 0 60px; display: grid; place-items: center; overflow: hidden; border-radius: 8px; color: var(--olive); background: var(--olive-pale); font-size: 23px; }
.upload-preview img { width: 100%; height: 100%; object-fit: cover; }
.upload-copy { display: block; min-width: 0; margin: 0; }
.upload-copy strong, .upload-copy small { display: block; }
.upload-copy strong { overflow: hidden; color: var(--ink); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.upload-copy small { margin-top: 5px; color: #919487; font-size: 10px; font-weight: 400; line-height: 1.4; }
input, textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 9px; outline: none; color: var(--ink); background: #fcfbf7; transition: .18s; }
input, select { height: 43px; padding: 0 12px; }
textarea { padding: 11px 12px; resize: vertical; line-height: 1.55; }
input:focus, textarea:focus, select:focus { border-color: #879253; box-shadow: 0 0 0 3px rgba(96,107,46,.09); }
.generate-button { width: 100%; height: 50px; display: flex; justify-content: center; align-items: center; gap: 12px; border-radius: 10px; font-weight: 700; }
.privacy { margin: 12px 0 0; text-align: center; color: #9a9c91; font-size: 11px; }
.generation-mode { margin: 4px 0 16px; }
.generation-mode > span { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 700; }
.mode-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mode-options label { margin: 0; }
.mode-options input { position: absolute; opacity: 0; pointer-events: none; }
.mode-options span { display: grid; place-items: center; height: 38px; margin: 0; border: 1px solid var(--line); border-radius: 8px; color: #76796d; background: #fbfaf6; cursor: pointer; font-size: 11px; font-weight: 700; }
.mode-options input:checked + span { border-color: var(--olive); color: var(--olive); background: var(--olive-pale); box-shadow: inset 0 0 0 1px var(--olive); }
.api-settings { margin-bottom: 16px; border: 1px solid #dadcc9; border-radius: 10px; background: #f9f9f2; }
.api-settings summary { display: flex; justify-content: space-between; align-items: center; padding: 12px; color: var(--olive-dark); cursor: pointer; list-style: none; font-size: 12px; font-weight: 700; }
.api-settings summary::-webkit-details-marker { display: none; }
.api-settings summary::before { content: "＋"; margin-right: 7px; }
.api-settings[open] summary::before { content: "－"; }
.api-settings summary span { margin-right: auto; }
.api-settings summary small { color: #989b8c; font-size: 9px; font-weight: 500; }
.api-fields { padding: 0 12px 12px; border-top: 1px solid #e4e5d8; }
.api-fields label { margin-top: 12px; margin-bottom: 0; }
.api-fields > p { margin: 10px 0 0; color: #96998c; font-size: 9px; line-height: 1.6; }
.secret-field { position: relative; display: block; margin: 0; }
.secret-field input { padding-right: 52px; }
.secret-field button { position: absolute; right: 5px; top: 5px; height: 33px; padding: 0 9px; border: 0; color: var(--olive); background: transparent; cursor: pointer; font-size: 10px; }
.generate-button:disabled { cursor: wait; opacity: .65; transform: none; }
.output-panel { min-height: 780px; padding: 0 22px 22px; }
.output-heading { position: sticky; z-index: 3; top: 0; padding: 22px 0 18px; background: var(--card); border-bottom: 1px solid var(--line); }
.secondary { height: 36px; padding: 0 15px; border: 1px solid #cdd0b9; border-radius: 8px; color: var(--olive); background: #f8f9ef; cursor: pointer; font-size: 12px; font-weight: 700; }
.results { padding-top: 16px; }
.image-output { margin-bottom: 18px; padding: 16px; border: 1px solid #d9dcc6; border-radius: 12px; background: #f6f7ec; }
.image-output-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 13px; }
.image-output-heading h4 { margin: 0 0 4px; font-size: 15px; }
.image-output-heading p { margin: 0; color: var(--muted); font-size: 11px; }
.image-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.generated-image { position: relative; overflow: hidden; border: 1px solid #e1e1d7; border-radius: 9px; background: white; }
.generated-image img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.generated-image-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px; }
.generated-image-meta span { overflow: hidden; font-size: 10px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.download-image { flex-shrink: 0; padding: 5px 7px; border: 0; border-radius: 6px; color: var(--olive); background: var(--olive-pale); cursor: pointer; font-size: 9px; font-weight: 700; }
.image-placeholder { margin-bottom: 18px; padding: 18px; border: 1px dashed #d3d5c3; border-radius: 12px; color: #7b7f6b; background: #fafaf5; text-align: center; font-size: 12px; line-height: 1.7; }
.result-card { margin-bottom: 12px; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.result-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px; background: #faf9f4; border-bottom: 1px solid var(--line); }
.result-title h4 { margin: 0; font-size: 15px; }
.result-index { margin-right: 8px; color: var(--olive); font-size: 11px; }
.result-actions { display: flex; gap: 7px; flex-shrink: 0; }
.mini-button { padding: 7px 9px; border: 1px solid #d8d9cd; border-radius: 7px; color: #626650; background: white; cursor: pointer; font-size: 10px; }
.result-grid { display: grid; grid-template-columns: 1fr 1fr; }
.result-item { min-height: 94px; padding: 14px 16px; border-bottom: 1px solid #ecebe5; }
.result-item:nth-child(odd) { border-right: 1px solid #ecebe5; }
.result-item.full { grid-column: 1 / -1; border-right: 0; }
.result-item:last-child { border-bottom: 0; }
.result-item h5 { margin: 0 0 7px; color: var(--olive-dark); font-size: 11px; }
.result-item p { margin: 0; color: #575a50; font-size: 12px; line-height: 1.7; }
.empty-state { display: grid; place-items: center; min-height: 650px; text-align: center; color: var(--muted); }
.empty-icon { display: grid; place-items: center; width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 24px; color: var(--olive); background: var(--olive-pale); font-size: 29px; }
.empty-state h4 { margin: 0 0 8px; color: var(--ink); font-size: 18px; }
.empty-state p { margin: 0; font-size: 13px; line-height: 1.7; }
.toast { position: fixed; z-index: 20; left: 50%; bottom: 30px; padding: 12px 18px; border-radius: 9px; color: white; background: #292c20; box-shadow: 0 10px 30px rgba(0,0,0,.18); opacity: 0; transform: translate(-50%, 15px); pointer-events: none; transition: .25s; font-size: 13px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
footer { padding: 28px 0; color: #8a8d80; background: #25271f; font-size: 12px; }
footer .shell { display: flex; justify-content: space-between; }
footer span:first-child { color: #dfe2cc; font-weight: 800; }

@media (max-width: 900px) {
  .hero { min-height: auto; }
  .hero-content { grid-template-columns: 1fr; padding: 80px 0; }
  .hero-visual { display: none; }
  .tool-layout { grid-template-columns: 1fr; }
  .input-panel { position: static; }
}
@media (max-width: 600px) {
  .shell { width: min(100% - 24px, 1180px); }
  .nav { height: 68px; }
  .local-badge { font-size: 11px; }
  .hero-content { min-height: 530px; padding: 60px 0; }
  h1 { font-size: 45px; }
  .hero-copy { font-size: 15px; }
  .hero-copy br { display: none; }
  .workspace { padding: 64px 0 80px; }
  .input-panel { padding: 18px; }
  .output-panel { padding: 0 14px 14px; }
  .result-title { align-items: flex-start; flex-direction: column; }
  .image-gallery { grid-template-columns: repeat(2, 1fr); }
  .result-grid { grid-template-columns: 1fr; }
  .result-item, .result-item:nth-child(odd) { border-right: 0; }
  .result-item.full { grid-column: 1; }
  footer .shell { gap: 10px; flex-direction: column; }
}
