:root {
  color-scheme: dark;
  --bg: #1b1b1b;
  --header: #0d0d0d;
  --panel: #202020;
  --panel-soft: #242424;
  --text: #eeeeee;
  --muted: #b7b7b7;
  --line: #454545;
  --blue: #6288ef;
  --blue-hover: #7c9cf3;
  --yellow: #ffc400;
  --danger: #d85d55;
  --shadow: 0 0 0 1px rgba(255,255,255,.08), 0 2px 5px rgba(0,0,0,.2), 0 14px 36px rgba(0,0,0,.18);
  --field: #1d1d1d;
  --field-focus: #222;
  --nav-hover: #171717;
  --control-hover: #292929;
  --control-hover-strong: #333;
  --media-bg: #121212;
  --item-bg: #151515;
  --progress-bg: #181818;
  --input-bg: #191919;
  --toast-bg: #080808;
  --brand-text: #f3f3f3;
  --on-accent: #fff;
  --image-outline: rgba(255,255,255,.1);
  --backdrop: rgba(0,0,0,.58);
  --image-label: rgba(0,0,0,.8);
  --notice-text: #b9c9f8;
  --success-text: #8fdaa9;
  --pending-text: #ffd95c;
  --error-text: #f08b84;
  --status-muted: #aaa;
  --status-bg: #333;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f6f8;
  --header: #fff;
  --panel: #fff;
  --panel-soft: #f0f2f5;
  --text: #1d2430;
  --muted: #626b78;
  --line: #d5dae1;
  --blue: #3569d4;
  --blue-hover: #2457bd;
  --yellow: #9a6700;
  --danger: #bd3f39;
  --shadow: 0 0 0 1px rgba(0,0,0,.06), 0 2px 5px rgba(0,0,0,.06), 0 14px 36px rgba(0,0,0,.07);
  --field: #fff;
  --field-focus: #fff;
  --nav-hover: #f0f2f5;
  --control-hover: #e8ebef;
  --control-hover-strong: #e1e5ea;
  --media-bg: #e9edf2;
  --item-bg: #f0f2f5;
  --progress-bg: #eef1f5;
  --input-bg: #fff;
  --toast-bg: #1d2430;
  --brand-text: #1b2028;
  --on-accent: #fff;
  --image-outline: rgba(0,0,0,.1);
  --backdrop: rgba(17,24,39,.35);
  --image-label: rgba(0,0,0,.76);
  --notice-text: #31569d;
  --success-text: #237344;
  --pending-text: #795d00;
  --error-text: #a8332e;
  --status-muted: #68717e;
  --status-bg: #e6e9ed;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--text); font-family: Arial, "Microsoft YaHei", sans-serif; font-size: 16px; }
body.drawer-open { overflow: hidden; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-hover); }
button, input, select { font: inherit; letter-spacing: 0; }
input, textarea { color: var(--text); }
button, select { cursor: pointer; }
button { color: inherit; }
img { display: block; max-width: 100%; outline: 1px solid var(--image-outline); outline-offset: -1px; }
h1, h2, h3 { margin: 0; letter-spacing: 0; text-wrap: balance; }
p, li { text-wrap: pretty; }
.shell { width: min(1300px, calc(100% - 32px)); margin-inline: auto; }

