:root {
  --ink: #10172a;
  --muted: #69738b;
  --line: #dfe3ec;
  --panel: #ffffff;
  --canvas: #f5f4f8;
  --violet: #7446f5;
  --violet-dark: #5d32d9;
  --violet-soft: #f0ebff;
  --blue: #2d6cdf;
  --green: #0eaa78;
  --green-soft: #eafbf4;
  --red: #c43838;
  --orange: #f39824;
  --shadow: 0 18px 50px rgba(29, 25, 56, 0.08);
  --radius: 18px;
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: radial-gradient(circle at 75% 0%, #eee8ff 0, transparent 28rem), var(--canvas); }
button, input, select, textarea { font: inherit; }
button, label, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.45; }
.hidden { display: none !important; }

.app-shell { min-height: 100vh; }
.topbar {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 34px;
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid rgba(220, 223, 232, 0.8);
  backdrop-filter: blur(20px);
}
.brand { display: flex; gap: 12px; align-items: center; color: var(--ink); text-decoration: none; }
.brand-mark { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-weight: 900; color: #fff; background: linear-gradient(145deg, #8c5bff, #5430d2); box-shadow: 0 9px 20px rgba(116, 70, 245, 0.3); }
.brand > span:last-child { display: grid; gap: 1px; }
.brand strong { font-size: 15px; letter-spacing: -0.01em; }
.brand small { color: var(--muted); font-size: 11px; }
.session-strip { display: flex; align-items: center; gap: 10px; }
.condition-badge, .privacy-badge, .time-pill { border-radius: 999px; padding: 8px 12px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.condition-badge { color: var(--violet-dark); background: var(--violet-soft); border: 1px solid #dcd0ff; }
.privacy-badge { display: flex; align-items: center; gap: 7px; color: #346556; background: #f1fbf7; border: 1px solid #cfeee2; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(14, 170, 120, 0.12); }

main { display: grid; grid-template-columns: 286px minmax(0, 1fr); min-height: calc(100vh - 76px); }
.stepper { padding: 44px 28px 30px 34px; border-right: 1px solid var(--line); background: rgba(255, 255, 255, 0.6); }
.stepper-intro h2 { margin: 10px 0 6px; font-size: 21px; letter-spacing: -0.03em; }
.stepper-intro p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.eyebrow, .mini-label { color: var(--violet); font-size: 11px; font-weight: 900; letter-spacing: 0.12em; }
.stepper ol { padding: 0; margin: 34px 0; list-style: none; position: relative; }
.stepper ol::before { content: ""; position: absolute; left: 18px; top: 24px; bottom: 24px; width: 1px; background: var(--line); }
.stepper li { display: grid; grid-template-columns: 38px 1fr; gap: 12px; align-items: center; position: relative; padding: 11px 0; color: #9298a7; }
.stepper li.navigable { cursor: pointer; }
.stepper li.navigable:hover { color: var(--violet-dark); }
.stepper li.navigable:hover > span { border-color: #bba8f6; background: #f8f5ff; }
.stepper li:focus-visible { outline: 3px solid rgba(116,70,245,.18); outline-offset: 3px; border-radius: 12px; }
.stepper li[aria-disabled="true"] { cursor: default; }
.stepper li > span { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 1px solid var(--line); font-size: 11px; font-weight: 800; z-index: 1; }
.stepper li div { display: grid; gap: 2px; }
.stepper li strong { font-size: 13px; }
.stepper li small { font-size: 11px; color: #9ba2b2; }
.stepper li.active { color: var(--ink); }
.stepper li.active > span { color: #fff; background: var(--violet); border-color: var(--violet); box-shadow: 0 6px 15px rgba(116, 70, 245, 0.24); }
.stepper li.complete > span { color: var(--green); background: var(--green-soft); border-color: #bde8d8; }
.experiment-note { margin-top: 28px; padding: 16px; border: 1px solid #ded5f6; border-radius: 14px; background: linear-gradient(145deg, #fbf9ff, #f1edff); }
.experiment-note span { font-size: 11px; font-weight: 850; color: var(--violet); }
.experiment-note p { margin: 7px 0 0; font-size: 12px; line-height: 1.65; color: #5f6070; }

.workspace { width: min(1100px, calc(100% - 64px)); margin: 0 auto; padding: 48px 0 90px; }
.screen { display: none; animation: screen-in 0.36s ease both; }
.screen.active { display: block; }
@keyframes screen-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.screen-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; }
.screen-head-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 9px; }
h1 { margin: 10px 0 0; font-size: clamp(30px, 4vw, 45px); letter-spacing: -0.05em; line-height: 1.14; }
.lead { margin: 14px 0 30px; max-width: 780px; font-size: 15px; color: var(--muted); line-height: 1.75; }
.time-pill { margin-top: 5px; color: #646b7d; background: rgba(255, 255, 255, 0.75); border: 1px solid var(--line); }

.profile-form, .baseline-card, .publish-check { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
fieldset { border: 0; padding: 0; margin: 0; }
legend, label > span, .field-label { display: block; margin-bottom: 9px; font-size: 13px; font-weight: 760; color: #30394f; }
.identity-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.identity-grid legend { grid-column: 1 / -1; }
.identity-option { position: relative; cursor: pointer; }
.identity-option input { position: absolute; opacity: 0; pointer-events: none; }
.identity-option span { min-height: 86px; display: grid; align-content: center; gap: 5px; margin: 0; padding: 16px; border-radius: 14px; border: 1px solid var(--line); background: #fbfbfd; transition: 0.2s ease; }
.identity-option b { font-size: 14px; }
.identity-option small { color: var(--muted); font-size: 11px; font-weight: 500; line-height: 1.5; }
.identity-option input:checked + span { border-color: var(--violet); background: var(--violet-soft); box-shadow: inset 0 0 0 1px var(--violet); color: var(--violet-dark); }
.form-grid { margin-top: 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
input, select, textarea { width: 100%; border: 1px solid #d8dce6; border-radius: 11px; background: #fff; color: var(--ink); outline: none; transition: border 0.18s, box-shadow 0.18s; }
input, select { height: 45px; padding: 0 13px; }
textarea { resize: vertical; padding: 12px 13px; line-height: 1.65; }
input:focus, select:focus, textarea:focus { border-color: var(--violet); box-shadow: 0 0 0 4px rgba(116, 70, 245, 0.1); }
.examples-field { display: block; margin-top: 18px; }
.consent-row { display: flex; align-items: flex-start; gap: 9px; margin-top: 18px; padding: 13px 14px; background: #f7faf9; border: 1px solid #dceee7; border-radius: 11px; }
.consent-row input { width: 16px; height: 16px; margin-top: 1px; accent-color: var(--green); }
.consent-row span { margin: 0; font-size: 12px; font-weight: 550; line-height: 1.55; color: #53655f; }
.action-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 24px; }
.action-row.end { justify-content: flex-end; }
.microcopy { color: var(--muted); font-size: 11px; }
.button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 0 17px; border-radius: 11px; border: 1px solid transparent; font-size: 13px; font-weight: 780; transition: transform 0.16s, box-shadow 0.16s, background 0.16s; }
.button:not(:disabled):hover { transform: translateY(-1px); }
.button-primary { color: #fff; background: linear-gradient(145deg, #8252fb, #6438e3); box-shadow: 0 9px 20px rgba(116, 70, 245, 0.22); }
.button-primary:not(:disabled):hover { box-shadow: 0 12px 28px rgba(116, 70, 245, 0.3); }
.button-secondary { color: #5430d2; background: #f2edff; border-color: #dcd0ff; }
.button-ghost { color: #61697b; background: transparent; border-color: var(--line); }
.button-ai { color: #4321b5; background: linear-gradient(145deg, #f7f3ff, #ebe3ff); border-color: #d6c8ff; box-shadow: 0 8px 18px rgba(116, 70, 245, 0.1); }
.button-ai span { font-size: 15px; }
.button-small { min-height: 34px; padding: 0 12px; font-size: 11px; }
.button.full { width: 100%; }

.drop-zone { position: relative; min-height: 260px; display: grid; place-items: center; align-content: center; text-align: center; padding: 34px; border: 1.5px dashed #bfc4d1; border-radius: var(--radius); background: rgba(255,255,255,0.76); transition: 0.2s ease; }
.drop-zone.dragging { border-color: var(--violet); background: var(--violet-soft); transform: scale(1.004); }
.drop-zone input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.drop-zone .drop-actions { position: relative; z-index: 2; display: flex; gap: 10px; margin-top: 13px; }
.drop-icon { width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; color: var(--violet); background: var(--violet-soft); font-size: 25px; font-weight: 800; }
.drop-zone h3 { margin: 14px 0 5px; font-size: 18px; }
.drop-zone p { margin: 0; color: var(--muted); font-size: 12px; }
.analysis-status { margin: 18px 0; padding: 16px 18px; border-radius: 13px; background: #fff; border: 1px solid var(--line); }
.analysis-status > div:first-child { display: flex; justify-content: space-between; font-size: 12px; }
.analysis-status small { display: block; margin-top: 8px; color: var(--muted); }
.ai-applied-note { margin: 18px 0; padding: 15px 17px; border: 1px solid #d7cbfb; border-radius: 13px; background: linear-gradient(145deg, #fcfaff, #f2edff); }
.ai-applied-note span { color: var(--violet-dark); font-size: 11px; font-weight: 850; }
.ai-applied-note p { margin: 7px 0 0; color: #555c6d; font-size: 12px; line-height: 1.65; }
.progress-track { height: 7px; margin-top: 10px; border-radius: 99px; overflow: hidden; background: #eaeaf0; }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--violet), #b578ff); transition: width 0.18s; }
.photo-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin: 20px 0 90px; }
.photo-tile { position: relative; aspect-ratio: 1; overflow: hidden; border-radius: 12px; background: #e4e5e9; border: 1px solid #d9dce4; }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-tile .photo-number { position: absolute; top: 6px; left: 6px; min-width: 22px; height: 22px; display: grid; place-items: center; border-radius: 7px; color: #fff; background: rgba(15, 22, 42, 0.72); font-size: 10px; font-weight: 800; backdrop-filter: blur(4px); }
.photo-tile .photo-score { position: absolute; right: 6px; bottom: 6px; padding: 4px 6px; border-radius: 7px; color: #fff; background: rgba(15, 22, 42, 0.72); font-size: 9px; font-weight: 800; }
.photo-subject { position: absolute; left: 6px; right: 6px; bottom: 6px; overflow: hidden; padding: 5px 7px; border-radius: 8px; color: #fff; background: rgba(47,30,78,.76); font-size: 10px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; backdrop-filter: blur(6px); }
.photo-tile:has(.photo-subject) .photo-score { top: 6px; bottom: auto; }
.photo-analysis-state { position: absolute; top: 6px; right: 6px; padding: 4px 6px; border-radius: 7px; color: #fff; background: rgba(31,35,48,.76); font-size: 8px; font-weight: 800; backdrop-filter: blur(6px); }
.photo-analysis-state.understood { background: rgba(20,125,87,.88); }
.photo-analysis-state.dark, .photo-analysis-state.conversion-failed, .photo-analysis-state.failed, .photo-analysis-state.unreadable { background: rgba(177,76,48,.9); }
.photo-tile:has(.photo-analysis-state) .photo-score { right: 6px; left: auto; top: 34px; bottom: auto; }
.photo-debug-dialog { width: min(720px, calc(100% - 32px)); max-height: 88dvh; padding: 24px; border: 1px solid var(--line); border-radius: 24px; color: var(--ink); background: #fff; box-shadow: 0 30px 90px rgba(25,18,47,.28); }
.photo-debug-dialog::backdrop { background: rgba(31,25,43,.55); backdrop-filter: blur(6px); }
.photo-debug-dialog > header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.photo-debug-dialog h2 { margin: 6px 0 0; }
.photo-debug-compare { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.photo-debug-compare figure { margin: 0; padding: 9px; border: 1px solid var(--line); border-radius: 15px; background: #f7f6f9; }
.photo-debug-compare img, .photo-debug-empty { width: 100%; aspect-ratio: 1; display: grid; place-items: center; object-fit: cover; border-radius: 10px; color: var(--muted); background: #e7e5eb; }
.photo-debug-compare figcaption { margin-top: 8px; color: var(--muted); font-size: 10px; text-align: center; }
.photo-debug-status { margin: 16px 0 12px; padding: 12px 14px; border-radius: 12px; color: #4f4166; background: #f3effa; font-size: 12px; line-height: 1.65; }
.photo-debug-dialog dl { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin: 0 0 14px; }
.photo-debug-dialog dl > div { display: flex; justify-content: space-between; gap: 8px; padding: 9px 11px; border-radius: 9px; background: #f7f7f9; font-size: 10px; }
.photo-debug-dialog dt { color: var(--muted); }
.photo-debug-dialog dd { margin: 0; font-weight: 750; text-align: right; }
.photo-debug-dialog > small { color: var(--muted); line-height: 1.6; }
.sticky-action { position: sticky; z-index: 10; bottom: 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 26px; padding: 15px 17px; border: 1px solid rgba(213, 216, 226, 0.9); border-radius: 15px; background: rgba(255, 255, 255, 0.9); box-shadow: 0 18px 45px rgba(26, 26, 45, 0.14); backdrop-filter: blur(18px); }
.sticky-action div { display: grid; gap: 3px; }
.sticky-action strong { font-size: 13px; }
.sticky-action small { color: var(--muted); font-size: 11px; }

.opportunity-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.opportunity-card { position: relative; display: flex; flex-direction: column; min-height: 515px; overflow: hidden; padding: 22px; border-radius: 17px; border: 1px solid var(--line); background: #fff; box-shadow: 0 10px 28px rgba(29, 25, 56, 0.05); cursor: pointer; transition: 0.2s ease; }
.opportunity-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.opportunity-card.selected { border-color: var(--violet); box-shadow: inset 0 0 0 1px var(--violet), 0 16px 36px rgba(116, 70, 245, 0.13); }
.rank-row { display: flex; align-items: center; justify-content: space-between; }
.rank-label { color: var(--violet); font-size: 10px; font-weight: 900; letter-spacing: 0.1em; }
.score-ring { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; color: var(--violet-dark); background: conic-gradient(var(--violet) calc(var(--score) * 1%), #ece9f4 0); position: relative; }
.score-ring::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: #fff; }
.score-ring b { position: relative; z-index: 1; font-size: 15px; }
.opportunity-card h2 { margin: 18px 0 8px; font-size: 20px; line-height: 1.35; letter-spacing: -0.03em; }
.opportunity-card > p { min-height: 66px; margin: 0; color: var(--muted); line-height: 1.65; font-size: 12px; }
.thumb-strip { display: flex; margin: 18px 0 16px; }
.thumb-strip img { width: 46px; height: 56px; object-fit: cover; border-radius: 8px; border: 2px solid #fff; margin-left: -8px; box-shadow: 0 4px 10px rgba(15, 22, 42, 0.12); }
.thumb-strip img:first-child { margin-left: 0; }
.reason-list { display: grid; gap: 8px; margin-top: auto; }
.reason { display: grid; gap: 5px; }
.reason > div { display: flex; justify-content: space-between; font-size: 10px; color: #545b6c; }
.reason-track { height: 5px; border-radius: 10px; overflow: hidden; background: #eeedf2; }
.reason-track span { display: block; height: 100%; border-radius: inherit; background: var(--violet); }
.why-copy { margin-top: 14px; padding-top: 13px; border-top: 1px solid #eeeef2; font-size: 11px; color: #5f6473; line-height: 1.55; }

.baseline-card { display: grid; gap: 24px; }
.baseline-card h2 { margin: 7px 0; font-size: 25px; }
.baseline-card p { color: var(--muted); margin: 0; }
.baseline-photo-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 8px; }
.baseline-photo { position: relative; aspect-ratio: 1; border: 2px solid transparent; border-radius: 9px; overflow: hidden; cursor: pointer; background: #e5e6eb; }
.baseline-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.baseline-photo.selected { border-color: var(--violet); box-shadow: 0 0 0 2px #fff inset; }
.baseline-photo.selected::after { content: "✓"; position: absolute; top: 4px; right: 4px; width: 19px; height: 19px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--violet); font-size: 10px; font-weight: 900; }
.selection-editor { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: start; margin: 18px 0; padding: 20px; border: 1px solid #ded8ed; border-radius: 17px; background: #faf8ff; }
.selection-editor h3 { margin: 6px 0; }
.selection-editor p { margin: 0; color: var(--muted); font-size: 11px; }
.selection-editor .baseline-photo-grid { grid-column: 1 / -1; }
.selection-count { display: flex; align-items: baseline; gap: 3px; padding: 10px 13px; border-radius: 12px; color: var(--violet-dark); background: var(--violet-soft); }
.selection-count b { font-size: 22px; }
.selection-count span { font-size: 11px; font-weight: 750; }

.draft-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.7fr); gap: 18px; align-items: start; }
.draft-editor, .draft-aside { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.draft-editor { padding: 22px; }
.draft-editor label { display: block; margin-bottom: 18px; }
.draft-editor textarea { min-height: 515px; font-size: 14px; line-height: 1.82; }
.editor-stats { display: flex; flex-wrap: wrap; gap: 8px; }
.editor-stats span { padding: 6px 9px; border-radius: 8px; color: #687084; background: #f2f3f7; font-size: 10px; }
.draft-aside { overflow: hidden; }
.aside-section { padding: 21px; border-bottom: 1px solid var(--line); }
.aside-section h3 { margin: 7px 0 15px; }
.image-plan { display: grid; gap: 9px; max-height: 310px; overflow: auto; }
.image-plan-item { display: grid; grid-template-columns: 42px 1fr; gap: 10px; align-items: center; }
.image-plan-item img { width: 42px; height: 50px; object-fit: cover; border-radius: 8px; }
.image-plan-item div { display: grid; gap: 2px; min-width: 0; }
.image-plan-item b { font-size: 11px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.image-plan-item small { color: var(--muted); font-size: 9px; line-height: 1.4; }
.risk-section { background: #fffaf8; }
.risk-section ul { padding-left: 18px; margin: 0; display: grid; gap: 8px; color: #7a5652; font-size: 11px; line-height: 1.55; }
.disclosure { margin: 0; padding: 16px 21px; color: #6e7280; background: #fafafa; font-size: 10px; line-height: 1.55; }

.export-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.export-card { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: start; padding: 19px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.export-card .button { grid-column: 1 / -1; width: 100%; }
.export-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; color: var(--violet-dark); background: var(--violet-soft); font-size: 14px; font-weight: 900; }
.export-card h3 { margin: 1px 0 5px; font-size: 14px; }
.export-card p { margin: 0; min-height: 36px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.platform-preview-section { margin-top: 22px; padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, #fff, #faf8ff); box-shadow: var(--shadow); }
.platform-preview-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.platform-preview-head h2 { margin: 7px 0 6px; font-size: 25px; letter-spacing: -.035em; }
.platform-preview-head p { max-width: 620px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.platform-tabs { display: flex; gap: 5px; padding: 4px; border: 1px solid #dedfe7; border-radius: 12px; background: #f2f3f7; }
.platform-tabs button { min-height: 34px; padding: 0 12px; border: 0; border-radius: 8px; color: #747b8d; background: transparent; font-size: 10px; font-weight: 800; }
.platform-tabs button.active { color: #fff; background: #1d2030; box-shadow: 0 6px 14px rgba(20,22,35,.18); }
.preview-workbench { display: grid; grid-template-columns: minmax(340px, .9fr) minmax(260px, .7fr); gap: 34px; align-items: center; margin-top: 26px; }
.preview-phone { width: min(100%, 390px); height: 740px; justify-self: center; padding: 10px; overflow: hidden; border-radius: 42px; background: #14151c; box-shadow: 0 28px 60px rgba(19,18,34,.26), inset 0 0 0 1px rgba(255,255,255,.11); }
.preview-phone-status { height: 27px; display: flex; justify-content: space-between; padding: 1px 18px 0; color: #fff; font-size: 9px; font-weight: 800; }
.preview-screen { position: relative; height: calc(100% - 27px); overflow-y: auto; border-radius: 31px; background: #fff; scrollbar-width: none; }
.preview-screen::-webkit-scrollbar { display: none; }
.preview-appbar { height: 47px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; border-bottom: 1px solid #eeeef2; font-size: 11px; }
.preview-appbar > span { font-size: 19px; }
.preview-author { height: 58px; display: flex; align-items: center; gap: 9px; padding: 9px 14px; }
.preview-avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: linear-gradient(145deg,#ef5669,#7d55e8); font-size: 11px; font-weight: 900; }
.preview-author > div { display: grid; gap: 2px; flex: 1; }
.preview-author b { font-size: 11px; }
.preview-author small { color: #999ead; font-size: 8px; }
.preview-author button { min-height: 28px; padding: 0 11px; border: 1px solid #ef5b6d; border-radius: 8px; color: #e9445b; background: #fff; font-size: 9px; font-weight: 800; }
.preview-media { position: relative; overflow: hidden; aspect-ratio: 3 / 4; background: linear-gradient(145deg,#efeaff,#d8cff9); }
.preview-media > img { width: 100%; height: 100%; display: block; object-fit: cover; }
.preview-empty-cover { position: absolute; inset: 0; display: grid; place-content: center; gap: 8px; text-align: center; color: #4d33ab; background: linear-gradient(145deg,#f5f1ff,#dcd2ff); font-size: 22px; font-weight: 900; letter-spacing: -.04em; }
.preview-empty-cover small { color: #776b9a; font-size: 9px; letter-spacing: 0; }
.preview-image-counter { position: absolute; top: 10px; right: 10px; padding: 5px 7px; border-radius: 99px; color: #fff; background: rgba(12,14,21,.63); font-size: 8px; font-weight: 800; }
.preview-arrow { position: absolute; z-index: 2; top: 50%; width: 28px; height: 36px; border: 0; border-radius: 9px; color: #fff; background: rgba(13,15,23,.38); transform: translateY(-50%); font-size: 22px; }
.preview-arrow.prev { left: 8px; }
.preview-arrow.next { right: 8px; }
.preview-copy { padding: 14px 16px 8px; background: #fff; }
.preview-copy h3 { margin: 0 0 7px; font-size: 14px; line-height: 1.45; letter-spacing: -.02em; }
.preview-copy p { display: -webkit-box; overflow: hidden; margin: 0; color: #4f5361; font-size: 10px; line-height: 1.65; -webkit-box-orient: vertical; -webkit-line-clamp: 5; }
.preview-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; color: #496ca8; font-size: 9px; }
.preview-copy > small { display: block; margin-top: 9px; color: #a0a4b0; font-size: 8px; }
.preview-post-actions { position: sticky; bottom: 0; display: flex; justify-content: space-around; padding: 12px 8px 15px; border-top: 1px solid #eeeef2; color: #454957; background: rgba(255,255,255,.96); font-size: 9px; backdrop-filter: blur(8px); }
.douyin-action-rail { display: none; }
.platform-instagram .preview-phone-status { background: #fff; color: #14151c; }
.platform-instagram .preview-screen { border-radius: 0 0 31px 31px; }
.platform-instagram .preview-author button { border: 0; color: #3478f6; }
.platform-instagram .preview-media { aspect-ratio: 4 / 5; }
.platform-instagram .preview-copy h3 { display: none; }
.platform-instagram .preview-copy p::before { content: "你的账号  "; color: #171922; font-weight: 850; }
.platform-instagram .preview-tags { color: #315f9b; }
.platform-douyin { background: #050505; }
.platform-douyin .preview-phone-status { position: relative; z-index: 4; background: #050505; }
.platform-douyin .preview-screen { overflow: hidden; background: #050505; }
.platform-douyin .preview-appbar { position: absolute; z-index: 4; top: 0; left: 0; right: 0; color: #fff; border: 0; background: linear-gradient(rgba(0,0,0,.45),transparent); }
.platform-douyin .preview-author { display: none; }
.platform-douyin .preview-media { position: absolute; inset: 0; aspect-ratio: auto; }
.platform-douyin .preview-media::after { content: ""; position: absolute; inset: 45% 0 0; background: linear-gradient(transparent,rgba(0,0,0,.82)); pointer-events: none; }
.platform-douyin .preview-image-counter { top: 54px; }
.platform-douyin .preview-copy { position: absolute; z-index: 3; left: 0; right: 58px; bottom: 42px; color: #fff; background: transparent; }
.platform-douyin .preview-copy h3 { font-size: 13px; }
.platform-douyin .preview-copy p { color: #fff; -webkit-line-clamp: 3; }
.platform-douyin .preview-tags { color: #fff; font-weight: 750; }
.platform-douyin .preview-copy > small { color: rgba(255,255,255,.7); }
.platform-douyin .preview-post-actions { position: absolute; z-index: 3; bottom: 0; left: 0; right: 0; color: #fff; border-color: rgba(255,255,255,.12); background: rgba(0,0,0,.76); }
.platform-douyin .douyin-action-rail { position: absolute; z-index: 4; right: 10px; bottom: 66px; display: grid; gap: 17px; justify-items: center; color: #fff; }
.platform-douyin .douyin-action-rail > span { width: 38px; height: 38px; display: grid; place-items: center; border: 2px solid #fff; border-radius: 50%; background: #222; font-size: 10px; font-weight: 900; }
.platform-douyin .douyin-action-rail b { display: grid; justify-items: center; gap: 2px; font-size: 23px; }
.platform-douyin .douyin-action-rail small { font-size: 7px; }
.preview-guide { padding: 23px; border: 1px solid #e2dcef; border-radius: 17px; background: #f8f5ff; }
.preview-guide h3 { margin: 8px 0; font-size: 19px; line-height: 1.4; }
.preview-guide > p { margin: 0; color: #686f82; font-size: 11px; line-height: 1.7; }
.preview-thumbs { display: grid; grid-template-columns: repeat(4,1fr); gap: 7px; margin-top: 18px; }
.preview-thumb { position: relative; aspect-ratio: 3/4; overflow: hidden; padding: 0; border: 2px solid transparent; border-radius: 8px; background: #e5e1ef; }
.preview-thumb img { width: 100%; height: 100%; display: block; object-fit: cover; }
.preview-thumb.active { border-color: var(--violet); box-shadow: 0 0 0 2px #fff inset; }
.preview-disclaimer { display: grid; gap: 4px; margin-top: 20px; padding: 13px; border-radius: 11px; color: #59665f; background: #eaf8f2; }
.preview-disclaimer b { font-size: 10px; }
.preview-disclaimer span { font-size: 9px; line-height: 1.5; }
.publish-check { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 34px; margin-top: 22px; }
.publish-check h2 { margin: 8px 0; }
.publish-check p { color: var(--muted); line-height: 1.65; font-size: 12px; }
.publish-check form { display: grid; gap: 16px; }
.outcome-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.outcome-options label { position: relative; cursor: pointer; }
.outcome-options input { position: absolute; opacity: 0; }
.outcome-options span { display: grid; gap: 3px; margin: 0; padding: 13px; border-radius: 11px; border: 1px solid var(--line); background: #fafbfc; }
.outcome-options small { color: var(--muted); font-size: 9px; font-weight: 500; }
.outcome-options input:checked + span { border-color: var(--violet); background: var(--violet-soft); color: var(--violet-dark); }
.score-row { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; }
.score-row span { margin: 0; }
.score-row input { height: auto; accent-color: var(--violet); }
.score-row output { font-size: 11px; font-weight: 800; }
.feedback-complete { display: grid; justify-items: start; align-content: center; }
.success-mark { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--green); font-weight: 900; }
.feedback-complete h3 { margin: 13px 0 2px; }

.trend-entry-action { margin-top: 22px; }
.trend-source-note { display: grid; gap: 8px; margin: 20px 0; padding: 17px 19px; border: 1px solid #d8e9e2; border-radius: 15px; background: #f1faf7; }
.trend-source-note > div { display: flex; align-items: center; gap: 9px; color: #245f4d; font-size: 12px; }
.trend-source-note p { margin: 0; color: #5e716a; font-size: 11px; line-height: 1.7; }
.trend-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 22px 0 10px; }
.trend-toolbar .platform-tabs { flex-wrap: wrap; }
.trend-status { margin-bottom: 16px; color: #777e90; font-size: 10px; }
.trend-grid { display: grid; gap: 20px; }
.trend-platform-group { padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: var(--shadow); }
.trend-platform-group > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.trend-platform-group h2 { margin: 0 0 5px; font-size: 21px; }
.trend-platform-group header p { margin: 0; color: var(--muted); font-size: 10px; }
.trend-mode { flex: 0 0 auto; padding: 6px 9px; border-radius: 99px; font-size: 9px; font-weight: 850; }
.trend-mode.live { color: #087957; background: #e5f8f1; }
.trend-mode.stale { color: #8a5d18; background: #fff0d9; }
.trend-mode.pattern { color: #7a5c20; background: #fff2d4; }
.trend-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.trend-card { display: grid; grid-template-rows: auto auto 1fr auto; gap: 9px; min-height: 205px; padding: 15px; border: 1px solid #e6e3ec; border-radius: 14px; background: #fbfbfd; }
.trend-card.live { border-color: #d6e9e2; background: #f8fcfa; }
.trend-card.stale { border-color: #efdfc8; background: #fffaf3; }
.trend-card > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.trend-card > div:first-child span { color: var(--violet-dark); font-size: 10px; font-weight: 900; }
.trend-card.live > div:first-child span { color: #087957; }
.trend-card.stale > div:first-child span { color: #9a6418; }
.trend-card > div:first-child small { color: #9399a8; font-size: 8px; }
.trend-card h3 { margin: 0; font-size: 14px; line-height: 1.45; }
.trend-card p { margin: 0; color: #6b7180; font-size: 10px; line-height: 1.65; }
.trend-card > div:last-child { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.trend-card > div:last-child a { color: var(--violet-dark); font-size: 9px; font-weight: 750; text-decoration: none; }
.trend-connectors { display: grid; grid-template-columns: .75fr 1.25fr; gap: 28px; margin-top: 22px; padding: 24px; border: 1px solid #ded8ed; border-radius: 18px; background: #f8f5ff; }
.trend-connectors h2 { margin: 7px 0; font-size: 20px; }
.trend-connectors p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.65; }
.connector-list { display: grid; gap: 9px; }
.connector-list a { display: grid; gap: 4px; padding: 12px 13px; border: 1px solid #ded5f4; border-radius: 11px; color: #433567; background: #fff; text-decoration: none; }
.connector-list a:hover { border-color: #bca9f4; transform: translateY(-1px); }
.connector-list b { font-size: 11px; }
.connector-list span { color: #777084; font-size: 9px; line-height: 1.45; }

body.ai-open { overflow: hidden; }
.ai-backdrop { position: fixed; z-index: 89; inset: 0; background: rgba(23, 19, 42, 0.28); opacity: 0; pointer-events: none; transition: opacity .22s ease; backdrop-filter: blur(2px); }
.ai-backdrop.show { opacity: 1; pointer-events: auto; }
.ai-drawer { position: fixed; z-index: 90; top: 0; right: 0; width: min(440px, 100vw); height: 100dvh; display: grid; grid-template-rows: auto auto auto auto minmax(120px, 1fr) auto auto; overflow: hidden; background: #fbfaff; border-left: 1px solid #dcd6ed; box-shadow: -24px 0 70px rgba(26, 22, 49, .2); transform: translateX(104%); transition: transform .28s cubic-bezier(.2,.75,.25,1); }
.ai-drawer.open { transform: translateX(0); }
.ai-drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 22px 20px 17px; background: #fff; border-bottom: 1px solid var(--line); }
.ai-drawer-head h2 { margin: 6px 0 0; font-size: 20px; letter-spacing: -.035em; }
.icon-button { width: 38px; min-width: 38px; height: 38px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 11px; color: #646b7d; background: #fff; font-size: 22px; }
.icon-button:hover { border-color: #c8b8f9; color: var(--violet-dark); }
.ai-model-bar { padding: 15px 20px 14px; background: #fff; border-bottom: 1px solid var(--line); }
.ai-model-bar > label { display: block; margin-bottom: 7px; color: #34394a; font-size: 11px; font-weight: 800; }
.ai-model-bar select { height: 42px; font-size: 12px; }
.ai-model-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.ai-model-meta small { color: var(--muted); font-size: 9px; text-align: right; }
.ai-mode-badge { padding: 5px 8px; border-radius: 99px; font-size: 9px; font-weight: 850; white-space: nowrap; }
.ai-mode-badge.live { color: #087957; background: #e5f8f1; }
.ai-mode-badge.demo { color: #8a5a0b; background: #fff3d6; }
.ai-context-bar { display: grid; gap: 8px; padding: 11px 20px; background: #f6f3ff; border-bottom: 1px solid #e5ddfb; }
.ai-context-bar > span { color: var(--violet-dark); font-size: 11px; font-weight: 850; }
.share-photos { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; }
.share-photos input { width: 15px; min-width: 15px; height: 15px; margin: 1px 0 0; accent-color: var(--violet); }
.share-photos span { margin: 0; color: #666079; font-size: 10px; font-weight: 550; line-height: 1.45; }
.ai-quick-actions { display: flex; gap: 7px; padding: 11px 20px; overflow-x: auto; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.78); }
.ai-quick-actions button { flex: 0 0 auto; padding: 7px 10px; border: 1px solid #ded5f6; border-radius: 99px; color: #5d3cc2; background: #f7f3ff; font-size: 10px; font-weight: 750; }
.ai-quick-actions button:hover { background: #eee7ff; }
.ai-messages { overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding: 18px 20px 24px; scroll-behavior: smooth; }
.ai-message { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 9px; align-items: start; }
.ai-message.user { grid-template-columns: minmax(0, 1fr) 30px; }
.ai-message.user .ai-avatar { grid-column: 2; background: #22263a; }
.ai-message.user > div { grid-row: 1; grid-column: 1; justify-self: end; color: #fff; background: #6d43e8; border-color: #6d43e8; }
.ai-avatar { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: linear-gradient(145deg, #8758fa, #5730d1); font-size: 9px; font-weight: 900; }
.ai-message > div { max-width: 100%; padding: 11px 12px; border: 1px solid #e1deea; border-radius: 4px 13px 13px 13px; background: #fff; box-shadow: 0 6px 16px rgba(29, 25, 56, .04); }
.ai-message.user > div { border-radius: 13px 4px 13px 13px; }
.ai-message p { margin: 0; white-space: pre-wrap; font-size: 12px; line-height: 1.72; }
.ai-message small { display: block; margin-top: 8px; color: #8a8fa0; font-size: 9px; }
.ai-message.user small { color: rgba(255,255,255,.72); }
.ai-message.pending > div { color: #777d8d; background: #f5f3fa; }
.ai-message.pending p::after { content: ""; display: inline-block; width: 12px; height: 4px; margin-left: 6px; border-radius: 99px; background: var(--violet); animation: ai-pulse 1s infinite alternate; }
@keyframes ai-pulse { from { opacity: .25; transform: scaleX(.45); } to { opacity: 1; transform: scaleX(1); } }
.ai-patch-list { display: grid; gap: 5px; margin-top: 10px; padding: 9px; border-radius: 9px; color: #5e5576; background: #f5f1ff; }
.ai-patch-list span { overflow: hidden; font-size: 9px; line-height: 1.5; }
.apply-ai-patch { width: 100%; min-height: 34px; margin-top: 9px; font-size: 10px; }
.voice-notice { margin: 0 20px 8px; padding: 8px 10px; border-radius: 8px; color: #76530a; background: #fff0c7; font-size: 9px; line-height: 1.45; }
.ai-composer { padding: 13px 20px 17px; background: #fff; border-top: 1px solid var(--line); }
.ai-composer textarea { min-height: 68px; max-height: 150px; resize: none; font-size: 12px; }
.ai-composer > div { display: grid; grid-template-columns: 38px 1fr auto; gap: 9px; align-items: center; margin-top: 9px; }
.ai-composer small { color: #9298a7; font-size: 9px; }
.mic-button { font-size: 13px; color: var(--violet-dark); }
.mic-button.recording { color: #fff; background: #d34646; border-color: #d34646; animation: record-pulse 1s infinite alternate; }
@keyframes record-pulse { from { box-shadow: 0 0 0 0 rgba(211,70,70,.15); } to { box-shadow: 0 0 0 7px rgba(211,70,70,.15); } }
.status-dot.warning { background: var(--orange); box-shadow: 0 0 0 4px rgba(243,152,36,.12); }

.toast { position: fixed; z-index: 100; left: 50%; bottom: 28px; transform: translate(-50%, 14px); padding: 11px 16px; border-radius: 11px; color: #fff; background: rgba(15, 22, 42, 0.92); box-shadow: 0 14px 34px rgba(0,0,0,.18); font-size: 12px; opacity: 0; pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1050px) {
  main { grid-template-columns: 220px minmax(0, 1fr); }
  .stepper { padding-left: 22px; padding-right: 18px; }
  .workspace { width: min(100% - 40px, 960px); }
  .identity-grid { grid-template-columns: 1fr 1fr; }
  .photo-grid { grid-template-columns: repeat(5, 1fr); }
  .opportunity-grid { grid-template-columns: 1fr; }
  .opportunity-card { min-height: 0; }
  .baseline-photo-grid { grid-template-columns: repeat(8, 1fr); }
  .preview-workbench { grid-template-columns: 1fr; }
  .preview-guide { max-width: 520px; justify-self: center; }
  .trend-cards { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 760px) {
  .topbar { height: auto; min-height: calc(70px + env(safe-area-inset-top)); padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left)); }
  .brand small, .privacy-badge, .condition-badge { display: none; }
  main { display: block; }
  .stepper { position: sticky; top: 70px; z-index: 20; padding: 9px 14px; border-right: 0; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.92); backdrop-filter: blur(15px); }
  .stepper-intro, .experiment-note, .stepper li div { display: none; }
  .stepper ol { display: flex; justify-content: center; gap: 9px; margin: 0; }
  .stepper ol::before { display: none; }
  .stepper li { display: block; padding: 0; }
  .stepper li > span { width: 31px; height: 31px; }
  .workspace { width: min(100% - 28px, 680px); padding: 30px 0 max(80px, calc(56px + env(safe-area-inset-bottom))); }
  h1 { font-size: 31px; }
  .time-pill { display: none; }
  .screen-head { display: grid; }
  .screen-head-actions { justify-content: flex-start; }
  .screen-head-actions .button-ai { min-height: 36px; }
  .identity-grid, .form-grid, .draft-layout, .publish-check { grid-template-columns: 1fr; }
  .photo-grid { grid-template-columns: repeat(4, 1fr); }
  .baseline-photo-grid { grid-template-columns: repeat(5, 1fr); }
  .export-grid { grid-template-columns: 1fr; }
  .sticky-action { align-items: stretch; flex-direction: column; bottom: 10px; }
  .sticky-action .button { width: 100%; }
  .action-row { align-items: stretch; flex-direction: column; }
  .action-row .button { width: 100%; }
  .drop-actions { flex-direction: column; }
  .drop-zone .drop-actions .button { width: 100%; }
  .outcome-options { grid-template-columns: 1fr; }
  .session-strip .ai-open-button { display: inline-flex; }
  #backStepTop { padding: 0 9px; }
  .ai-drawer { width: 100vw; }
  .ai-drawer-head { padding-top: max(18px, env(safe-area-inset-top)); }
  .platform-preview-section { padding: 20px 14px; }
  .platform-preview-head { align-items: stretch; flex-direction: column; }
  .platform-tabs { display: grid; grid-template-columns: repeat(3,1fr); }
  .trend-toolbar { align-items: stretch; flex-direction: column; }
  .trend-toolbar .platform-tabs { grid-template-columns: repeat(2,1fr); }
  .trend-cards, .trend-connectors { grid-template-columns: 1fr; }
  .trend-platform-group { padding: 16px; }
  .preview-workbench { display: block; }
  .preview-phone { height: 690px; margin: 22px auto 0; border-radius: 34px; }
  .preview-guide { margin-top: 18px; }
}
