.task-progress { margin-top: 14px; }
.funding-choice { display: flex; flex-wrap: wrap; gap: 12px 20px; padding: 0; border: 0; margin: 0 0 16px; }
.funding-choice legend { font-size: 13px; margin-bottom: 10px; font-weight: 600; }
.funding-choice label { display: flex; align-items: center; gap: 7px; font-size: 13px; }
.funding-choice input { width: auto; min-height: auto; margin: 0; accent-color: var(--accent); }
#payment-orders .task-note { overflow-wrap: anywhere; }
.task-progress-label { margin: 0 0 7px; color: var(--accent); font-size: 12px; font-variant-numeric: tabular-nums; }
.task-progress-bar { display: block; width: 100%; height: 6px; border: 0; border-radius: 8px; overflow: hidden; accent-color: var(--accent); background: var(--line); }
.task-progress-bar::-webkit-progress-bar { background: var(--line); border-radius: 8px; }
.task-progress-bar::-webkit-progress-value { background: var(--accent); border-radius: 8px; }
.task-progress-bar::-moz-progress-bar { background: var(--accent); border-radius: 8px; }

:root {
  color-scheme: light;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  line-height: 1.6;
  --page-bg: #f7f9fb;
  --text: #263643;
  --surface-bg: #fff;
  --input-bg: #fff;
  --accent: #167a76;
  --accent-hover: #106b67;
  --accent-text: #fff;
  --muted: #60707b;
  --line: #e0e7eb;
  --input-border: #c8d3db;
  --placeholder: #60707b;
  --focus-ring: #167a7624;
  --focus-outline: #3c8e84;
  --notice-bg: #eff8f5;
  --notice-text: #336a59;
  --warning-bg: #faf3e8;
  --warning-text: #886232;
  --badge-bg: #eaf5f1;
  --badge-text: #37705e;
  --error-text: #b34e46;
  --empty-icon: #6d8790;
  --table-head-bg: #f1f5f7;
  --code-bg: #f5f8f9;
  --card-shadow: #2b465407;
  --backdrop: #223b4c45;
  color: var(--text);
  background: var(--page-bg);
}