.site-header { height: 56px; background: var(--header); position: relative; z-index: 20; }
.nav { height: 56px; padding: 0 12px; display: flex; align-items: center; }
.brand { min-height: 44px; margin-right: 18px; display: inline-flex; align-items: center; color: var(--brand-text); }
.brand strong { font-size: 27px; line-height: 1; text-transform: lowercase; }
.brand strong span { color: var(--blue); }
.nav-links { min-width: 0; flex: 1; display: flex; justify-content: space-between; align-items: center; }
.nav-primary, .nav-account { display: flex; align-items: center; gap: 5px; }
.nav-links a, .nav-button { min-height: 44px; padding: 0 11px; display: inline-flex; align-items: center; gap: 7px; border: 0; border-radius: 2px; background: transparent; color: var(--blue); font-size: 16px; transition-property: color, background-color, transform; transition-duration: 150ms; }
.nav-form { margin: 0; }
.nav-links a:hover, .nav-links a[aria-current="page"], .nav-button:hover { color: var(--text); background: var(--nav-hover); }
.nav-links a:active, .nav-button:active, button:active, .primary-button:active, .secondary-button:active, .outline-button:active { transform: scale(.96); }
.library-count { min-width: 20px; height: 20px; padding-inline: 5px; display: inline-grid; place-items: center; border-radius: 10px; background: var(--blue); color: var(--on-accent); font-size: 11px; font-variant-numeric: tabular-nums; }
.icon-button { width: 44px; height: 44px; padding: 0; display: inline-grid; place-items: center; border: 0; border-radius: 2px; background: transparent; transition-property: background-color, transform; transition-duration: 150ms; }
.icon-button:hover { background: var(--control-hover); }
.nav-toggle { display: none; margin-left: auto; }
.nav-toggle span { width: 20px; height: 2px; display: block; margin: 2px; background: var(--text); }

.upload-hero { min-height: 452px; padding: 50px 20px 24px; text-align: center; }
.ad-slot { width: min(970px, calc(100% - 32px)); min-height: 90px; margin: 22px auto; display: grid; place-items: center; position: relative; overflow: hidden; color: var(--muted); text-align: center; }
.ad-slot-upload-top { margin-bottom: 0; }
.ad-slot-upload-bottom, .ad-slot-viewer-bottom { margin-block: 0 38px; }
.ad-slot-viewer-sidebar { width: 100%; min-height: 250px; margin: 28px 0 0; }
.ad-label { position: absolute; top: 3px; right: 4px; z-index: 1; color: var(--muted); font-size: 9px; line-height: 1; text-transform: uppercase; }
.ad-content { width: 100%; min-width: 0; overflow: hidden; }
.ad-content img, .ad-content iframe { max-width: 100%; margin-inline: auto; }
.upload-intro { max-width: 620px; margin: 0 auto 24px; }
.upload-intro h1 { font-size: 35px; font-weight: 700; line-height: 1.25; }
.upload-intro p { margin: 23px auto 0; color: var(--text); font-size: 16px; line-height: 1.55; }
.upload-panel { width: min(400px, 100%); margin: 0 auto; }
.upload-options { display: grid; gap: 15px; }
.upload-options label > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
select, input[type="url"] { width: 100%; height: 39px; padding: 0 38px 0 12px; border: 1px solid var(--line); border-radius: 5px; background: var(--field); color: var(--text); outline: none; transition-property: border-color, box-shadow, background-color; transition-duration: 150ms; }
select:focus, input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(98,136,239,.16); background: var(--field-focus); }
.drop-zone { min-height: 50px; margin: 15px auto 0; padding: 0; display: flex; align-items: center; justify-content: center; outline: none; }
.drop-zone strong { min-width: 210px; min-height: 49px; padding: 0 22px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; border: 1px solid var(--blue); border-radius: 6px; color: var(--blue); font-size: 18px; font-weight: 400; transition-property: color, background-color, transform, box-shadow; transition-duration: 150ms; }
.drop-zone:hover strong, .drop-zone:focus strong, .drop-zone.is-dragging strong { color: var(--text); background: rgba(98,136,239,.12); box-shadow: 0 0 0 3px rgba(98,136,239,.12); }
.upload-hint { margin: 16px -100px 0; color: var(--text); font-size: 15px; }
.upload-terms { margin: 28px -140px 0; color: var(--text); font-size: 15px; }
.upload-terms a { margin-left: 3px; }
.file-queue { margin-top: 15px; display: grid; gap: 1px; overflow: hidden; border-radius: 4px; background: var(--line); text-align: left; }
.queue-item { min-width: 0; padding: 9px; display: grid; grid-template-columns: 44px minmax(0,1fr) 40px; align-items: center; gap: 10px; background: var(--panel); }
.queue-item img { width: 44px; height: 44px; object-fit: cover; border-radius: 2px; }
.queue-item div { min-width: 0; }
.queue-item strong, .queue-item span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-item strong { font-size: 13px; }
.queue-item span { margin-top: 3px; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.queue-item button { width: 40px; height: 40px; border: 0; border-radius: 2px; background: transparent; font-size: 21px; }
.queue-item button:hover { background: var(--control-hover-strong); }
.primary-button, .secondary-button, .danger-button, .outline-button { min-height: 48px; padding: 0 22px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--blue); border-radius: 6px; background: transparent; color: var(--blue); font-weight: 400; transition-property: color, background-color, box-shadow, transform; transition-duration: 150ms; }
.primary-button:hover, .outline-button:hover { color: var(--text); background: rgba(98,136,239,.12); }
.secondary-button { min-height: 42px; border-color: var(--line); color: var(--text); }
.secondary-button:hover { border-color: var(--blue); color: var(--blue); }
.danger-button { border-color: var(--danger); color: var(--danger); }
.upload-submit { width: 100%; margin-top: 14px; }
.remote-field { margin-top: 15px; }
.remote-field > label { display: block; margin-bottom: 8px; text-align: left; }
.remote-field > div { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; }
.remote-field .primary-button { min-height: 39px; }
.upload-progress { height: 50px; margin-top: 14px; position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 4px; background: var(--progress-bg); }
.upload-progress > span { position: absolute; inset: 0 auto 0 0; width: 0; background: rgba(98,136,239,.17); transition: width 180ms ease-out; }
.upload-progress p { position: relative; height: 100%; margin: 0; display: flex; align-items: center; justify-content: center; gap: 7px; font-size: 13px; }
.upload-progress b { font-variant-numeric: tabular-nums; }
.form-error { margin: 14px 0 0; padding: 12px 14px; border: 1px solid rgba(216,93,85,.55); border-radius: 4px; color: var(--error-text); font-size: 13px; }
.stagger-item { opacity: 0; transform: translateY(12px); filter: blur(4px); animation: enter 380ms ease-out forwards; }
.stagger-item:nth-child(2) { animation-delay: 90ms; }
@keyframes enter { to { opacity: 1; transform: translateY(0); filter: blur(0); } }

