:root {
  --page: #f4f6f2; --surface: #fff; --surface-alt: #edf1eb;
  --ink: #17211c; --muted: #65716a; --faint: #8b958f;
  --line: #d4dcd6; --line-strong: #b8c5bd;
  --brand: #166b50; --brand-strong: #0f553f; --brand-soft: #e4f0e9;
  --coral: #c85f46; --danger: #b83d45; --warning: #93620d; --focus: #276fbf;
  --shadow: 0 18px 48px rgba(24,39,31,.14);
  font-family: Inter,-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei","Segoe UI",sans-serif;
  color: var(--ink); background: var(--page); letter-spacing: 0;
}
[data-theme="ocean"] { --page:#f3f7fa; --surface-alt:#e8f0f5; --ink:#15232b; --muted:#62727c; --faint:#87959d; --line:#d1dce2; --line-strong:#afc0ca; --brand:#176b87; --brand-strong:#0e5269; --brand-soft:#e0eff4; --focus:#1677a3; }
[data-theme="berry"] { --page:#faf5f7; --surface-alt:#f4e9ed; --ink:#281d21; --muted:#75656b; --faint:#9b898f; --line:#e2d4d9; --line-strong:#cdb6be; --brand:#9b3859; --brand-strong:#792540; --brand-soft:#f5e2e9; --focus:#b23b65; }
[data-theme="graphite"] { --page:#f4f5f5; --surface-alt:#e9ecec; --ink:#1c2222; --muted:#667070; --faint:#8b9494; --line:#d4dada; --line-strong:#b8c2c2; --brand:#3f6260; --brand-strong:#294a48; --brand-soft:#e2eceb; --focus:#356f76; }
* { box-sizing: border-box; }
html { min-width: 320px; background: var(--page); }
body { min-height: 100dvh; margin: 0; background: var(--page); color: var(--ink); }
button,textarea,input,select { font: inherit; letter-spacing: 0; }
button,a { -webkit-tap-highlight-color: transparent; }
h1,h2,h3,p { margin: 0; }
[hidden] { display: none !important; }
button:focus-visible,a:focus-visible,textarea:focus-visible,input:focus-visible { outline: 3px solid color-mix(in srgb,var(--focus) 28%,transparent); outline-offset: 2px; }

.app-shell { width: min(1240px,100%); min-height: 100dvh; display: flex; flex-direction: column; margin: 0 auto; padding: 0 30px; }
.topbar { height: 64px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-size: 18px; font-weight: 760; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 7px; background: var(--brand); color: #fff; font-size: 16px; }
.account-button,.mode-button,.text-button,.clear-button,.close-button,.back-button,.theme-button,.theme-swatch { border: 0; background: transparent; color: inherit; cursor: pointer; }
.topbar-actions { position: relative; min-width: 0; display: flex; align-items: center; gap: 5px; }
.account-button { min-height: 38px; max-width: min(68vw,360px); display: flex; align-items: center; gap: 10px; padding: 0 4px; color: var(--brand); font-size: 13px; font-weight: 700; white-space: nowrap; }
.account-button>span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.account-quota { display: inline-flex; align-items: baseline; gap: 4px; padding-left: 10px; border-left: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.account-quota strong { color: var(--ink); font-size: 16px; font-variant-numeric: tabular-nums; }
.account-button:disabled { cursor: wait; opacity: .62; }
.theme-picker { position: relative; }
.theme-button { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; }
.theme-button:hover,.account-button:hover,.close-button:hover,.back-button:hover { background: var(--brand-soft); }
.theme-icon { width: 20px; height: 20px; display: grid; grid-template-columns:repeat(2,1fr); gap:2px; padding:2px; border:1px solid var(--line); border-radius:50%; }
.theme-icon i,.theme-swatch { border-radius:50%; }
.theme-icon i:nth-child(1) { background:#166b50; }.theme-icon i:nth-child(2) { background:#176b87; }.theme-icon i:nth-child(3) { background:#9b3859; }.theme-icon i:nth-child(4) { background:#3f6260; }
.theme-menu { position:absolute; z-index:8; top:43px; right:0; display:flex; gap:8px; padding:9px; border:1px solid var(--line); border-radius:8px; background:var(--surface); box-shadow:0 10px 28px rgba(24,39,31,.14); }
.theme-swatch { width:28px; height:28px; border:3px solid var(--surface); box-shadow:0 0 0 1px var(--line-strong); }
.theme-swatch.is-selected { box-shadow:0 0 0 2px var(--ink); }
.theme-swatch-forest { background:#166b50; }.theme-swatch-ocean { background:#176b87; }.theme-swatch-berry { background:#9b3859; }.theme-swatch-graphite { background:#3f6260; }
.account-button:focus-visible,.close-button:focus-visible,.back-button:focus-visible,.theme-button:focus-visible,.theme-swatch:focus-visible { outline:none; box-shadow:none; background:var(--brand-soft); }

.main-layout { flex: 1; display: grid; grid-template-columns: minmax(0,2fr) minmax(250px,1fr); align-content: start; gap: 34px; padding: 32px 0 46px; }
.workspace { min-width: 0; }
.workspace-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.workspace-heading h1 { font-size: 24px; line-height: 1.3; }
.workspace-heading p { margin-top: 6px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.mobile-history-button { display: none; min-height: 38px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--surface); color: var(--brand); font-weight: 700; cursor: pointer; white-space: nowrap; }
.mode-switch { width: fit-content; display: grid; grid-template-columns: repeat(2,minmax(126px,1fr)); gap: 2px; margin-bottom: 20px; padding: 3px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-alt); }
.mode-button { min-height: 36px; padding: 0 14px; border-radius: 5px; color: var(--muted); font-size: 13px; font-weight: 650; white-space: nowrap; }
.mode-button.is-active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(20,32,26,.12); }
.workspace-panel { min-width: 0; }
.workspace-panel-intro { min-height: 20px; margin: 0 0 10px; overflow: hidden; color: var(--faint); font-size: 12px; line-height: 20px; text-overflow: ellipsis; white-space: nowrap; }

.parse-form label,.works-form label { display: block; margin-bottom: 7px; color: var(--ink); font-size: 13px; font-weight: 680; }
.input-wrap { position: relative; }
.input-wrap textarea { width: 100%; min-height: 138px; resize: vertical; padding: 15px 46px 15px 15px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--surface); color: var(--ink); font-size: 15px; line-height: 1.65; box-shadow: inset 0 1px 2px rgba(23,33,28,.03); }
.input-wrap textarea::placeholder,input::placeholder { color: #929c96; }
.input-wrap textarea:focus,.email-form input:focus,.works-input-row input:focus,.invite-form input:focus { border-color: var(--focus); }
.clear-button,.close-button,.back-button { width: 40px; height: 40px; display: grid; place-items: center; color: var(--muted); font-size: 24px; line-height: 1; }
.clear-button { position: absolute; top: 5px; right: 5px; }
.back-button { font-size: 21px; }
.primary-button,.paste-button,.secondary-action,.share-button,.plan-buy-button { border-radius: 7px; font-weight: 700; cursor: pointer; }
.primary-button { min-height: 44px; border: 1px solid var(--brand); background: var(--brand); color: #fff; }
.primary-button:hover:not(:disabled),.plan-buy-button:hover:not(:disabled) { background: var(--brand-strong); }
.primary-button:disabled,.plan-buy-button:disabled { cursor: not-allowed; opacity: .48; }
.parse-actions { display: grid; grid-template-columns: 86px 86px minmax(0,1fr); gap: 9px; margin-top: 10px; }
.paste-button { min-height: 44px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--brand); }
.paste-button:disabled { cursor:not-allowed; opacity:.42; }

.status-region { min-height: 42px; align-items: center; gap: 9px; margin-top: 12px; padding: 9px 11px; border-left: 3px solid var(--line-strong); background: var(--surface-alt); color: var(--muted); font-size: 13px; }
.status-region:not([hidden]) { display: flex; }
.status-region[data-type="error"] { border-color: var(--danger); background: #faecec; color: var(--danger); }
.status-region[data-type="success"] { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-strong); }
.status-region[data-type="loading"] .status-indicator { animation: pulse 1s ease-in-out infinite; }
.status-indicator { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: currentColor; }
.text-button { margin-left: auto; color: inherit; font-weight: 700; }
.result-region { margin-top: 18px; }
.media-result { overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.media-result video { width: 100%; max-height: 520px; display: block; background: #111714; }
.result-title { padding: 11px 13px; overflow: hidden; color: var(--muted); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.result-platform { padding: 10px 13px 0; color: var(--brand); font-size: 12px; font-weight: 700; }
.result-tabs { display: flex; gap: 4px; padding: 10px 11px 0; overflow-x: auto; }
.result-tab { min-width: 72px; min-height: 36px; padding: 0 13px; border: 1px solid transparent; border-radius: 6px; background: var(--surface-alt); color: var(--muted); font-weight: 700; }
.result-tab[aria-selected="true"] { border-color: var(--line-strong); background: var(--surface); color: var(--brand); }
.result-tab-panel { min-width: 0; }
.result-tab-empty { min-height: 120px; display: grid; place-items: center; margin: 0; padding: 24px; color: var(--muted); }
.result-cover { width: 100%; max-height: 520px; display: block; object-fit: contain; background: var(--surface-alt); }
.result-title-panel { min-height: 120px; padding: 20px; color: var(--ink); line-height: 1.75; white-space: pre-wrap; }
.media-result-toolbar { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; padding: 11px; }
.media-result-toolbar .primary-button,.media-result-toolbar .secondary-action { min-width: 0; min-height: 43px; margin: 0; }
.media-result-toolbar .secondary-action { color: var(--brand); }
.official-full-video { margin: 0 11px 11px; padding-top: 11px; border-top: 1px solid var(--line); }
.official-full-video h3 { margin-bottom: 9px; font-size: 14px; }
.official-full-video video { max-height: 420px; border-radius: 6px; }
.official-full-video .download-button { margin: 9px 0 0; }
.result-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin: 11px; }
.share-button { min-height: 43px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--brand); }
.save-guidance { margin: 0 11px 13px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.download-button { min-height: 43px; display: flex; align-items: center; justify-content: center; margin: 11px; border-radius: 7px; background: var(--brand); color: #fff; font-weight: 700; text-decoration: none; }
.result-actions .download-button { margin: 0; }
.image-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1px; background: var(--line); }
.image-grid figure { position: relative; aspect-ratio: 1; margin: 0; overflow: hidden; background: var(--surface-alt); }
.image-grid img { width: 100%; height: 100%; display: block; object-fit: cover; }
.image-actions { position: absolute; right: 7px; bottom: 7px; left: 7px; display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.image-download,.image-share { min-width: 0; min-height: 33px; display: grid; place-items: center; padding: 0 6px; border: 0; border-radius: 5px; background: rgba(20,29,24,.86); color: #fff; font-size: 12px; text-decoration: none; cursor: pointer; }
.media-video-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; padding: 11px; background: var(--surface-alt); }
.media-single-item { min-width: 0; }
.media-grid-item { min-width: 0; margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.media-grid-item video,.media-grid-item img { width: 100%; aspect-ratio: 9/16; display: block; object-fit: contain; background: #111714; }
.media-grid-item-image img { object-fit: cover; background: var(--surface-alt); }
.media-grid-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; padding: 8px; }
.media-grid-actions .download-button,.media-grid-actions .share-button { min-width: 0; margin: 0; padding: 0 6px; font-size: 12px; text-align: center; white-space: nowrap; }
.media-single-item .media-grid-item { border: 0; }
.media-single-item .media-grid-item video { max-height: 68dvh; aspect-ratio: auto; }
.merge-progress-dialog { width: min(430px,calc(100% - 28px)); }
.merge-progress { display: grid; gap: 16px; }
.merge-progress p { min-height: 24px; color: var(--muted); }
.merge-progress progress { width: 100%; height: 8px; accent-color: var(--brand); }
.merge-progress-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.merge-progress-actions [hidden] + .secondary-action { grid-column: 1 / -1; }
.merge-manual-queue { max-height: 42dvh; overflow: auto; border-top: 1px solid var(--line); }
.merge-manual-queue:not([hidden]) { display: grid; }
.merge-manual-queue a { min-height: 44px; display: flex; align-items: center; padding: 8px 2px; border-bottom: 1px solid var(--line); color: var(--brand); font-weight: 700; text-decoration: none; }

.side-panel { min-height: 300px; padding: 2px 0 0 24px; border-left: 1px solid var(--line); }
.side-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.side-heading h2 { font-size: 15px; }
.side-heading span { color: var(--faint); font-size: 11px; }
.empty-history { padding: 56px 0; color: var(--faint); text-align: center; font-size: 13px; }
.history-list { max-height: 373px; display: grid; gap: 0; padding: 0; margin: 14px 0 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; list-style: none; border-top: 1px solid var(--line); }
.history-item { width: 100%; min-height: 62px; display: grid; align-content:center; gap: 4px; padding: 9px 6px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.history-item:hover { background: rgba(255,255,255,.62); }
.history-title-window { min-width:0; display:block; overflow:hidden; white-space:nowrap; }
.history-title-track { display:inline-block; min-width:0; font-size:13px; white-space:nowrap; will-change:transform; }
.history-title-window.is-overflowing .history-title-track { padding-right:28px; }
.history-item:hover .history-title-window.is-overflowing .history-title-track { animation:historyTitleScroll 4.5s ease-in-out infinite alternate; }
.history-item .history-meta { color: var(--faint); font-size: 10px; font-weight:500; }
.footer { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.footer-links { display: flex; align-items: center; gap: 16px; }
.footer a { color: inherit; }

.dialog-layer { position: fixed; inset: 0; z-index: 20; }
.dialog { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.dialog-backdrop { touch-action: none; }
.payment-success-mark { display: grid; place-items: center; width: 72px; height: 72px; margin: 24px auto; border: 3px solid var(--brand); border-radius: 50%; color: var(--brand); font-size: 36px; animation: paymentConfirmed .35s ease-out; }
@keyframes paymentConfirmed { from { transform: scale(.65); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media(prefers-reduced-motion: reduce) { .payment-success-mark { animation: none; } }
.dialog-backdrop { position: absolute; inset: 0; background: rgba(17,27,22,.5); }
.dialog { position: absolute; top: 50%; left: 50%; width: min(460px,calc(100% - 28px)); max-height: calc(100dvh - 28px); overflow: auto; transform: translate(-50%,-50%); border: 1px solid rgba(255,255,255,.6); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.dialog.account-drawer { top: 0; right: 0; bottom: 0; left: auto; width: min(480px,100%); max-height: none; transform: translateX(0); opacity: 1; border-top: 0; border-right: 0; border-bottom: 0; border-radius: 0; transition: transform .32s cubic-bezier(.22,.78,.24,1), opacity .22s ease-out; }
#accountDialog .dialog-backdrop { opacity: 1; transition: opacity .24s ease-out; }
.dialog-layer.is-closing { pointer-events: none; }
.dialog-layer.is-closing .dialog.account-drawer { transform: translateX(100%); opacity: .92; }
#accountDialog.is-closing .dialog-backdrop { opacity: 0; }
@starting-style {
  #accountDialog:not([hidden]) .dialog.account-drawer { transform: translateX(100%); opacity: .92; }
  #accountDialog:not([hidden]) .dialog-backdrop { opacity: 0; }
}
.account-drawer .dialog-header { position: sticky; top: 0; z-index: 1; background: var(--surface); }
.history-dialog-layer { display: none; }
.history-dialog { max-height: 70dvh; }
.history-dialog-body { padding-top: 12px; }
.history-dialog-note { color: var(--faint); font-size: 12px; }
.history-dialog .history-list { max-height: min(373px,calc(70dvh - 126px)); margin-top: 10px; }
.membership-detail-layer { z-index: 30; }
.product-benefits { margin: 18px 0 10px; }
.dialog-header { min-height: 56px; display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; padding: 7px 9px; border-bottom: 1px solid var(--line); }
.dialog-header h2 { grid-column: 2; font-size: 17px; text-align: center; }
.dialog-header .back-button { grid-column: 1; grid-row: 1; }
.dialog-header .close-button { grid-column: 3; grid-row: 1; }
.dialog-body { padding: 20px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.dialog-body .primary-button { width: 100%; margin-top: 16px; }
.email-form { margin-top: 16px; }
.email-form input { width: 100%; min-height: 46px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--surface); color: var(--ink); }
.account-hint-list { display: grid; gap: 8px; margin-top: 16px; }
.account-hint-button { width: 100%; min-height: 48px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink); font: inherit; font-weight: 700; text-align: left; cursor: pointer; }
.account-hint-button:hover { border-color: var(--brand); background: var(--brand-soft); }
.selected-account-hint { width: 100%; min-height: 46px; margin-top: 12px; padding: 0 13px; border: 1px solid var(--brand); border-radius: 7px; background: var(--brand-soft); color: var(--brand-strong); font-weight: 750; }
.account-hint-other { display: block; margin: 14px auto 0; color: var(--brand); }
.form-error { min-height: 21px; margin-top: 6px; color: var(--danger); font-size: 12px; }
.resend-button { width: 100%; min-height: 36px; margin-top: 7px; color: var(--brand); }
.resend-button:disabled { color: var(--faint); cursor: wait; }
.secondary-action { width: 100%; min-height: 42px; margin-top: 16px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--danger); }
.secondary-action:disabled { cursor: wait; opacity: .52; }
.dialog-loading { padding: 22px 0; text-align: center; }
.account-identity { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; color: var(--ink); }
.account-identity span { color: var(--muted); font-size: 12px; }
.account-identity { flex-wrap: wrap; }
.account-id-copy { padding: 3px 0; border: 0; background: transparent; color: var(--brand); font-size: 12px; cursor: pointer; }
.account-id-copy::after { content: ' ⧉'; }
.quota-list { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 1px; margin: 16px 0 0; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--line); }
.quota-list div { min-width: 0; padding: 9px 4px; background: var(--surface); text-align: center; }
.quota-list dt { color: var(--muted); font-size: 11px; }
.quota-list dd { margin: 2px 0 0; color: var(--ink); font-size: 17px; font-weight: 760; font-variant-numeric: tabular-nums; }
.account-section { padding-top: 15px; margin-top: 15px; border-top: 1px solid var(--line); }
.account-section h3 { margin: 0 0 3px; color: var(--ink); font-size: 14px; }
.account-link-action { min-height: 32px; margin: 6px 0 0; color: var(--brand); }
.invite-form { display: grid; grid-template-columns: minmax(0,1fr) 78px; gap: 7px; margin-top: 9px; }
.invite-form input { min-width: 0; min-height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); }
.invite-form .secondary-action { min-height: 40px; margin: 0; color: var(--brand); }
.plan-list { margin-top: 14px; border-top: 1px solid var(--line); }
.plan-item { min-height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); }
.plan-item>div { min-width: 0; display: flex; align-items: baseline; gap: 8px; }
.plan-item strong { color: var(--ink); font-size: 15px; }
.plan-item span { color: var(--muted); font-size: 12px; }
.plan-buy-button { min-width: 88px; min-height: 36px; border: 1px solid var(--brand); background: var(--brand); color: #fff; }
.account-plan-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; border: 0; }
.account-plan-list .plan-item { position:relative; isolation:isolate; min-width: 0; min-height: 86px; flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 7px; background:var(--surface); text-align: left; cursor: pointer; transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.account-plan-list .plan-item::before { position:absolute; z-index:1; inset:-3px; padding:2px; border-radius:8px; background:conic-gradient(from var(--plan-angle),#f04e52,#f7a928,#e7d629,#36ad68,#269bc8,#7367d7,#d04f9b,#f04e52); content:''; opacity:0; pointer-events:none; -webkit-mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0); -webkit-mask-composite:xor; mask-composite:exclude; }
.account-plan-list .plan-price { color: var(--brand); font-size: 18px; }
.account-plan-list .plan-item:hover { border-color: var(--brand); box-shadow: 0 8px 20px rgba(23,124,91,.12); transform: translateY(-3px); }
.account-plan-list .plan-item:hover::before { opacity:1; animation:planBorderSpin 2.2s linear infinite; }
.account-plan-list .plan-item.is-selected { border-color: var(--brand); animation: planSelectBounce .34s ease-out; }
.invite-tier-list { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0,1fr); gap: 4px; margin: 16px 0 0; padding: 0; list-style: none; }
.invite-tier-list::before { position: absolute; top: 14px; right: 12%; left: 12%; height: 1px; background: var(--line); content: ''; }
.invite-tier-list li { position: relative; min-width: 0; display: grid; justify-items: center; align-content: start; gap: 7px; text-align: center; }
.invite-tier-list li>span { z-index: 1; width: 29px; height: 29px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--muted); font-size: 10px; }
.invite-tier-list li.is-reached>span { border-color: var(--brand); background: var(--brand); color: #fff; }
.invite-tier-list li>div { display: grid; gap: 1px; }
.invite-tier-list strong { color: var(--ink); font-size: 12px; }
.invite-tier-list li>div span { color: var(--muted); font-size: 10px; }
.checkin-heading { position:relative; display: flex; align-items: center; justify-content: space-between; }
.checkin-celebration { position:absolute; z-index:2; top:50%; right:42px; width:12px; height:12px; pointer-events:none; }
.checkin-celebration i { position:absolute; width:6px; height:3px; border-radius:2px; background:var(--brand); animation:checkinSpark .9s cubic-bezier(.2,.8,.2,1) forwards; transform:rotate(calc(var(--spark) * 45deg)) translateX(8px); }
.checkin-celebration i:nth-child(1){--spark:0;background:#ef5b5b}.checkin-celebration i:nth-child(2){--spark:1;background:#f5ae36}.checkin-celebration i:nth-child(3){--spark:2;background:#d7cf35}.checkin-celebration i:nth-child(4){--spark:3;background:#37a96b}.checkin-celebration i:nth-child(5){--spark:4;background:#2f9cc0}.checkin-celebration i:nth-child(6){--spark:5;background:#6f68d5}.checkin-celebration i:nth-child(7){--spark:6;background:#c85ca3}.checkin-celebration i:nth-child(8){--spark:7;background:#ee6b55}
.checkin-heading .account-link-action { margin: 0; padding: 0 12px; border: 1px solid var(--brand); border-radius: 6px; }
.checkin-heading button:disabled { border-color: var(--line); color: var(--faint); background: var(--surface-alt); cursor: default; }
.checkin-month { margin-top: 12px; color: var(--ink); font-size: 12px; }
.checkin-calendar { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 4px; margin-top: 6px; }
.checkin-calendar>span { min-width: 0; height: 30px; display: grid; place-items: center; font-size: 12px; }
.calendar-weekday { color: var(--faint); }
.calendar-day { border: 1px solid transparent; border-radius: 5px; font-variant-numeric: tabular-nums; }
.calendar-day.is-today { border-color: var(--brand); color: var(--brand); }
.calendar-day.is-checked { background: var(--brand-soft); color: var(--brand-strong); font-weight: 750; }
.calendar-day.is-checked::after { content: ''; width: 4px; height: 4px; margin-top: -5px; border-radius: 50%; background: var(--brand); }
.terms-row { display: flex; align-items: flex-start; gap: 9px; margin-top: 15px; color: var(--muted); font-size: 12px; line-height: 1.65; cursor: pointer; }
.terms-row input { width: 17px; height: 17px; flex: 0 0 17px; margin: 1px 0 0; accent-color: var(--brand); }
.terms-row span { min-width: 0; }
.terms-row a { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }
.payment-channel-fieldset { min-width: 0; margin: 18px 0 0; padding: 0; border: 0; }
.payment-channel-fieldset legend { margin-bottom: 8px; color: var(--ink); font-size: 13px; font-weight: 700; }
.payment-channel-list { display: grid; grid-template-columns: minmax(0,1fr); gap: 9px; }
.payment-channel-option { min-width: 0; min-height: 58px; display: flex; align-items: center; gap: 9px; padding: 10px 11px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--surface); color: var(--ink); cursor: pointer; }
.payment-channel-option:hover { border-color: var(--brand); }
.payment-channel-option:focus-within { outline: 2px solid color-mix(in srgb,var(--brand) 32%,transparent); outline-offset: 2px; }
.payment-channel-option.is-selected { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.payment-channel-option:has(input:disabled) { color: var(--faint); cursor: not-allowed; opacity: .62; }
.payment-channel-option input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
.payment-channel-mark { width: 30px; height: 30px; flex: 0 0 30px; display: grid; place-items: center; border-radius: 50%; background: #20a463; color: #fff; font-size: 14px; font-weight: 800; }
.payment-channel-alipay .payment-channel-mark { background: #1677ff; }
.payment-channel-option strong { min-width: 0; overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.payment-channel-option small { margin-left: auto; color: var(--muted); font-size: 12px; }
.payment-channel-option:has(input:disabled) small { color: var(--faint); }
.payment-destination { margin: 14px 0 0; padding-top: 13px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.payment-note { margin-top: 11px; padding: 10px 11px; border-left: 3px solid var(--warning); background: #fff4d7; color: #76500d; font-size: 12px; }
.payment-summary { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; color: var(--ink); }
.payment-summary strong { font-size: 17px; }
.payment-summary span { font-size: 18px; font-weight: 760; }
.payment-qr { width: 244px; height: 244px; display: grid; place-items: center; margin: 16px auto; border: 1px solid var(--line); background: #fff; }
.payment-qr img { width: 220px; height: 220px; display: block; image-rendering: pixelated; }
.payment-qr p { padding: 20px; color: var(--danger); text-align: center; }
.payment-expiry { margin: -7px 0 12px; color: var(--muted); text-align: center; font-size: 12px; }
.payment-status { min-height: 40px; display: flex; align-items: center; justify-content: center; padding: 8px 11px; background: var(--surface-alt); text-align: center; }
.payment-status[data-state="paid"] { background: var(--brand-soft); color: var(--brand-strong); }
.payment-status[data-state="closed"],.payment-status[data-state="expired"] { background: #faecec; color: var(--danger); }

.legal-page { padding: 28px 18px 60px; }
.legal-document { width: min(760px,100%); margin: 0 auto; padding: 30px 34px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.legal-back { color: var(--brand); font-size: 13px; }
.legal-document h1 { margin-top: 22px; font-size: 26px; }
.legal-document h2 { margin-top: 26px; font-size: 17px; }
.legal-document p { margin-top: 8px; color: var(--muted); line-height: 1.8; }
@keyframes pulse { 0%,100% { opacity:.35; transform:scale(.8); } 50% { opacity:1; transform:scale(1); } }
@keyframes planSelectBounce { 0%,100% { transform:translateY(0); } 45% { transform:translateY(-5px); } }
@property --plan-angle { syntax:'<angle>'; initial-value:0deg; inherits:false; }
@keyframes planBorderSpin { to { --plan-angle:360deg; } }
@keyframes historyTitleScroll { to { transform:translateX(calc(-1 * var(--history-shift))); } }
@keyframes checkinSpark { from { opacity:1; transform:rotate(calc(var(--spark) * 45deg)) translateX(4px); } to { opacity:0; transform:rotate(calc(var(--spark) * 45deg)) translateX(34px); } }
@media (max-width:800px) {
  input:not([readonly]),textarea:not([readonly]),select:not([disabled]) { font-size: 16px; }
  .app-shell { padding: 0 16px; }
  .topbar { height: 58px; }
  .account-quota>span { display:none; }
  .main-layout { display: block; padding: 26px 0 36px; }
  .mobile-history-button { display: inline-grid; place-items: center; }
  .mode-switch { width: 100%; }
  .mode-button { min-width: 0; }
  .side-panel { display: none; }
  .empty-history { padding: 32px 0; }
  .footer { align-items: flex-start; flex-direction: column; justify-content: center; padding: 17px 0 calc(17px + env(safe-area-inset-bottom)); }
  .footer-links { flex-wrap: wrap; gap: 10px 16px; }
  .dialog { top: auto; bottom: 0; left: 0; width: 100%; max-height: calc(100dvh - 36px); transform: none; border-right: 0; border-bottom: 0; border-left: 0; border-radius: 8px 8px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .dialog.account-drawer { top: 0; right: 0; bottom: 0; left: auto; max-height: none; border-top: 0; border-radius: 0; }
  .history-dialog-layer:not([hidden]) { display: block; }
}
@media (prefers-reduced-motion:reduce) {
  .dialog.account-drawer,#accountDialog .dialog-backdrop { transition: none; }
  .account-plan-list .plan-item.is-selected { animation: none; }
  .account-plan-list .plan-item { transition: none; }
  .account-plan-list .plan-item:hover { transform: none; }
}
@media (max-width:380px) {
  .app-shell { padding: 0 12px; }
  .account-button { max-width:64vw; gap:6px; }
  .workspace-heading h1 { font-size: 22px; }
  .mode-button { padding-inline: 6px; font-size: 12px; }
  .parse-actions { grid-template-columns: 72px 72px minmax(0,1fr); gap: 6px; }
  .dialog-body { padding: 17px 14px; }
  .quota-list dt { font-size: 10px; }
  .legal-document { padding: 24px 20px; }
}
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { scroll-behavior:auto!important; animation-duration:.01ms!important; animation-iteration-count:1!important; } }
 .download-progress-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
 .download-progress-row > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
 .download-progress-row > span:nth-child(2) { font-variant-numeric: tabular-nums; color: var(--brand); }
 .download-progress-row progress { grid-column: 1 / -1; width: 100%; height: 8px; accent-color: var(--brand); }
 .download-success-toast { position: fixed; z-index: 10000; left: 50%; bottom: 32px; transform: translateX(-50%); max-width: calc(100% - 32px); padding: 14px 20px; border-radius: 8px; background: var(--brand); color: white; box-shadow: 0 8px 28px #0002; animation: download-success-pop .3s ease-out; }
 @keyframes download-success-pop { from { opacity: 0; transform: translate(-50%, 12px) scale(.96); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
 @media (prefers-reduced-motion: reduce) { .download-success-toast { animation: none; } }
