:root {
  --ink: #17191c;
  --ink-soft: #24272b;
  --paper: #f4f5f7;
  --card: #ffffff;
  --line: #e4e6e9;
  --muted: #69707a;
  --yellow: #f2c94c;
  --yellow-soft: #fff7d7;
  --green: #23855d;
  --green-soft: #e8f6ef;
  --blue: #3975d4;
  --red: #c95353;
  --shadow: 0 16px 45px rgba(24, 27, 31, 0.07);
  font-family: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); min-width: 320px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 238px minmax(0, 1fr); }
.sidebar { background: var(--ink); color: white; min-height: 100vh; padding: 24px 16px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 5; }
.brand { display: flex; gap: 12px; align-items: center; padding: 0 8px 30px; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: var(--yellow); color: var(--ink); font-weight: 800; }
.brand strong, .brand span { display: block; }
.brand strong { font-size: 15px; }
.brand span { color: #aeb3ba; font-size: 12px; margin-top: 3px; }
.nav-list { display: grid; gap: 5px; }
.nav-item { width: 100%; border: 0; background: transparent; color: #b8bdc4; text-align: left; border-radius: 10px; padding: 11px 12px; display: flex; align-items: center; gap: 11px; transition: .18s ease; }
.nav-item span { width: 21px; text-align: center; font-size: 17px; }
.nav-item b { margin-left: auto; border-radius: 99px; min-width: 22px; height: 22px; display: grid; place-items: center; background: var(--yellow); color: var(--ink); font-size: 11px; }
.nav-item:hover, .nav-item.active { background: #30343a; color: white; }
.sidebar-footer { margin-top: auto; display: grid; gap: 12px; }
.prototype-note { border: 1px solid #383c42; border-radius: 12px; padding: 12px; display: flex; gap: 9px; align-items: flex-start; }
.prototype-note strong, .prototype-note small { display: block; }
.prototype-note strong { font-size: 12px; }
.prototype-note small { color: #949aa2; margin-top: 3px; line-height: 1.35; }
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 0 5px rgba(242,201,76,.12); margin-top: 4px; }
.workspace { min-width: 0; }
.topbar { height: 84px; padding: 0 32px; background: rgba(255,255,255,.92); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 4; backdrop-filter: blur(14px); }
.topbar h1 { margin: 2px 0 0; font-size: 23px; }
.eyebrow { margin: 0; color: #9a7415; text-transform: uppercase; letter-spacing: .12em; font-size: 10px; font-weight: 800; }
.top-actions { display: flex; gap: 12px; align-items: center; }
.connection-pill { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: #f1f2f4; border-radius: 999px; color: var(--muted); font-size: 12px; }
.connection-pill span { width: 8px; height: 8px; background: #a3a8ae; border-radius: 50%; }
.connection-pill.connected { background: var(--green-soft); color: var(--green); }
.connection-pill.connected span { background: var(--green); }
.avatar { width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--ink); color: white; font-weight: 700; }
.mobile-menu { display: none; }
main { padding: 28px 32px 46px; }
.page { display: none; animation: enter .2s ease; }
.page.active { display: block; }
@keyframes enter { from { opacity: 0; transform: translateY(5px); } }
.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }
.metric-card, .panel { background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.metric-card { padding: 18px 20px; min-height: 126px; display: flex; flex-direction: column; }
.metric-card span { color: var(--muted); font-size: 12px; }
.metric-card strong { font-size: 34px; margin: auto 0 2px; }
.metric-card small { color: #9298a0; }
.metric-card.accent { background: var(--yellow); border-color: var(--yellow); box-shadow: 0 16px 40px rgba(204,159,24,.18); }
.metric-card.accent span, .metric-card.accent small { color: #665117; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, .72fr); gap: 18px; }
.panel { padding: 22px; }
.panel-heading { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 20px; }
.panel-heading h2, .session-copy h2, .decision-panel h2, .settings-card h2 { margin: 4px 0 0; font-size: 19px; }
.heading-actions, .button-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
select, input, textarea { border: 1px solid #d9dce0; background: white; border-radius: 9px; padding: 10px 11px; color: var(--ink); outline: none; }
select:focus, input:focus, textarea:focus { border-color: #b78d1c; box-shadow: 0 0 0 3px rgba(242,201,76,.22); }
.button { border: 1px solid transparent; border-radius: 9px; padding: 9px 13px; font-weight: 700; font-size: 12px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.button.primary { background: var(--ink); color: white; }
.button.primary:hover { background: #31353a; }
.button.secondary { background: white; border-color: var(--line); color: var(--ink); }
.button.secondary:hover { background: #f7f8f9; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; color: #8b9199; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; padding: 10px 12px; border-bottom: 1px solid var(--line); }
td { padding: 14px 12px; border-bottom: 1px solid #eff0f2; font-size: 13px; }
tbody tr { transition: .15s; }
tbody tr:hover { background: #fafafa; }
.style-cell strong, .style-cell small { display: block; }
.style-cell small { color: var(--muted); margin-top: 3px; }
.progress-cell { min-width: 110px; }
.progress-track { height: 5px; background: #eceef0; border-radius: 99px; overflow: hidden; margin-bottom: 5px; }
.progress-track i { display: block; height: 100%; background: var(--yellow); border-radius: inherit; }
.progress-cell small { color: var(--muted); }
.status { display: inline-flex; border-radius: 99px; padding: 5px 8px; font-size: 10px; font-weight: 800; }
.status.pending { background: var(--yellow-soft); color: #8b6812; }
.status.running { background: #e9f1ff; color: var(--blue); }
.status.done { background: var(--green-soft); color: var(--green); }
.status.ready { background: #f0f1f3; color: #656b73; }
.status.blocked, .status.failed { background: #fff0ed; color: #a33b2e; }
.row-action { border: 0; background: transparent; font-size: 18px; color: var(--muted); }
.current-panel { background: var(--ink-soft); color: white; overflow: hidden; position: relative; }
.current-panel::after { content: ""; width: 160px; height: 160px; border-radius: 50%; background: rgba(242,201,76,.08); position: absolute; right: -70px; top: -70px; }
.current-panel .eyebrow { color: var(--yellow); }
.current-panel h2 { margin: 7px 0 4px; font-size: 24px; }
.current-panel p { color: #b5bac1; line-height: 1.55; font-size: 13px; }
.current-progress { margin: 26px 0; }
.current-progress div { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 12px; }
.current-progress .progress-track { background: #41454c; height: 7px; }
.current-meta { display: grid; gap: 10px; margin: 22px 0; }
.current-meta span { display: flex; justify-content: space-between; color: #aeb4bb; font-size: 12px; }
.current-meta b { color: white; font-weight: 600; }
.current-panel .button { width: 100%; background: var(--yellow); color: var(--ink); }
.two-column { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .55fr); gap: 18px; }
.session-card { padding: 0; overflow: hidden; }
.session-visual { padding: 34px; background: linear-gradient(140deg, #202328, #363b42); }
.browser-window { background: white; border-radius: 12px; overflow: hidden; box-shadow: 0 26px 50px rgba(0,0,0,.28); }
.browser-bar { background: #eceef0; padding: 9px 11px; display: flex; gap: 6px; align-items: center; }
.browser-bar i { width: 8px; height: 8px; border-radius: 50%; background: #c8cbd0; }
.browser-bar span { margin-left: 8px; background: white; color: #8a9098; padding: 5px 9px; border-radius: 6px; font-size: 10px; flex: 1; }
.login-preview { padding: 42px; text-align: center; color: var(--ink); }
.preview-logo { color: #aa8216; font-size: 24px; font-weight: 800; margin-bottom: 24px; }
.login-preview p { color: var(--muted); font-size: 12px; }
.session-copy { padding: 26px 30px 30px; }
.session-copy > p:not(.eyebrow):not(.inline-status) { color: var(--muted); line-height: 1.65; }
.feature-list { display: flex; flex-wrap: wrap; gap: 10px 18px; font-size: 12px; color: var(--green); margin: 20px 0; }
.inline-status { color: var(--muted); font-size: 12px; margin: 16px 0 0; }
.step-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 20px; }
.step-list li { display: flex; gap: 12px; align-items: center; color: #9399a1; position: relative; }
.step-list li:not(:last-child)::after { content: ""; width: 1px; height: 17px; background: var(--line); position: absolute; left: 15px; top: 35px; }
.step-list li > span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); font-size: 11px; }
.step-list strong, .step-list small { display: block; }
.step-list strong { font-size: 13px; color: var(--ink); }
.step-list small { margin-top: 3px; }
.step-list li.done > span { background: var(--green); color: white; border-color: var(--green); }
.drop-zone { min-height: 260px; border: 1.5px dashed #cdd1d6; border-radius: 14px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 8px; background: #fbfbfc; transition: .18s; }
.drop-zone.dragging { background: var(--yellow-soft); border-color: #c79b25; }
.drop-zone input { display: none; }
.upload-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: var(--yellow-soft); color: #9a7415; font-size: 22px; }
.drop-zone small { color: var(--muted); }
.drop-zone em { margin-top: 8px; color: #8a6710; font-style: normal; font-size: 12px; font-weight: 800; }
.import-result { margin-top: 15px; display: flex; align-items: center; justify-content: space-between; padding: 14px; border: 1px solid var(--line); border-radius: 10px; }
.import-result strong, .import-result small { display: block; }
.import-result small { color: var(--muted); margin-top: 4px; }
.batch-setup { margin-top: 18px; border: 1px solid var(--line); border-radius: 14px; padding: 20px; background: #fcfcfd; }
.setup-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.setup-heading h3 { margin: 4px 0 0; font-size: 17px; }
.template-field { display: grid; gap: 6px; max-width: 620px; font-size: 11px; font-weight: 700; }
.setup-note { color: var(--muted); font-size: 11px; margin: 8px 0 18px; }
.defaults-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.defaults-grid label { display: grid; gap: 6px; color: var(--muted); font-size: 10px; font-weight: 700; }
.defaults-grid input, .defaults-grid textarea { width: 100%; color: var(--ink); }
.defaults-grid .wide-field { grid-column: span 3; }
.setup-actions { margin-top: 16px; }
.setup-actions span { color: var(--muted); font-size: 11px; }
.preview-table { margin-top: 14px; overflow-x: auto; }
.hidden { display: none !important; }
.mapping-list { display: grid; }
.mapping-row { display: grid; grid-template-columns: 1fr 40px 1fr 1fr; gap: 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.mapping-row .arrow { text-align: center; color: #9a7415; }
.mapping-row label { font-size: 11px; color: var(--muted); }
.mapping-row input, .mapping-row select { width: 100%; margin-top: 5px; }
.review-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(330px, .75fr); gap: 18px; }
.segmented { display: flex; padding: 3px; background: #f1f2f4; border-radius: 9px; }
.segmented button { border: 0; background: transparent; padding: 7px 9px; border-radius: 7px; color: var(--muted); font-size: 11px; }
.segmented button.active { background: white; color: var(--ink); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.mock-browser { border: 1px solid #d8dce1; border-radius: 12px; overflow: hidden; background: #f3f4f6; }
.live-screenshot { width: 100%; display: block; border: 1px solid #d8dce1; border-radius: 12px; background: #f3f4f6; }
.mock-header { background: var(--yellow); padding: 16px 20px; display: flex; justify-content: space-between; align-items: center; }
.mock-header strong { font-size: 20px; }
.mock-header span { background: var(--ink); color: white; border-radius: 99px; padding: 5px 12px; font-size: 11px; }
.mock-content { padding: 18px; }
.mock-content h3 { background: white; margin: 0 0 14px; padding: 12px; border-radius: 8px; font-size: 13px; }
.mock-content label { display: grid; gap: 5px; font-size: 10px; font-weight: 700; margin-bottom: 12px; }
.mock-content input, .mock-content select { width: 100%; background: white; }
.mock-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.highlight-field { background: var(--yellow-soft); border: 2px solid var(--yellow); border-radius: 9px; padding: 12px; position: relative; }
.highlight-field b { position: absolute; right: 8px; top: -10px; background: var(--yellow); padding: 3px 7px; border-radius: 99px; font-size: 8px; }
.mock-buttons { display: flex; gap: 6px; margin-top: 18px; }
.mock-buttons span { padding: 7px 9px; background: white; border: 1px solid #cfd3d8; border-radius: 6px; font-size: 9px; }
.decision-panel { align-self: start; }
.decision-meta { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 11px; margin-bottom: 28px; }
.decision-panel > p:not(.eyebrow) { color: var(--muted); line-height: 1.6; }
.context-box { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; background: #f7f8f9; border-radius: 10px; padding: 13px; margin: 18px 0; }
.context-box span { color: var(--muted); font-size: 10px; }
.context-box b { display: block; color: var(--ink); margin-top: 4px; font-size: 11px; }
.option-grid { display: grid; gap: 9px; }
.option-grid button { border: 1px solid var(--line); background: white; border-radius: 10px; text-align: left; padding: 12px 14px; }
.option-grid button.selected { border-color: #c1941c; background: var(--yellow-soft); box-shadow: 0 0 0 2px rgba(242,201,76,.16); }
.option-grid span, .option-grid small { display: block; }
.option-grid span { font-weight: 800; }
.option-grid small { color: var(--muted); margin-top: 3px; }
.remember-check { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); margin: 17px 0; }
.remember-check input { accent-color: var(--yellow); }
.decision-panel .button-row { justify-content: flex-end; }
.timeline { display: grid; gap: 0; }
.timeline-item { display: grid; grid-template-columns: 90px 18px 1fr; gap: 12px; padding: 12px 0; }
.timeline-time { color: var(--muted); font-size: 11px; text-align: right; }
.timeline-dot { position: relative; }
.timeline-dot::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--yellow); position: absolute; top: 3px; left: 4px; }
.timeline-item:not(:last-child) .timeline-dot::after { content: ""; width: 1px; height: calc(100% + 14px); background: var(--line); position: absolute; left: 8px; top: 13px; }
.timeline-copy strong, .timeline-copy small { display: block; }
.timeline-copy strong { font-size: 12px; }
.timeline-copy small { color: var(--muted); margin-top: 4px; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.settings-card > label:not(.switch-row) { display: grid; gap: 6px; margin-top: 16px; font-size: 11px; font-weight: 700; }
.settings-card .button { margin-top: 18px; }
.switch-row { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.switch-row b, .switch-row small { display: block; }
.switch-row b { font-size: 12px; }
.switch-row small { color: var(--muted); margin-top: 3px; }
.switch-row input { appearance: none; width: 42px; height: 24px; border: 0; padding: 0; border-radius: 99px; background: #d8dce0; position: relative; transition: .2s; }
.switch-row input::after { content: ""; width: 18px; height: 18px; background: white; border-radius: 50%; position: absolute; left: 3px; top: 3px; transition: .2s; box-shadow: 0 2px 5px rgba(0,0,0,.2); }
.switch-row input:checked { background: var(--green); }
.switch-row input:checked::after { transform: translateX(18px); }
.toast { position: fixed; right: 24px; bottom: 24px; background: var(--ink); color: white; border-radius: 10px; padding: 12px 16px; font-size: 12px; transform: translateY(20px); opacity: 0; pointer-events: none; transition: .2s; z-index: 10; box-shadow: 0 14px 40px rgba(0,0,0,.25); }
.toast.show { transform: translateY(0); opacity: 1; }

@media (max-width: 1100px) {
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid, .review-layout { grid-template-columns: 1fr; }
  .current-panel { min-height: 320px; }
}

@media (max-width: 820px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: -250px; width: 238px; transition: .22s; box-shadow: 20px 0 50px rgba(0,0,0,.18); }
  .sidebar.open { left: 0; }
  .mobile-menu { display: inline-grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); background: white; border-radius: 8px; margin-right: 12px; }
  .topbar { justify-content: flex-start; padding: 0 18px; }
  .top-actions { margin-left: auto; }
  main { padding: 20px 18px 40px; }
  .two-column, .settings-grid { grid-template-columns: 1fr; }
  .defaults-grid { grid-template-columns: 1fr 1fr; }
  .defaults-grid .wide-field { grid-column: span 2; }
}

@media (max-width: 560px) {
  .summary-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric-card { min-height: 112px; padding: 15px; }
  .metric-card strong { font-size: 27px; }
  .connection-pill { display: none; }
  .panel { padding: 16px; border-radius: 13px; }
  .panel-heading { align-items: flex-start; flex-direction: column; }
  .heading-actions { width: 100%; }
  .heading-actions select { flex: 1; }
  .session-visual { padding: 18px; }
  .login-preview { padding: 28px 16px; }
  .mapping-row { grid-template-columns: 1fr 28px 1fr; }
  .mapping-row > label:last-child { grid-column: 1 / -1; }
  .mock-row, .context-box { grid-template-columns: 1fr; }
  .setup-heading { align-items: flex-start; flex-direction: column; }
  .defaults-grid { grid-template-columns: 1fr; }
  .defaults-grid .wide-field { grid-column: auto; }
  .decision-panel .button-row .button { flex: 1; }
}
