/* Shared media-library system. Page-specific geometry follows in home/pages. */
:root {
  --bg:#101014; --surface:#1c1c22; --surface-raised:#292930;
  --surface-2:#292930; --surface-3:#33333c; --line:#41414d;
  --text:#f4f4f8; --muted:#b8b8c5; --faint:#aaaabb;
  --accent:#a6b0f5; --red:#a6b0f5; --red-dark:#8b99e2;
  --vr-accent:#a6b0f5; --vr-border:#41414d; --vr-focus:0 0 0 3px #a6b0f52b;
  --page-gutter:clamp(24px,4vw,72px); --header-height:76px;
  --max:1800px; --ease-out:cubic-bezier(.16,1,.3,1);
  color-scheme:dark;
}
html { scroll-behavior:auto; scroll-padding-top:96px; }
body { background:var(--bg); color:var(--text); font-family:system-ui,-apple-system,"PingFang SC","Microsoft YaHei","Noto Sans CJK SC",sans-serif; font-size:14px; line-height:1.65; }
body::before { display:none; }
::selection { background:#3a5480; color:#fff; }
button,input,select,textarea { font:inherit; }
button,a,input,select,textarea,summary { -webkit-tap-highlight-color:transparent; }
button,a { touch-action:manipulation; }
button { color:inherit; }
button:disabled,[aria-disabled="true"] { cursor:not-allowed; opacity:.5; }
a,button { transition:background-color 160ms,color 160ms,border-color 160ms,transform 160ms; }
button:active:not(:disabled),.button:active { transform:scale(.98); }
:is(a,button,input,select,textarea,summary,[tabindex]):focus-visible { outline:3px solid #95b6f0; outline-offset:4px; box-shadow:0 0 0 6px #080c1299; }
.hana-icon { width:22px; height:22px; flex:none; display:inline-block; vertical-align:middle; fill:currentColor; }
.sr-only { position:absolute!important; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.skip-link { position:fixed; top:12px; left:16px; z-index:80; transform:translateY(-160%); background:var(--accent); color:#080c13; border-radius:8px; padding:12px 20px; font-weight:650; }
.skip-link:focus { transform:translateY(0); }
.age-line { height:24px; padding:0 var(--page-gutter); color:#c0c9d4; font-size:10px; position:relative; z-index:21; background:var(--bg); }
.age-line span { background:#293946; color:#edf4f8; font-size:10px; }
.topbar { height:76px; min-height:76px; padding:0 var(--page-gutter); gap:clamp(18px,2.3vw,44px); background:#0b111af5; box-shadow:none; border-bottom:1px solid #ffffff0c; backdrop-filter:none; transition:background-color 220ms,border-color 220ms; }
body[data-page="home"][data-home-preset="large_cover"] .age-line { background:#080c122b; }
body[data-page="home"][data-home-preset="large_cover"] .topbar:not(.is-scrolled) { background:linear-gradient(#080c1280,#080c1200); border-bottom-color:transparent; }
.topbar.is-scrolled { background:#0b111af5; border-bottom-color:#ffffff10; }
.brand { gap:9px; align-items:center; }
.brand b { width:32px; height:32px; font-size:20px; border-radius:9px; background:var(--accent); color:#081222; box-shadow:none; }
.brand span { min-width:0; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; font-size:16px; font-weight:650; letter-spacing:0; }
.category-nav { gap:3px; padding:0; flex:1; }
.category-nav a { min-height:44px; padding:10px 13px; color:#c8d0db; border:0; border-radius:8px; font-size:13px; position:relative; }
.category-nav a:hover { background:#ffffff0b; color:#fff; }
.category-nav a.active { background:transparent; color:#fff; }
.category-nav a.active::after { content:""; position:absolute; bottom:3px; left:13px; right:13px; height:2px; background:var(--accent); border-radius:2px; }
.top-actions { gap:7px; flex-shrink:0; }
.icon-button { width:44px; height:44px; color:#e0e7ef; border:0; border-radius:10px; }
.icon-button:hover { background:#ffffff12; color:#fff; }
.account { gap:6px; }
.account-login,.account-join,.account-exit,.account-menu summary { min-height:44px; padding:10px 13px; border-radius:10px; background:transparent; color:var(--text); border:1px solid #ffffff18; }
.account-join { background:#e7ebf1; color:#0c1119; border-color:transparent; }
.account-login:hover,.account-menu summary:hover { background:#ffffff0e; }
.account-menu nav { background:#17212e; border:1px solid var(--line); box-shadow:0 20px 65px #03080b80; }
.account-menu nav a:hover,.account-menu nav button:hover { background:#253746; }
.account-menu nav a,.account-menu nav button { min-height:44px; }
.button { min-height:44px; border-radius:10px; font-size:14px; font-weight:600; padding:11px 20px; gap:9px; line-height:1.35; }
.button-primary { background:#f3f6fa; border-color:#f3f6fa; color:#111821; box-shadow:none; }
.button-primary:hover { background:#dce5f4; border-color:#dce5f4; color:#111821; box-shadow:none; }
.button-quiet { background:#ffffff0b; border:1px solid #ffffff20; color:var(--text); }
.button-quiet:hover { background:#ffffff16; border-color:#ffffff35; }
.button-danger { background:#49232b; color:#ffd3da; border-color:#7f404e; }
.engagement-button { height:auto; min-height:44px; min-width:44px; border-radius:10px; padding:9px 12px; gap:7px; background:#18232f; color:#cbd6e1; border:1px solid #2c3c4e; }
.engagement-button span { font-size:13px; }
.engagement-button:hover,.engagement-button.active { background:#172337; border-color:#4c6692; color:#a5c1f0; }
.engagement-button[aria-busy="true"] { opacity:.7; }
.tag-chip { color:#c0cedb; background:#ffffff06; border-color:#435061; border-radius:6px; padding:4px 9px; font-size:12px; }
.tag-chip:hover { color:#d4e4ff; border-color:#6c83ab; background:#232e40; }
.creator-link { color:#dfe9f2; text-decoration-thickness:1px; text-underline-offset:4px; }
.creator-link:hover { color:#9eb8e5; }
.text-link,.account-library,.account-submit { color:#a3bdea; }
.platform-page,.library-page,.submit-page { max-width:var(--max); padding:42px var(--page-gutter) 84px; margin:auto; }
.platform-heading { margin-bottom:28px; border:0; }
.platform-heading h1,.library-heading h1,.submit-heading h1 { font-size:clamp(28px,2.7vw,38px); font-weight:650; letter-spacing:-.025em; line-height:1.25; margin:0 0 10px; }
.platform-heading p { max-width:70ch; }
.panel-card,.submission-form { background:var(--surface); border:1px solid #283746; border-radius:14px; box-shadow:none; }
.admin-tabs,.library-tabs,.platform-tabs { gap:8px; border-bottom:1px solid var(--line); }
.admin-tabs a,.library-tabs a,.platform-tabs a { min-height:44px; padding:10px 14px; color:var(--muted); }
.admin-tabs a.active,.library-tabs a.active,.platform-tabs a.active { color:#dbe8ff; border-color:var(--accent); background:#1b2434; }
label { color:#b6c3d2; }
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),select,textarea { color:var(--text); background:#101a26; border:1px solid #3b4c60; border-radius:10px; min-height:44px; padding:10px 12px; }
input::placeholder,textarea::placeholder { color:#8998ab; }
input:focus,select:focus,textarea:focus { border-color:#6886bb; }
input[type="checkbox"],input[type="radio"] { accent-color:var(--accent); }
input[type="checkbox"] { width:18px; height:18px; }
.filter-bar label { font-size:13px; }
.form-error { color:#ffb8c2; font-size:13px; }
.empty-state { border-color:#344658; background:#0f1923; border-radius:14px; min-height:230px; padding:32px 20px; text-align:center; }
.empty-state strong { font-size:20px; color:var(--text); }
.empty-state p { color:var(--muted); }
.page-loading { min-height:52vh; display:flex; align-items:center; justify-content:center; gap:16px; font-size:15px; }
.page-loading::before { content:""; width:28px; height:28px; border:2px solid #2c374b; border-top-color:#8eafe7; border-radius:50%; animation:hana-loading 900ms linear infinite; }
.is-history-restoring, .is-history-restoring * { animation-duration:0s!important; transition-duration:0s!important; }
@keyframes hana-loading { to { transform:rotate(360deg); } }
.pager { gap:14px; margin:36px 0 8px; font-variant-numeric:tabular-nums; }
.pager a,.pager button { min-width:44px; min-height:44px; border-radius:9px; display:inline-flex; align-items:center; justify-content:center; color:var(--text); background:#15212e; border:1px solid #334659; }
dialog { width:min(460px,calc(100% - 32px)); max-height:calc(100dvh - 32px); border-radius:16px; background:#121d29; color:var(--text); border:1px solid #3b4d62; padding:32px; box-shadow:0 30px 120px #020608aa; }
dialog[open] { animation:hana-dialog 180ms var(--ease-out); }
dialog::backdrop { background:#030810c9; backdrop-filter:none; }
.dialog-close { width:44px; height:44px; top:10px; right:10px; display:grid; place-items:center; color:#c2cfdb; font-size:26px; border-radius:9px; }
.dialog-close:hover { background:#ffffff10; }
dialog h2,dialog h3 { font-size:25px; font-weight:650; padding-right:32px; }
dialog label { font-size:13px; }
.modal-tabs { margin:-4px -32px 26px; padding:0 32px; gap:24px; }
.modal-tabs button { min-height:44px; font-size:14px; }
.modal-tabs button.active { border-color:var(--accent); color:#eff5ff; }
@keyframes hana-dialog { from { opacity:0; transform:translateY(10px) scale(.985); } to { opacity:1; transform:none; } }
footer { max-width:var(--max); gap:24px; padding:42px var(--page-gutter); border-top:1px solid #263542; color:#8e9dad; font-size:12px; flex-wrap:wrap; }
footer a { color:#b5c7d6; text-decoration:underline; text-underline-offset:4px; }
.hana-toast { position:fixed; bottom:28px; left:50%; transform:translateX(-50%); z-index:45; background:#232c3c; border:1px solid #6b7c9a; color:#f2f7ff; padding:12px 20px; border-radius:10px; max-width:calc(100% - 32px); box-shadow:0 10px 40px #030a0ba6; font-size:14px; }
[data-reveal].reveal-pending { opacity:0; transform:translateY(16px); }
[data-reveal].reveal-visible { animation:hana-reveal 480ms var(--ease-out) both; animation-delay:var(--reveal-delay,0ms); }
@keyframes hana-reveal { from { opacity:0; transform:translateY(16px); } to { opacity:1; transform:none; } }
[data-rail-track] { overscroll-behavior-x:contain; scroll-padding-inline:8px; }
[data-rail-prev],[data-rail-next] { width:44px; height:44px; border-radius:50%; background:#182432; border:1px solid #526172; display:inline-grid; place-items:center; }
[data-rail-prev]:hover,[data-rail-next]:hover { background:#314151; }
[data-rail-prev]:disabled,[data-rail-next]:disabled { opacity:.3; }
.list-card { background:#111b25; border-color:#2b3a49; border-radius:12px; }
.list-copy h2 { font-size:19px; font-weight:600; }
.list-copy p { font-size:13px; }
.row-actions button,.filter-clear { min-height:44px; }
@media(min-width:761px) {
  .top-actions:has(.account-menu) > [data-action="login"] { display:none; }
}
@media(max-width:1100px) {
  .topbar { gap:16px; }
  .category-nav a { padding-inline:9px; font-size:12px; }
  .brand span { font-size:14px; }
  .account-join { display:none; }
}
@media(max-width:760px) {
  :root { --page-gutter:16px; --header-height:60px; }
  html { scroll-padding-top:110px; }
  .age-line { height:20px; font-size:9px; }
  .topbar { height:104px; min-height:104px; padding:0 16px; gap:0; align-content:flex-start; }
  .brand,.top-actions { height:60px; }
  .brand { gap:8px; }
  .brand span { font-size:15px; }
  .brand b { width:28px; height:28px; }
  .top-actions { gap:2px; }
  .top-actions .icon-button { width:44px; height:44px; }
  .category-nav { height:44px; width:calc(100% + 32px); flex:0 0 calc(100% + 32px); margin:0 -16px; padding:0 12px; border-top-color:#ffffff0d; gap:6px; }
  .category-nav a { min-height:44px; padding:9px 12px; font-size:12px; }
  .category-nav a:nth-child(n) { display:inline-flex; }
  .account { display:none; }
  #app { padding-bottom:78px; }
  .mobile-nav { height:calc(62px + env(safe-area-inset-bottom)); padding-bottom:env(safe-area-inset-bottom); background:#101b26f7; border-color:#2d3e4c; backdrop-filter:none; z-index:30; }
  .mobile-nav a,.mobile-nav button { min-height:52px; font-size:20px; color:#98aabd; gap:4px; }
  .mobile-nav span { font-size:11px; }
  .mobile-nav .active { color:#a6c3f5; }
  .platform-page,.library-page,.submit-page { padding:28px 16px 36px; }
  .button { font-size:13px; min-height:44px; padding:11px 15px; }
  .tag-chip { font-size:12px; }
  dialog { padding:26px 22px; }
  .modal-tabs { margin:-3px -22px 22px; padding:0 22px; }
  .hana-toast { bottom:calc(80px + env(safe-area-inset-bottom)); }
  footer { display:flex; padding:24px 16px 100px; font-size:11px; gap:8px; }
  .panel-card { border-radius:12px; }
}
@media(prefers-reduced-motion:reduce) {
  html { scroll-behavior:auto!important; }
  *,*::before,*::after { animation:none!important; transition:none!important; scroll-behavior:auto!important; }
  [data-reveal].reveal-pending { opacity:1; transform:none; }
}

.watch-progress {position:absolute;bottom:0;left:0;width:100%;height:4px;border:0;border-radius:0;appearance:none;background:#ffffff30;z-index:3;}
.watch-progress::-webkit-progress-bar{background:#ffffff30}.watch-progress::-webkit-progress-value{background:var(--accent)}.watch-progress::-moz-progress-bar{background:var(--accent)}

/* Interior pages use a stable surface; the home header overlays its artwork. */
.topbar,.topbar.is-scrolled { background:var(--bg); border-bottom:0; box-shadow:none; backdrop-filter:none; }
@media(max-width:768px) {
  :root { --header-height:60px; }
  .topbar { height:60px; min-height:60px; flex-wrap:nowrap; }
  .topbar .category-nav { display:none; }
}

body[data-page="home"][data-home-preset="large_cover"] .topbar { position:fixed; inset:0 0 auto; width:100%; background:transparent; border:0; box-shadow:none; backdrop-filter:none; }
body[data-page="home"][data-home-preset="large_cover"] .topbar.is-scrolled { background:#101014; }