/* 两页共用主题；未保存选择时跟随系统，手动选择优先。 */
:root[data-theme="dark"] {
  color-scheme: dark;
  --page-bg: #11191f;
  --text: #e1e9ee;
  --surface-bg: #19252d;
  --input-bg: #131e25;
  --accent: #76d4c3;
  --accent-hover: #a0e5d8;
  --accent-text: #10332e;
  --muted: #a0b0bb;
  --line: #31414d;
  --input-border: #425763;
  --placeholder: #92a5b2;
  --focus-ring: #76d4c329;
  --focus-outline: #76d4c3;
  --notice-bg: #1c3931;
  --notice-text: #a2d9bc;
  --warning-bg: #392f21;
  --warning-text: #efcb8f;
  --badge-bg: #233d34;
  --badge-text: #a2d9bc;
  --error-text: #ffada5;
  --empty-icon: #91b2bc;
  --table-head-bg: #1d2c36;
  --code-bg: #131e25;
  --card-shadow: #00000026;
  --backdrop: #050c14a6;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --page-bg: #11191f;
    --text: #e1e9ee;
    --surface-bg: #19252d;
    --input-bg: #131e25;
    --accent: #76d4c3;
    --accent-hover: #a0e5d8;
    --accent-text: #10332e;
    --muted: #a0b0bb;
    --line: #31414d;
    --input-border: #425763;
    --placeholder: #92a5b2;
    --focus-ring: #76d4c329;
    --focus-outline: #76d4c3;
    --notice-bg: #1c3931;
    --notice-text: #a2d9bc;
    --warning-bg: #392f21;
    --warning-text: #efcb8f;
    --badge-bg: #233d34;
    --badge-text: #a2d9bc;
    --error-text: #ffada5;
    --empty-icon: #91b2bc;
    --table-head-bg: #1d2c36;
    --code-bg: #131e25;
    --card-shadow: #00000026;
    --backdrop: #050c14a6;
  }
}
*{box-sizing:border-box}body{margin:0}button,input,textarea,select{font:inherit}button,input,textarea,select{color:inherit}button,a,input,textarea{ -webkit-tap-highlight-color:transparent}button{cursor:pointer}button:disabled{cursor:wait;opacity:.55}a{color:inherit;text-decoration:none}[hidden]{display:none!important}.site-header{max-width:1120px;margin:auto;min-height:96px;display:flex;align-items:center;justify-content:space-between;padding:20px 32px;gap:18px}.brand{display:flex;align-items:center;gap:10px;font-weight:650;font-size:17px;white-space:nowrap}.brand-mark{display:block;flex-shrink:0;width:32px;height:32px;background:var(--accent);-webkit-mask:url("/assets/logo.svg?v=blue-20260912") center/contain no-repeat;mask:url("/assets/logo.svg?v=blue-20260912") center/contain no-repeat}.account{display:flex;gap:14px;align-items:center;font-size:13px;color:var(--muted)}.text-button{border:0;background:transparent;color:var(--accent);padding:4px 0;font-size:13px;white-space:nowrap}.main-shell{width:min(100% - 40px,640px);margin:36px auto 0}.intro{text-align:center;margin-bottom:32px}.eyebrow{font-size:12px;letter-spacing:3px;color:var(--accent);margin:0 0 12px}.intro h1{font-size:34px;letter-spacing:-1.2px;font-weight:650;margin:0 0 9px}.intro>p:last-child{font-size:14px;color:var(--muted);margin:0}.download-card{padding:30px 32px;background:var(--surface-bg);border:1px solid var(--line);border-radius:18px;box-shadow:0 8px 32px var(--card-shadow)}.field{margin-bottom:20px}label,.payment-heading{font-size:14px;font-weight:550}label{display:block;margin-bottom:8px}input[type=text],input[type=tel],input[type=password],input[type=number],input[type=datetime-local],textarea,select{width:100%;padding:12px 14px;color:var(--text);border:1px solid var(--input-border);border-radius:9px;background:var(--input-bg);outline:none;transition:border-color .15s,box-shadow .15s;min-width:0}textarea{resize:vertical;min-height:110px;line-height:1.8}input::placeholder,textarea::placeholder{color:var(--placeholder);font-weight:400}input:focus,textarea:focus,select:focus{border-color:var(--accent);box-shadow:0 0 0 3px var(--focus-ring)}.field-bottom{display:flex;justify-content:space-between;align-items:center;gap:12px;font-size:12px;color:var(--muted);margin-top:6px}.notice{padding:11px 13px;border-radius:9px;background:var(--notice-bg);color:var(--notice-text);font-size:13px;margin:0 0 18px}.notice.unsupported{background:var(--warning-bg);color:var(--warning-text)}.payment-area{border-top:1px solid var(--line);padding-top:20px}.payment-heading{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px;gap:10px}.payment-heading label{margin:0}.badge{background:var(--badge-bg);color:var(--badge-text);border-radius:5px;padding:2px 7px;font-size:11px}.field-help{font-size:12px;color:var(--muted);margin:7px 0 0}.muted{color:var(--muted);font-size:12px;font-weight:400}.consent{display:flex;align-items:flex-start;gap:8px;color:var(--muted);font-size:12px;font-weight:400;margin:24px 0 18px}.consent input{margin:4px 0 0;accent-color:var(--accent);flex-shrink:0}.primary-button{background:var(--accent);color:var(--accent-text);width:100%;border:0;border-radius:10px;padding:13px 18px;font-size:15px;font-weight:550;display:flex;align-items:center;justify-content:space-between;gap:10px;transition:background .15s}.primary-button:hover{background:var(--accent-hover)}.under-button{margin:10px 0 0;text-align:center;font-size:11px;color:var(--muted)}.error{color:var(--error-text);font-size:13px;margin:8px 0 12px}.tasks-section{margin-top:34px}.section-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:12px}h2{font-size:17px;font-weight:600;margin:0}.empty-state{text-align:center;padding:25px;border:1px dashed var(--input-border);border-radius:12px;color:var(--muted)}.empty-icon{font-size:25px;color:var(--empty-icon);line-height:1}.empty-state p{font-size:13px;margin:5px 0}.empty-state>span:last-child{font-size:11px}details{border-bottom:1px solid var(--line);padding:12px 0}summary{font-size:12px;color:var(--muted);cursor:pointer}details p{font-size:12px;color:var(--muted);padding:0 15px;line-height:1.8}footer{text-align:center;color:var(--muted);font-size:11px;padding:24px 20px 32px;line-height:1.8}.footer-icp{margin-top:6px;font-size:11px;color:var(--muted)}.footer-sep{margin:0 6px;opacity:0.6}.footer-icp a{color:inherit;text-decoration:none;transition:color .15s}.footer-icp a:hover{color:var(--accent);text-decoration:underline}dialog{width:min(100% - 40px,400px);padding:32px;border:1px solid var(--line);border-radius:16px;background:var(--surface-bg);color:var(--text)}dialog::backdrop{background:var(--backdrop);backdrop-filter:blur(3px)}dialog p{font-size:14px;color:var(--muted)}dialog .primary-button{margin-top:24px}.dialog-close{position:absolute;right:18px;top:9px;font-size:25px}button:focus-visible,a:focus-visible,summary:focus-visible{outline:3px solid var(--focus-outline);outline-offset:4px}.admin-shell{width:min(100% - 48px,1040px);margin:32px auto}.admin-title{margin-bottom:25px}.admin-title h1{font-size:28px;font-weight:600;margin:0}.admin-panel{background:var(--surface-bg);border:1px solid var(--line);border-radius:14px;padding:25px;margin:20px 0}.admin-grid{display:grid;grid-template-columns:2fr 1fr 1fr 2fr;gap:16px;align-items:start}.admin-grid label{font-size:12px}.admin-grid input{font-size:13px}.admin-actions{display:flex;align-items:center;gap:20px;flex-wrap:wrap;margin-top:22px}.admin-actions .primary-button{width:auto;min-width:140px;justify-content:center}.table-wrap{overflow-x:auto}table{border-collapse:collapse;width:100%;font-size:12px;white-space:nowrap}th,td{text-align:left;border-bottom:1px solid var(--line);padding:13px 12px;font-weight:400}th{font-size:11px;color:var(--muted);background:var(--table-head-bg)}.admin-login{max-width:390px;margin:90px auto}.admin-login input{margin-bottom:18px}.admin-login h1{font-size:24px;margin:0 0 25px}.codes-table{max-height:320px;margin:12px 0}.redemption-code{font-family:ui-monospace,monospace}.text-button.danger-button{color:var(--error-text)}.grant-controls{display:flex;gap:9px;align-items:center}.grant-controls input{width:78px;padding:5px 8px;font-size:12px}@media(max-width:640px){.site-header{min-height:72px;padding:17px 20px}.brand{font-size:15px}.brand-mark{width:28px;height:28px}.account{gap:8px;font-size:11px}.main-shell{margin-top:26px;width:calc(100% - 32px)}.intro{margin-bottom:24px}.intro h1{font-size:27px;letter-spacing:-.8px}.intro>p:last-child{font-size:12px}.eyebrow{font-size:10px;letter-spacing:2px}.download-card{padding:23px 20px;border-radius:14px}.field-bottom{font-size:10px}.text-button{font-size:12px}.tasks-section{margin-top:28px}.admin-shell{width:calc(100% - 32px);margin-top:20px}.admin-grid{grid-template-columns:1fr 1fr}.admin-grid .wide{grid-column:1/-1}.admin-panel{padding:20px}.admin-login{margin-top:50px}.admin-title h1{font-size:24px}.task-meta{flex-wrap:wrap}}@media(prefers-reduced-motion:reduce){*{transition:none!important}}

