:root {
  --ink: #172536;
  --ink-soft: #34465a;
  --green: #13766f;
  --green-dark: #0d5b56;
  --gold: #e2ad3a;
  --coral: #c65f4b;
  --paper: #f5f7f8;
  --white: #ffffff;
  --line: #dce2e6;
  --muted: #6c7886;
  --danger: #a33f35;
  --shadow: 0 16px 44px rgba(23, 37, 54, 0.09);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); }
body { margin: 0; min-height: 100vh; color: var(--ink); font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif; background: var(--paper); letter-spacing: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 3px solid rgba(19, 118, 111, 0.22); outline-offset: 2px; }

.site-header { height: 68px; padding: 0 max(24px, calc((100vw - 1180px) / 2)); display: flex; align-items: center; justify-content: space-between; background: var(--white); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: Georgia, "Microsoft YaHei", serif; font-size: 19px; }
.brand b { color: var(--green); font-weight: 600; }
.brand-mark { width: 34px; height: 34px; display: inline-grid; place-items: center; background: var(--ink); color: var(--gold); font: 700 18px Georgia, serif; border-radius: 4px; }
.header-note { color: var(--muted); font-size: 13px; }
.customer-header { height: 84px; }
.customer-brand { display: inline-flex; align-items: baseline; gap: 11px; color: var(--ink); }
.customer-brand strong { font: 700 35px/1 Georgia, "Times New Roman", serif; }
.customer-brand span { color: var(--green); font: 600 12px/1 Georgia, serif; text-transform: uppercase; }
.site-header nav { display: flex; align-items: center; gap: 22px; font-size: 14px; }
.site-header nav form { display: inline; }
.link-button { padding: 0; border: 0; color: var(--muted); background: transparent; }