.pricing-section { padding: 24px 20px 52px; text-align: center; }
.pricing-shell { width: min(1296px, 100%); margin: 0 auto; }
.pricing-section h2 { font-size: 28px; line-height: 1.3; }
.pricing-lead { margin: 24px 0 27px; }
.account-plans { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.plan-card, .price-card { overflow: hidden; border: 1px solid var(--line); border-radius: 5px; background: var(--field); }
.plan-card.premium, .price-card { border-color: var(--blue); }
.plan-card h3, .price-card h3 { min-height: 52px; padding: 11px 14px; border-bottom: 1px solid var(--line); color: #777b89; font-size: 28px; }
.plan-card.premium h3, .price-card h3 { color: var(--blue); }
.plan-card ul { margin: 0; padding: 0; list-style: none; }
.plan-card li { height: 41px; padding: 0 12px; display: grid; place-items: center; border-bottom: 1px solid var(--line); }
.plan-card li:last-child { border-bottom: 0; }
.outline-button { margin-top: 22px; min-width: 178px; font-size: 18px; }
.annual-title { margin-top: 22px; }
.price-plans { margin-top: 32px; display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; align-items: start; }
.price-card { min-height: 180px; }
.price-card h3 { font-size: 27px; }
.price-card strong, .price-card b, .price-card small { display: block; font-variant-numeric: tabular-nums; }
.price-card strong { margin-top: 22px; font-size: 21px; }
.price-card b { margin-top: 8px; color: var(--yellow); font-size: 20px; }
.price-card small { margin-top: 8px; color: var(--muted); }

.admin-header-actions { display: flex; align-items: center; gap: 10px; }
.admin-header-actions form { margin: 0; }
.admin-header-actions .outline-button { margin-top: 0; min-width: 120px; }
.api-token-section { margin-top: 26px; }
.api-token-section .section-title { margin-bottom: 20px; }
.api-token-section .section-title p { margin: 6px 0 0; color: var(--muted); }
.token-reveal { margin-bottom: 20px; padding: 16px; border-radius: 5px; background: var(--panel-soft); box-shadow: var(--shadow); }
.token-reveal > strong { display: block; margin-bottom: 10px; color: var(--pending-text); }
.token-reveal > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.token-reveal input { min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.token-create-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px; }
.token-create-form label { margin: 0; }
.token-list { margin-top: 22px; border-top: 1px solid var(--line); }
.token-list article { min-width: 0; padding: 14px 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.token-list article > div { min-width: 0; display: grid; gap: 5px; }
.token-list code { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.token-list small { color: var(--muted); font-variant-numeric: tabular-nums; }
.compact-button { min-height: 40px; padding-inline: 16px; }
.api-example { margin-top: 20px; }
.api-example summary { min-height: 40px; display: flex; align-items: center; color: var(--blue); cursor: pointer; }
.api-example pre { max-width: 100%; margin: 8px 0 0; padding: 14px; overflow: auto; border-radius: 5px; background: var(--item-bg); color: var(--text); }

.results-section { padding: 54px 0 70px; }
.section-heading { margin-bottom: 22px; display: flex; justify-content: space-between; align-items: end; gap: 20px; }
.eyebrow { display: inline-block; margin-bottom: 8px; color: var(--blue); font-size: 12px; }
.section-heading h2 { font-size: 26px; }
.result-list { display: grid; gap: 12px; }
.result-card { min-width: 0; display: grid; grid-template-columns: 156px minmax(0,1fr); overflow: hidden; border-radius: 5px; background: var(--panel); box-shadow: var(--shadow); }
.result-card > img { width: 156px; height: 100%; min-height: 180px; object-fit: cover; }
.result-content { min-width: 0; padding: 18px; }
.result-top { margin-bottom: 12px; display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.result-top strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.result-top span { flex: none; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.result-actions { display: grid; grid-template-columns: 112px minmax(0,1fr) 66px; gap: 8px; align-items: end; }
.result-actions label { min-width: 0; }
.result-actions label > span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 11px; }
.result-actions select, .result-actions input { min-width: 0; height: 42px; }
.result-actions input { width: 100%; padding: 0 10px; border: 1px solid var(--line); border-radius: 4px; background: var(--input-bg); color: var(--muted); font-size: 12px; }
.result-actions button { height: 42px; border: 1px solid var(--blue); border-radius: 4px; background: transparent; color: var(--blue); font-size: 12px; }

.viewer { padding: 48px 0 80px; display: grid; grid-template-columns: minmax(0,1.5fr) minmax(320px,.65fr); gap: 38px; align-items: start; }
.viewer-stage { min-height: 540px; display: grid; place-items: center; overflow: hidden; border-radius: 5px; background: var(--media-bg); box-shadow: var(--shadow); }
.viewer-stage img { max-height: 75vh; object-fit: contain; }
.viewer-info { position: sticky; top: 28px; }
.viewer-info h1 { font-size: 36px; font-weight: 500; overflow-wrap: anywhere; }
.image-meta { display: flex; gap: 16px; margin: 12px 0 28px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.copy-field { display: block; margin-bottom: 14px; }
.copy-field > span:first-child { display: block; margin-bottom: 7px; color: var(--muted); font-size: 11px; }
.copy-field > span:last-child { display: grid; grid-template-columns: minmax(0,1fr) 60px; }
.copy-field input { min-width: 0; height: 43px; padding: 0 10px; border: 1px solid var(--line); border-right: 0; border-radius: 4px 0 0 4px; background: var(--input-bg); color: var(--muted); font-size: 11px; }
.copy-field button { border: 1px solid var(--blue); border-radius: 0 4px 4px 0; background: transparent; color: var(--blue); font-size: 12px; }
.delete-link, .text-link { min-height: 44px; display: inline-flex; align-items: center; margin-top: 7px; color: var(--danger); font-size: 13px; }
.narrow-section { width: min(680px, calc(100% - 48px)); min-height: 570px; margin: 0 auto; padding: 80px 0; text-align: center; }
.narrow-section h1 { font-size: 44px; }
.narrow-section > p { color: var(--muted); line-height: 1.8; }
.narrow-section .primary-button { margin-top: 15px; }
.delete-page img { width: 250px; height: 190px; margin: 30px auto 22px; object-fit: cover; border-radius: 4px; }
.delete-page form { display: flex; justify-content: center; align-items: center; gap: 20px; }
.prose { text-align: left; }
.prose h2 { margin: 42px 0 10px; font-size: 21px; }
.prose p { margin: 0; }

.library-drawer { position: fixed; inset: 0; z-index: 50; pointer-events: none; visibility: hidden; }
.library-drawer[aria-hidden="false"] { pointer-events: auto; visibility: visible; }
.drawer-backdrop { position: absolute; inset: 0; background: var(--backdrop); opacity: 0; transition: opacity 180ms ease-out; }
.drawer-panel { position: absolute; top: 0; right: 0; width: min(460px, 100%); height: 100%; padding: 24px; overflow-y: auto; background: var(--panel); transform: translateX(100%); transition: transform 220ms cubic-bezier(.2,0,0,1); box-shadow: -8px 0 50px rgba(0,0,0,.35); }
.library-drawer[aria-hidden="false"] .drawer-backdrop { opacity: 1; }
.library-drawer[aria-hidden="false"] .drawer-panel { transform: translateX(0); }
.drawer-panel header { display: flex; justify-content: space-between; align-items: start; }
.drawer-panel h2 { font-size: 30px; }
.library-grid { margin-top: 28px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.library-item { position: relative; overflow: hidden; border-radius: 4px; aspect-ratio: 1.2; background: var(--item-bg); box-shadow: 0 0 0 1px var(--image-outline); }
.library-item img { width: 100%; height: 100%; object-fit: cover; }
.library-item span { position: absolute; inset: auto 7px 7px; padding: 6px 8px; overflow: hidden; border-radius: 3px; background: var(--image-label); color: var(--on-accent); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.library-empty { margin-top: 36px; color: var(--muted); text-align: center; line-height: 1.7; }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 100; max-width: calc(100% - 32px); padding: 11px 16px; border-radius: 4px; background: var(--toast-bg); color: var(--on-accent); box-shadow: var(--shadow); font-size: 13px; opacity: 0; transform: translate(-50%,12px); filter: blur(4px); pointer-events: none; transition-property: opacity, transform, filter; transition-duration: 180ms; }
.toast.is-visible { opacity: 1; transform: translate(-50%,0); filter: blur(0); }

.site-footer { min-height: 210px; padding: 30px 20px 24px; background: var(--header); color: var(--muted); font-size: 14px; text-align: center; }
.footer-inner { width: min(760px,100%); margin: 0 auto; }
.footer-links { margin-bottom: 16px; display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 25px; }
.footer-links a, .footer-controls button { min-height: 40px; display: inline-flex; align-items: center; color: var(--blue); }
.footer-controls { margin: 4px 0 10px; display: flex; justify-content: center; gap: 22px; }
.footer-controls button { padding: 0 6px; border: 0; background: transparent; }
.theme-toggle { width: 40px; height: 40px; position: relative; justify-content: center; border-radius: 4px !important; transition-property: background-color, transform; transition-duration: 150ms; }
.theme-toggle:hover { background: var(--nav-hover); }
.theme-icon { position: absolute; font-size: 21px; line-height: 1; transition-property: opacity, transform, filter; transition-duration: 180ms; transition-timing-function: cubic-bezier(.2,0,0,1); }
.theme-icon-sun, [data-theme="light"] .theme-icon-moon { opacity: 0; transform: scale(.25); filter: blur(4px); }
.theme-icon-moon, [data-theme="light"] .theme-icon-sun { opacity: 1; transform: scale(1); filter: blur(0); }
.language-form, .language-form label { margin: 0; min-height: 40px; display: inline-flex; align-items: center; gap: 7px; }
.language-form select { width: auto; min-width: 128px; height: 40px; padding-block: 0; border-color: transparent; background-color: transparent; color: var(--blue); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.site-footer p { margin: 0; }

.flash { padding: 12px 20px; border-bottom: 1px solid var(--line); text-align: center; }
.site-notice { padding: 10px 20px; border-bottom: 1px solid rgba(98,136,239,.25); background: rgba(98,136,239,.1); color: var(--notice-text); text-align: center; }
.flash-success { background: rgba(56,145,94,.16); color: var(--success-text); }
.flash-error, .inline-error { background: rgba(216,93,85,.12); color: var(--error-text); }
.inline-error { margin-bottom: 18px; padding: 12px 14px; border: 1px solid rgba(216,93,85,.42); border-radius: 4px; }
.auth-page { min-height: 650px; padding: 70px 16px; display: grid; place-items: start center; }
.auth-card { width: min(430px,100%); padding: 30px; border-radius: 6px; background: var(--panel); box-shadow: var(--shadow); }
.auth-card h1 { margin-bottom: 12px; font-size: 31px; }
.auth-card > p { color: var(--muted); line-height: 1.6; }
.auth-card > p:last-child { margin: 22px 0 0; text-align: center; }
.auth-card label, .settings-card label, .membership-plans label { display: grid; gap: 7px; margin-top: 16px; color: var(--muted); font-size: 13px; }
.auth-card input, .settings-card input, .settings-card textarea, .table-card input, .membership-plans select { width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 4px; background: var(--input-bg); outline: none; }
.settings-card textarea { resize: vertical; }
.auth-card input:focus, .settings-card input:focus, .settings-card textarea:focus, .table-card input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(98,136,239,.14); }
.auth-card .primary-button { width: 100%; margin-top: 22px; }
.page-heading { padding: 44px 0 28px; display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.page-heading h1 { font-size: 34px; }
.page-heading p { margin: 10px 0 0; color: var(--muted); }
.account-page, .billing-page, .admin-page { min-height: 700px; padding-bottom: 70px; }
.account-stats, .admin-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.account-stats { grid-template-columns: repeat(4,1fr); }
.admin-stats { grid-template-columns: repeat(4,1fr); }
.account-stats article, .admin-stats article { min-height: 120px; padding: 20px; border-radius: 5px; background: var(--panel); box-shadow: var(--shadow); }
.account-stats span, .admin-stats span, .admin-stats small { display: block; color: var(--muted); }
.account-stats strong, .admin-stats strong { display: block; margin-top: 14px; font-size: 27px; font-variant-numeric: tabular-nums; }
.admin-stats small { margin-top: 8px; }
.account-columns, .dashboard-grid, .settings-grid { margin-top: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.settings-grid { align-items: start; }
.settings-card { padding: 22px; border-radius: 5px; background: var(--panel); box-shadow: var(--shadow); }
.settings-card h2 { margin-bottom: 12px; font-size: 21px; }
.settings-card h3 { margin: 25px 0 4px; color: var(--blue); }
.settings-card > p { color: var(--muted); line-height: 1.6; }
.settings-card .field-hint { margin: 12px 0 0; font-size: 12px; }
.settings-card .secondary-button, .settings-card .primary-button { margin-top: 20px; }
.wide-card { width: min(900px,100%); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.check-row { min-height: 44px; display: flex !important; grid-template-columns: none !important; flex-direction: row; align-items: center; gap: 10px !important; }
.check-row input { width: 18px; min-height: 18px; height: 18px; }
.user-gallery, .table-card { margin-top: 28px; padding: 22px; border-radius: 5px; background: var(--panel); box-shadow: var(--shadow); }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.image-grid { margin-top: 18px; display: grid; grid-template-columns: repeat(5,1fr); gap: 10px; }
.image-grid a { min-width: 0; overflow: hidden; border-radius: 4px; background: var(--item-bg); }
.image-grid img { width: 100%; aspect-ratio: 1.2; object-fit: cover; }
.image-grid span { padding: 8px; display: block; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.empty-state { padding: 34px 0; color: var(--muted); text-align: center; }
.membership-plans { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.membership-plans article { padding: 22px; border: 1px solid var(--blue); border-radius: 5px; background: var(--panel); }
.membership-plans article > strong { display: block; margin: 16px 0; color: var(--blue); font-size: 25px; font-variant-numeric: tabular-nums; }
.membership-plans article > p { min-height: 44px; color: var(--muted); }
.membership-plans .primary-button { width: 100%; margin-top: 14px; }
.table-scroll { margin-top: 16px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; white-space: nowrap; }
th { color: var(--muted); font-size: 12px; font-weight: 400; }
td { font-size: 13px; }
td small { margin-top: 4px; display: block; color: var(--muted); }
.table-card select, .table-card input { min-width: 118px; height: 40px; }
.table-button { min-width: 56px; height: 40px; border: 1px solid var(--blue); border-radius: 4px; background: transparent; color: var(--blue); }
.status { padding: 5px 8px; border-radius: 3px; background: var(--status-bg); font-size: 11px; }
.status-paid { background: rgba(56,145,94,.2); color: var(--success-text); }
.status-pending { background: rgba(255,196,0,.13); color: var(--pending-text); }
.status-cancelled, .status-refunded { color: var(--status-muted); }
.admin-tabs { margin-bottom: 22px; display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.admin-tabs a { min-height: 44px; padding: 0 13px; display: inline-flex; align-items: center; white-space: nowrap; border-bottom: 2px solid transparent; }
.admin-tabs a[aria-current="page"] { border-bottom-color: var(--blue); color: var(--text); }
.detail-list { margin: 0; }
.detail-list div { min-height: 42px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; font-variant-numeric: tabular-nums; }

@media (max-width: 820px) {
  .site-header, .nav { height: 56px; }
  .nav-toggle { display: inline-grid; }
  .nav-links { position: absolute; top: 56px; left: 0; right: 0; padding: 8px; display: grid; gap: 2px; background: var(--header); box-shadow: 0 12px 30px rgba(0,0,0,.35); opacity: 0; transform: translateY(-8px); pointer-events: none; transition-property: opacity, transform; transition-duration: 160ms; }
  .nav-links.is-open { opacity: 1; transform: translateY(0); pointer-events: auto; }
  .nav-primary, .nav-account { display: grid; }
  .nav-links a, .nav-button { width: 100%; justify-content: flex-start; }
  .account-plans, .price-plans { grid-template-columns: 1fr; }
  .admin-stats, .account-stats { grid-template-columns: 1fr 1fr; }
  .membership-plans { grid-template-columns: 1fr; }
  .image-grid { grid-template-columns: repeat(3,1fr); }
}

@media (max-width: 620px) {
  .shell { width: min(100% - 24px, 1300px); }
  .upload-hero { min-height: 440px; padding: 42px 16px 22px; }
  .upload-intro h1 { font-size: 29px; }
  .upload-intro p { margin-top: 18px; font-size: 15px; }
  .upload-hint, .upload-terms { margin-left: 0; margin-right: 0; }
  .pricing-section { padding-inline: 12px; }
  .pricing-section h2 { font-size: 24px; }
  .account-plans, .price-plans { gap: 16px; }
  .plan-card h3, .price-card h3 { font-size: 23px; }
  .section-heading { align-items: start; flex-direction: column; }
  .result-card { grid-template-columns: 1fr; }
  .result-card > img { width: 100%; height: 180px; min-height: 0; }
  .result-actions { grid-template-columns: 1fr 62px; }
  .result-actions label:first-child { grid-column: 1 / -1; }
  .viewer { padding: 24px 0 64px; grid-template-columns: 1fr; }
  .viewer-stage { min-height: 340px; }
  .viewer-info { position: static; }
  .viewer-info h1 { font-size: 30px; }
  .narrow-section { width: calc(100% - 32px); padding: 64px 0; }
  .narrow-section h1 { font-size: 36px; }
  .delete-page form { flex-direction: column; gap: 4px; }
  .footer-links-primary { display: none; }
  .site-footer { min-height: 180px; }
  .page-heading { align-items: start; flex-direction: column; }
  .account-columns, .dashboard-grid, .settings-grid, .form-row { grid-template-columns: 1fr; }
  .admin-stats, .account-stats { grid-template-columns: 1fr; }
  .image-grid { grid-template-columns: repeat(2,1fr); }
  .auth-card { padding: 22px; }
  .admin-header-actions { width: 100%; align-items: stretch; flex-direction: column; }
  .admin-header-actions .outline-button { width: 100%; }
  .token-create-form, .token-reveal > div { grid-template-columns: 1fr; }
  .token-list article { align-items: stretch; flex-direction: column; }
  .token-list article form, .token-list .compact-button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
