:root {
  color-scheme: light;
  /* Same tokens as the @iisticker/transfer-web component (--ii-transfer-*),
     so the phone and code pages look like the cross-device dialog. */
  /* Tokens from iisticker_transfer_web/docs/design-system.md (same values as
     the Transfer front end); the component reads them via --ii-transfer-*. */
  --brand-gradient: linear-gradient(145deg, #a22b83, #4159b8);
  --ink: #101828;
  --muted: #5d6679;
  --line: #d9e0ea;
  --line-soft: #e8ecf3;
  --surface: #fff;
  --canvas: #f6f7fb;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eaf1ff;
  --primary-ring: rgb(37 99 235 / 30%);
  --success: #079455;
  --danger: #d92d20;
  --warning: #b54708;
  --ii-transfer-primary: var(--primary);
  --ii-transfer-text: var(--ink);
  --ii-transfer-text-muted: var(--muted);
  --ii-transfer-border: var(--line);
  --ii-transfer-surface-muted: var(--canvas);
  --ii-transfer-success: var(--success);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--canvas); color: var(--ink); }
button, input { font: inherit; }
.hidden { display: none !important; }
.site-header { height: 72px; padding: 0 max(24px, calc((100vw - 1120px)/2)); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line-soft); background: rgb(255 255 255 / 92%); backdrop-filter: blur(18px); }
.brand { color: inherit; text-decoration: none; display: flex; gap: 13px; align-items: center; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-gradient); border: 1px solid rgb(255 255 255 / 22%); box-shadow: 0 6px 16px rgb(78 67 169 / 18%); }
.brand-mark img { display: block; width: 26px; height: 26px; object-fit: contain; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 17px; letter-spacing: -.01em; }
.brand small { color: var(--muted); font-size: 12px; margin-top: 2px; }
.language-button { border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 10px; padding: 9px 13px; cursor: pointer; }
.language-button:hover { border-color: var(--primary); }
main { min-height: calc(100vh - 136px); padding: clamp(28px,6vw,76px) 20px 36px; }
.transfer-shell { width: min(760px,100%); margin: 0 auto; background: var(--surface); border: 1px solid var(--line-soft); border-radius: 20px; box-shadow: 0 1px 2px rgb(16 24 40 / 4%), 0 16px 40px rgb(16 24 40 / 8%); overflow: hidden; }
.loading-state,.error-state,.success-state { min-height: 480px; padding: 60px 42px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.code-state { min-height: 480px; padding: 60px 42px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 0; }
.code-help { margin: 12px 0 28px; color: var(--muted); line-height: 1.6; max-width: 420px; }
.code-input { width: min(320px,100%); height: 64px; border: 2px solid var(--line); border-radius: 12px; text-align: center; font-size: 30px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: var(--ink); background: #fafcff; outline: none; }
.code-input::placeholder { color: #b4bdca; }
.code-input:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 4px var(--primary-ring); }
.code-input.is-autofill { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-ring); }
.code-error { margin: 12px 0 0; color: var(--danger); font-size: 13px; font-weight: 600; }
.code-state .primary-button { margin-top: 22px; width: min(320px,100%); }
.loading-mark { width: 62px; height: 62px; display: grid; place-items: center; border-radius: 18px; background: var(--brand-gradient); border: 1px solid rgb(255 255 255 / 22%); box-shadow: 0 14px 32px rgb(78 67 169 / 18%); }
.loading-mark img { display: block; width: 48px; height: 48px; object-fit: contain; }
.loading-state p { margin: 22px 0 14px; color: #778197; font-size: 15px; }
.loading-progress { width: min(280px, 80vw); height: 4px; overflow: hidden; background: #e0e4ef; border-radius: 999px; }
.loading-progress::after { display: block; width: 42%; height: 100%; content: ""; background: linear-gradient(90deg, #a22b83, #4159b8); border-radius: inherit; animation: brand-progress 1.15s ease-in-out infinite alternate; }
@keyframes brand-progress { from { transform: translateX(-10%); } to { transform: translateX(150%); } }
.session-heading { padding: 42px 46px 26px; text-align: center; }
.eyebrow { margin: 0 0 11px; font-size: 12px; letter-spacing: .12em; font-weight: 700; color: var(--primary); }
h1 { font-size: clamp(28px,5vw,36px); line-height: 1.2; letter-spacing: -.025em; font-weight: 700; margin: 0; }
.instructions { margin: 12px auto 0; color: var(--muted); line-height: 1.6; max-width: 600px; }
.expiry { margin: 18px auto 0; width: fit-content; display: flex; align-items: center; gap: 8px; border-radius: 999px; padding: 7px 11px; background: var(--canvas); color: var(--muted); font-size: 12px; font-weight: 500; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px rgb(7 148 85 / 12%); }
.drop-zone { margin: 0 32px; min-height: 280px; padding: 40px 24px; border: 2px dashed var(--line); border-radius: 16px; background: #fbfcfe; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; cursor: pointer; transition: border-color .18s, background .18s, transform .18s; outline: none; }
.drop-zone:hover,.drop-zone:focus-visible,.drop-zone.is-dragging { border-color: var(--primary); background: var(--primary-soft); transform: translateY(-1px); }
.upload-glyph { width: 58px; height: 58px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; margin-bottom: 18px; }
.upload-glyph svg { width: 28px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.drop-zone h2 { margin: 0; font-size: 21px; letter-spacing: -.02em; }
.drop-zone p { margin: 8px 0 0; color: var(--muted); }
.browse-link { color: var(--primary-dark); font-weight: 700; }
.file-rules { font-size: 12px; line-height: 1.5; }
.upload-notice { max-width: 520px; margin-top: 14px !important; border-radius: 12px; padding: 9px 12px; color: var(--warning) !important; background: #fffaeb; font-size: 12px; line-height: 1.45; }
.files-section { padding: 28px 32px 0; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.section-heading h2 { margin: 0; font-size: 17px; }
.section-heading span { color: var(--muted); font-size: 13px; }
.file-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.file-item { min-height: 76px; border: 1px solid var(--line-soft); border-radius: 12px; display: grid; grid-template-columns: 48px minmax(0,1fr) auto; gap: 13px; align-items: center; padding: 12px; }
.file-preview { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; background: var(--canvas); }
.file-icon { width: 48px; height: 48px; border-radius: 10px; background: var(--primary-soft); color: var(--primary-dark); display: grid; place-items: center; font-size: 11px; font-weight: 800; }
.file-copy { min-width: 0; }
.file-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-meta { color: var(--muted); font-size: 12px; margin-top: 4px; }
.file-progress { height: 4px; overflow: hidden; border-radius: 99px; background: #e0e4ef; margin-top: 8px; }
.file-progress span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #a22b83, #4159b8); transition: width .18s; }
.file-progress span.is-indeterminate { width: 42% !important; animation: secure-upload-progress 1.15s ease-in-out infinite; }
@keyframes secure-upload-progress { from { transform: translateX(-125%); } to { transform: translateX(250%); } }
.file-remove { border: 0; background: transparent; color: var(--muted); cursor: pointer; width: 40px; height: 40px; border-radius: 9px; }
.file-remove:hover { color: var(--danger); background: #fef3f2; }
.session-footer { padding: 28px 32px 32px; display: flex; align-items: center; gap: 24px; justify-content: space-between; }
.privacy-note { margin: 0; max-width: 420px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.primary-button { border: 0; border-radius: 10px; background: var(--primary); color: #fff; min-height: 48px; padding: 0 20px; display: inline-flex; gap: 8px; align-items: center; justify-content: center; font-weight: 650; cursor: pointer; box-shadow: 0 6px 16px rgb(37 99 235 / 22%); transition: background .18s, transform .18s; white-space: nowrap; }
.primary-button:hover:not(:disabled) { background: var(--primary-dark); transform: translateY(-1px); }
.primary-button:disabled { background: #92b1f5; box-shadow: none; cursor: not-allowed; }
.primary-button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.success-check,.state-icon { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 24px; }
.success-check { color: var(--success); background: #ecfdf3; }
.success-check svg { width: 38px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.error-icon { color: var(--danger); background: #fef3f2; font-size: 30px; font-weight: 800; }
.success-state>p:last-child,.error-state>p:last-child { color: var(--muted); line-height: 1.6; max-width: 480px; }
footer { min-height: 64px; padding: 0 24px; display: flex; gap: 20px; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; }
@media (max-width: 640px) {
  .site-header { height: 60px; padding: 0 16px; }
  .brand small { display: none; }
  main { padding: 18px 12px 24px; min-height: calc(100vh - 126px); }
  .transfer-shell { border-radius: 20px; }
  .session-heading { padding: 32px 22px 22px; }
  .drop-zone { margin: 0 16px; min-height: 250px; padding: 32px 18px; }
  .files-section { padding: 24px 16px 0; }
  .session-footer { padding: 24px 16px 20px; flex-direction: column; align-items: stretch; }
  .primary-button { width: 100%; }
  .privacy-note { text-align: center; max-width: none; }
  .loading-state,.error-state,.success-state,.code-state { min-height: 420px; padding: 42px 24px; }
}
@media (prefers-reduced-motion: reduce) { .loading-progress::after { width: 55%; animation: none; } }
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; } }
.primary-button:focus-visible { outline: 3px solid var(--primary-ring); outline-offset: 3px; }
.name-field { display: grid; gap: 6px; margin: 0 32px 18px; font-size: 13px; font-weight: 600; }
.name-field input { height: 46px; border: 1px solid var(--line); border-radius: 8px; padding: 0 14px; font-size: 15px; font-weight: 500; outline: none; }
.name-field input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.name-field small { color: var(--muted); font-weight: 400; }
.code-full,.code-notice { margin: 0 32px 16px; }
.code-message { white-space: pre-line; }
.file-item.is-failed .file-meta { color: var(--danger); }
.secondary-button { border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); min-height: 40px; padding: 0 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.secondary-button:hover:not(:disabled) { border-color: var(--primary); color: var(--primary-dark); }
.secondary-button:disabled { color: #98a2b3; cursor: wait; }
.password-input { letter-spacing: .08em; text-transform: none; font-size: 22px; }
.password-input::placeholder { font-size: 15px; letter-spacing: 0; }
#pickupFiles .files-section { padding-bottom: 4px; }
@media (max-width: 640px) {
  .name-field,.code-full,.code-notice { margin-left: 16px; margin-right: 16px; }
  #pickupFiles .file-item { grid-template-columns: 40px minmax(0,1fr) auto; min-height: 64px; gap: 12px; }
  #pickupFiles .file-item .secondary-button { grid-column: 1 / -1; width: 100%; }
  .file-icon { width: 40px; height: 40px; }
}

/* Pickup list: a small download button at the end of each row, so names keep their room. */
.icon-button { flex: none; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; color: var(--primary, #2563eb); background: transparent; border: 1px solid var(--line, #e2e8f0); border-radius: 10px; cursor: pointer; }
.icon-button:hover:not(:disabled) { background: rgb(37 99 235 / 8%); }
.icon-button:disabled { opacity: .5; cursor: default; }
.icon-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.expiry.is-paused { color: #667085; background: #f2f4f7; }
.expiry.is-paused .status-dot { background: #98a2b3; box-shadow: none; }

/* Pickup: thumbnails and preview (images, PDFs), phone first */
.file-icon.has-thumb { padding: 0; overflow: hidden; background: #f2f4f7; }
.file-icon.has-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.file-item.is-previewable .file-copy, .file-item.is-previewable .file-icon { cursor: pointer; }
.file-item.is-previewable { grid-template-columns: 48px minmax(0,1fr) auto auto; }
body.preview-open { overflow: hidden; }
.preview-overlay { position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; background: #0f172a; }
.preview-bar { display: flex; align-items: center; gap: 8px; padding: max(10px, env(safe-area-inset-top)) 12px 10px 16px; color: #fff; }
.preview-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.preview-bar .icon-button { color: #fff; border-color: rgb(255 255 255 / 25%); }
.preview-bar .icon-button:hover:not(:disabled) { background: rgb(255 255 255 / 12%); }
.preview-stage { flex: 1; min-height: 0; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; padding: 8px 8px max(8px, env(safe-area-inset-bottom)); }
.preview-stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; }
.preview-stage iframe { width: min(100%, 1000px); height: 100%; border: 0; border-radius: 6px; background: #fff; }
.preview-status { color: rgb(255 255 255 / 85%); text-align: center; padding: 0 24px; }
@media (max-width: 640px) {
  #pickupFiles .file-item.is-previewable { grid-template-columns: 40px minmax(0,1fr) auto auto; }
  .preview-stage { padding: 0; }
  .preview-stage iframe, .preview-stage img { border-radius: 0; }
}
.preview-stage.is-card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; }
.preview-stage.is-card .preview-status { max-width: 420px; margin: 0; }
.preview-stage .preview-open { width: auto; margin: 0; display: inline-flex; align-items: center; justify-content: center; min-width: 160px; text-decoration: none; }
.file-item.is-cancelling { opacity: .5; }
.send-more { margin-top: 20px; }

/* Back to the code form from an ended or finished page (S 2026-10-29). */
.new-code { margin-top: 22px; width: min(320px,100%); text-decoration: none; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; }
.success-state .new-code { margin-top: 12px; min-height: 48px; }
.other-code { display: inline-flex; align-items: center; min-height: 40px; margin-bottom: 4px; font-size: 14px; font-weight: 600; color: var(--primary-dark); text-decoration: none; }
.other-code:hover { text-decoration: underline; }

/* 从我的 Transfer 空间选 under the upload box (S 2026-10-29). */
.from-drive { display: flex; align-items: center; justify-content: center; gap: 10px; width: calc(100% - 64px); min-height: 52px; margin: 12px 32px 0; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.from-drive svg { width: 22px; height: 22px; fill: none; stroke: var(--primary); stroke-width: 2; }
.from-drive:hover { border-color: var(--primary); color: var(--primary-dark); }
.from-drive.hidden { display: none; }
.picked-note { margin: 8px 0 0; color: #15803d; font-weight: 600; }
.upload-notice.is-ok { color: #15803d !important; background: #f0fdf4; }
.session-state > .other-code { margin: 16px 0 0 32px; }
@media (max-width: 640px) {
  .from-drive { width: calc(100% - 32px); margin: 12px 16px 0; }
  .session-state > .other-code { margin-left: 16px; }
}

/* 从我的 Transfer 空间选 over the page (pick-sheet.js): a bottom sheet on phones, a dialog on wider screens. */
.pick-sheet-backdrop { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: flex-end; justify-content: center; background: rgb(16 24 40 / 0%); transition: background .2s ease; }
.pick-sheet-backdrop.is-open { background: rgb(16 24 40 / 45%); }
.pick-sheet { position: relative; display: flex; flex-direction: column; width: 100%; height: 92dvh; overflow: hidden; background: var(--surface); border-radius: 16px 16px 0 0; box-shadow: 0 -8px 32px rgb(16 24 40 / 18%); transform: translateY(100%); transition: transform .25s ease; }
.pick-sheet-backdrop.is-open .pick-sheet { transform: none; }
.pick-sheet-handle { flex: none; width: 40px; height: 4px; margin: 8px auto 0; background: var(--line); border-radius: 2px; }
.pick-sheet-frame { flex: 1; width: 100%; min-height: 0; border: 0; opacity: 0; transition: opacity .15s; }
.pick-sheet.is-ready .pick-sheet-frame { opacity: 1; }
.pick-sheet-wait { position: absolute; top: 50%; left: 50%; width: 28px; height: 28px; margin: -14px; border: 3px solid var(--primary-soft); border-top-color: var(--primary); border-radius: 50%; animation: pick-sheet-spin .8s linear infinite; }
.pick-sheet.is-ready .pick-sheet-wait { display: none; }
.pick-sheet-login { display: grid; gap: 12px; max-width: 360px; margin: auto; padding: 24px; text-align: center; }
.pick-sheet-login h2 { margin: 0; font-size: 20px; }
.pick-sheet-login p { margin: 0; color: var(--muted); }
.pick-sheet-note { color: var(--warning) !important; }
.pick-sheet-offline { position: absolute; right: 16px; bottom: 16px; left: 16px; margin: 0; padding: 10px 12px; color: var(--warning); text-align: center; background: #fffaeb; border-radius: 10px; }
@keyframes pick-sheet-spin { to { transform: rotate(360deg); } }
@media (min-width: 720px) {
  .pick-sheet-backdrop { align-items: center; }
  .pick-sheet { width: min(920px, 94vw); height: min(86vh, 760px); border-radius: 16px; transform: translateY(16px); opacity: 0; transition: transform .2s ease, opacity .2s ease; }
  .pick-sheet-backdrop.is-open .pick-sheet { opacity: 1; }
  .pick-sheet-handle { display: none; }
}
@media (prefers-reduced-motion: reduce) { .pick-sheet, .pick-sheet-backdrop { transition: none; } }
