:root {
  color-scheme: light;
  --ink: #1f2933;
  --muted: #667085;
  --line: #d8e0ea;
  --panel: #ffffff;
  --canvas: #f4f7fb;
  --brand: #0b5cad;
  --brand-2: #17845f;
  --danger: #c2410c;
  --warn: #a15c00;
  --shadow: 0 18px 45px rgba(15, 31, 52, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
  background:
    linear-gradient(135deg, rgba(11, 92, 173, 0.08), rgba(23, 132, 95, 0.08)),
    var(--canvas);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

*[hidden] {
  display: none !important;
}

.app-shell {
  min-height: 100vh;
}

.view {
  min-height: 100vh;
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(360px, 520px);
  gap: 28px;
  align-items: center;
  max-width: 1120px;
  margin: 0 auto;
  padding: 48px 24px;
}

.brand-panel {
  padding: 40px;
}

.brand-mark {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--brand);
  font-size: 32px;
  font-weight: 800;
}

.brand-panel h1,
.welcome h1 {
  margin: 20px 0 12px;
  font-size: clamp(32px, 5vw, 54px);
  letter-spacing: 0;
}

.brand-panel p {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.8;
}

.auth-card,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.auth-card {
  padding: 24px;
}

.tab-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 22px;
  padding: 4px;
  border-radius: 8px;
  background: #eef3f8;
}

.auth-subtabs {
  grid-template-columns: 1fr 1fr;
  margin: 0 0 2px;
}

.inline-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.inline-field .secondary {
  min-width: 112px;
  margin: 0;
}

.membership-panel {
  margin-top: 24px;
  padding: 22px;
}

.membership-plans {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.membership-plan {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 16px;
  background: #fff;
}

.membership-plan strong {
  color: var(--ink);
}

.membership-plan-price {
  color: var(--brand);
  font-size: 24px;
  font-weight: 800;
}

.membership-plan small,
.membership-order-row small {
  color: var(--muted);
}

.membership-order-list {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.membership-order-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.tab,
.primary,
.secondary,
.ghost,
.link-button {
  border: 0;
  border-radius: 6px;
  transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}

.tab {
  min-height: 42px;
  color: var(--muted);
  background: transparent;
  font-weight: 700;
}

.tab.active {
  color: var(--brand);
  background: #fff;
  box-shadow: 0 4px 12px rgba(15, 31, 52, 0.08);
}

.auth-form,
.form-grid {
  display: grid;
  gap: 16px;
}

.form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
  display: grid;
  gap: 8px;
  color: #344054;
  font-weight: 700;
}

.field.required > span::after {
  content: " *";
  color: var(--danger);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

.field textarea {
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(11, 92, 173, 0.12);
}

.error {
  min-height: 18px;
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
}

.hint {
  min-height: 18px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.strength {
  height: 8px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.strength span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--danger);
}

.strength span[data-level="中"] {
  background: var(--warn);
}

.strength span[data-level="强"] {
  background: var(--brand-2);
}

.primary,
.secondary,
.ghost {
  min-height: 42px;
  padding: 0 18px;
  font-weight: 800;
}

.primary {
  color: #fff;
  background: var(--brand);
}

.primary:hover,
.secondary:hover,
.ghost:hover,
.link-button:hover {
  transform: translateY(-1px);
}

.primary:disabled,
.secondary:disabled {
  cursor: wait;
  opacity: 0.62;
}

.secondary {
  color: var(--brand);
  background: #e8f1fb;
}

.ghost {
  border: 1px solid var(--line);
  color: #344054;
  background: #fff;
}

.compact {
  min-height: 36px;
  padding: 0 12px;
}

.full {
  width: 100%;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 78px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar h2 {
  margin: 4px 0 0;
  font-size: 22px;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0;
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
}

.user-box {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 260px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.workspace-view {
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 24px;
}

.welcome {
  text-align: center;
  padding: 34px 0 18px;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.module-card {
  display: grid;
  gap: 10px;
  min-height: 180px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: left;
  background: #fff;
  box-shadow: var(--shadow);
}

.module-card strong {
  font-size: 24px;
  letter-spacing: 0;
}

.module-card small {
  color: var(--muted);
  font-size: 15px;
}

.module-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--brand);
  font-weight: 900;
}

.order-directory-panel {
  margin-top: 22px;
}

.panel-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.order-directory-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.85fr) minmax(0, 1.15fr);
  gap: 16px;
}

.order-list-column,
.order-detail-pane {
  min-width: 0;
}

.order-list-column {
  display: grid;
  align-content: start;
  gap: 10px;
}

.order-directory-list {
  display: grid;
  gap: 8px;
  max-height: 560px;
  overflow: auto;
  padding-right: 2px;
}

.order-directory-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
  text-align: left;
}

