:root {
    color-scheme: light;
    --ink: #263c32;
    --muted: #647267;
    --green: #426b53;
    --border: #d9dfd1;
    --paper: #fffefa;
    --sage: #edf2e9;
    --gold: #a68142;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 18px;
    color: var(--ink);
    background: #f7f5ee;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body { margin: 0; font-size: 17px; line-height: 1.7; }
button, input, select, textarea { font: inherit; color: inherit; }
button, select, summary { cursor: pointer; }
button { touch-action: manipulation; }
input, select, textarea { width: 100%; min-width: 0; border: 1px solid #a9b5a7; border-radius: 10px; background: var(--paper); padding: 12px 14px; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: #526259; opacity: 1; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, summary:focus-visible, a:focus-visible { outline: 3px solid #d19013; outline-offset: 3px; }
input:disabled, select:disabled, textarea:disabled { background: #eef3ef; color: #35473d; opacity: 1; }
button:disabled { cursor: not-allowed; background: #dce6df; color: #35473d; border-color: #a8b8ac; opacity: 1; }
fieldset { border: 0; margin: 22px 0; padding: 0; min-width: 0; }
legend, .field-label { font-weight: 700; display: block; margin-bottom: 10px; }
p { margin: 8px 0 16px; }
h1, h2, h3 { margin: 0; line-height: 1.35; overflow-wrap: anywhere; }
h1 { font-size: clamp(34px, 4vw, 52px); font-weight: 750; letter-spacing: -.04em; line-height: 1.3; }
h2 { font-size: 22px; font-weight: 750; }
h3 { font-size: 19px; font-weight: 750; }
a { color: var(--green); }
[hidden] { display: none !important; }
.job-feedback { margin: 20px 0; padding: 18px 20px; border: 1px solid #b6c8b9; border-radius: 12px; background: #f0f6ef; color: #263c32; font-size: 16px; line-height: 1.75; overflow-wrap: anywhere; }
.job-feedback p { margin: 8px 0; }
.job-feedback .feedback-done { font-weight: 650; color: #27533a; }
.job-feedback dl { margin: 12px 0; }
.job-feedback dl > div { display: flex; gap: 14px; margin: 8px 0; }
.job-feedback dt { flex: 0 0 3em; color: #405348; }
.job-feedback dd { margin: 0; font-weight: 650; }
.job-feedback .feedback-time { margin-bottom: 0; font-size: 14px; color: #4d6154; }
.job-feedback .feedback-action { border-top: 1px solid #d6d8bb; padding-top: 10px; font-weight: 650; color: #704a20; }
.job-feedback[data-state="attention"] { background: #fff8e9; border-color: #ddc69d; }
.skip-link { position: absolute; top: -100px; left: 20px; padding: 12px; z-index: 100; background: white; }
.skip-link:focus { top: 8px; }
.site-header { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 20px max(24px, calc((100vw - 1320px) / 2)); background: var(--paper); border-bottom: 1px solid var(--border); }
.brand { color: var(--ink); text-decoration: none; font-size: 20px; font-weight: 750; display: flex; align-items: center; gap: 12px; }
.brand small { display: block; font-size: 12px; font-weight: 500; letter-spacing: .16em; color: var(--muted); margin-top: 2px; }
.brand-mark { background: var(--green); color: #fff; border-radius: 15px 15px 15px 4px; display: grid; place-items: center; width: 46px; height: 46px; flex: 0 0 auto; font-family: "Songti SC", serif; font-size: 26px; }
.workspace-nav { display: flex; gap: 28px; }
.workspace-nav a { text-decoration: none; color: var(--muted); font-size: 15px; padding: 10px 0; }
.workspace-nav a:hover { color: var(--green); text-decoration: underline; text-underline-offset: 6px; }
.service-status { font-size: 16px; font-weight: 650; color: var(--muted); border: 1px solid var(--border); background: #f2f6f2; border-radius: 999px; padding: 6px 14px; }
.service-status.connected { color: #125039; border-color: #82b399; background: #edf7ef; }
main { max-width: 1368px; margin: 0 auto; padding: 0 24px; }
.hero { padding: 44px 0 32px; display: grid; grid-template-columns: 1fr minmax(280px, .65fr); gap: 28px 80px; align-items: center; }
.eyebrow { display: block; font-size: 14px; letter-spacing: .15em; color: var(--green); font-weight: 650; margin-bottom: 14px; }
.hero-copy > p { font-size: 17px; margin: 18px 0 0; color: var(--muted); line-height: 1.9; }
.hero-note { border-left: 2px solid #c6b58f; padding: 6px 0 6px 28px; max-width: 360px; }
.note-label { font-size: 13px; color: #80652e; letter-spacing: .14em; }
.hero-note > p { font-family: "Songti SC", "SimSun", serif; font-size: 23px; line-height: 1.65; margin: 12px 0 16px; }
.note-line { display: block; width: 36px; height: 1px; background: #c6b58f; margin-bottom: 16px; }
.hero-note small { display: block; font-size: 14px; color: var(--muted); }
.local-entry { margin-top: 16px; font-size: 14px; }
.local-entry summary { font-size: 14px; font-weight: 600; color: var(--green); }
.local-entry p { font-size: 14px; }
.mobile-break { display: none; }
.flow { grid-column: 1 / -1; list-style: none; padding: 8px; margin: 8px 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: #eeeee4; border: 1px solid #dedfd2; border-radius: 18px; }
.flow li + li { border-left: 1px solid #d9ddce; }
.flow a { display: flex; align-items: center; gap: 13px; padding: 14px 20px; text-decoration: none; color: var(--ink); border-radius: 12px; }
.flow a:hover { background: var(--paper); }
.flow strong { display: block; font-size: 16px; font-weight: 650; }
.flow small { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.flow span { font-size: 23px; color: #7b8c74; font-family: Georgia, serif; }
.step-number { display: grid; place-items: center; background: var(--sage); color: var(--green); border-radius: 10px; width: 34px; height: 34px; flex: 0 0 auto; font-size: 16px; font-weight: 750; }
.workspace { display: grid; grid-template-columns: minmax(340px, .9fr) minmax(0, 1.4fr); grid-template-areas: "import materials" "options results" "provider results"; gap: 24px; align-items: start; }
#importPanel { grid-area: import; }
#materialsPanel { grid-area: materials; }
#optionsPanel { grid-area: options; }
#resultsPanel { grid-area: results; }
.provider-panel { grid-area: provider; }
.panel { background: var(--paper); border: 1px solid var(--border); border-radius: 20px; padding: 28px; box-shadow: 0 4px 20px #39452b04; min-width: 0; }
.invite-panel { margin-bottom: 24px; }
.invite-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.invite-heading a { font-size: 14px; }
.invite-status { font-weight: 650; margin: 14px 0; overflow-wrap: anywhere; }
.invite-form { max-width: 660px; }
.invite-form .field-label { font-size: 16px; }
.invite-input-row { display: flex; align-items: stretch; gap: 12px; }
.invite-input-row input { flex: 1; }
.invite-input-row button { flex: 0 0 auto; }
.invite-details { display: flex; gap: 8px 24px; flex-wrap: wrap; }
.invite-details p { margin: 0; }
.invite-actions { display: flex; gap: 10px 22px; flex-wrap: wrap; }
.invite-actions .text-button { font-size: 15px; margin: 12px 0; }
.invite-panel > .hint { margin: 8px 0 0; }
#inviteFeedback.error { color: #9b3022; }
.section-heading { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 22px; }
.section-heading .step-number { margin-top: 2px; }
.section-heading p { color: var(--muted); font-size: 16px; margin: 8px 0 0; }
.folder-drop { border: 1.5px dashed #afbea5; border-radius: 16px; padding: 26px 20px; background: #f2f5ed; text-align: center; }
.folder-symbol { display: grid; place-items: center; width: 68px; height: 68px; background: #e5ebdc; border-radius: 20px; margin: 0 auto 18px; color: var(--green); }
.folder-symbol svg { width: 40px; height: 40px; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.folder-drop strong { font-size: 20px; display: block; overflow-wrap: anywhere; }
.folder-drop p { color: var(--muted); font-size: 16px; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 52px; padding: 12px 20px; border: 1.5px solid transparent; border-radius: 11px; font-size: 18px; font-weight: 750; line-height: 1.5; white-space: normal; text-align: center; text-decoration: none; }
.button.primary { background: var(--green); color: white; border-color: var(--green); }
.button.primary:hover:not(:disabled) { background: #124f39; }
.button.secondary { background: var(--paper); color: var(--green); border-color: #a9b5a7; }
.button.secondary:hover:not(:disabled) { background: #edf5ef; }
.button:disabled { background: #dce6df; color: #35473d; border-color: #a8b8ac; }
.text-button { display: block; border: 0; background: none; color: #164d35; margin: 14px auto 0; text-decoration: underline; font-size: 18px; font-weight: 650; }
.hint { font-size: 16px; color: var(--muted); line-height: 1.65; overflow-wrap: anywhere; }
.help-details { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 14px; font-size: 16px; }
summary { font-weight: 750; font-size: 18px; }
details p { color: var(--muted); font-size: 16px; margin: 12px 0 0; }
.choice-grid { display: grid; gap: 10px; }
.choice-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choice-list { display: grid; gap: 10px; }
.choice { border: 1px solid #c5cebf; border-radius: 12px; padding: 13px 12px; display: flex; align-items: flex-start; gap: 9px; background: var(--paper); font-size: 17px; line-height: 1.5; }
.choice:has(input:checked) { border-color: var(--green); background: var(--sage); box-shadow: inset 0 0 0 .5px var(--green); }
.choice input { width: 20px; height: 20px; margin: 5px 0 0; padding: 0; flex: 0 0 auto; accent-color: #186348; }
.choice strong { font-size: 18px; }
.choice small { display: block; font-size: 16px; color: #35473d; margin-top: 4px; }
.two-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
#overlayField { margin-top: 16px; }
.start-button { width: 100%; margin-top: 22px; }
.provider-panel p { overflow-wrap: anywhere; }
.provider-row { border-bottom: 1px solid #d2ded5; padding: 12px 0; }
.provider-row strong { display: block; color: var(--ink); font-size: 18px; }
.provider-row span { font-size: 16px; }
.api-settings { padding: 18px; border: 1px solid var(--border); border-radius: 14px; background: #f3f6ef; }
.api-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 14px; }
.api-actions .text-button { margin: 0; font-size: 16px; }
.api-model-info { margin-top: 16px; padding: 14px 16px; border-left: 3px solid var(--green); background: var(--sage); overflow-wrap: anywhere; }
.api-model-info p { margin: 4px 0; font-size: 15px; }
#apiSettingsStatus.error { color: #9b3022; }
.material-list, .result-list { display: grid; gap: 18px; }
.batch-track-field { margin-bottom: 22px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.material-list { max-height: 700px; overflow: auto; padding: 2px; scrollbar-color: #bdc9b2 transparent; }
.reference-label { font-size: 14px; color: var(--green); margin: 10px 0 0; }
.empty-state { padding: 56px 24px; text-align: center; background: #f7f7f0; border-radius: 16px; border: 1px dashed #d0d7c6; }
.empty-icon { display: grid; place-items: center; width: 54px; height: 64px; border: 1px solid #bdc9b2; background: var(--paper); border-radius: 8px; color: #738968; font-size: 26px; margin: 0 auto 20px; transform: rotate(-6deg); box-shadow: 5px 5px 0 #e4e9dc; }
.empty-state strong { display: block; font-size: 19px; font-weight: 650; }
.empty-state p { color: var(--muted); font-size: 16px; margin: 8px auto 0; max-width: 480px; }
.material-card, .result-card { border: 1px solid #d2dacb; border-radius: 16px; padding: 22px; min-width: 0; background: #fff; }
.card-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.card-heading h3 { flex: 1; min-width: 0; }
.card-index { font-size: 18px; color: var(--muted); margin-right: 8px; font-weight: 650; }
.material-card label { margin-top: 12px; }
.material-card textarea { resize: vertical; min-height: 122px; font-size: 18px; }
.file-list { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0; font-size: 16px; }
.file-chip { background: #f2f3ec; color: #52624b; padding: 4px 9px; border-radius: 6px; overflow-wrap: anywhere; max-width: 100%; font-size: 13px; }
.reference-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.reference-list figure { margin: 0; min-width: 0; }
.reference-preview { display: block; width: 100%; border: 1px solid var(--border); padding: 8px; border-radius: 12px; background: #f4f3eb; cursor: zoom-in; }
.reference-preview:hover { border-color: var(--green); }
.reference-list img { display: block; width: 100%; height: 220px; object-fit: contain; }
.reference-list figcaption { font-size: 13px; color: var(--muted); line-height: 1.5; overflow-wrap: anywhere; margin-top: 7px; }
.local-media-options { padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--sage); }
.local-media-options label, .local-media-editor label { font-size: 15px; }
.local-media-editor { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.local-media-editor summary { font-size: 15px; }
.local-media-editor .button { font-size: 15px; min-height: 42px; margin-top: 10px; padding: 8px 12px; }
.local-media-editor .hint { font-size: 14px; }
.crop-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.crop-fields input { padding: 8px; }
.remove-button { background: white; border: 1px solid #b77b70; color: #7d291c; font-size: 16px; border-radius: 8px; padding: 7px 12px; min-height: 40px; }
.status-tag { border: 1px solid #9eb5a4; background: #edf5ef; color: #214a32; font-size: 16px; font-weight: 700; border-radius: 999px; padding: 3px 12px; flex: 0 0 auto; }
.status-tag.error { color: #7f221a; border-color: #bc7669; background: #fff1ed; }
.copy-title { font-size: 22px; margin: 14px 0 12px; font-weight: 800; }
.copy-body { font-size: 18px; line-height: 1.85; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0 0 16px; }
.copy-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.image-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.image-grid figure { margin: 0; min-width: 0; }
.image-preview { display: block; width: 100%; padding: 0; border: 1px solid #a3b7a8; background: #edf3ee; border-radius: 10px; overflow: hidden; }
.image-preview img { display: block; width: 100%; height: auto; max-height: 460px; object-fit: contain; }
.image-grid figcaption { font-size: 16px; color: #35473d; margin-top: 8px; }
.result-error { color: #872719; font-size: 18px; white-space: pre-wrap; overflow-wrap: anywhere; }
.result-source { margin-top: 16px; padding-top: 14px; border-top: 1px solid #bfcec2; }
.result-source p { font-size: 16px; }
.result-source summary { font-size: 18px; }
.notice { background: #fff4db; border: 1.5px solid #bf8b21; color: #5c3c00; border-radius: 12px; padding: 16px 20px; margin-bottom: 24px; font-size: 18px; white-space: pre-wrap; overflow-wrap: anywhere; }
.notice.error { background: #fff1ed; color: #7d291c; border-color: #b86d5a; }
progress { width: 100%; height: 18px; accent-color: #186348; }
#progressArea { margin-bottom: 20px; }
.download-area { border-top: 1px solid #a4bba9; margin-top: 24px; padding-top: 22px; }
.download-area .button { width: 100%; }
.download-area p { font-size: 16px; color: var(--muted); margin: 12px 0 0; }
.history-area { border-bottom: 1px solid #bfcec2; padding-bottom: 18px; margin-bottom: 20px; }
.history-controls { display: flex; gap: 10px; align-items: stretch; }
.history-controls select { flex: 1; min-width: 0; }
.history-controls button { flex: 0 0 auto; }
.local-recovery { border: 1.5px solid #bd8b25; color: #523700; background: #fff8e9; border-radius: 12px; padding: 16px; margin-top: 18px; }
.local-recovery p { font-size: 16px; }
footer { display: flex; justify-content: space-between; gap: 16px; padding: 34px 0; font-size: 16px; color: #35473d; font-weight: 600; }
dialog { border: 1px solid #829e8b; border-radius: 14px; padding: 20px; width: min(800px, calc(100vw - 28px)); max-height: 94vh; overflow: auto; color: var(--ink); }
dialog::backdrop { background: #10271ec4; }
dialog img { display: block; max-width: 100%; max-height: 76vh; object-fit: contain; margin: 18px auto; }
dialog .button { float: right; }
dialog p { clear: both; font-size: 16px; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #183c29; color: white; font-size: 18px; border-radius: 12px; padding: 14px 22px; max-width: calc(100vw - 32px); box-shadow: 0 8px 30px #10271e30; z-index: 200; text-align: center; }
@media (max-width: 1050px) {
    .workspace { grid-template-columns: minmax(320px, .95fr) minmax(0, 1.15fr); gap: 18px; }
    .workspace-nav { gap: 16px; }
    .hero { gap: 24px 36px; }
    .flow a { padding: 12px; gap: 10px; }
    .panel { padding: 20px; }
    .two-fields { grid-template-columns: 1fr; }
    .choice-grid.three { grid-template-columns: 1fr; }
    .image-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
    .workspace { grid-template-columns: 1fr; grid-template-areas: "import" "materials" "options" "results" "provider"; }
    .material-list { max-height: none; overflow: visible; }
    .site-header { padding: 18px 20px; flex-wrap: wrap; gap: 12px; }
    .workspace-nav { order: 3; width: 100%; justify-content: space-between; border-top: 1px solid var(--border); padding-top: 4px; }
    .hero-note { display: none; }
    .hero { grid-template-columns: 1fr; }
    .brand { font-size: 20px; }
    main { padding: 0 20px; }
    .hero { padding-top: 28px; }
    .choice-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .two-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .image-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
    .invite-input-row { flex-direction: column; }
    .site-header { padding: 16px; }
    main { padding: 0 14px; }
    .brand { font-size: 18px; gap: 9px; }
    .brand-mark { width: 42px; height: 42px; }
    .panel { padding: 18px 16px; border-radius: 14px; }
    .mobile-break { display: inline; }
    .hero > p { font-size: 18px; }
    .brand small { font-size: 11px; }
    .service-status { font-size: 12px; padding: 5px 9px; }
    .hero { padding: 24px 0; gap: 18px; }
    .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 6px; }
    .flow li + li { border-left: 0; }
    .flow a { padding: 10px 8px; }
    .flow strong { font-size: 15px; }
    .flow small { font-size: 12px; }
    .flow span { font-size: 20px; }
    .reference-list img { height: 160px; }
    h2 { font-size: 21px; }
    .choice-grid.three, .two-fields, .image-grid { grid-template-columns: 1fr; }
    .choice { font-size: 18px; }
    .material-card, .result-card { padding: 16px 12px; }
    .card-heading { align-items: flex-start; flex-wrap: wrap; }
    .card-heading h3 { flex-basis: 60%; }
    footer { flex-direction: column; gap: 4px; }
    .folder-drop { padding: 20px 14px; }
    .history-controls { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}
