:root {
  color-scheme: light dark;
  --surface-2: #ffffff;
  --surface-1: #f7f7f6;
  --surface-0: #ffffff;
  --text-primary: #252525;
  --text-secondary: #646464;
  --text-muted: #757575;
  --border: #dededb;
  --border-strong: #a6a6a2;
  --border-stronger: #646464;
  --overlay: rgba(0, 0, 0, .35);
  --font-sans: "Noto Sans SC", sans-serif;
  --font-voice: Georgia, serif;
  --font-mono: Consolas, monospace;
  --radius: 8px;
  --pad-sm: 8px;
  --pad-md: 12px;
  --pad-lg: 16px;
  --pad-xl: 20px;
  --gap-xs: 4px;
  --gap-sm: 8px;
  --gap-md: 12px;
  --gap-lg: 16px;
  --gap-xl: 24px;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.7;
  color: var(--text-primary);
  background: transparent;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}
@media (prefers-color-scheme: dark) {
  :root {
    --surface-2: #202020;
    --surface-1: #292929;
    --surface-0: #181818;
    --text-primary: #ededeb;
    --text-secondary: #b4b4af;
    --text-muted: #a3a39e;
    --border: #444441;
    --border-strong: #777772;
    --border-stronger: #b4b4af;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: transparent; color: var(--text-primary); }
button, input, textarea { font: inherit; color: var(--text-primary); }
button, a, input { -webkit-tap-highlight-color: transparent; }
a { color: var(--text-primary); }
button { cursor: pointer; }
[hidden] { display: none !important; }
button:disabled, input:disabled { cursor: not-allowed; }
button, .button-primary { min-height: 36px; padding: 5px 12px; border: .5px solid var(--border); border-radius: var(--radius); background: var(--surface-2); color: var(--text-primary); font-size: 14px; font-weight: 400; line-height: 1.7; }
button:hover, .button-primary:hover { border-color: var(--border-strong); }
button:disabled { color: var(--text-muted); background: var(--surface-1); }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--border-stronger); outline-offset: 3px; }
h1, h2, h3 { margin: 0; font-weight: 500; line-height: 1.7; }
h1 { font-size: 22px; }
h2 { font-size: 18px; }
h3 { font-size: 16px; }
.app-shell { display: block; width: 100%; max-width: 680px; margin: 0 auto; padding: clamp(48px, 18vh, 140px) var(--pad-xl) 40px; }
.flow { display: grid; grid-template-columns: repeat(4, minmax(0, 124px)); justify-content: center; gap: 28px; list-style: none; margin: 0; padding: 0; }
.flow-item { position: relative; min-width: 0; }
.flow-node { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; min-height: 104px; padding: 16px; gap: 10px; border: .5px solid var(--border); border-radius: 12px; background: var(--surface-2); color: var(--text-primary); }
.flow-start { background: var(--text-primary); color: var(--surface-2); border-color: var(--border-strong); }
.flow-start:disabled { background: var(--surface-1); color: var(--text-muted); }
.node-icon { font-size: 22px; line-height: 1; }
.node-label { font-size: 14px; font-weight: 500; }
.node-optional { font-size: 11px; line-height: 1.2; margin-top: -5px; color: var(--text-muted); }
#dedup-feedback { display: flex; align-items: center; gap: 8px; }
.audit-disclosure { margin-top: 16px; font-size: 12px; color: var(--text-secondary); }
.audit-disclosure summary { cursor: pointer; padding: 6px 0; }
.audit-disclosure dl { display: grid; gap: 6px; padding: 12px; margin: 8px 0 0; border: .5px solid var(--border); border-radius: var(--radius); }
.audit-disclosure dl > div { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 8px; }
.audit-disclosure dd { margin: 0; overflow-wrap: anywhere; }
.flow-arrow { position: absolute; inset-inline-end: -23px; top: calc(50% - 9px); color: var(--text-muted); font-size: 18px; line-height: 1; }
.flow-node.is-active, .flow-result:not(:disabled) { border-color: var(--border-stronger); }
.flow-node.is-ready { border-color: var(--border-stronger); }
.flow-node.is-current { border-color: var(--border-stronger); }
.flow-node.is-active .node-icon { display: none; }
.flow-node.is-active .busy-indicator { width: 22px; height: 22px; }
.busy-indicator { display: inline-block; width: 16px; height: 16px; flex: none; border: 1.5px solid var(--border); border-top-color: currentColor; border-radius: 50%; animation: spin .8s linear infinite; }
.button-primary { gap: 8px; }
.stage-loading { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 56px; color: var(--text-secondary); font-size: 13px; }
.is-loading .ti-refresh { animation: spin .8s linear infinite; }
.app-shell > .notice { text-align: center; }
.flow-reminder { display: flex; justify-content: center; margin-top: 24px; }
.flow-reminder .button-quiet { border-color: transparent; color: var(--text-secondary); font-size: 13px; }
.flow-reminder .button-quiet:hover { border-color: var(--border); }
.app-shell > .notice:not(:empty) { margin: 20px auto 0; padding: 0; border: 0; background: transparent; color: var(--text-secondary); font-size: 13px; }
dialog { position: absolute; inset: 0; width: min(560px, calc(100% - 32px)); max-height: calc(100dvh - 32px); margin: auto; padding: 24px; overflow: auto; overscroll-behavior: contain; border: .5px solid var(--border); border-radius: 12px; background: var(--surface-2); color: var(--text-primary); }
dialog::backdrop { background: var(--overlay); }
#task-dialog[open] { display: flex; flex-direction: column; overflow: hidden; }
#template-dialog[open] { display: flex; flex-direction: column; overflow: hidden; }
.template-body { overflow-y: auto; min-height: 0; margin-top: 18px; }
.template-meta { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.template-name { font-size: 14px; font-weight: 500; }
.template-preview { display: grid; width: 100%; overflow: hidden; border: .5px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.template-preview iframe { grid-area: 1 / 1; display: block; width: 100%; height: 340px; border: 0; }
.template-preview[aria-busy="true"] iframe { visibility: hidden; }
.template-loading { grid-area: 1 / 1; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 340px; color: var(--text-secondary); font-size: 13px; }
.template-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.template-links a { min-height: 36px; padding: 5px 12px; border: .5px solid var(--border); border-radius: var(--radius); font-size: 13px; text-decoration: none; }
#template-dialog .dialog-footer { flex: none; padding-top: 14px; margin-top: 14px; border-top: .5px solid var(--border); }
#upload-form { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.dialog-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 2px; margin: 0 -2px; scrollbar-width: thin; }
#task-dialog .dialog-footer { flex: none; margin-top: 14px; padding-top: 14px; border-top: .5px solid var(--border); }
.dialog-heading { display: flex; flex-shrink: 0; align-items: center; justify-content: space-between; gap: var(--gap-md); }
.dialog-heading h2 { display: inline-flex; align-items: center; gap: var(--gap-sm); }
.dialog-actions { display: flex; align-items: center; gap: var(--gap-sm); }
.dialog-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--gap-md); margin-top: var(--gap-lg); }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0; background: transparent; }
.icon-button .ti { font-size: 18px; }
#results-dialog .task-list, #results-dialog .empty-state { margin-top: 16px; }
.count { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; min-height: 22px; padding: 0 6px; background: var(--surface-1); color: var(--text-secondary); border-radius: 6px; font-size: 12px; font-weight: 400; }
.optional { margin-left: var(--gap-xs); font-size: 12px; font-weight: 400; color: var(--text-muted); }
.composer { margin-top: 22px; padding: 14px 16px 8px; border: .5px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.composer:hover { border-color: var(--border-strong); }
.composer:focus-within { border-color: var(--border-stronger); outline: 1.5px solid var(--border-stronger); outline-offset: -1.5px; }
.composer-heading, .composer-toolbar, .attachment-heading, .attachment-summary { display: flex; align-items: center; justify-content: space-between; gap: var(--gap-md); }
.composer-heading label, .attachment-heading label { font-size: 13px; font-weight: 500; }
.composer-heading .optional { margin-left: 0; }
.composer-toolbar { min-height: 36px; margin-top: 4px; }
.clear-button { display: inline-flex; align-items: center; gap: 5px; min-height: 32px; padding: 3px 6px; margin-left: -6px; border-color: transparent; background: transparent; color: var(--text-secondary); font-size: 12px; }
.clear-button:hover:not(:disabled) { border-color: transparent; background: var(--surface-1); }
.clear-button:disabled { border-color: transparent; background: transparent; color: var(--text-muted); }
.character-count { color: var(--text-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.attachment-heading { margin: 22px 0 10px; }
.attachment-summary { flex-wrap: wrap; gap: 2px var(--gap-md); margin-top: 7px; }
.file-input { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.upload-zone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; width: 100%; min-height: 142px; padding: 18px; border: .5px dashed var(--border-strong); border-radius: 12px; background: var(--surface-1); }
.upload-zone:hover:not(:disabled), .upload-zone.dragover { border-color: var(--border-stronger); background: var(--surface-2); }
.upload-zone.dragover { outline: 1.5px solid var(--border-stronger); outline-offset: -1.5px; }
.upload-zone:disabled { cursor: not-allowed; }
.upload-zone:disabled .upload-action, .upload-zone:disabled .upload-mark { color: var(--text-muted); }
.upload-mark { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; margin-bottom: 3px; border: .5px solid var(--border); border-radius: 10px; background: var(--surface-2); color: var(--text-secondary); font-size: 20px; }
.upload-action { color: var(--text-primary); font-size: 14px; font-weight: 500; }
.upload-alternative { color: var(--text-muted); font-size: 12px; }
.field-hint { font-size: 12px; color: var(--text-muted); }
.selected-files { max-height: 204px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.selected-files:not(:empty) { display: grid; gap: var(--gap-sm); margin-top: 12px; }
.selected-file { display: grid; grid-template-columns: 34px minmax(0, 1fr) 32px; align-items: center; gap: var(--gap-md); min-height: 60px; padding: 9px 10px; border: .5px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.file-symbol { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 36px; border-radius: 6px; background: var(--surface-1); color: var(--text-secondary); font-size: 20px; }
.file-meta { min-width: 0; }
.file-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.file-subline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 2px; font-size: 11px; color: var(--text-muted); }
.file-stage { color: var(--text-secondary); }
.remove-file { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; min-height: 32px; padding: 0; border-color: transparent; background: transparent; }
.remove-file:hover { border-color: transparent; background: var(--surface-1); }
.remove-file .ti { font-size: 16px; }
textarea { display: block; width: 100%; min-height: 112px; max-height: 240px; margin-top: 10px; resize: none; padding: 0; overflow-y: auto; border: 0; border-radius: 0; background: transparent; font-size: 16px; font-weight: 400; line-height: 1.7; }
textarea::placeholder { color: var(--text-muted); }
textarea:focus-visible { outline: none; }
.button-primary { display: inline-flex; align-items: center; justify-content: center; gap: var(--gap-sm); font-weight: 500; text-decoration: none; }
.button-primary:not(:disabled) { background: var(--text-primary); color: var(--surface-2); border-color: var(--border-strong); }
.button-primary .ti, .button-quiet .ti { font-size: 16px; }
.upload-progress:not(:empty) { margin-top: var(--gap-md); }
.progress-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-secondary); margin-bottom: var(--gap-xs); }
progress { display: block; width: 100%; height: 4px; border: 0; border-radius: 4px; background: var(--surface-1); accent-color: var(--text-secondary); }
progress::-webkit-progress-bar { background: var(--surface-1); border-radius: 4px; }
progress::-webkit-progress-value { background: var(--text-secondary); border-radius: 4px; }
progress::-moz-progress-bar { background: var(--text-secondary); border-radius: 4px; }
.form-error, .notice { display: block; font-size: 14px; color: var(--text-primary); }
.form-error:not(:empty), .notice:not(:empty) { padding: var(--pad-sm) var(--pad-md); border: .5px solid var(--border-strong); border-radius: var(--radius); background: var(--surface-1); }
.form-error:not(:empty) { margin-top: var(--gap-md); }
.notice:not(:empty) { margin-top: var(--gap-lg); }
.button-quiet { display: inline-flex; justify-content: center; align-items: center; gap: var(--gap-sm); background: transparent; }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--gap-sm); min-height: 112px; padding: var(--pad-lg); border: .5px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.empty-state > .ti { color: var(--text-muted); font-size: 22px; }
.task-list { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; gap: var(--gap-md); }
.task-card { display: block; width: 100%; min-width: 0; padding: var(--pad-lg) var(--pad-xl); border: .5px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.task-header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--gap-md); }
.task-name-wrap { display: flex; gap: var(--gap-md); align-items: flex-start; min-width: 0; }
.task-name-wrap > .ti { font-size: 20px; color: var(--text-secondary); padding-top: 3px; }
.task-name-wrap > div { min-width: 0; }
.task-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-file-info { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.status-badge { display: inline-flex; align-items: center; flex: none; gap: 5px; padding: 3px 7px; border: .5px solid var(--border); border-radius: 6px; color: var(--text-secondary); font-size: 12px; font-weight: 400; line-height: 1.7; }
.status-badge .ti { font-size: 14px; }
.task-times { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--gap-sm) var(--gap-lg); margin: 14px 0 0; }
.task-times dt { color: var(--text-muted); font-size: 12px; }
.task-times dd { margin: 0; color: var(--text-secondary); font-size: 14px; }
.task-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--gap-sm); margin-top: var(--gap-md); }
.waiting-label { color: var(--text-muted); font-size: 12px; }
.notification-state { display: flex; align-items: center; gap: 6px; margin-top: 12px; padding-top: 12px; border-top: .5px solid var(--border); color: var(--text-secondary); font-size: 12px; }
.notification-state .ti { font-size: 14px; }
#wechat-dialog { width: min(360px, calc(100% - 32px)); }
.wechat-binding { display: flex; flex-direction: column; align-items: center; gap: 8px; padding-top: 16px; }
.qr-visual { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 224px; }
.qr-visual > .ti { font-size: 36px; color: var(--text-muted); }
.qr-visual.is-bound { min-height: 128px; }
.qr-visual.is-bound > .ti { color: var(--text-primary); }
.wechat-qr { display: block; width: 208px; height: 208px; max-width: 100%; object-fit: contain; }
#wechat-status { color: var(--text-primary); font-size: 16px; }
#wechat-dialog .dialog-footer { justify-content: center; }
@media (max-width: 540px) {
  .app-shell { padding-top: 48px; }
  .flow { grid-template-columns: minmax(0, 140px); gap: 32px; }
  .flow-node { min-height: 88px; }
  .flow-arrow { inset-inline-end: auto; left: calc(50% - 9px); top: auto; bottom: -25px; transform: rotate(90deg); }
}
@media (max-width: 400px) {
  .app-shell, dialog, .task-card { padding-left: 16px; padding-right: 16px; }
  .task-header { gap: var(--gap-sm); }
  .task-name-wrap { gap: var(--gap-sm); }
  .task-name-wrap > .ti { font-size: 18px; }
  .task-actions { justify-content: flex-start; }
  .composer { padding-left: 12px; padding-right: 12px; }
  .selected-file { grid-template-columns: 28px minmax(0, 1fr) 32px; gap: 8px; padding: 8px; }
  .file-symbol { width: 28px; height: 34px; font-size: 18px; }
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