.order-directory-row:hover,
.order-directory-row.selected {
  border-color: var(--brand);
  background: #f2f8ff;
}

.order-row-main,
.order-row-side,
.order-file-meta {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.order-row-main strong,
.order-file-meta strong {
  overflow-wrap: anywhere;
}

.order-row-main span,
.order-row-directory,
.order-row-side span:last-child {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.order-row-side {
  justify-items: end;
  align-content: start;
}

.order-status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--brand);
  background: #e8f1fb;
  font-size: 12px;
  font-weight: 800;
}

.order-row-directory {
  grid-column: 1 / -1;
  overflow-wrap: anywhere;
  font-family: Consolas, "Courier New", monospace;
}

.order-detail-pane {
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 280px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfdff;
}

.order-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.order-detail-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 7px;
}

.order-detail-toggle {
  min-width: 82px;
}

.order-detail-pane.is-collapsed {
  min-height: 0;
}

.order-detail-body[hidden] {
  display: none;
}

.danger-button {
  border: 0;
  border-radius: 6px;
  min-height: 42px;
  padding: 0 14px;
  color: #fff;
  background: var(--danger);
  font-weight: 800;
}

.danger-button:hover {
  transform: translateY(-1px);
}

.danger-button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.order-detail-header h4 {
  margin: 0 0 6px;
  font-size: 18px;
  overflow-wrap: anywhere;
}

.order-detail-header code {
  color: var(--muted);
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.order-detail-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.order-detail-summary span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.order-edit-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.order-edit-header h4 {
  margin: 4px 0 6px;
  font-size: 18px;
}

.order-edit-header small {
  color: var(--muted);
  font-size: 12px;
}

.order-edit-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.order-edit-form[hidden] {
  display: none;
}

.order-edit-state {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  background: #f8fafc;
}

.order-edit-dirty-hint {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.order-edit-dirty-hint.is-dirty {
  color: #b45309;
}

.primary.attention {
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.order-edit-form .form-actions,
.order-edit-form .form-wide-error {
  grid-column: 1 / -1;
}

.order-edit-hardware {
  grid-column: 1 / -1;
}

.order-file-tree {
  display: grid;
  gap: 12px;
}

.order-file-group {
  padding-top: 2px;
}

.order-file-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 30px;
}

.order-file-group h5 {
  margin: 0;
  color: #344054;
  font-size: 13px;
}

.order-file-group-toggle {
  min-width: 74px;
  padding: 5px 8px;
  border: 1px solid #cbdced;
  border-radius: 5px;
  color: #175a9c;
  background: #f3f8fd;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}

.order-file-group-toggle:hover,
.order-file-group-toggle:focus-visible {
  border-color: #8bb5dd;
  background: #e8f2fb;
}

.order-file-group.is-expanded .order-file-group-toggle {
  color: #344054;
  background: #fff;
}

.order-file-list {
  display: grid;
  gap: 7px;
  margin: 7px 0 0;
  padding: 0;
  list-style: none;
}

.order-file-list[hidden] {
  display: none;
}

.order-file-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.order-file-meta small {
  color: var(--muted);
  font-family: Consolas, "Courier New", monospace;
  font-size: 11px;
  overflow-wrap: anywhere;
}

.order-file-download {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.panel {
  padding: 24px;
  margin-bottom: 22px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
}

.panel-head h3 {
  margin: 4px 0 0;
  font-size: 24px;
  letter-spacing: 0;
}

.status-pill {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 7px 11px;
  color: var(--brand);
  background: #e8f1fb;
  font-size: 13px;
  font-weight: 800;
}

.check-group {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.check-group legend {
  padding: 0 6px;
  color: #344054;
  font-weight: 800;
}

.wall-select-group {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.wall-select-group legend {
  padding: 0 6px;
  color: #344054;
  font-weight: 800;
}

.required-mark {
  color: var(--danger);
}

.wall-select-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--brand);
  font-weight: 800;
}

.wall-select-head span:last-child {
  color: var(--muted);
  font-size: 13px;
}

.wall-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(100px, 1fr));
  gap: 10px;
}

.wall-options label {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #344054;
  background: #fff;
  font-weight: 700;
}

.wall-options label:has(input:checked) {
  border-color: var(--brand);
  color: var(--brand);
  background: #edf6ff;
}

.form-wide-error {
  grid-column: 1 / -1;
}

.sunroom-roof-gate {
  padding: 14px;
  border: 1px solid #93c5fd;
  border-radius: 8px;
  background: #eff6ff;
}

.sunroom-dependent-fields {
  grid-column: 1 / -1;
  align-items: start;
}

.check-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #344054;
  font-weight: 700;
}

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 10px;
}

