:root {
  color: #18313a;
  background: #f4f8f7;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, sans-serif;
  font-synthesis: none;
  --green-900: #124a42;
  --green-700: #176b5d;
  --green-500: #21a37f;
  --green-100: #dff4ed;
  --ink: #18313a;
  --muted: #64777c;
  --line: #dce8e4;
  --surface: #fff;
  --shadow: 0 24px 70px rgba(16, 70, 61, .12);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: #f4f8f7; }
body { margin: 0; min-height: 100vh; overflow-x: hidden; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .58; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-size: 20px; font-weight: 800; letter-spacing: .04em; }
.brand.centered { justify-content: center; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; color: #fff; background: linear-gradient(145deg, #26b18a, #176b5d); box-shadow: 0 8px 18px rgba(20,120,98,.2); }
.eyebrow { margin: 0 0 10px; color: var(--green-700); font-size: 12px; font-weight: 800; letter-spacing: .14em; }

.login-page { background: radial-gradient(circle at 12% 12%, #e3f6ef 0, transparent 32%), linear-gradient(135deg, #f7fbfa, #eef6f3); }
.login-layout { width: min(1120px, calc(100% - 48px)); min-height: 100vh; margin: 0 auto; padding: 56px 0; display: grid; grid-template-columns: 1.15fr .85fr; align-items: stretch; }
.brand-panel { position: relative; overflow: hidden; padding: 56px; color: #fff; background: linear-gradient(145deg, #124a42, #176b5d 56%, #188673); border-radius: 30px 0 0 30px; box-shadow: var(--shadow); }
.brand-panel::after { content: ""; position: absolute; right: -110px; bottom: -130px; width: 360px; height: 360px; border: 1px solid rgba(255,255,255,.18); border-radius: 50%; box-shadow: 0 0 0 55px rgba(255,255,255,.04), 0 0 0 110px rgba(255,255,255,.03); }
.brand-copy { position: relative; z-index: 1; margin-top: 100px; max-width: 520px; }
.brand-copy .eyebrow { color: #9ce4d0; }
.brand-copy h1 { margin: 0; max-width: 480px; font-size: clamp(36px, 4vw, 54px); line-height: 1.12; letter-spacing: -.04em; }
.brand-copy > p:last-child { margin: 24px 0 0; max-width: 500px; color: rgba(255,255,255,.76); font-size: 17px; line-height: 1.8; }
.benefit-list { position: relative; z-index: 1; list-style: none; display: grid; gap: 14px; margin: 72px 0 0; padding: 0; color: rgba(255,255,255,.88); }
.benefit-list li { display: flex; align-items: center; gap: 14px; }
.benefit-list span { color: #87dec4; font: 700 11px/1 monospace; }
.login-card { padding: 64px 56px; display: flex; flex-direction: column; justify-content: center; background: var(--surface); border-radius: 0 30px 30px 0; box-shadow: var(--shadow); }
.card-heading { text-align: center; }
.card-heading h2 { margin: 0; font-size: 30px; letter-spacing: -.03em; }
.card-heading > p:last-child { margin: 12px 0 0; color: var(--muted); }
.qr-section { margin-top: 32px; text-align: center; }
.qr-frame { width: 248px; height: 248px; margin: 0 auto; padding: 12px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: 0 12px 32px rgba(34,83,73,.09); }
.qr-frame img { display: block; width: 224px; height: 224px; border-radius: 10px; object-fit: contain; }
.qr-placeholder { width: 100%; height: 100%; display: grid; place-items: center; color: var(--muted); background: #f4f8f7; border-radius: 10px; }
.status-line { min-height: 24px; margin: 18px 0 0; color: var(--muted); font-weight: 700; }
.status-line[data-mode="active"] { color: #b7791f; }
.status-line[data-mode="success"] { color: var(--green-700); }
.status-line[data-mode="error"] { color: #b64a4a; }
.privacy-note { margin: 34px 0 0; color: #87979a; font-size: 12px; line-height: 1.7; text-align: center; }
.wechat-section, .mobile-guard { margin-top: 42px; text-align: center; }
.wechat-icon { width: 76px; height: 76px; margin: 0 auto 18px; display: grid; place-items: center; border-radius: 25px; color: #fff; background: var(--green-500); font-size: 25px; font-weight: 800; }
.wechat-icon.muted { background: #8da39d; }
.mobile-guard h3 { margin: 0; font-size: 24px; }
.mobile-guard p, .wechat-section p { color: var(--muted); line-height: 1.7; }

.button-row { display: flex; justify-content: flex-end; gap: 12px; margin-top: 22px; }
.button-row.compact { justify-content: center; margin-top: 12px; }
.primary-button, .secondary-button, .text-button { min-height: 44px; padding: 0 22px; border-radius: 12px; border: 0; font-weight: 700; }
.primary-button { color: #fff; background: var(--green-700); box-shadow: 0 8px 18px rgba(23,107,93,.2); }
.primary-button:hover { background: var(--green-900); }
.secondary-button { color: var(--green-700); background: #edf7f4; border: 1px solid #cae6dd; }
.text-button { min-height: 36px; padding: 0 10px; color: var(--muted); background: transparent; }
.inline-button { display: inline-flex; width: auto; min-height: 40px; align-items: center; justify-content: center; padding: 0 18px; font-size: 14px; }

.portal-page { background: linear-gradient(#f7fbfa, #f1f7f5); }
.portal-header { width: min(1180px, calc(100% - 48px)); height: 86px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; }
.header-caption { color: var(--muted); font-size: 14px; }
.header-account { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 14px; }
.form-shell, .workspace-shell { width: min(960px, calc(100% - 48px)); margin: 14px auto 72px; }
.progress-strip { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 22px; color: #8a9a9d; font-size: 13px; }
.progress-strip span.active { color: var(--green-700); font-weight: 800; }
.progress-strip i { width: 52px; height: 1px; background: var(--line); }
.form-card { padding: 46px; background: #fff; border: 1px solid rgba(211,229,223,.9); border-radius: 26px; box-shadow: 0 20px 58px rgba(24,74,65,.08); }
.form-heading { max-width: 680px; }
.form-heading h1, .welcome-block h1 { margin: 0; font-size: clamp(30px, 4vw, 42px); letter-spacing: -.04em; }
.form-heading > p:last-child, .welcome-block > p:last-child { margin: 14px 0 0; color: var(--muted); line-height: 1.7; }
.identity-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 34px; }
.identity-card { min-height: 150px; padding: 24px; display: grid; grid-template-columns: 52px 1fr; grid-template-rows: auto auto; gap: 6px 16px; text-align: left; color: var(--ink); background: #fbfdfc; border: 1px solid var(--line); border-radius: 18px; }
.identity-card:hover, .identity-card.selected { border-color: var(--green-500); background: #f0faf6; box-shadow: inset 0 0 0 1px var(--green-500); }
.identity-icon { grid-row: 1 / 3; width: 52px; height: 52px; display: grid; place-items: center; color: var(--green-700); background: var(--green-100); border-radius: 15px; font-weight: 800; }
.identity-card strong { align-self: end; font-size: 19px; }
.identity-card small { color: var(--muted); line-height: 1.5; }
.subtype-panel { margin-top: 24px; padding: 22px; background: #f6faf8; border-radius: 16px; }
.field-label { margin: 0 0 12px; font-size: 14px; font-weight: 700; }
.subtype-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.subtype-grid button { min-height: 48px; padding: 8px 14px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.subtype-grid button.selected { color: var(--green-700); border-color: var(--green-500); box-shadow: inset 0 0 0 1px var(--green-500); }
.profile-form { margin-top: 30px; padding-top: 30px; border-top: 1px solid var(--line); }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.field-grid label, .full-field { display: grid; gap: 9px; color: #3d5359; font-size: 14px; font-weight: 700; }
.field-grid b { color: #c05858; }
input, textarea { width: 100%; color: var(--ink); background: #fff; border: 1px solid #cfddd9; border-radius: 11px; outline: none; }
input { height: 48px; padding: 0 14px; }
textarea { padding: 13px 14px; resize: vertical; }
input:focus, textarea:focus { border-color: var(--green-500); box-shadow: 0 0 0 3px rgba(33,163,127,.12); }
.full-field { margin-top: 20px; }
.agreement-row { margin-top: 22px; display: flex; align-items: flex-start; gap: 9px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.agreement-row input { flex: 0 0 auto; width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--green-700); }
.form-message { min-height: 22px; margin: 16px 0 0; color: #a05252; font-size: 14px; }

.workspace-shell { width: min(1040px, calc(100% - 48px)); }
.welcome-block { padding: 42px 0 30px; }
.workspace-section { margin-top: 28px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.section-heading h2 { margin: 0; font-size: 24px; }
.card-list { display: grid; gap: 12px; }
.workspace-card { min-width: 0; padding: 22px 24px; display: flex; align-items: center; justify-content: space-between; gap: 24px; background: #fff; border: 1px solid var(--line); border-radius: 17px; box-shadow: 0 10px 30px rgba(23,74,64,.05); }
.card-main { min-width: 0; }
.card-main h3 { margin: 0; overflow-wrap: anywhere; font-size: 18px; }
.card-main > p { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.card-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.status-badge { padding: 4px 9px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.status-badge.draft, .status-badge.muted { color: #687679; background: #edf1f1; }
.status-badge.pending { color: #8c671d; background: #fbf1d9; }
.status-badge.success { color: #167057; background: #ddf4eb; }
.status-badge.warning { color: #996018; background: #fff0d5; }
.status-badge.error { color: #a84949; background: #fbe4e4; }
.review-note { padding: 10px 12px; color: #815820 !important; background: #fff8e9; border-radius: 10px; line-height: 1.6; }
.text-link { flex: 0 0 auto; color: var(--green-700); font-size: 14px; font-weight: 800; }
.empty-state { padding: 34px; color: var(--muted); text-align: center; background: rgba(255,255,255,.7); border: 1px dashed #c9d9d4; border-radius: 17px; }
.empty-state strong { color: var(--ink); }
.empty-state p { margin: 9px 0 0; }
.device-card { align-items: flex-start; }
.device-meta { display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 14px 0 0; }
.device-meta div { display: grid; gap: 3px; }
.device-meta dt { color: var(--muted); font-size: 12px; }
.device-meta dd { margin: 0; font-size: 14px; }
.device-message { min-height: 20px; margin: 10px 2px 0; color: var(--muted); font-size: 13px; }
.error-state strong { color: #a84949; }
.card-actions, .form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.demand-shell { width: min(1040px, calc(100% - 48px)); margin: 0 auto 56px; }
.account-form { display: grid; max-width: 920px; gap: 16px; }
.account-form label { display: grid; gap: 8px; color: #3d5359; font-size: 14px; font-weight: 700; }
.account-form select { width: 100%; height: 48px; padding: 0 14px; color: var(--ink); background: #fff; border: 1px solid #cfddd9; border-radius: 11px; outline: none; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.quote-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; }
.quote-card { padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: 17px; box-shadow: 0 10px 30px rgba(23,74,64,.05); }
.quote-card h3 { margin: 0; font-size: 18px; }
.quote-card dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
.quote-card dt { color: var(--muted); font-size: 12px; }
.quote-card dd { margin: 4px 0 0; color: var(--ink); font-size: 14px; font-weight: 800; }
.quote-card p { color: var(--muted); font-size: 14px; line-height: 1.6; }
.quote-decision { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }

.center-page { display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 50% 0, #e2f5ee, transparent 46%), #f4f8f7; }
.result-card { width: min(470px, 100%); padding: 50px; text-align: center; background: #fff; border-radius: 24px; box-shadow: var(--shadow); }
.result-icon { width: 68px; height: 68px; margin: 42px auto 18px; display: grid; place-items: center; color: #fff; background: var(--green-500); border-radius: 50%; font-size: 28px; font-weight: 900; }
.result-card h1 { margin: 0; font-size: 28px; }
.result-card p { margin: 14px 0 28px; color: var(--muted); line-height: 1.7; }

@media (max-width: 760px) {
  .login-layout { width: 100%; min-height: 100svh; padding: 0; display: block; }
  .brand-panel { display: none; }
  .login-card { min-height: 100svh; padding: 38px 24px 28px; border-radius: 0; box-shadow: none; }
  .card-heading h2 { font-size: 27px; }
  .qr-frame { width: 232px; height: 232px; }
  .qr-frame img { width: 208px; height: 208px; }
  .portal-header { width: calc(100% - 32px); height: 72px; }
  .header-caption { display: none; }
  .header-account { max-width: 52%; }
  .header-account > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .form-shell, .workspace-shell { width: calc(100% - 24px); margin-top: 4px; margin-bottom: 42px; }
  .demand-shell { width: calc(100% - 24px); margin-top: 4px; margin-bottom: 42px; }
  .progress-strip { gap: 7px; font-size: 11px; }
  .progress-strip i { width: 18px; }
  .form-card { padding: 26px 18px; border-radius: 20px; }
  .identity-grid, .field-grid, .subtype-grid { grid-template-columns: 1fr; }
  .identity-card { min-height: 112px; padding: 18px; }
  .button-row { flex-direction: column-reverse; }
  .button-row.compact { flex-direction: row; }
  .button-row .primary-button, .button-row .secondary-button { width: 100%; }
  .welcome-block { padding: 24px 4px 18px; }
  .section-heading { align-items: center; }
  .section-heading .inline-button { padding: 0 12px; }
  .workspace-card { padding: 19px; align-items: stretch; flex-direction: column; gap: 16px; }
  .organization-card .primary-button { width: 100%; }
  .device-card .secondary-button { width: 100%; }
  .device-meta { display: grid; grid-template-columns: 1fr; gap: 10px; }
  .form-grid, .quote-card dl { grid-template-columns: 1fr; }
  .result-card { padding: 38px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

.attachment-editor {
  margin: 1rem 0;
  padding: 1rem;
  border: 1px solid var(--border, #dbe3ec);
  border-radius: 12px;
}

.attachment-list p { margin: .5rem 0 0; }