.header-actions{display:flex;align-items:center;justify-content:flex-end;gap:18px;flex-wrap:wrap}
.account-avatar{width:30px;height:30px;flex-shrink:0;border-radius:50%;object-fit:cover;background:var(--surface-bg)}
.console-label{font-size:12px;color:var(--muted);font-weight:400}
@media(max-width:640px){.site-header{flex-wrap:wrap;gap:12px}.header-actions{gap:10px;margin-left:auto}.brand{flex-wrap:nowrap;white-space:nowrap}}
@media(max-width:440px){.site-header{align-items:flex-start}.header-actions{justify-content:space-between;flex-basis:100%;margin-left:0}.console-label{font-size:11px}}

.batch-actions{display:flex;align-items:center;gap:14px}
.delete-dialog-actions{display:flex;align-items:center;justify-content:flex-end;gap:24px;margin-top:24px}
.delete-dialog-actions .primary-button{width:auto;margin:0;justify-content:center}
.delete-dialog-actions .delete-confirm{background:var(--error-text);color:var(--surface-bg)}
#delete-message{overflow-wrap:anywhere}
.download-stats{display:grid;grid-template-columns:repeat(5,1fr);gap:12px}.download-stats>div{padding:18px 20px;border:1px solid var(--line);border-radius:12px;background:var(--surface-bg)}.download-stats span{display:block;font-size:12px;color:var(--muted)}.download-stats strong{display:block;font-size:28px;font-weight:600;margin-top:10px}.download-filters{display:flex;gap:16px;align-items:center}.download-filters select{max-width:180px;border:1px solid var(--input-border);border-radius:8px;padding:8px 10px;color:var(--text);background-color:var(--input-bg)}.downloads-table td:first-child{white-space:normal;min-width:230px;max-width:320px;overflow-wrap:anywhere}.download-secondary{margin-top:5px;font-size:11px}.download-row-actions{display:flex;gap:12px;align-items:center;flex-wrap:wrap;min-width:120px}.study-dialog{width:min(1000px,calc(100vw - 32px));max-width:none;max-height:85vh;overflow:auto}.study-meta{display:grid;grid-template-columns:130px 1fr;gap:12px 20px;font-size:13px}.study-meta dt{color:var(--muted)}.study-meta dd{margin:0;overflow-wrap:anywhere}.console-nav{margin-top:16px}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}@media(max-width:640px){.download-stats{grid-template-columns:repeat(2,1fr)}.download-stats>div:last-child{grid-column:1/-1}.download-stats strong{font-size:23px}.download-filters{gap:10px}.study-meta{grid-template-columns:1fr;gap:4px}.study-meta dd{margin-bottom:12px}}

.download-search{display:flex;gap:12px;align-items:center;max-width:620px;margin:16px 0}.download-search input{flex:1;min-width:0}.download-secondary{overflow-wrap:anywhere}#failure-content dd{white-space:pre-wrap}

.node-deployments { display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: 10px; }
.node-deployments label { display: flex; align-items: center; gap: 8px; }
.node-deployments input { width: auto; margin: 0; }
#node-token { width: 100%; font-family: monospace; overflow-wrap: anywhere; }

