@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Instrument+Sans:wght@500;600&display=swap');

:root {
  color-scheme: light;
  --bg: #f5f6f4;
  --panel: #ffffff;
  --ink: #1a2420;
  --muted: #75807a;
  --line: #e3e7e1;
  --line-strong: #d4dbd3;
  --brand: #195b45;
  --brand-dark: #124534;
  --brand-soft: #e8f0eb;
  --accent: #b9dd68;
  --danger: #b4473f;
  --ok: #317558;
  --radius: 18px;
  --shadow: 0 12px 36px rgba(31, 48, 39, .055);
}
* {box-sizing: border-box;}
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea {font: inherit;}
button {cursor: pointer; -webkit-tap-highlight-color: transparent;}
button[hidden] {display: none;}
button:disabled {opacity: .48; cursor: default;}
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {outline: 3px solid rgba(25, 91, 69, .2); outline-offset: 3px;}
.gate {position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 24px; background: #173e31;}
.gate[hidden] {display: none;}
.gate-card {width: min(420px, 100%); padding: 34px; border-radius: 24px; background: #fafbf8; box-shadow: 0 24px 80px rgba(0, 0, 0, .18);}
.gate-card h1 {margin: 14px 0 10px; font-size: 28px; letter-spacing: -.04em;}
.gate-card p {margin: 0 0 26px; color: var(--muted); line-height: 1.7; font-size: 14px;}
.gate-card button {width: 100%; display: flex; justify-content: space-between;}
.wordmark, .eyebrow {color: var(--brand); font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;}
.app-header {position: sticky; top: 0; z-index: 10; background: rgba(245, 246, 244, .9); border-bottom: 1px solid rgba(227, 231, 225, .8); backdrop-filter: blur(18px);}
.header-inner {max-width: 960px; margin: 0 auto; padding: max(16px, env(safe-area-inset-top)) 22px 16px; display: flex; align-items: center; justify-content: space-between;}
.brand {display: flex; align-items: center; gap: 11px;}
.brand-mark {display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: var(--brand); color: var(--accent); font-size: 22px;}
.brand strong, .brand span {display: block;}
.brand strong {font-size: 16px; letter-spacing: .02em;}
.brand div span {margin-top: 2px; color: var(--muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase;}
.header-actions {display: flex; align-items: center; gap: 14px;}
.connection {display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px;}
.connection i {width: 6px; height: 6px; border-radius: 50%; background: var(--ok);}
.icon-button {display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line-strong); border-radius: 50%; background: transparent; color: var(--brand); font-size: 20px;}
main {max-width: 960px; margin: 0 auto; padding: 34px 22px 120px;}
.panel {display: none;}
.panel.active {display: block;}
.page-heading {margin-bottom: 28px;}
.page-heading h1 {margin: 10px 0 10px; font-size: clamp(27px, 4vw, 38px); line-height: 1.2; letter-spacing: -.045em; font-weight: 650;}
.page-heading > p:last-child {margin: 0; color: var(--muted); font-size: 14px; line-height: 1.7;}
.page-heading.compact {margin-bottom: 22px;}
.page-heading.compact h1 {font-size: 30px;}
.workspace {border: 1px solid var(--line); border-radius: 24px; background: var(--panel); box-shadow: var(--shadow); overflow: hidden;}
.flow {display: flex; align-items: center; gap: 12px; padding: 17px 24px; background: #f8faf7; border-bottom: 1px solid var(--line);}
.flow-item {display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; white-space: nowrap;}
.flow-item b {color: #a0aaa2; font-size: 10px; letter-spacing: .06em; font-weight: 600;}
.flow-item.active {color: var(--brand); font-weight: 600;}
.flow-item.active b {color: var(--brand);}
.flow-line {flex: 1; min-width: 12px; height: 1px; background: var(--line-strong);}
.workspace-section {padding: 24px; border-bottom: 1px solid var(--line);}
.workspace-section:last-child {border-bottom: 0;}
.section-label {display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; color: var(--ink); font-size: 13px; font-weight: 650;}
.section-note {color: var(--muted); font-size: 12px; font-weight: 400;}
.text-button {padding: 0; border: 0; background: transparent; color: var(--brand); font-size: 12px;}
.account-grid {display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px;}
.choice {position: relative; display: flex; align-items: center; gap: 12px; min-height: 72px; padding: 15px 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; color: var(--ink); text-align: left; transition: border-color .18s, background .18s, transform .18s;}
.choice:hover {border-color: #b4c5b8; transform: translateY(-1px);}
.choice.selected {border-color: var(--brand); background: var(--brand-soft);}
.choice-avatar {display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 auto; border-radius: 10px; background: #edf1eb; color: var(--brand); font-size: 14px; font-weight: 700;}
.choice.selected .choice-avatar {background: var(--brand); color: #fff;}
.choice-copy {min-width: 0;}
.choice-copy strong {display: block; overflow: hidden; text-overflow: ellipsis; font-size: 13px; font-weight: 600;}
.choice-copy small {display: block; margin-top: 5px; color: var(--muted); font-size: 11px;}
.choice-check {display: none; margin-left: auto; color: var(--brand); font-size: 15px;}
.choice.selected .choice-check {display: block;}
.loading-block, .empty-state {padding: 14px 0; color: var(--muted); font-size: 13px;}
.version-card {display: flex; align-items: center; gap: 16px;}
.version-number {min-width: 92px; padding: 12px 14px; border-radius: 12px; background: var(--ink); color: #fff; font-size: 21px; font-weight: 650; letter-spacing: -.04em; text-align: center;}
.version-meta {min-width: 0;}
.version-meta strong {display: block; font-size: 13px; font-weight: 600;}
.version-meta span {display: block; margin-top: 4px; color: var(--muted); font-size: 12px;}
.version-description {margin: 16px 0 0; padding-top: 15px; border-top: 1px solid var(--line); color: #526057; font-size: 13px; line-height: 1.75;}
.version-description small {display: block; margin-bottom: 5px; color: var(--muted); font-size: 11px;}
.preview-content {display: flex; align-items: center; gap: 22px;}
.qr-placeholder {display: grid; place-items: center; align-content: center; gap: 8px; width: 128px; height: 128px; flex: 0 0 auto; border: 1px dashed #bac6b9; border-radius: 14px; background: repeating-linear-gradient(45deg, #f8faf7, #f8faf7 5px, #f3f6f1 5px, #f3f6f1 10px); color: var(--brand); text-align: center;}
.qr-placeholder span {font-size: 12px; font-weight: 600;}
.qr-placeholder small {color: var(--muted); font-size: 10px;}
.qr-placeholder img {width: 100%; height: 100%; object-fit: contain; border-radius: 13px;}
.preview-copy {flex: 1;}
.preview-copy strong {font-size: 14px;}
.preview-copy p {margin: 8px 0 15px; color: var(--muted); font-size: 12px; line-height: 1.7;}
.inline-status {display: block; margin-top: 8px; color: var(--muted); font-size: 11px;}
.review-summary {display: grid; gap: 13px;}
.review-summary > div {display: flex; align-items: center; justify-content: space-between; gap: 18px; font-size: 13px;}
.review-summary span {color: var(--muted);}
.review-summary strong {font-weight: 600; text-align: right;}
.submit-area {display: flex; align-items: center; gap: 20px; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line);}
.submit-area p {flex: 1; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.7;}
.primary-button, .secondary-button, .status-grid button {border-radius: 11px; padding: 12px 16px; font-weight: 600; font-size: 13px;}
.primary-button {border: 1px solid var(--brand); background: var(--brand); color: #fff; white-space: nowrap;}
.primary-button span {margin-left: 12px; color: var(--accent);}
.secondary-button, .ghost {border: 1px solid var(--line-strong); background: #fff; color: var(--brand);}
.secondary-panel {margin-top: 14px; padding: 0 18px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, .55);}
.secondary-panel summary {padding: 15px 0; color: var(--muted); font-size: 12px; cursor: pointer;}
.secondary-panel[open] {padding-bottom: 16px;}
.status-grid {display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;}
.status-grid button {border: 1px solid var(--line); background: #fff; color: var(--brand);}
.status-line {margin-top: 12px; color: var(--muted); font-size: 12px; line-height: 1.6;}
.manual-form {display: grid; gap: 12px;}
label {display: block; color: #46534b; font-size: 12px; font-weight: 600;}
input, select, textarea {width: 100%; margin-top: 7px; padding: 11px 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; color: var(--ink);}
textarea {line-height: 1.6;}
.switch-row {display: grid; gap: 10px; margin: 14px 0;}
.switch-row label {display: flex; align-items: center; gap: 8px; font-weight: 400;}
.switch-row input {width: 16px; height: 16px; margin: 0;}
.tabbar {position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; justify-content: center; gap: 4px; padding: 8px 14px calc(8px + env(safe-area-inset-bottom)); background: rgba(250, 251, 248, .94); border-top: 1px solid var(--line); backdrop-filter: blur(18px);}
.tabbar button {display: flex; align-items: center; gap: 7px; padding: 10px 18px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 12px;}
.tabbar button.active {background: var(--brand-soft); color: var(--brand); font-weight: 600;}
.tabbar button span {font-size: 16px;}
.stack {display: grid; gap: 12px; margin-top: 18px;}
.stack > article, .task-area > article {padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); box-shadow: 0 4px 16px rgba(31, 48, 39, .035);}
h2, h3 {margin: 0;}
h3 {font-size: 15px;}
.row, .task-head {display: flex; justify-content: space-between; align-items: start; gap: 12px;}
.meta {color: var(--muted); font-size: 12px; line-height: 1.6;}
.badge {padding: 5px 9px; border-radius: 20px; background: var(--brand-soft); color: var(--brand); font-size: 11px; white-space: nowrap;}
.project-body {margin-top: 14px; color: #526057; font-size: 12px; line-height: 1.8;}
.project-actions {display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px;}
.small {padding: 8px 11px; border-radius: 8px; font-size: 11px;}
.danger {border: 1px solid #e8cfcc; background: #fff; color: var(--danger);}
.task-target {margin: 16px 0; padding: 14px; border-radius: 12px; background: var(--brand-soft); font-size: 13px; line-height: 1.8;}
.checks {display: grid; gap: 10px; margin: 16px 0;}
.check {display: flex; gap: 9px; font-size: 12px; line-height: 1.6;}
.dot {width: 7px; height: 7px; margin-top: 5px; flex: 0 0 auto; border-radius: 50%; background: var(--muted);}
.dot.pass {background: var(--ok);}
.dot.fail {background: var(--danger);}
.confirm-grid {display: grid; grid-template-columns: 1fr 130px; gap: 10px; margin-top: 14px;}
.confirm-grid button {border: 0; border-radius: 10px; background: var(--brand); color: #fff; font-weight: 600;}
.review-confirmation {display: grid; gap: 10px; margin: 16px 0; padding: 15px; border: 1px solid var(--line); border-radius: 12px;}
.review-confirmation > div {display: flex; justify-content: space-between; gap: 16px; font-size: 12px; line-height: 1.6;}
.review-confirmation span {color: var(--muted); flex: 0 0 auto;}
.review-confirmation strong {font-weight: 600; text-align: right;}
.screens {display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 12px;}
.screens img {width: 100%; height: 120px; object-fit: cover; border: 1px solid var(--line); border-radius: 10px;}
.message {margin-top: 12px; font-size: 12px; line-height: 1.7;}
.error {display: block; margin-top: 12px; color: var(--danger); font-size: 12px;}
.log-item {font-size: 12px; line-height: 1.7; overflow-wrap: anywhere;}
.advanced {margin-top: 16px; color: var(--muted); font-size: 12px;}
.advanced summary {cursor: pointer; margin-bottom: 12px;}
dialog {width: min(620px, calc(100vw - 28px)); max-height: calc(100dvh - 32px); padding: 26px; border: 0; border-radius: 20px; background: #fafbf8; color: var(--ink);}
dialog::backdrop {background: rgba(20, 42, 33, .42); backdrop-filter: blur(4px);}
dialog label {margin-bottom: 14px;}
.dialog-heading {margin-bottom: 22px;}
.dialog-actions {display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px;}
@media (min-width: 720px) {
  .tabbar {position: sticky; bottom: auto; width: max-content; margin: 22px auto 0; border: 1px solid var(--line); border-radius: 14px;}
  main {padding-bottom: 34px;}
  .account-grid {grid-template-columns: repeat(3, minmax(0, 1fr));}
  .switch-row {grid-template-columns: repeat(3, 1fr);}
}
@media (max-width: 560px) {
  .header-inner {padding-left: 16px; padding-right: 16px;}
  main {padding: 26px 14px 104px;}
  .page-heading {margin-bottom: 22px; padding: 0 4px;}
  .page-heading h1 {font-size: 28px;}
  .workspace {border-radius: 18px;}
  .flow {padding: 14px 16px; gap: 7px;}
  .flow-item {gap: 5px; font-size: 11px;}
  .flow-item b {font-size: 9px;}
  .workspace-section {padding: 20px 16px;}
  .account-grid {grid-template-columns: 1fr;}
  .choice {min-height: 62px;}
  .preview-content {gap: 16px;}
  .qr-placeholder {width: 108px; height: 108px;}
  .submit-area {display: block;}
  .submit-area p {margin-bottom: 14px;}
  .primary-button {width: 100%; display: flex; justify-content: space-between;}
  .status-grid {grid-template-columns: 1fr;}
  .tabbar {justify-content: space-around;}
  .tabbar button {padding: 9px 12px;}
}

/* Refined neutral interface */
:root {
  --bg: #f6f7fb;
  --panel: #ffffff;
  --ink: #202333;
  --muted: #73778a;
  --line: #e7e8ef;
  --line-strong: #d9dbe6;
  --brand: #5652d6;
  --brand-dark: #4541b9;
  --brand-soft: #efefff;
  --accent: #d9d8ff;
  --danger: #c44c61;
  --ok: #377d68;
  --shadow: 0 18px 55px rgba(34, 38, 65, .07);
}
body {
  background: radial-gradient(circle at 8% -10%, rgba(110, 103, 230, .09), transparent 31rem), var(--bg);
  font-family: "DM Sans", "PingFang SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
svg {width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;}
.gate {background: #24243a;}
.gate-card {border: 1px solid rgba(255,255,255,.6); background: #fbfbff; box-shadow: 0 30px 90px rgba(0,0,0,.25);}
.app-header {background: rgba(246,247,251,.86); border-bottom-color: rgba(221,223,233,.75);}
.header-inner, main {max-width: 980px;}
.brand-mark {background: var(--ink); color: #fff; box-shadow: 0 6px 16px rgba(32,35,51,.18);}
.brand-mark svg {font-size: 21px;}
.icon-button {border-radius: 12px; background: rgba(255,255,255,.72); color: var(--ink);}
.workspace {border-radius: 26px;}
.flow {background: #fbfbfd;}
.flow-item b {display: grid; place-items: center; width: 20px; height: 20px; border: 1px solid var(--line-strong); border-radius: 50%; color: #9497a8; font-size: 8px;}
.flow-item.active b {border-color: var(--brand); background: var(--brand); color: #fff;}
.workspace-section {padding: 25px 26px;}
.login-section {background: linear-gradient(135deg, #f8f7ff, #fff 68%);}
.login-card {display: flex; align-items: center; justify-content: space-between; gap: 18px;}
.login-identity {display: flex; align-items: center; gap: 13px; min-width: 0;}
.login-identity > div {min-width: 0;}
.login-identity strong {display: block; overflow: hidden; text-overflow: ellipsis; font-size: 14px;}
.wechat-mark {display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 auto; border: 1px solid #dedff2; border-radius: 14px; background: #fff; color: var(--brand); font-size: 26px; box-shadow: 0 6px 16px rgba(70,67,170,.08);}
.wechat-mark svg {fill: currentColor; stroke: none;}
.login-actions {display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-wrap: wrap;}
.status-pill {padding: 5px 9px; border-radius: 999px; background: #f1f2f6; color: var(--muted); font-size: 10px; font-weight: 700;}
.status-pill.ready {background: #edf7f3; color: var(--ok);}
.status-pill.required {background: #fff2f0; color: var(--danger);}
.choice {min-height: 76px; border-radius: 16px;}
.choice:hover {border-color: #c8c7ef; box-shadow: 0 8px 24px rgba(66,63,151,.07);}
.choice.selected {background: #f8f7ff; box-shadow: inset 0 0 0 1px rgba(86,82,214,.08);}
.choice-avatar {width: 42px; height: 42px; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: #f0f1f6; color: #5c6072;}
.choice-avatar img {width: 100%; height: 100%; object-fit: cover;}
.choice.selected .choice-avatar {background: #f0f1f6; color: #5c6072;}
.version-description {color: #55596d;}
.qr-placeholder {border-color: #c9c9df; background: #fafaff;}
.primary-button {box-shadow: 0 7px 18px rgba(86,82,214,.17);}
.primary-button:hover {border-color: var(--brand-dark); background: var(--brand-dark);}
.secondary-button, .ghost {color: var(--ink);}
.status-line {margin: 3px 0 0;}
.tabbar {background: rgba(250,250,253,.94);}
.tabbar button span {display: grid; place-items: center; font-size: 16px;}
.tabbar button span svg {width: 17px; height: 17px;}
.stack > article, .task-area > article {box-shadow: 0 5px 20px rgba(34,38,65,.04);}
.task-target {background: #f8f7ff;}
.confirm-grid {display: block;}
.confirm-grid input {display: none;}
.confirm-grid button {width: 100%; min-height: 43px; border-radius: 12px;}
dialog {background: #fbfbff;}
dialog::backdrop {background: rgba(28,29,45,.48);}

@media (max-width: 600px) {
  .connection {display: none;}
  .workspace {border-radius: 20px;}
  .flow {overflow-x: auto;}
  .workspace-section {padding: 20px 16px;}
  .login-card {align-items: flex-start; flex-direction: column;}
  .login-actions {width: 100%; justify-content: flex-start;}
  .login-actions .primary-button {flex: 1;}
  .tabbar button {flex-direction: column; gap: 3px; min-width: 62px; padding-top: 7px; padding-bottom: 7px;}
}
