:root {
  --ink: #17232f;
  --muted: #667382;
  --line: #dce3e9;
  --canvas: #f4f7f9;
  --surface: #ffffff;
  --navy: #113c5b;
  --teal: #087d7a;
  --teal-soft: #e4f4f2;
  --amber: #9a5c08;
  --amber-soft: #fff4df;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
body.drawer-open { overflow: hidden; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.app-header { width: min(1440px, calc(100% - 48px)); height: 76px; margin: auto; display: flex; justify-content: space-between; align-items: center; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand-mark { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 11px; background: var(--navy); color: #fff; font: 800 19px Georgia, serif; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; letter-spacing: -.02em; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.service-status { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.service-status span { width: 8px; height: 8px; border-radius: 50%; background: #20a379; box-shadow: 0 0 0 4px #d9f2e9; }

.page-shell { width: min(1440px, calc(100% - 48px)); margin: 0 auto 56px; }
.page-intro { display: flex; justify-content: flex-end; padding: 6px 0 10px; }
.eyebrow { margin: 0 0 11px; color: var(--teal); font-size: 11px; font-weight: 800; letter-spacing: .12em; }
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 620px; margin-bottom: 5px; color: var(--navy); font: 700 clamp(25px, 2.5vw, 32px)/1.2 Georgia, "Songti SC", serif; letter-spacing: -.035em; }
.page-intro > div > p:last-child { max-width: 620px; margin-bottom: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.workflow-tabs { display: flex; gap: 6px; width: fit-content; padding: 4px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.workflow-tabs button { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 11px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 700; }
.workflow-tabs button span { display: grid; width: 19px; height: 19px; place-items: center; border-radius: 50%; background: #eaf0f5; color: var(--navy); font-size: 10px; }
.workflow-tabs button.active { background: var(--navy); color: #fff; }
.workflow-tabs button.active span { background: var(--teal); color: #fff; }
.workflow-tabs button:disabled { cursor: not-allowed; opacity: .45; }

.workspace { display: grid; grid-template-columns: minmax(360px, .78fr) minmax(560px, 1.22fr); gap: 24px; align-items: start; }
.source-column { position: sticky; top: 18px; }
.work-column, .result-column { display: grid; gap: 20px; min-width: 0; }
.panel, .awaiting-card, .reply-panel { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 12px 30px rgba(31, 50, 66, .045); }
.panel-heading { display: flex; align-items: flex-start; gap: 12px; padding: 22px 24px 18px; }
.panel-heading > div:nth-child(2) { min-width: 0; }
.panel-heading h2, .reply-heading h2 { margin: 0; color: var(--navy); font-size: 17px; letter-spacing: -.02em; }
.panel-heading p, .reply-heading p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.step-number { display: grid; flex: 0 0 auto; width: 28px; height: 28px; place-items: center; border-radius: 8px; background: #eaf0f5; color: var(--navy); font-size: 11px; font-weight: 800; }

.source-panel form, .normalized-description-body { padding: 0 24px 22px; }
.language-switch { display: inline-flex; flex: 0 0 auto; gap: 2px; margin-left: auto; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: #f8fbfc; }
.language-switch button { min-height: 27px; padding: 0 8px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 700; }
.language-switch button.active { background: #fff; color: var(--navy); box-shadow: 0 1px 3px rgba(31, 50, 66, .12); }
.normalized-description-body textarea { min-height: 390px; background: #f8fbfc; font: 12px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace; }
.normalized-description-body p { margin: 10px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.normalized-description-footer { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.normalized-description-footer p { margin: 10px 0 0; }
.compact-button { min-height: 32px; padding: 0 10px; font-size: 11px; white-space: nowrap; }
textarea { display: block; width: 100%; min-height: 190px; padding: 15px 16px; border: 1px solid #cfd9e1; border-radius: 10px; outline: none; resize: vertical; background: #fbfcfd; color: var(--ink); font-size: 14px; line-height: 1.7; transition: border-color .16s, box-shadow .16s; }
textarea::placeholder { color: #96a2ad; }
textarea:focus, input:focus, select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(8, 125, 122, .12); }
.source-footer, .quote-footer { display: flex; justify-content: space-between; gap: 18px; align-items: center; margin-top: 14px; }
.source-footer p, .quote-footer p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.source-footer p b, .quote-footer p strong { color: var(--ink); }
.source-actions { display: flex; align-items: center; gap: 16px; white-space: nowrap; }
.text-button { color: var(--muted); font-size: 13px; text-decoration: none; }
.text-button:hover { color: var(--navy); text-decoration: underline; }
.primary-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 17px; border: 0; border-radius: 9px; background: var(--navy); color: #fff; font-size: 13px; font-weight: 750; box-shadow: 0 4px 10px rgba(17, 60, 91, .15); transition: background .16s, transform .16s; }
.primary-button:hover { background: var(--teal); transform: translateY(-1px); }
.secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 17px; border: 1px solid var(--navy); border-radius: 9px; background: #fff; color: var(--navy); font-size: 13px; font-weight: 750; }
.secondary-button:hover { background: #edf4f6; }
.primary-button:disabled, .secondary-button:disabled { cursor: not-allowed; transform: none; opacity: .45; }
.awaiting-card { display: flex; gap: 16px; align-items: flex-start; padding: 30px 28px; border-style: dashed; box-shadow: none; color: var(--muted); }
.awaiting-icon { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 10px; background: #edf2f6; color: var(--navy); font-size: 21px; }
.awaiting-card h2 { margin: 1px 0 6px; color: var(--ink); font-size: 15px; }
.awaiting-card p { max-width: 480px; margin: 0; font-size: 13px; line-height: 1.65; }

.confirmation-heading { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.confirmation-heading p { display: none; }
.model-summary { margin: 14px 24px 0; padding: 10px 12px; border-radius: 8px; background: var(--teal-soft); color: #05615f; font-size: 12px; line-height: 1.5; }
.review-list { display: grid; gap: 8px; padding: 18px 24px 22px; }
.review-row { min-width: 0; padding: 10px 12px; border: 1px solid #e3e9ed; border-radius: 9px; background: #fbfcfd; }
.review-row.field-value-row { display: grid; grid-template-columns: 148px minmax(0, 1fr); align-items: center; gap: 14px; }
.review-label { display: flex; gap: 8px; align-items: center; margin: 0; }
.field-icon { display: grid; width: 23px; height: 23px; place-items: center; border-radius: 6px; background: #edf4f6; color: var(--teal); font-size: 15px; }
.review-label h3 { margin: 0; color: var(--ink); font-size: 13px; }
.field-value-row .review-label h3::after { content: "："; }
.review-label p { display: none; }
.review-control { display: flex; align-items: center; gap: 8px; min-width: 0; }
.field-value-row .field-state { flex: 0 0 auto; margin: 0; }
.field-value-row .destination-combobox, .field-value-row > .review-control > select { flex: 1 1 auto; }
.field-value-row .container-list { flex: 1 1 auto; }
.field-value-row .condition-list { margin: 0; }
.field-value-row .add-container { flex: 0 0 auto; margin: 0; white-space: nowrap; }
.parsed-fields { grid-column: span 2; }
.parsed-list { display: grid; gap: 6px; margin: 0; }
.parsed-list div { display: grid; grid-template-columns: 148px minmax(0, 1fr); align-items: center; min-width: 0; padding: 7px 10px; border-radius: 7px; background: #f3f7f9; }
.parsed-list dt { color: var(--muted); font-size: 12px; }
.parsed-list dt::after { content: "："; }
.parsed-list dd { min-width: 0; margin: 0; color: var(--ink); font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.parsed-list input { width: 100%; min-height: 32px; padding: 5px 7px; border: 1px solid #cfd9e1; border-radius: 6px; outline: none; background: #fff; color: var(--ink); font-size: 12px; }
.field-state { display: inline-flex; margin: 0 0 8px; padding: 3px 7px; border-radius: 999px; font-size: 10px; font-weight: 700; }
.field-state.confirmed { background: var(--teal-soft); color: #05615f; }
.field-state.needs-action { background: var(--amber-soft); color: var(--amber); }
select, .quantity-input, .destination-combobox input[type="search"] { width: 100%; min-height: 40px; border: 1px solid #cfd9e1; border-radius: 8px; outline: none; background: #fff; color: var(--ink); font-size: 13px; }
select { padding: 0 11px; }
select:disabled { cursor: not-allowed; background: #f4f6f7; color: #8b97a1; }
.destination-combobox { position: relative; }
.destination-combobox input[type="search"] { padding: 0 36px 0 11px; }
.destination-combobox::after { content: "⌄"; position: absolute; top: 9px; right: 12px; color: var(--muted); pointer-events: none; }
.destination-options { position: absolute; z-index: 5; top: calc(100% + 5px); right: 0; left: 0; max-height: 220px; overflow-y: auto; padding: 5px; border: 1px solid #cfd9e1; border-radius: 8px; background: #fff; box-shadow: 0 10px 22px rgba(31, 50, 66, .14); }
.destination-option { display: block; width: 100%; padding: 9px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--ink); font-size: 12px; text-align: left; }
.destination-option:hover, .destination-option[aria-selected="true"] { background: var(--teal-soft); color: #05615f; }
.destination-empty, .destination-more { margin: 0; padding: 9px 10px; color: var(--muted); font-size: 12px; }
.destination-more { border-top: 1px solid var(--line); font-size: 11px; }
.suggestions, .condition-list { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 9px; font-size: 11px; }
.suggestions > span, .condition-list > span { color: var(--muted); }
.suggestions em, .condition-list em { padding: 4px 7px; border-radius: 5px; background: #f0f4f7; color: #415363; font-style: normal; }
.suggestion-button { display: grid; gap: 3px; width: 100%; padding: 8px; border: 1px solid #c9dde0; border-radius: 7px; background: #f4fbfa; color: #075e5c; text-align: left; }
.suggestion-button:hover { border-color: var(--teal); background: var(--teal-soft); }
.suggestion-button strong { font-size: 11px; }
.suggestion-button small { color: #577776; font-size: 10px; line-height: 1.4; }
.container-list { display: grid; gap: 7px; }
.container-row { display: grid; grid-template-columns: 64px 14px minmax(120px, 1fr) 28px; gap: 7px; align-items: center; max-width: 320px; }
.quantity-input { padding: 0 8px; }
.container-row > span { color: var(--muted); text-align: center; }
.remove-row, .add-container { border: 0; background: none; color: var(--muted); font-size: 14px; }
.remove-row { width: 28px; height: 28px; border-radius: 6px; font-size: 18px; line-height: 1; }
.remove-row:hover { background: #f4e9e9; color: #a34343; }
.add-container { margin-top: 8px; padding: 0; color: var(--navy); font-size: 12px; font-weight: 700; }
.add-container:hover { color: var(--teal); }
.quote-footer { margin: 0; padding: 14px 20px 17px; background: #f8fafb; border-radius: 0 0 16px 16px; }
.quote-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.quote-button { min-width: 150px; white-space: nowrap; }

.drawer-backdrop { position: fixed; z-index: 20; inset: 0; opacity: 0; visibility: hidden; background: rgba(9, 31, 48, .38); transition: opacity .22s, visibility .22s; }
.drawer-backdrop.is-open { opacity: 1; visibility: visible; }
.quote-drawer, .email-drawer { position: fixed; z-index: 21; top: 0; right: 0; bottom: 0; width: min(760px, 92vw); padding: 20px; overflow-y: auto; background: #f4f7f9; box-shadow: -18px 0 45px rgba(8, 30, 46, .2); transform: translateX(104%); transition: transform .25s ease; }
.quote-drawer { width: min(1240px, 96vw); }
.quote-drawer.is-open, .email-drawer.is-open { transform: translateX(0); }
.drawer-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.drawer-toolbar p { margin: 0; color: var(--navy); font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.drawer-toolbar button { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--navy); font-size: 22px; line-height: 1; }
.drawer-toolbar button:hover { border-color: var(--navy); background: #edf4f6; }
.drawer-content, .email-drawer-content { display: grid; }
.email-drawer .reply-panel { min-height: calc(100vh - 108px); }

.result-panel { overflow: hidden; }
.result-placeholder { padding: 70px 24px; color: var(--muted); text-align: center; }
.result-placeholder strong { display: block; margin-bottom: 7px; color: var(--ink); font-size: 15px; }
.result-placeholder p { margin: 0; font-size: 12px; line-height: 1.65; }
.result-placeholder.attention { background: #fffaf1; }
.result-placeholder.attention strong { color: var(--amber); }
.quote-workspace { display: grid; grid-template-columns: minmax(300px, .86fr) minmax(420px, 1.14fr); gap: 16px; padding: 0 16px 16px; align-items: start; }
.rate-list { display: grid; gap: 12px; }
.rate-picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 7px; }
.rate-picker-option { display: grid; gap: 3px; min-width: 0; padding: 10px; border: 1px solid #cfdde5; border-radius: 9px; background: #fff; color: var(--ink); text-align: left; }
.rate-picker-option:hover { border-color: var(--teal); background: var(--teal-soft); }
.rate-picker-option.active { border-color: var(--teal); background: var(--teal-soft); box-shadow: inset 0 0 0 1px var(--teal); }
.rate-picker-option span, .rate-picker-option small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.rate-picker-option span b { color: var(--navy); }
.rate-picker-option strong { color: var(--navy); font-size: 15px; }
.rate-card { padding: 16px; border: 1px solid var(--line); border-radius: 11px; }
.rate-head { display: flex; justify-content: space-between; gap: 10px; }
.rate-head p, .scenario-list > p { margin: 0 0 4px; color: var(--teal); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.rate-head h3 { margin: 0; color: var(--ink); font-size: 14px; line-height: 1.35; }
.rate-head > div:last-child { text-align: right; }
.rate-head small { display: block; margin-bottom: 3px; color: var(--muted); font-size: 10px; }
.rate-head strong { color: var(--navy); font-size: 22px; letter-spacing: -.04em; }
.rate-details { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 15px 0 12px; }
.rate-details div { padding: 8px; border-radius: 7px; background: #f5f8fa; }
.rate-details dt { color: var(--muted); font-size: 10px; }
.rate-details dd { margin: 4px 0 0; color: var(--ink); font-size: 12px; font-weight: 750; }
.rate-meta { display: flex; justify-content: space-between; gap: 8px; padding-top: 11px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10.5px; }
.rate-meta b { color: var(--ink); }
.rate-detail-selector { display: grid; gap: 7px; margin: 13px 0 0; padding: 10px; border: 1px solid #c9dde0; border-radius: 8px; }
.rate-detail-selector legend { padding: 0 4px; color: var(--teal); font-size: 10px; font-weight: 800; letter-spacing: .06em; }
.rate-detail-selector label { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.rate-detail-selector .rate-detail-toggle { grid-template-columns: auto minmax(0, 1fr); padding-bottom: 7px; border-bottom: 1px solid var(--line); color: var(--navy); font-weight: 800; }
.rate-detail-selector input { accent-color: var(--teal); }
.rate-detail-selector b { color: var(--ink); font-size: 11px; }
details { margin-top: 11px; padding-top: 10px; border-top: 1px solid var(--line); }
summary { color: var(--navy); cursor: pointer; font-size: 11px; font-weight: 700; }
details ul { display: grid; gap: 5px; padding: 8px 0 0; margin: 0; list-style: none; color: var(--muted); font-size: 11px; }
details li { display: flex; justify-content: space-between; gap: 8px; }
details b { color: var(--ink); }
.scenario-list { display: grid; gap: 6px; margin-top: 13px; }
.scenario-list article { display: flex; justify-content: space-between; gap: 9px; padding: 9px; border-radius: 7px; background: var(--teal-soft); }
.scenario-list strong, .scenario-list span { display: block; }
.scenario-list strong { color: #075e5c; font-size: 11px; }
.scenario-list span { margin-top: 3px; color: #577776; font-size: 10px; line-height: 1.35; }
.scenario-list article > b { align-self: center; color: #075e5c; font-size: 13px; }

.customer-quote-template { min-height: 640px; padding: 24px; border: 1px solid #cfdde5; border-radius: 12px; background: #f8fbfc; color: var(--ink); }
.customer-quote-heading { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 16px; }
.customer-quote-heading p { margin: 0 0 4px; color: var(--teal); font-size: 10px; font-weight: 800; letter-spacing: .09em; }
.customer-quote-heading h2 { margin: 0; color: var(--navy); font-size: 17px; }
.customer-quote-heading button { min-height: 30px; padding: 0 9px; border: 1px solid #b9ced8; border-radius: 7px; background: #fff; color: var(--navy); font-size: 11px; }
.customer-quote-heading button:hover { background: var(--teal-soft); }
.customer-quote-template pre { min-height: 500px; margin: 0; padding: 21px; overflow: visible; border: 1px solid #cfdde5; border-radius: 10px; background: #fff; color: var(--ink); font: 12px/1.75 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; }
.customer-quote-note { margin: 13px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }

.reply-panel { min-height: 570px; padding: 28px 30px; background: #f8fbfc; border-color: #cfdde5; color: var(--ink); }
.reply-heading { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 20px; }
.reply-heading p { margin: 0 0 4px; color: var(--teal); font-size: 10px; font-weight: 800; letter-spacing: .09em; }
.reply-heading h2 { color: var(--navy); font-size: 20px; }
.reply-heading button { min-height: 30px; padding: 0 9px; border: 1px solid #b9ced8; border-radius: 7px; background: #fff; color: var(--navy); font-size: 11px; }
.reply-heading button:hover { background: var(--teal-soft); }
.reply-panel pre { min-height: 420px; margin: 0; padding: 26px 28px; overflow: visible; border: 1px solid #cfdde5; border-radius: 10px; background: #fff; color: var(--ink); font: 13px/1.8 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; }
.manual-email-button { margin-top: 20px; border-color: #9dbdc6; background: #fff; color: var(--navy); }
.manual-email-button:hover { background: var(--teal-soft); }

@media (max-width: 980px) { .workspace { grid-template-columns: 1fr; } .source-column { position: static; } .quote-workspace { grid-template-columns: 1fr; } }
@media (max-width: 680px) { .app-header, .page-shell { width: min(100% - 32px, 1440px); } .app-header { height: 66px; } .service-status { font-size: 0; } .workspace { gap: 16px; } .panel-heading, .source-panel form, .normalized-description-body, .review-list { padding-left: 17px; padding-right: 17px; } .review-row.field-value-row, .parsed-list div { grid-template-columns: 1fr; gap: 6px; } .field-value-row .review-control { align-items: stretch; flex-wrap: wrap; } .field-value-row .destination-combobox, .field-value-row > .review-control > select, .field-value-row .container-list { flex-basis: 100%; } .parsed-fields { grid-column: auto; } .source-footer, .quote-footer, .normalized-description-footer { align-items: stretch; flex-direction: column; } .quote-actions { flex-direction: column; } .source-actions { justify-content: space-between; } .primary-button { min-height: 44px; } .quote-button, .compact-button { width: 100%; } .rate-details { grid-template-columns: 1fr; } .reply-panel { min-height: 0; padding: 20px 17px; } .reply-panel pre, .customer-quote-template pre { min-height: 0; padding: 18px; font-size: 11px; } .customer-quote-template { min-height: 0; padding: 20px 17px; } .quote-drawer { width: 100%; padding: 14px; } }