.field-bottom{justify-content:flex-end}
.task{background:var(--surface-bg);border:1px solid var(--line);padding:18px 20px;border-radius:14px;margin-bottom:14px;box-shadow:0 2px 8px var(--card-shadow);transition:border-color .15s,box-shadow .15s}
.task:hover{border-color:var(--input-border)}
.task-head{display:flex;justify-content:space-between;align-items:flex-start;gap:14px}
.task-heading{min-width:0;flex:1}
.task-title{margin:0;font-size:15px;line-height:1.5;font-weight:600;color:var(--text);overflow-wrap:anywhere}
.task-summary{margin:4px 0 0;font-size:12.5px;line-height:1.6;color:var(--muted);overflow-wrap:anywhere}
.task-status{display:inline-flex;align-items:center;padding:3px 10px;border-radius:999px;font-size:11.5px;font-weight:600;line-height:1.3;white-space:nowrap;background:var(--badge-bg);color:var(--badge-text);flex-shrink:0}
.task-status.ready{background:var(--badge-bg);color:var(--badge-text)}
.task-status.error{background:rgba(239,68,68,0.14);color:var(--error-text)}
.task-meta{display:flex;justify-content:space-between;align-items:center;gap:12px;font-size:12px;color:var(--muted);margin-top:10px;row-gap:4px}
.task-note{font-size:12px;line-height:1.6;color:var(--muted);margin:12px 0 0;padding:9px 13px;background:var(--input-bg);border-radius:8px;border-left:3px solid var(--accent)}
.task-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:14px;padding-top:14px;border-top:1px solid var(--line)}
.task-actions .task-btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;height:34px;padding:0 16px;border-radius:8px;font-size:13px;font-weight:550;cursor:pointer;text-decoration:none;white-space:nowrap;transition:background .15s,border-color .15s,transform .1s,box-shadow .15s;box-sizing:border-box}
.task-actions .task-btn.primary{background:var(--accent);color:var(--accent-text);border:1px solid var(--accent);box-shadow:0 1px 3px rgba(0,0,0,0.08)}
.task-actions .task-btn.primary:hover{background:var(--accent-hover);border-color:var(--accent-hover);transform:translateY(-1px);box-shadow:0 3px 8px rgba(0,0,0,0.12)}
.task-actions .task-btn.primary:active{transform:translateY(0);box-shadow:none}
.task-actions .task-btn.secondary{background:var(--surface-bg);color:var(--text);border:1px solid var(--input-border)}
.task-actions .task-btn.secondary:hover{border-color:var(--accent);color:var(--accent);background:var(--notice-bg);transform:translateY(-1px)}
.task-actions .task-btn.secondary:active{transform:translateY(0)}
.task-expire{font-size:12px;color:var(--muted);margin-left:auto;line-height:1.5;white-space:nowrap}
@media(max-width:580px){.task-actions{gap:8px}.task-actions .task-btn{flex:1 1 auto;text-align:center;padding:0 12px;height:36px}.task-expire{margin-left:0;width:100%;margin-top:4px;text-align:left;font-size:11.5px}}
.verification-options{margin:0 0 22px;padding:14px 0;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}
.verification-options summary{cursor:pointer;font-size:14px;font-weight:500}
.verification-options select{width:100%;margin:12px 0;padding:11px 12px;border:1px solid var(--line);border-radius:8px;background:var(--surface-bg);color:var(--text)}
.verification-options .field{margin:16px 0 0}
#inputs-dialog{width:min(520px,calc(100vw - 32px));max-height:85vh;overflow:auto}
#request-content dd{white-space:pre-wrap;overflow-wrap:anywhere}

#download-button{display:grid;grid-template-columns:24px minmax(0,1fr) 24px;text-align:center}
#submit-label{grid-column:2}
.batch-card{padding:18px 0;border-bottom:1px solid var(--line)}
.batch-card:first-child{padding-top:4px}
.batch-card:last-child{margin-bottom:20px}
.batch-title{font-size:14px;font-weight:600;margin:0 0 6px;overflow-wrap:anywhere}
.batch-card .verification-options{margin:12px 0}
#batch-fields .field:last-child{margin-bottom:0}
#download-button>span[aria-hidden]{grid-column:3}
.share-input-zone{position:relative;border-radius:10px}
.share-input-zone textarea{display:block}
.qr-drop-hint{display:none;position:absolute;inset:0;align-items:center;justify-content:center;border:2px dashed var(--accent);border-radius:10px;background:var(--surface-bg);color:var(--accent);font-size:14px;pointer-events:none}
.share-input-zone.is-dragover .qr-drop-hint{display:flex}
.source-input-actions{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:6px;flex-wrap:wrap}
.source-input-actions .field-help{margin:0;font-size:11px}
.source-input-buttons{display:flex;align-items:center;gap:8px;margin-left:auto}
.source-input-buttons button{min-height:42px;padding:8px 10px;white-space:nowrap}
#upload-qr{border:1px solid var(--line);border-radius:8px;background:var(--surface-bg)}
.contact-label{display:flex;align-items:baseline;justify-content:space-between;gap:12px}
.contact-label .text-button{font-size:11px;min-height:36px}
.qr-choices{display:grid;gap:10px;margin:20px 0}
.qr-choice{width:100%;padding:13px 14px;text-align:left;border:1px solid var(--line);border-radius:9px;background:var(--surface-bg);color:var(--text);overflow-wrap:anywhere}
.qr-choice:hover{border-color:var(--accent);color:var(--accent)}
.qr-cancel{min-height:44px;display:block;margin-left:auto}
@media(max-width:440px){.source-input-actions>.field-help{flex-basis:100%;margin-top:2px}.source-input-buttons{width:100%;gap:10px}.source-input-buttons button{flex:1;min-height:44px;text-align:center}}