.order-draft-dirty-hint {
  min-width: 210px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.order-draft-dirty-hint.is-dirty {
  color: #b45309;
}

.drop-zone {
  display: grid;
  place-items: center;
  min-height: 188px;
  border: 2px dashed #9bb8d6;
  border-radius: 8px;
  padding: 24px;
  color: #315b87;
  background: #f7fbff;
  text-align: center;
  outline: none;
}

.drop-zone input {
  display: none;
}

.drop-zone strong {
  font-size: 18px;
  letter-spacing: 0;
}

.drop-zone span {
  color: var(--muted);
}

.drop-zone.dragging,
.drop-zone:focus {
  border-color: var(--brand);
  background: #edf6ff;
  box-shadow: 0 0 0 3px rgba(11, 92, 173, 0.12);
}

.upload-progress {
  height: 10px;
  margin: 16px 0;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.upload-progress div {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--brand-2);
  transition: width 0.12s ease;
}

.structured-data-entry {
  margin: 0 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.structured-data-entry summary {
  min-height: 42px;
  padding: 11px 14px;
  color: var(--brand);
  font-weight: 800;
  cursor: pointer;
}

.structured-data-entry .field {
  padding: 0 14px 14px;
}

.structured-data-entry textarea {
  min-height: 132px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.5;
}

.file-list {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.file-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.file-list li.archived-file {
  background: #f7fbff;
}

.file-item-actions,
.generated-output-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.order-file-view,
.order-file-download {
  white-space: nowrap;
}

.generate-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #f8fbff;
}

.generate-toolbar div {
  display: grid;
  gap: 6px;
}

.generate-toolbar strong {
  font-size: 18px;
  letter-spacing: 0;
}

.generate-toolbar span {
  color: var(--muted);
}

.window-page-size {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.window-page-size legend {
  padding: 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.window-page-size label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  padding: 0 9px;
  border-radius: 6px;
  color: #344054;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.window-page-size label:has(input:checked) {
  color: var(--brand);
  background: #edf6ff;
}

.generated-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  margin-top: 18px;
}

.generated-card,
.empty-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.generated-card {
  overflow: hidden;
}

.generated-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #f7fbff;
}

.generated-preview-content {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.generated-preview-content strong {
  color: var(--ink);
  font-size: 15px;
}

.generated-preview-content span {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 13px;
}

.generated-preview-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.generated-preview-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.generated-preview-compact {
  min-height: 0;
}

@media (max-width: 640px) {
  .generated-preview {
    align-items: flex-start;
    flex-direction: column;
  }

  .generated-preview-actions {
    justify-content: flex-start;
  }
}

.generated-meta {
  display: grid;
  gap: 7px;
  padding: 14px;
}

.generated-meta-compact {
  gap: 6px;
}

.generated-meta strong {
  overflow-wrap: anywhere;
}

.generated-meta span {
  color: var(--muted);
  font-size: 13px;
}

.generated-details {
  border-top: 1px solid #e6edf5;
  padding-top: 6px;
}

.generated-details summary {
  width: fit-content;
  color: var(--brand);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.generated-details-body {
  display: grid;
  gap: 5px;
  padding-top: 7px;
}

.generated-archive-summary {
  color: var(--muted);
  font-size: 12px !important;
}

.generated-warning {
  border: 1px solid #fed7aa;
  border-radius: 6px;
  padding: 10px;
  color: #9a3412;
  background: #fff7ed;
  font-size: 13px;
  line-height: 1.6;
}

.generated-correction-decision {
  display: grid;
  gap: 9px;
  border: 1px solid #fecaca;
  border-radius: 6px;
  padding: 10px;
  color: #991b1b;
  background: #fff7f7;
  font-size: 13px;
  line-height: 1.6;
}

.generated-correction-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.generated-topology-decision {
  display: grid;
  gap: 9px;
  border: 1px solid #f59e0b;
  border-radius: 6px;
  padding: 10px;
  color: #92400e;
  background: #fffbeb;
  font-size: 13px;
  line-height: 1.6;
}

body.modal-open {
  overflow: hidden;
}

.preview-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 31, 52, 0.72);
}

.preview-dialog {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1320px, calc(100vw - 48px));
  height: min(860px, calc(100vh - 48px));
  overflow: hidden;
  border: 1px solid rgba(216, 224, 234, 0.8);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.preview-head h3,
.preview-head p {
  margin: 0;
}

.preview-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.preview-body {
  min-height: 0;
  overflow: auto;
  background: #eef5fb;
}

.preview-frame {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 720px;
  border: 0;
  background: #fff;
}

.preview-image {
  display: block;
  max-width: 100%;
  max-height: none;
  margin: 0 auto;
  background: #fff;
}

.preview-pdf-pages {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.preview-pdf-page {
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  background: #fff;
  box-shadow: 0 2px 12px rgb(15 23 42 / 16%);
}

.preview-pdf-canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

.result-badge {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 7px 11px;
  color: var(--muted);
  background: #eef2f6;
  font-size: 13px;
  font-weight: 800;
}

.result-badge[data-state="success"] {
  color: #166534;
  background: #dcfce7;
}

.result-badge[data-state="warn"] {
  color: #9a3412;
  background: #ffedd5;
}

.sunroom-result {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.sunroom-shape-preview {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #fffaf3;
}

.sunroom-shape-preview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.sunroom-shape-preview-head h4 {
  margin: 0;
  color: #7c2d12;
  font-size: 15px;
}

.sunroom-shape-preview-head p {
  margin: 4px 0 0;
  color: #9a3412;
  font-size: 12px;
  line-height: 1.55;
}

.sunroom-shape-svg {
  display: grid;
  min-height: 280px;
  place-items: center;
  overflow: auto;
  border: 1px solid #fdba74;
  border-radius: 6px;
  background: #fff;
}

.sunroom-shape-svg svg {
  width: 100%;
  height: auto;
  min-width: 620px;
}

.sunroom-shape-svg [data-sunroom-edit-field] {
  cursor: pointer;
}

.sunroom-shape-svg [data-sunroom-edit-field]:focus {
  outline: 2px solid #ea580c;
  outline-offset: 3px;
}

.sunroom-shape-marker {
  fill: #fff7ed;
  stroke: #ea580c;
  stroke-width: 2;
  stroke-dasharray: 5 4;
}

.sunroom-shape-marker-text {
  fill: #9a3412;
  font-size: 13px;
  font-family: Microsoft YaHei, Arial, sans-serif;
  font-weight: 700;
}

.sunroom-shape-confirmed-text {
  fill: #166534;
  font-size: 13px;
  font-family: Microsoft YaHei, Arial, sans-serif;
  font-weight: 700;
}

.sunroom-shape-missing-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sunroom-shape-missing-list li {
  padding: 5px 8px;
  border: 1px solid #fdba74;
  border-radius: 999px;
  color: #9a3412;
  background: #ffedd5;
  font-size: 12px;
}

.sunroom-inline-editor {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  border: 1px solid #fb923c;
  border-radius: 6px;
  background: #fff7ed;
}

.sunroom-inline-editor label {
  display: grid;
  gap: 4px;
  min-width: 180px;
  color: #7c2d12;
  font-size: 12px;
  font-weight: 700;
}

.sunroom-inline-editor input {
  min-height: 34px;
  border: 1px solid #fdba74;
  border-radius: 5px;
  padding: 6px 8px;
  background: #fff;
}

.sunroom-source-review {
  border: 1px solid #fde68a;
  border-radius: 6px;
  padding: 9px 10px;
  color: #854d0e;
  background: #fefce8;
  font-size: 13px;
  line-height: 1.6;
}

.sunroom-result-card {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.sunroom-result-card--product-page {
  grid-template-columns: minmax(0, 1fr);
}

.sunroom-result-card--product-page .sunroom-window-sheet-preview {
  min-height: 0;
  background: #fff;
}

.sunroom-result-card--product-page .sunroom-window-sheet-preview svg {
  max-height: none;
}

.sunroom-result-previews {
  display: grid;
  gap: 14px;
}

.sunroom-preview-section {
  display: grid;
  gap: 7px;
}

.sunroom-preview-section h4,
.sunroom-materials h4 {
  margin: 0;
  color: #0f172a;
  font-size: 14px;
}

.sunroom-svg-preview {
  display: grid;
  min-height: 360px;
  place-items: center;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7fbff;
}

.sunroom-svg-preview svg {
  width: 100%;
  height: auto;
  max-height: 560px;
}

.sunroom-top-preview,
.sunroom-3d-preview {
  min-height: 300px;
}

.sunroom-result-meta {
  display: grid;
  align-content: start;
  gap: 9px;
}

.sunroom-result-meta strong {
  font-size: 18px;
}

.sunroom-result-meta span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.sunroom-result-warning {
  border: 1px solid #fed7aa;
  border-radius: 6px;
  padding: 10px;
  color: #9a3412;
  background: #fff7ed;
  font-size: 13px;
  line-height: 1.6;
}

.sunroom-validation {
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  padding: 10px;
  color: #166534;
  background: #f0fdf4;
  font-size: 13px;
  line-height: 1.6;
}

.sunroom-materials {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

.sunroom-material-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.sunroom-material-table th,
.sunroom-material-table td {
  padding: 7px 6px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.sunroom-material-table th {
  color: #475569;
  font-weight: 800;
}

.sunroom-summary-section {
  display: grid;
  gap: 8px;
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.sunroom-summary-section h4 {
  margin: 0;
  color: #0f172a;
  font-size: 15px;
}

.sunroom-summary-source {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.sunroom-summary-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.sunroom-summary-table {
  min-width: 1280px;
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.sunroom-summary-table th,
.sunroom-summary-table td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

.sunroom-summary-table th {
  color: #475569;
  background: #f8fafc;
  font-weight: 800;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 28px;
  color: var(--muted);
  text-align: center;
  font-weight: 800;
}

.empty-state.mini {
  border: 0;
  background: transparent;
}

.link-button {
  color: var(--danger);
  background: transparent;
  font-weight: 800;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  max-width: min(420px, calc(100vw - 44px));
  border-radius: 8px;
  padding: 13px 16px;
  color: #fff;
  background: #344054;
  box-shadow: var(--shadow);
  font-weight: 800;
}

.toast[data-type="success"] {
  background: var(--brand-2);
}

.toast[data-type="warn"] {
  background: var(--warn);
}

.toast[data-type="error"] {
  background: var(--danger);
}

@media (max-width: 820px) {
  .auth-layout,
  .module-grid,
  .form-grid,
  .generated-list,
  .membership-plans {
    grid-template-columns: 1fr;
  }

  .auth-layout {
    padding: 22px 14px;
  }

  .brand-panel {
    padding: 16px 6px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .user-box {
    justify-content: space-between;
    width: 100%;
  }

  .membership-order-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .workspace-view {
    padding: 20px 14px;
  }

  .generate-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .preview-modal {
    padding: 10px;
  }

  .preview-dialog {
    width: calc(100vw - 20px);
    height: calc(100vh - 20px);
  }

  .preview-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .preview-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .wall-options,
  .sunroom-result-card {
    grid-template-columns: 1fr;
  }

  .order-directory-layout,
  .order-detail-summary,
  .order-edit-form {
    grid-template-columns: 1fr;
  }

  .order-edit-state {
    align-items: stretch;
    flex-direction: column;
  }

  .wall-select-head {
    align-items: flex-start;
    flex-direction: column;
  }
}