.eyebrow { margin: 0 0 10px; color: var(--green); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.muted { color: var(--muted); }
.primary, .secondary { min-height: 42px; padding: 0 20px; display: inline-flex; align-items: center; justify-content: center; border-radius: 5px; border: 1px solid var(--green); font-weight: 700; font-size: 14px; }
.primary { background: var(--green); color: var(--white); box-shadow: 0 7px 18px rgba(19, 118, 111, 0.18); }
.primary:hover { background: var(--green-dark); }
.secondary { background: var(--white); color: var(--green); }
.wide { width: 100%; }
.alert { margin: 18px 0; padding: 13px 15px; border: 1px solid; border-radius: 5px; font-size: 13px; line-height: 1.55; }
.alert.error { color: #7f3028; border-color: #eac4bf; background: #fff5f3; }
.alert.warning { color: #705115; border-color: #ead49a; background: #fff9e9; }
.alert.success { color: #155d51; border-color: #acd7ce; background: #effaf7; }

.customer-shell { max-width: 1180px; margin: 0 auto; padding: 54px 24px 80px; }
.intro-band { display: block; padding-bottom: 42px; border-bottom: 1px solid var(--line); }
.intro-band h1 { max-width: 780px; margin: 0; font-family: Georgia, "Microsoft YaHei", serif; font-size: 40px; line-height: 1.28; font-weight: 700; }
.intro-band p:last-child { max-width: 760px; margin: 18px 0 0; color: var(--ink-soft); font-size: 15px; line-height: 1.9; }
.order-id { padding-left: 20px; border-left: 3px solid var(--gold); }
.order-id span, .order-id small { display: block; color: var(--muted); font-size: 11px; }
.order-id strong { display: block; margin: 7px 0; font-size: 17px; overflow-wrap: anywhere; }
.submission-grid { display: grid; grid-template-columns: minmax(0, 1fr) 285px; gap: 58px; padding-top: 42px; align-items: start; }
.submission-form { padding: 36px; background: var(--white); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 7px; }
fieldset { margin: 0 0 34px; padding: 0 0 34px; border: 0; border-bottom: 1px solid var(--line); }
fieldset:last-of-type { margin-bottom: 22px; }
legend { width: 100%; margin-bottom: 22px; display: flex; align-items: center; gap: 12px; font-size: 16px; font-weight: 700; }
legend span { color: var(--green); font: 700 11px Georgia, serif; }
label { display: grid; gap: 8px; color: var(--ink-soft); font-size: 12px; font-weight: 700; }
input, select, textarea { width: 100%; border: 1px solid #cdd5db; border-radius: 4px; background: var(--white); color: var(--ink); }
input, select { min-height: 44px; padding: 0 12px; }
textarea { min-height: 180px; padding: 13px; resize: vertical; line-height: 1.75; }
input::placeholder, textarea::placeholder { color: #98a1aa; }
.two-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.two-cols.compact { margin-top: 18px; grid-template-columns: 180px 1fr; align-items: stretch; }
.privacy-note { padding: 11px 14px; display: grid; align-content: center; gap: 3px; border-left: 3px solid var(--gold); background: #fffaf0; font-size: 12px; }
.privacy-note span { color: var(--muted); line-height: 1.55; }
.file-drop { min-height: 150px; padding: 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; border: 1px dashed #9eabb5; border-radius: 5px; background: #f9fbfb; cursor: pointer; text-align: center; }
.file-drop:hover, .file-drop.dragging { border-color: var(--green); background: #f0f8f6; }
.file-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.file-drop strong { color: var(--ink); font-size: 14px; overflow-wrap: anywhere; }
.file-drop small { color: var(--muted); font-weight: 400; }
.file-icon { width: 38px; height: 44px; display: grid; place-items: center; border: 1px solid var(--green); border-radius: 3px; color: var(--green); background: var(--white); font: 700 16px Georgia, serif; }
.consent { margin: 0 0 18px; display: flex; grid-template-columns: auto 1fr; flex-direction: row; align-items: flex-start; gap: 9px; color: var(--muted); font-weight: 400; line-height: 1.5; }
.consent input { width: 16px; min-height: 16px; margin: 2px 0 0; accent-color: var(--green); }
.submit-button { width: 100%; min-height: 48px; }
.process-panel { padding-top: 8px; position: sticky; top: 24px; }
.process-panel ol { margin: 24px 0 0; padding: 0; list-style: none; counter-reset: steps; }
.process-panel li { min-height: 92px; padding: 0 0 24px 42px; position: relative; border-left: 1px solid var(--line); }
.process-panel li:last-child { border-left-color: transparent; }
.process-panel li::before { counter-increment: steps; content: counter(steps); position: absolute; left: -14px; top: -3px; width: 27px; height: 27px; display: grid; place-items: center; border: 1px solid var(--green); border-radius: 50%; background: var(--paper); color: var(--green); font: 700 10px Georgia, serif; }
.process-panel b, .process-panel span { display: block; }
.process-panel b { margin-bottom: 7px; font-size: 14px; }
.process-panel span { color: var(--muted); font-size: 12px; line-height: 1.65; }

.login-shell, .center-state { min-height: calc(100vh - 68px); display: grid; place-items: center; padding: 32px 20px; }
.login-panel { width: min(430px, 100%); padding: 42px; background: var(--white); border: 1px solid var(--line); border-radius: 7px; box-shadow: var(--shadow); }
.login-panel h1 { margin: 0; font: 700 31px Georgia, "Microsoft YaHei", serif; }
.login-panel .muted { margin: 12px 0 28px; font-size: 13px; line-height: 1.7; }
.stack-form { display: grid; gap: 18px; }
.center-state { text-align: center; align-content: center; }
.center-state h1 { margin: 16px 0 8px; font: 700 30px Georgia, "Microsoft YaHei", serif; }
.center-state p { max-width: 520px; margin: 0 0 24px; color: var(--muted); line-height: 1.75; }
.state-symbol { width: 54px; height: 54px; display: grid; place-items: center; margin: 0 auto; border-radius: 50%; background: var(--ink); color: var(--gold); font: 700 28px Georgia, serif; }

.status-shell { max-width: 860px; margin: 0 auto; padding: 72px 24px; }
.status-panel { padding: 42px; background: var(--white); border: 1px solid var(--line); border-radius: 7px; box-shadow: var(--shadow); }
.status-top { display: flex; justify-content: space-between; align-items: start; gap: 20px; }
.status-top h1 { margin: 0; font: 700 34px Georgia, "Microsoft YaHei", serif; }
.status-code { padding: 7px 10px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); font: 700 10px Consolas, monospace; }
.progress-track { height: 7px; margin: 30px 0 10px; overflow: hidden; border-radius: 3px; background: #e8ecef; }
.progress-track span { display: block; height: 100%; background: var(--green); transition: width .4s ease; }
.status-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; }
.working-copy { margin-top: 38px; padding: 22px; display: grid; gap: 7px; border-left: 3px solid var(--gold); background: #fffaf0; }
.working-copy span { color: var(--muted); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.delivery-ready { margin-top: 38px; padding: 22px; display: grid; grid-template-columns: 54px 1fr auto; align-items: center; gap: 16px; border: 1px solid var(--line); border-radius: 5px; }
.file-badge { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 4px; color: var(--white); background: var(--coral); font-size: 10px; font-weight: 700; }
.delivery-ready strong, .delivery-ready span { display: block; overflow-wrap: anywhere; }
.delivery-ready strong { margin-bottom: 5px; font-size: 13px; }
.delivery-ready span { color: var(--muted); font-size: 11px; }
.rebuy { display: block; margin-top: 22px; color: var(--green); font-size: 13px; text-align: center; }

.admin-body { background: #f2f4f5; }
.admin-shell { max-width: 1280px; margin: 0 auto; padding: 42px 24px 80px; }
.admin-heading { margin-bottom: 28px; display: flex; justify-content: space-between; align-items: end; }
.admin-heading h1 { margin: 0; font: 700 34px Georgia, "Microsoft YaHei", serif; }
.mode-flag { padding: 7px 10px; border: 1px solid #a8d6cc; border-radius: 4px; background: #effaf7; color: var(--green); font-size: 11px; font-weight: 700; }
.mode-flag.demo { color: #78591a; border-color: #e4cf93; background: #fff9e8; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.metrics div { min-height: 100px; padding: 20px; display: flex; flex-direction: column; justify-content: space-between; background: var(--white); border: 1px solid var(--line); border-radius: 6px; }
.metrics span { color: var(--muted); font-size: 11px; }
.metrics strong { font: 700 27px Georgia, serif; }
.admin-section { margin-top: 18px; padding: 25px; background: var(--white); border: 1px solid var(--line); border-radius: 6px; }
.admin-section h2 { margin: 0; font-size: 16px; }
.admin-section p { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.create-link { display: grid; grid-template-columns: 270px 1fr; gap: 30px; align-items: end; border-left: 4px solid var(--green); }
.create-link form { display: grid; grid-template-columns: 1.4fr .65fr 1fr auto; gap: 12px; align-items: end; }
.section-title { margin-bottom: 17px; display: flex; justify-content: space-between; align-items: center; }
.section-title span { color: var(--muted); font-size: 11px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { padding: 10px 12px; color: var(--muted); text-align: left; font-weight: 600; background: #f7f8f9; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 14px 12px; border-bottom: 1px solid #e8ecef; vertical-align: middle; }
td strong, td small { display: block; }
td small { max-width: 280px; margin-top: 4px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill { display: inline-block; padding: 4px 8px; border-radius: 3px; color: var(--muted); background: #edf0f2; font-size: 10px; font-weight: 700; white-space: nowrap; }
.pill.active, .status-ready, .status-delivered { color: #116052; background: #e9f7f3; }
.status-failed { color: var(--danger); background: #fff0ee; }
.status-analyzing, .status-planning, .status-rendering, .status-queued { color: #755715; background: #fff7df; }
.link-cell { min-width: 300px; display: flex; align-items: center; gap: 7px; }
.link-cell input { min-height: 34px; padding: 0 8px; font: 10px Consolas, monospace; color: var(--muted); }
.icon-button { min-height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 4px; background: var(--white); color: var(--green); }
.text-danger { padding: 0; border: 0; background: transparent; color: var(--danger); font-size: 11px; }
.actions { min-width: 210px; }
.actions, .actions form { display: inline-flex; align-items: center; gap: 11px; }
.actions a, .actions button { padding: 0; border: 0; background: transparent; color: var(--green); font-size: 11px; white-space: nowrap; }
.error-text { color: var(--danger); }
.empty { padding: 30px; color: var(--muted); text-align: center; }
.detail-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 18px; }
.detail-grid .admin-section { margin-top: 0; }
.detail-grid dl { margin: 22px 0 0; display: grid; grid-template-columns: 100px 1fr; gap: 13px 18px; font-size: 13px; }
.detail-grid dt { color: var(--muted); }
.detail-grid dd { margin: 0; overflow-wrap: anywhere; }
.file-name { margin: 22px 0 18px !important; color: var(--ink) !important; font-weight: 700; overflow-wrap: anywhere; }
.requirement-block pre { margin: 0; padding: 20px; white-space: pre-wrap; overflow-wrap: anywhere; border: 1px solid var(--line); border-radius: 4px; background: #f7f8f9; font: 13px/1.85 "Microsoft YaHei", sans-serif; }
.manual-actions form { margin-top: 18px; }

@media (max-width: 900px) {
  .intro-band { grid-template-columns: 1fr; gap: 25px; }
  .intro-band h1 { font-size: 33px; }
  .order-id { max-width: 300px; }
  .submission-grid { grid-template-columns: 1fr; }
  .process-panel { position: static; order: -1; }
  .process-panel ol { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .process-panel li { min-height: 0; border-left: 0; padding: 0 0 0 38px; }
  .create-link { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .create-link form { grid-template-columns: 1fr 1fr; }
  .metrics { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .site-header { padding: 0 16px; }
  .header-note { display: none; }
  .customer-shell { padding: 36px 16px 60px; }
  .intro-band h1 { font-size: 28px; }
  .submission-form, .status-panel, .login-panel { padding: 24px 18px; }
  .two-cols, .two-cols.compact { grid-template-columns: 1fr; }
  .process-panel ol { grid-template-columns: 1fr; }
  .delivery-ready { grid-template-columns: 48px 1fr; }
  .delivery-ready .primary { grid-column: 1 / -1; }
  .status-shell { padding: 38px 14px; }
  .metrics { gap: 8px; }
  .metrics div { min-height: 86px; }
  .create-link form { grid-template-columns: 1fr; }
  .admin-shell { padding: 30px 12px 60px; }
  .admin-section { padding: 17px; }
}