/* Header 统一操作区：高度、边框、圆角与视觉节奏对齐 */
.header-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap}



.account{display:flex;gap:8px;align-items:center;font-size:12px;color:var(--muted)}

/* 优化兑换码输入框高度 */
#redemption-code{min-height:68px;padding:10px 12px;font-size:13px;line-height:1.5}

/* 授权声明勾选行与链接 */
.consent-row{display:flex;align-items:center;flex-wrap:wrap;gap:4px 6px;font-size:12px;color:var(--muted);margin:22px 0 16px;line-height:1.6}
.consent-check{display:inline-flex;align-items:center;gap:6px;cursor:pointer;user-select:none;margin:0;font-weight:400;font-size:12px;color:var(--muted)}
.consent-check input[type="checkbox"]{width:15px;height:15px;margin:0;accent-color:var(--accent);cursor:pointer;flex-shrink:0}
.consent-link-button{border:0;background:transparent;color:var(--accent);padding:0 2px;font-size:12px;cursor:pointer;text-decoration:underline;text-underline-offset:3px;display:inline;line-height:inherit}
.consent-link-button:hover{color:var(--accent-hover)}

/* 授权与隐私说明模态框 */
#consent-dialog{position:fixed;inset:0;margin:auto;z-index:1000;width:min(100% - 32px,520px);max-height:85vh;overflow-y:auto;padding:26px 28px 28px;box-shadow:0 16px 48px var(--card-shadow)}
#consent-dialog h2{font-size:17px;font-weight:600;margin:0 0 16px;color:var(--text)}
.consent-dialog-body{display:flex;flex-direction:column;gap:13px;font-size:12px;line-height:1.65;color:var(--text)}
.consent-section h3{font-size:12px;font-weight:600;color:var(--text);margin:0 0 3px}
.consent-section p{margin:0;color:var(--muted);font-size:12px;line-height:1.6}
#consent-dialog .primary-button{margin-top:20px;justify-content:center}

@media(max-width:640px){
  .site-header{min-height:auto;padding:12px 14px;flex-direction:column;align-items:center;gap:10px}
  .brand{font-size:16px}
  .header-actions{width:100%;justify-content:center;gap:6px}
  .consent-row{margin:18px 0 14px}
}
@media(max-width:380px){
  .header-actions{gap:4px}
}

.footer-guide-link { display: inline-block; margin-top: 6px; color: inherit; text-decoration: none; }
.footer-guide-link:hover { text-decoration: underline; }

.guide-home-link{display:flex;align-items:center;justify-content:center;width:fit-content;max-width:100%;margin:-14px auto 24px;padding:4px 8px;border-radius:6px;color:var(--accent);font-size:13px;font-weight:550;transition:background .15s}.guide-home-link:hover{background:var(--notice-bg);color:var(--accent-hover)}.warm-message{text-align:center;color:var(--muted);font-size:12px;line-height:1.8;margin:22px 0 0}



/* Apple-inspired visual refinement: quieter surfaces, generous whitespace and restrained controls. */
:root {
  --page-bg: #f5f5f7;
  --text: #1d1d1f;
  --surface-bg: rgba(255,255,255,.86);
  --input-bg: #fbfbfd;
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --accent-text: #fff;
  --muted: #6e6e73;
  --line: rgba(29,29,31,.12);
  --input-border: rgba(29,29,31,.18);
  --focus-ring: rgba(0,113,227,.22);
  --focus-outline: #0071e3;
  --placeholder: #86868b;
  --notice-bg: rgba(0,113,227,.08);
  --notice-text: #0066cc;
  --warning-bg: rgba(255,149,0,.11);
  --warning-text: #9a5b00;
  --badge-bg: rgba(0,113,227,.1);
  --badge-text: #0066cc;
  --error-text: #c9342f;
  --empty-icon: #86868b;
  --card-shadow: rgba(0,0,0,.08);
  --backdrop: rgba(0,0,0,.34);
}
:root[data-theme="dark"] {
  --page-bg: #161617;
  --text: #f5f5f7;
  --surface-bg: rgba(31,31,33,.9);
  --input-bg: #1c1c1e;
  --accent: #2997ff;
  --accent-hover: #3da4ff;
  --accent-text: #fff;
  --muted: #a1a1a6;
  --line: rgba(255,255,255,.14);
  --input-border: rgba(255,255,255,.22);
  --focus-ring: rgba(41,151,255,.3);
  --focus-outline: #2997ff;
  --placeholder: #8e8e93;
  --notice-bg: rgba(41,151,255,.14);
  --notice-text: #64b5ff;
  --warning-bg: rgba(255,159,10,.16);
  --warning-text: #ffbd5c;
  --badge-bg: rgba(41,151,255,.18);
  --badge-text: #74bdff;
  --error-text: #ff6961;
  --empty-icon: #98989d;
  --card-shadow: rgba(0,0,0,.32);
  --backdrop: rgba(0,0,0,.62);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --page-bg: #161617;
    --text: #f5f5f7;
    --surface-bg: rgba(31,31,33,.9);
    --input-bg: #1c1c1e;
    --accent: #2997ff;
    --accent-hover: #3da4ff;
    --accent-text: #fff;
    --muted: #a1a1a6;
    --line: rgba(255,255,255,.14);
    --input-border: rgba(255,255,255,.22);
    --focus-ring: rgba(41,151,255,.3);
    --focus-outline: #2997ff;
    --placeholder: #8e8e93;
    --notice-bg: rgba(41,151,255,.14);
    --notice-text: #64b5ff;
    --warning-bg: rgba(255,159,10,.16);
    --warning-text: #ffbd5c;
    --badge-bg: rgba(41,151,255,.18);
    --badge-text: #74bdff;
    --error-text: #ff6961;
    --empty-icon: #98989d;
    --card-shadow: rgba(0,0,0,.32);
    --backdrop: rgba(0,0,0,.62);
  }
}
body {
  min-height: 100vh;
  background: var(--page-bg);
  color: var(--text);
  letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased;
}
.site-header { max-width: 1180px; min-height: 72px; padding: 18px 28px; }
.brand { gap: 9px; font-size: 16px; letter-spacing: -.02em; }
.brand-mark { width: 29px; height: 29px; }
.header-actions { gap: 8px; }
.main-shell { width: min(100% - 48px, 960px); margin-top: 72px; }
.intro { margin-bottom: 42px; }
.eyebrow { font-size: 12px; letter-spacing: 2.2px; margin-bottom: 16px; }
.intro h1 { max-width: none; margin: 0 auto 16px; font-size: clamp(36px, 5.5vw, 54px); line-height: 1.08; letter-spacing: -2.6px; font-weight: 650; }
.intro>p:last-child { max-width: 600px; margin: 0 auto; font-size: 16px; line-height: 1.7; }
.guide-home-link { margin: -20px auto 10px; padding: 7px 11px; border-radius: 999px; font-size: 13px; }
.home-guide-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px 16px; max-width: 720px; margin: 0 auto 28px; padding: 0 12px; }
.home-guide-links a { color: var(--muted); font-size: 12px; line-height: 1.55; text-decoration: none; transition: color .15s; }
.home-guide-links a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.download-card { padding: 34px 34px 30px; border: 1px solid var(--line); border-radius: 24px; box-shadow: 0 20px 60px var(--card-shadow); backdrop-filter: blur(18px); }
.download-card, .tasks-section, .warm-message { max-width: 720px; margin-left: auto; margin-right: auto; }
.field { margin-bottom: 24px; }
label, .payment-heading { font-size: 13px; font-weight: 600; }
label { margin-bottom: 9px; }
input[type=text], input[type=tel], input[type=password], input[type=number], input[type=datetime-local], textarea, select { padding: 13px 14px; border-radius: 14px; background: var(--input-bg); }
textarea { min-height: 128px; line-height: 1.7; }
.source-input-actions { margin-top: 9px; }
.source-input-buttons button { min-height: 38px; border-radius: 999px; }
#upload-qr { border-radius: 999px; background: transparent; }
.payment-area { padding-top: 24px; }
.verification-options { padding: 16px 0; }
#redemption-code { min-height: 72px; border-radius: 14px; }
.consent-row { margin: 24px 0 18px; }
.primary-button { min-height: 52px; border-radius: 14px; padding: 14px 18px; font-size: 15px; font-weight: 600; box-shadow: 0 7px 18px rgba(0,113,227,.2); }
.primary-button:hover { transform: translateY(-1px); box-shadow: 0 9px 22px rgba(0,113,227,.26); }
.under-button { margin-top: 12px; font-size: 12px; }
.tasks-section { margin-top: 58px; }
h2 { font-size: 22px; letter-spacing: -.5px; }
.empty-state { padding: 36px 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface-bg); }
.empty-icon { font-size: 27px; }
details { padding: 16px 0; }
summary { font-size: 13px; }
footer { padding-top: 42px; }
@media (max-width: 640px) {
  .site-header { padding: 14px 18px; }
  .main-shell { width: calc(100% - 32px); margin-top: 48px; }
  .intro { margin-bottom: 32px; }
  .intro h1 { font-size: clamp(32px, 10vw, 42px); letter-spacing: -1.8px; }
  .intro>p:last-child { font-size: 14px; }
  .download-card { padding: 24px 20px 22px; border-radius: 20px; }
  .tasks-section { margin-top: 44px; }
  h2 { font-size: 20px; }
}
@media (min-width: 761px) {
  .intro h1 { white-space: nowrap; }
}



/* 轻量的品牌光晕和卡片顶边，提供焦点但不增加装饰噪声。 */
body { background: radial-gradient(ellipse 720px 420px at 50% 12%, rgba(0,113,227,.075), transparent 72%), var(--page-bg); }
:root[data-theme="dark"] body { background: radial-gradient(ellipse 760px 460px at 50% 10%, rgba(41,151,255,.105), transparent 72%), var(--page-bg); }
.intro { position: relative; }
.intro::before { content: ""; position: absolute; z-index: -1; width: 220px; height: 120px; top: -36px; left: 50%; transform: translateX(-50%); border-radius: 50%; background: rgba(41,151,255,.1); filter: blur(40px); pointer-events: none; }
.eyebrow { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border-radius: 999px; background: var(--notice-bg); letter-spacing: .8px; }
.eyebrow::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 15%, transparent); }
.intro h1 { text-wrap: balance; }
.download-card { position: relative; overflow: hidden; }
.download-card::before { content: ""; position: absolute; inset: 0 18% auto; height: 2px; background: linear-gradient(90deg, transparent, var(--accent), transparent); opacity: .5; }
.primary-button { background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 76%, #6cc8ff)); }
.primary-button:hover { background: linear-gradient(135deg, var(--accent-hover), color-mix(in srgb, var(--accent-hover) 76%, #6cc8ff)); }
.section-heading h2 { display: inline-flex; align-items: center; gap: 9px; }
.section-heading h2::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 5px var(--notice-bg); }
.empty-icon { color: var(--accent); }
@media (max-width: 640px) {
  .intro::before { top: -22px; }
}

/* 首页只有这一组响应式头部规则，不影响后台页面的导航布局。 */
.portal-home {
  --portal-gutter: 24px;
  --portal-width: min(720px, calc(100% - var(--portal-gutter) * 2));
  --header-control-gap: 8px;
}
.portal-home .main-shell,
.portal-home .site-header { width: var(--portal-width); max-width: none; margin-inline: auto; }
.portal-home .site-header {
  display: flex;
  flex-flow: row wrap;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 18px 0;
  gap: 12px;
}
.portal-home .brand { flex: 0 1 auto; flex-wrap: nowrap; min-width: 0; }
.portal-home .brand > span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.portal-home .header-actions { display: flex; flex: 0 0 auto; flex-wrap: nowrap; width: auto; margin: 0 0 0 auto; gap: var(--header-control-gap); align-items: center; }
.portal-home .account { flex: 0 0 auto; gap: var(--header-control-gap); }



@media (max-width: 640px) {
  .portal-home { --portal-gutter: 16px; }
  .portal-home .site-header { min-height: 64px; padding: 14px 0; }
  .portal-home .intro h1 { white-space: nowrap; font-size: clamp(22px, 7.2vw, 42px); letter-spacing: -1.4px; }
}

/* 英文标题允许自然换行，避免长单词把整个页面撑出视口。 */
.portal-home:lang(en) .intro h1 { white-space: normal; }

/* 首页头部、主体与页脚使用同一条内容基线，避免首屏上下出现悬空留白。 */
.portal-home .main-shell { margin-top: 40px; }
.portal-home footer { padding-top: 24px; }
@media (max-width: 640px) {
  .portal-home .main-shell { margin-top: 28px; }
}

.portal-home .brand-group { display: flex; align-items: center; flex: 0 0 auto; max-width: 100%; min-width: 0; gap: 12px; }
.portal-home .brand-group .brand { flex: 0 1 auto; min-width: 0; }
@media (max-width: 640px) { .portal-home .brand-group { gap: 8px; } }

.eyebrow-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.eyebrow-wrap .eyebrow {
  margin: 0 !important;
}
.viewer-entry-pill {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent-subtle, rgba(0, 113, 227, 0.08));
  border: 1px solid var(--accent-subtle, rgba(0, 113, 227, 0.25));
  color: var(--accent);
  font-size: 12px;
  font-weight: 550;
  text-decoration: none;
  transition: background .15s, border-color .15s, transform .1s;
}
.viewer-entry-pill:hover {
  background: var(--accent);
  color: #ffffff;
  border-color: transparent;
  transform: translateY(-1px);
}
.viewer-entry-pill:active {
  transform: scale(0.97);
}

/* 多检查自选卡片样式 */
.recognition-progress{margin:12px 0;padding:12px 14px;border:1px solid var(--line);border-radius:10px;background:var(--surface-bg)}
.recognition-progress p{margin:0 0 8px;font-size:13px;color:var(--text)}
.recognition-progress progress{display:block;width:100%;height:12px;accent-color:var(--accent)}
.study-choice-item.is-unavailable{opacity:.72;cursor:not-allowed}
.study-choice-status{font-size:12px;margin-top:5px;color:var(--muted)}
.study-choice-item.is-unavailable .study-choice-status{color:var(--error-text)}
.studies-selection{margin:16px 0 20px;padding:16px;border:1px solid var(--line);border-radius:10px;background:var(--surface-bg)}
.studies-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px;gap:10px;flex-wrap:wrap}
.studies-title{font-size:14px;font-weight:600;margin:0}
.studies-actions{display:flex;gap:8px}
.studies-actions button{font-size:12px;padding:2px 8px;min-height:28px}
.studies-list{display:grid;gap:8px;max-height:300px;overflow-y:auto;padding-right:4px}
.study-choice-item{display:flex;align-items:center;gap:10px;padding:10px 12px;border:1px solid var(--line);border-radius:8px;background:var(--bg);cursor:pointer;transition:border-color .15s}
.study-choice-item:hover{border-color:var(--accent)}
.study-choice-item.is-selected{border-color:var(--accent);background:rgba(0,122,255,0.04)}
.study-choice-item input[type="checkbox"]{margin:0;width:18px;height:18px;cursor:pointer}
.study-choice-info{flex:1;min-width:0;font-size:13px}
.study-choice-title{font-weight:600;color:var(--text);display:flex;align-items:center;gap:6px}
.study-choice-meta{font-size:11px;color:var(--muted);margin-top:2px}
.study-badge{font-size:10px;padding:1px 5px;border-radius:4px;background:var(--accent);color:#fff;font-weight:normal}
.studies-summary{margin-top:12px;font-size:12px;color:var(--muted);text-align:right}
.studies-summary strong{color:var(--accent);font-size:14px}

#captcha-dialog{width:min(520px,calc(100vw - 32px));max-height:85vh;overflow:auto}
.captcha-image-row{display:flex;align-items:center;gap:18px;min-height:68px;margin-top:18px;margin-bottom:10px}
.captcha-image-row img{object-fit:contain;background:#fff;border:1px solid var(--line);border-radius:6px}
#captcha-dialog .field{margin-top:18px;margin-bottom:12px}
#captcha-dialog .primary-button{margin-top:18px}

/* 来源名称与兼容状态分开，混合包按实例显示；说明可用键盘和触屏展开。 */
.dicom-source { margin-block: 10px; font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.dicom-source-labels { display: flex; flex-wrap: wrap; gap: 6px; }
.dicom-source-label { display: inline-block; padding: 3px 9px; border: 1px solid var(--dd-line, #d5d7dc); border-radius: 7px; }
.dicom-source-note { margin: 4px 0; font-weight: 500; }
.dicom-source summary { cursor: pointer; width: fit-content; padding-block: 5px; }
.dicom-source details p { margin: 4px 0; max-width: 65ch; }
.dicom-source summary:focus-visible { outline: 2px solid var(--dd-accent, #007aff); outline-offset: 2px; }

.jobs-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; margin: 16px 0; }
.jobs-toolbar select { width: auto; max-width: 100%; margin: 0; }
#jobs-page { margin-right: auto; color: var(--muted); font-size: 13px; }


/* 业务下拉统一外观，保留原生选项、键盘操作和读屏语义。 */
:root { --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' stroke='%236e6e73' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 4.5L6 8l3.5-3.5'/%3E%3C/svg%3E"); }
:root[data-theme="dark"] { --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' stroke='%23a1a1a6' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 4.5L6 8l3.5-3.5'/%3E%3C/svg%3E"); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) { --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' stroke='%23a1a1a6' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 4.5L6 8l3.5-3.5'/%3E%3C/svg%3E"); }
}
select:not(.locale-ctrl select) {
  appearance: none;
  -webkit-appearance: none;
  min-width: 0;
  max-width: 100%;
  background-image: var(--select-arrow);
  background-repeat: no-repeat;
  background-position: right var(--select-arrow-inset, 14px) center;
  background-size: 12px 12px;
  padding-right: var(--select-padding-end, 38px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
select:not(.locale-ctrl select):focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
select:not(.locale-ctrl select):disabled { cursor: not-allowed; opacity: .55; }
select:not(.locale-ctrl select) option { background: var(--input-bg); color: var(--text); }
@media (forced-colors: active) {
  select:not(.locale-ctrl select) { appearance: auto; -webkit-appearance: auto; background-image: none; }
  select:not(.locale-ctrl select):focus-visible { outline: 2px solid Highlight; outline-offset: 2px; }
}

/* 首页底部提供两个直达入口，长说明集中在指南页面。 */
.portal-home .home-resources { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 28px; margin-top: 24px; }
.portal-home .home-resources a { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 4px; color: var(--accent); font-size: 14px; text-decoration: none; }
.portal-home .home-resources a:hover { text-decoration: underline; text-underline-offset: 4px; }
.portal-home .home-resources a:focus-visible { outline: 2px solid var(--focus-outline); outline-offset: 3px; border-radius: 4px; }
/* 对话框主按钮文字居中，关闭按钮统一收敛为次要色调 */
dialog h2 { margin-right: 32px; }
dialog .primary-button { margin-top: 24px; justify-content: center; }
.dialog-close { position: absolute; right: 16px; top: 14px; width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; padding: 0; font-size: 22px; line-height: 1; color: var(--muted); transition: background .15s, color .15s; }
.dialog-close:hover { background: var(--notice-bg); color: var(--text); }
