:root {
  font-family: "MV Boli", "Microsoft YaHei UI", sans-serif;
  color: #1f1f1f;
  background: #f7f7f7;
  --codex-sidebar: #f2f2f2;
  --codex-canvas: #ffffff;
  --codex-hover: #e9e9e9;
  --bg: #f7f7f7;
  --surface: #ffffff;
  --surface-strong: #ffffff;
  --surface-soft: #f7f7f7;
  --line: #e5e5e5;
  --line-strong: #d8d8d8;
  --text: #1f1f1f;
  --subtext: #737373;
  --primary: #202020;
  --focus: #007aff;
  --success: #34c759;
  --danger: #ff3b30;
  --radius-lg: 12px;
  --radius-md: 10px;
  --shadow-panel: none;
  --shadow-float: 0 12px 32px rgba(0, 0, 0, .12);
}

* {
  box-sizing: border-box;
  scrollbar-color: #d4d4d8 transparent;
  scrollbar-width: thin;
}
[hidden] { display: none !important; }
*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
*::-webkit-scrollbar-vertical { width: 8px; }
*::-webkit-scrollbar-horizontal { height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: #c9c9c9;
  border: 2px solid transparent;
  border-radius: 999px;
  background-clip: content-box;
}
*::-webkit-scrollbar-corner { background: transparent; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
}
button, input, textarea, select { font: inherit; }
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
.number-stepper-field { position: relative; min-width: 0; width: 100%; display: block; }
.number-stepper-field > input { width: 100%; padding-right: 26px !important; appearance: textfield; }
.number-stepper-controls { position: absolute; top: 50%; right: 4px; width: 18px; height: 28px; display: grid; grid-template-rows: 1fr 1fr; transform: translateY(-50%); }
.number-stepper-controls [role="button"] { width: 18px; min-width: 18px; height: 14px; min-height: 0; padding: 0; display: grid; place-items: center; border: 0 !important; border-radius: 0; background: transparent !important; box-shadow: none !important; cursor: pointer; }
.number-stepper-controls [role="button"]:hover,
.number-stepper-controls [role="button"]:focus-visible { border: 0 !important; outline: 0; background: transparent !important; box-shadow: none !important; }
.number-stepper-controls svg { width: 10px; height: 6px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  color: #edf2ff;
  background:
    radial-gradient(circle at 20% 10%, rgba(0, 225, 255, .18), transparent 34%),
    radial-gradient(circle at 80% 90%, rgba(187, 60, 255, .2), transparent 36%),
    #080b19;
}
.login-shell {
  width: min(420px, 100%);
  display: grid;
  justify-items: center;
  gap: 24px;
}
.login-logo { display: block; width: min(340px, 82vw); height: auto; }
.login-card {
  width: 100%;
  padding: 36px;
  border: 1px solid rgba(120, 226, 255, .25);
  border-radius: 20px;
  background: rgba(18, 23, 48, .72);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .45);
  backdrop-filter: blur(20px);
}
.login-card h1 { margin: 4px 0 8px; font-size: 28px; }
.login-card h2 { margin: 0 0 20px; font-size: 20px; }
.login-kicker { margin: 0; color: #56e3ff; font-weight: 700; letter-spacing: .08em; }
.login-subtitle { margin: 0 0 28px; color: #aeb9d5; }
.login-card form { display: grid; gap: 10px; }
.login-card label { margin-top: 5px; color: #c8d2eb; font-size: 14px; }
.login-card input {
  width: 100%;
  padding: 12px 14px;
  color: #fff;
  border: 1px solid #35405f;
  border-radius: 10px;
  outline: none;
  background: rgba(5, 8, 23, .7);
}
.login-card input:focus { border-color: #56e3ff; box-shadow: 0 0 0 3px rgba(86, 227, 255, .13); }
.login-submit {
  margin-top: 14px;
  padding: 13px;
  color: #05101d;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  background: linear-gradient(90deg, #52e5ff, #a76cff);
}
.login-error { margin: 2px 0 0; color: #ff8596; }
.login-lock { margin: 2px 0 0; color: #ffd166; }
.login-dialog { width: min(440px, calc(100vw - 32px)); }
.login-dialog .login-card { box-sizing: border-box; }
.login-dialog .library-head { margin-bottom: 20px; }
.login-dialog .library-head h2 { margin: 3px 0 0; }
.login-dialog .login-submit { width: 100%; min-height: 44px; }
.admin-page { min-height: 100vh; color: #edf2ff; background: #080b19; }
.admin-header, .admin-shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.admin-header { display: flex; align-items: center; justify-content: space-between; padding: 28px 0 18px; }
.admin-header p, .admin-header h1 { margin: 0; }
.admin-header p { color: #56e3ff; }
.admin-header a { color: #edf2ff; }
.admin-shell { display: grid; gap: 18px; padding-bottom: 40px; }
.admin-panel, .admin-dialog { border: 1px solid rgba(120, 226, 255, .22); border-radius: 16px; background: rgba(18, 23, 48, .86); }
.admin-panel { padding: 20px; }
.admin-panel-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.admin-panel h2, .admin-dialog h2 { margin: 0 0 16px; }
.account-list { display: grid; gap: 10px; }
.library-tabs { display: flex; gap: 10px; margin: 0; }
.usage-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; }
.usage-list div { min-width: 0; padding: 14px; border: 1px solid rgba(148, 163, 184, .16); border-radius: 12px; background: rgba(4, 10, 24, .42); }
.usage-list dt, .usage-list dd { margin: 0; }
.usage-list dt { color: #91a3bf; font-size: 12px; }
.usage-list dd { margin-top: 5px; color: #f8fafc; font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.tool-page { grid-column: 1 / -1; min-width: 0; width: 100%; height: 100%; margin: 0; padding: clamp(18px, 3vw, 36px); overflow: auto; border: 0; border-radius: 0; background: transparent; }
.tool-page-header { width: min(1180px, 100%); margin: 0 auto; padding: 22px 24px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border: 1px solid rgba(103, 232, 249, .2); border-radius: 18px; background: linear-gradient(145deg, rgba(23, 34, 65, .82), rgba(12, 20, 42, .7)); box-shadow: 0 18px 50px rgba(0, 0, 0, .2); }
.tool-page-header h1 { margin: 2px 0 6px; font-size: clamp(24px, 3vw, 32px); }
.tool-page-header p { color: #9fb0c8; line-height: 1.5; }
.tool-page-kicker { color: #67e8f9 !important; font-size: 12px; font-weight: 800; letter-spacing: .12em; }
.tool-page-toolbar { width: min(1180px, 100%); margin: 16px auto; padding: 10px; border: 1px solid rgba(148, 163, 184, .16); border-radius: 14px; background: rgba(8, 14, 31, .62); }
.asset-panel-head { width: min(1180px, 100%); margin: 18px auto 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.asset-panel-head h2 { margin: 0; }
.tool-page-search { width: min(360px, 100%); }
.resource-grid { width: min(1180px, 100%); margin: 18px auto 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.resource-card, .prompt-page-card, .tool-card { border: 1px solid rgba(148, 163, 184, .18); border-radius: 16px; background: linear-gradient(145deg, rgba(23, 34, 65, .82), rgba(12, 20, 42, .7)); box-shadow: 0 16px 38px rgba(0, 0, 0, .2); }
.resource-card { min-width: 0; display: grid; align-content: start; gap: 12px; padding: 14px; }
.resource-card img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; }
.resource-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; }
.resource-actions > * { flex: 1 1 120px; }
.asset-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.asset-card video { width: 100%; aspect-ratio: 16 / 9; object-fit: contain; border-radius: 9px; background: #020617; }
.asset-meta { display: grid; gap: 4px; color: var(--subtext); font-size: 13px; }
.asset-card pre { margin: 8px 0 0; max-height: 180px; overflow: auto; white-space: pre-wrap; word-break: break-word; color: var(--text); }
.asset-download { min-height: 42px; padding: 0 16px; display: inline-flex; align-items: center; justify-content: center; text-align: center; border: 1px solid var(--line); border-radius: 8px; color: var(--text); text-decoration: none; background: var(--surface-strong); }
.asset-download:focus-visible { outline: 3px solid rgba(34, 211, 238, .18); outline-offset: 2px; }
.prompt-page-list { width: min(1000px, 100%); margin: 18px auto 0; display: grid; gap: 16px; }
.prompt-page-card { display: grid; gap: 12px; padding: 18px; }
.prompt-page-card textarea { min-height: 180px; resize: vertical; line-height: 1.65; }
.tool-card { margin: 0; padding: 22px; align-content: start; }
.tool-card h2 { margin: 0 0 16px; }
.account-security { width: min(640px, 100%); margin: 0 auto; padding: 30px 32px 32px; }
.account-security h1 { margin: 3px 0 8px; font-size: 28px; line-height: 1.2; }
.account-security > p:not(.tool-page-kicker) { margin: 0 0 26px; color: var(--subtext); line-height: 1.5; }
.account-password { display: grid; gap: 16px; }
.account-security .dialog-actions { margin-top: 24px; }
.account-security .dialog-actions button { width: 100%; min-height: 44px; }
.user-center { width: min(608px, 100%); margin: 0 auto; padding: 18px 22px 22px; border: 0; box-shadow: none; }
.user-center h1 { margin: 0 0 16px; font-size: 28px; font-weight: 700; }
.user-center-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 0; margin-bottom: 18px; border: 0; background: transparent; }
.app .user-center-tabs button { min-height: 36px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 10px; color: var(--subtext); background: transparent; box-shadow: none; }
.user-center-tabs svg { width: 16px; height: 16px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.app .user-center-tabs button:hover, .app .user-center-tabs button:focus-visible, .app .user-center-tabs button.active { color: var(--text); background: var(--hover); box-shadow: none; }
.user-password-panel { width: min(480px, 100%); margin: 0 auto; }
.user-center-note { margin: 0 0 12px; color: var(--subtext); line-height: 1.5; }
.user-center .account-password { gap: 10px; }
.user-center .account-password label { gap: 5px; }
.user-center .account-password input { min-height: 38px; padding-top: 0; padding-bottom: 0; border: 0; background: var(--surface-soft); box-shadow: none; }
.user-center .account-password input:focus, .user-center .account-password input:focus-visible { border: 1px solid #c76ff5; outline: 0; background: var(--surface-strong); box-shadow: none; }
.user-center .dialog-actions { margin-top: 14px; }
.user-center .dialog-actions button { width: 100%; min-height: 38px; border: 0; }
.user-points-balance { min-height: 126px; display: grid; place-content: center; gap: 7px; text-align: center; border: 0; border-radius: 18px; background: var(--surface-soft); }
.user-points-balance span { color: var(--subtext); }
.user-points-balance strong { color: #c76ff5; font-size: 42px; font-weight: 700; line-height: 1; }
.point-history { display: grid; gap: 7px; }
.point-history > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 0; border-radius: 12px; background: var(--surface-soft); }
.point-history span { display: grid; gap: 4px; }
.point-history small { color: var(--subtext); }
.point-history b { color: var(--text); }
.point-history b.refund, .point-history b:not(.consume) { color: #c76ff5; }
@media (max-width: 680px) { .user-center { padding: 15px 13px; } .user-center-tabs { grid-template-columns: repeat(2, 1fr); } }
.account-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px; border: 1px solid #35405f; border-radius: 12px; background: rgba(5, 8, 23, .55); }
.account-card small { display: block; margin-top: 4px; color: #aeb9d5; }
.account-card pre { max-width: 75%; overflow: auto; white-space: pre-wrap; }
.account-actions, .admin-dialog-actions, .admin-data-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-page button { padding: 8px 12px; color: #edf2ff; border: 1px solid #475271; border-radius: 8px; cursor: pointer; background: #202943; }
.admin-page button.danger { border-color: #8f3d50; background: #592536; }
.admin-dialog { width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 22px; color: #edf2ff; overflow: auto; }
.admin-dialog::backdrop { background: rgba(0, 0, 0, .72); }
.admin-dialog form, .admin-dialog label { display: grid; gap: 8px; }
.admin-dialog form { gap: 12px; }
.admin-dialog input { padding: 10px 12px; color: #fff; border: 1px solid #35405f; border-radius: 8px; background: #080b19; }
.admin-dialog-actions { justify-content: flex-end; margin-top: 10px; }
.admin-data-dialog { width: min(900px, calc(100vw - 32px)); }
.admin-data-tabs { margin: 12px 0; }
@media (max-width: 800px) {
  .tool-page-header { align-items: stretch; flex-direction: column; }
  .tool-page-header > button, .tool-page-search { width: 100%; }
  .usage-list { grid-template-columns: 1fr; }
}

.app {
  --center-width: 1fr;
  --right-width: clamp(320px, 28vw, 520px);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto;
  column-gap: 8px;
  row-gap: 16px;
  height: 100vh;
  overflow: auto;
  padding: 16px 16px 16px 252px;
}

.side-nav {
  position: fixed;
  z-index: 30;
  inset: 0 auto 0 0;
  width: 236px;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 3px;
  border-right: 1px solid var(--line);
  background: var(--codex-sidebar);
}
.side-nav-logo {
  position: relative;
  isolation: isolate;
  display: block;
  width: 100%;
  margin: 0 0 16px;
}
.side-nav-logo img { display: block; width: 100%; height: auto; }
.side-nav-logo-base { position: relative; z-index: 0; }
.side-nav-logo-color { position: absolute; z-index: 1; inset: 0; clip-path: inset(34% 10% 38% 82%); filter: none; }
body:not(.web-mode) .web-only { display: none !important; }
.side-nav-brand {
  width: 38px;
  height: 38px;
  margin-bottom: 18px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: white;
  font-weight: 800;
  background: #202020;
  box-shadow: none;
}
.side-nav-item {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  border-radius: 7px;
  background: transparent;
  color: #64748b;
  font-size: 14px;
  box-shadow: none;
}
.side-nav-item:hover { background: var(--codex-hover); color: #202020; }
.side-nav-item.active { background: #dedede; color: #111; }
.side-nav-bottom { margin-top: auto; }
.nav-icon { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.panel-inner.workspace-panel {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.workspace-column {
  padding: 0 12px;
  border-right: 1px solid var(--line);
  background: var(--codex-canvas);
  transition: border-color .15s ease;
}
.workspace-column-last { border-right: 0; }
.column-resize-handle:hover::before { background: #b8b8b8; }

.panel, .panel-inner, .item {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-panel);
}

.left, .right {
  overflow: auto;
  padding: 18px 22px 18px 18px;
  scrollbar-gutter: stable;
}

.scroll-panel {
  position: relative;
  overflow: auto;
  padding: 0 14px 0 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
  scrollbar-gutter: auto;
}
.panel-inner {
  min-height: 100%;
  padding: 18px;
}

.right-panel-stack {
  height: auto;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
}

.progress-card.panel-inner {
  margin-top: 0;
  min-height: 180px;
  overflow: auto;
  scrollbar-gutter: stable;
}

.progress-card.panel-inner {
  align-content: start;
  gap: 0;
}

.column-resize-handle {
  min-width: 10px;
  min-height: 0;
  display: none;
  place-items: stretch center;
  cursor: col-resize;
}
.column-resize-handle[hidden] { display: none !important; }

.column-resize-handle::before {
  content: "";
  width: 1px;
  height: 100%;
  background: var(--line);
  transition: background .15s ease;
}
.column-resize-handle:hover::before { background: #b8b8b8; }

.menu-bar {
  grid-column: 1 / -1;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-radius: 18px;
}
.menu-bar nav { display: flex; gap: 10px; }
.menu-bar strong {
  min-width: 0;
  color: var(--text);
  font-size: 15px;
  letter-spacing: 0;
}
.menu-bar .secondary {
  background: #111827;
  color: white;
  border-color: #111827;
  box-shadow: 0 8px 18px rgba(17, 24, 39, .12);
}
.menu-bar .page-tab.active { background: #007aff; border-color: #007aff; }
.page-two[hidden] { display: none; }
body.page-two-active .app > .left,
body.page-two-active .app > .center,
body.page-two-active .app > .right,
body.page-two-active .app > .column-resize-handle { display: none; }

.brand {
  display: grid;
  place-items: center;
  padding: 2px 0 10px;
}

.brand-logo {
  display: block;
  width: min(100%, 260px);
  height: auto;
  object-fit: contain;
}

.eyebrow, .hint {
  color: #64748b;
  font-size: 13px;
}

h1, h2, p { margin: 0; }
h1 { margin-top: 6px; font-size: 26px; letter-spacing: 0; }
h2 { font-size: 18px; color: var(--text); }
h3 { margin: 0; font-size: 15px; }
section { margin-top: 22px; display: grid; gap: 14px; }
#centerPanel { margin-top: 0; }
#pageOneLeft .panel-inner {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
}
#materialSection {
  position: relative;
  min-height: 0;
  grid-template-rows: auto auto auto auto minmax(0, 1fr) auto;
  overflow: auto;
}
.library-picker-actions > button { flex: 1; }

.prompt-field {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 7px;
}
#materialPrompt {
  height: 100%;
  min-height: 120px;
}
.prompt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #334155;
  font-size: 13px;
}
.prompt-tools {
  display: flex;
  gap: 6px;
}
.icon-button {
  width: 28px;
  height: 28px;
  min-height: 0;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
}
.icon-button:hover { background: #f8fafc; }
.icon-button::before { font-size: 15px; line-height: 1; }
.icon-save::before { content: "⇩"; }
.icon-list::before { content: "☷"; }
.icon-expand::before { content: "⛶"; }

label {
  display: grid;
  gap: 7px;
  color: #334155;
  font-size: 13px;
}

input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 13px;
  background: var(--surface-strong);
  outline: 0;
  color: var(--text);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

textarea { resize: vertical; }
input:focus, textarea:focus, select:focus {
  border-color: rgba(0, 122, 255, .46);
  box-shadow: 0 0 0 4px rgba(0, 122, 255, .11);
  background: #fff;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .14s ease, opacity .18s ease;
}

.primary {
  background: #202020;
  color: white;
  font-weight: 700;
  box-shadow: none;
}
.primary:hover { background: #000; box-shadow: none; }
.primary:active, .secondary:active, .icon-button:active, .icon-action:active { transform: translateY(1px); }
.danger { background: #111827; color: white; }
.secondary {
  background: var(--surface-strong);
  color: #111827;
  border: 1px solid var(--line);
}
.secondary:hover { background: #f8fafc; border-color: var(--line-strong); }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid rgba(0, 122, 255, .18);
  outline-offset: 2px;
}

.upload-box {
  min-height: 72px;
  width: 100%;
  display: grid;
  place-items: center;
  gap: 6px;
  border: 1px dashed rgba(15, 23, 42, .18);
  background: linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(248, 250, 252, .72));
  color: #111827;
  text-align: center;
}
.upload-box:hover { border-color: rgba(0, 122, 255, .38); background: #fff; }
.upload-box span { color: #64748b; font-size: 13px; }
.upload-box.dragging {
  border-color: rgba(0, 122, 255, .6);
  box-shadow: 0 0 0 4px rgba(0, 122, 255, .1);
}
.thumbs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; min-height: 0; }
.thumb {
  position: relative;
  margin: 0;
  aspect-ratio: 1;
  overflow: visible;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, .08);
  background: #f8fafc;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 14px; }
.thumb-zoomed {
  position: fixed;
  z-index: 20;
  inset: 7vh 7vw;
  aspect-ratio: auto;
  background: rgba(15, 23, 42, .86);
  border-radius: 18px;
  padding: 16px;
}
.thumb-zoomed img { object-fit: contain; }
.pick-thumb {
  width: 100%;
  aspect-ratio: 1;
  min-height: 0;
  padding: 0;
  border-radius: 14px;
  overflow: hidden;
  background: #f8fafc;
  border: 2px solid transparent;
}
.pick-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pick-selected { border-color: #007aff; }
.thumb-remove {
  position: absolute;
  z-index: 3;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  min-height: 0;
  border: 0;
  border-radius: 999px;
  background: #111827;
  color: white;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  padding: 0;
  opacity: .7;
  box-shadow: 0 4px 12px rgba(15, 23, 42, .18);
}
.library-context-menu {
  position: fixed;
  z-index: 10001;
  min-width: 110px;
  padding: 6px;
  border: 1px solid rgba(15, 23, 42, .1);
  border-radius: 12px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 16px 38px rgba(15, 23, 42, .16);
}
.library-context-menu[hidden] { display: none; }
.library-context-menu button {
  width: 100%;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 9px;
  background: transparent;
  color: #111827;
  text-align: left;
}
.library-context-menu button:hover { background: #f1f5f9; }
.mention-panel {
  position: relative;
  z-index: 9999;
  width: min(280px, calc(100vw - 40px));
  margin-top: 0;
  padding: 12px;
  border: 1px solid rgba(15, 23, 42, .1);
  border-radius: 16px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 18px 45px rgba(15, 23, 42, .14);
}
.mention-panel[hidden] { display: none; }
.list-mention-panel {
  width: min(340px, 100%);
  margin-top: 8px;
}
.mention-library-list {
  margin-top: 6px;
  padding-left: 10px;
  max-height: 280px;
  overflow: auto;
  scrollbar-gutter: stable;
}
.mention-title {
  margin-bottom: 8px;
  color: #64748b;
  font-size: 12px;
}
.mention-row {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 12px;
  background: var(--surface-soft);
  color: #334155;
  text-align: left;
}
.mention-row:hover, .mention-library-item:hover { background: #eef2f7; }
.mention-row + .mention-row { margin-top: 6px; }
.mention-row img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: cover;
}
.mention-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
.mention-toggle {
  grid-template-columns: 1fr auto;
}
.mention-library-item {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  padding: 6px;
  border-radius: 12px;
  background: var(--surface-soft);
}
.mention-image-button {
  width: 34px;
  height: 34px;
  min-height: 0;
  padding: 0;
  border-radius: 8px;
  overflow: hidden;
  background: transparent;
}
.mention-image-button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.mention-name {
  min-height: 34px;
  padding: 0 4px;
  background: transparent;
  color: #334155;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
.mention-empty {
  margin-top: 6px;
  padding: 12px;
  color: #94a3b8;
  font-size: 12px;
}
.mention-zoomed {
  position: fixed;
  z-index: 10000;
  inset: 6vh 6vw;
  width: auto;
  height: auto;
  border-radius: 18px;
  padding: 16px;
  background: rgba(15, 23, 42, .88);
}
.mention-zoomed img { object-fit: contain; }

.grid2 { display: grid; grid-template-columns: 1fr 110px; gap: 10px; }
.model-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.center { min-width: 0; }
.center-inner {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  overflow: hidden;
}
.list-header {
  padding: 2px 2px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.actions { display: flex; gap: 8px; align-items: center; }
.select-all {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 6px;
  color: #334155;
}
.select-all input, .item-check {
  width: 18px;
  height: 18px;
  accent-color: #111827;
}
.list { overflow: auto; display: grid; gap: 10px; padding-right: 10px; scrollbar-gutter: stable; }
.video-generation-actions {
  display: grid;
  grid-template-columns: minmax(0, 280px);
  justify-content: center;
  align-items: end;
  gap: 10px;
}
.video-generation-actions label,
.video-generation-actions select,
.video-generation-actions button { width: 100%; }
.item {
  padding: 13px 14px;
  display: block;
  cursor: pointer;
  background: rgba(255, 255, 255, .9);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.item summary { list-style: none; }
.item summary::-webkit-details-marker { display: none; }
.item:hover {
  border-color: rgba(0, 122, 255, .24);
  box-shadow: 0 14px 34px rgba(15, 23, 42, .08);
  background: #fff;
}
.item-title { display: flex; justify-content: space-between; gap: 12px; }
.item-title strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-actions { display: flex; gap: 8px; flex-shrink: 0; }
.item-toggle, .item-copy, .item-delete {
  width: 44px;
  height: 28px;
  min-height: 0;
  padding: 0;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 12px;
  display: inline-grid;
  place-items: center;
  line-height: 1;
}
.item-toggle:hover, .item-copy:hover, .item-delete:hover { background: #e2e8f0; color: #0f172a; }
.item-toggle::before { content: "展开"; }
.item[open] .item-toggle::before { content: "收起"; }
.item-copy { transition: background .18s ease, color .18s ease, transform .18s ease; }
.item-copy.copied {
  background: #dcfce7;
  color: #166534;
  transform: scale(1.04);
}
.prompt-edit {
  width: 100%;
  margin-top: 10px;
  min-height: 148px;
  resize: vertical;
  line-height: 1.55;
}
.video-result {
  margin-top: 8px;
  padding: 9px 10px;
  border-radius: 12px;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  line-height: 1.5;
  word-break: break-all;
}
.progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.progress-count {
  color: #64748b;
  font-size: 13px;
  text-align: right;
  margin: -2px 0 6px;
}
.progress-head span, .progress-empty {
  color: #64748b;
  font-size: 13px;
}
.progress-item {
  display: grid;
  gap: 10px;
  margin-top: 0;
  padding: 14px;
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 16px;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 10px 28px rgba(15, 23, 42, .06);
}
.progress-item + .progress-item { margin-top: 8px; }
.progress-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}
.progress-top strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.progress-bottom {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}
.progress-bottom span {
  color: #475569;
  font-size: 13px;
  white-space: nowrap;
}
.progress-item b {
  color: #111827;
  font-size: 13px;
  text-align: right;
}
.progress-bottom small {
  min-width: 0;
  color: #64748b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.progress-failed {
  border-color: rgba(180, 35, 24, .18);
}
.progress-line {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
}
.progress-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e7eb;
}
.progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #34c759;
  transition: width .24s ease;
}
.progress-done {
  background: #34c759;
}
.progress-failed-fill {
  background: #ff3b30;
}
.progress-percent {
  display: inline-grid;
  grid-template-columns: 34px 16px;
  align-items: center;
  gap: 5px;
}
.progress-percent b {
  text-align: center;
}
.progress-actions {
  display: flex;
  gap: 5px;
}
.icon-action {
  width: 28px;
  height: 28px;
  min-height: 0;
  padding: 0;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  display: grid;
  place-items: center;
  font-size: 14px;
}
.icon-action:hover {
  background: #f1f5f9;
  color: #334155;
}
.error-badge {
  width: 16px;
  height: 16px;
  min-height: 0;
  padding: 0;
  border-radius: 999px;
  background: #ff3b30;
  color: white;
  font-size: 12px;
  font-weight: 700;
  display: inline-grid;
  place-items: center;
  line-height: 1;
}
.tag { color: #475569; background: #f1f5f9; border-radius: 999px; padding: 4px 8px; font-size: 12px; }
.hook { color: #475569; line-height: 1.55; }
.detail {
  display: grid;
  gap: 5px;
  align-content: start;
  margin-top: 5px;
  line-height: 1.45;
  color: #334155;
  white-space: normal;
}

dialog {
  border: 0;
  border-radius: 24px;
  padding: 0;
  max-height: calc(100vh - 72px);
  overflow: hidden;
  box-shadow: 0 32px 90px rgba(15, 23, 42, .18);
  background: var(--surface-strong);
}
dialog::backdrop { background: rgba(15, 23, 42, .28); backdrop-filter: blur(10px); }
.settings {
  box-sizing: border-box;
  width: min(640px, calc(100vw - 72px));
  max-height: calc(100vh - 96px);
  padding: 22px 34px 22px 22px;
  display: grid;
  gap: 13px;
  overflow-y: auto;
  scrollbar-gutter: stable;
  background: linear-gradient(180deg, #fff, #f8fafc);
}
.fission-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.prompt-editor-dialog { width: min(760px, calc(100vw - 40px)); }
.prompt-editor-dialog textarea { min-height: 360px; line-height: 1.65; }
.prompt-library-list { display: grid; gap: 8px; max-height: 420px; overflow: auto; scrollbar-gutter: stable; }
.prompt-library-item {
  position: relative;
  padding: 10px 42px 10px 12px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid var(--line);
  color: #334155;
  line-height: 1.45;
}
.prompt-library-item:hover { background: #fff; }
.prompt-library-item summary {
  list-style: none;
  cursor: pointer;
}
.prompt-library-item summary::-webkit-details-marker { display: none; }
.prompt-preview {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-wrap;
}
.prompt-library-item[open] .prompt-preview { display: none; }
.prompt-full {
  margin-top: 2px;
  white-space: pre-wrap;
}
.prompt-library-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  min-height: 0;
  padding: 0;
  border-radius: 999px;
  background: rgba(15, 23, 42, .08);
  color: #64748b;
}
.prompt-library-use {
  margin-top: 10px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 12px;
  background: #111827;
  color: white;
  font-size: 12px;
}
.prompt-empty {
  padding: 16px;
  color: #94a3b8;
  font-size: 13px;
}
.dialog-status { min-height: 20px; color: #b42318; font-size: 13px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.library-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.library-pick { display: grid; gap: 10px; }

@media (min-width: 1181px) {
  .app {
    grid-template-columns: 330px minmax(420px, var(--center-width)) 10px minmax(300px, var(--right-width));
    grid-template-rows: minmax(0, 1fr);
    overflow: hidden;
  }
  .workspace-column, .column-resize-handle {
    min-height: 0;
    height: 100%;
  }
  .column-resize-handle {
    display: grid;
  }
  .right-panel-stack {
    height: 100%;
    min-height: 100%;
    gap: 0;
    grid-template-rows: minmax(0, 1fr);
  }
}

@media (max-width: 1180px) {
}


@media (max-width: 760px) {
  .app { padding: 10px; row-gap: 10px; }
  .menu-bar {
    align-items: stretch;
    flex-direction: column;
  }
  .menu-bar nav {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
  }
  .grid2, .model-grid, .fission-grid { grid-template-columns: 1fr; }
  .list-header {
    align-items: stretch;
    flex-direction: column;
  }
  .actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .select-all { grid-column: 1 / -1; }
  .video-generation-actions {
    grid-template-columns: minmax(0, 1fr);
    max-width: 100%;
  }
  .settings {
    width: calc(100vw - 24px);
    padding: 18px 28px 18px 18px;
  }
}

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

/* Cyber glass theme */
:root {
  --cyber-bg: #070b17;
  --cyber-cyan: #22d3ee;
  --cyber-pink: #ec4899;
  --action-gradient: linear-gradient(90deg, #34cde8 0%, #7dd3fc 55%, #b8a9f6 100%);
  --codex-sidebar: rgba(10, 15, 32, .82);
  --codex-canvas: rgba(12, 18, 38, .48);
  --codex-hover: rgba(34, 211, 238, .1);
  --bg: var(--cyber-bg);
  --surface: rgba(18, 27, 53, .72);
  --surface-strong: rgba(13, 21, 43, .88);
  --surface-soft: rgba(30, 41, 70, .58);
  --line: rgba(148, 163, 184, .18);
  --line-strong: rgba(34, 211, 238, .42);
  --text: #f8fafc;
  --subtext: #a5b4cc;
  --primary: var(--cyber-cyan);
  --focus: var(--cyber-cyan);
  --success: #34d399;
  --danger: #fb7185;
  --shadow-panel: 0 18px 44px rgba(0, 0, 0, .22);
  --shadow-float: 0 24px 70px rgba(0, 0, 0, .46);
  color: var(--text);
  background: var(--cyber-bg);
}

* { scrollbar-color: rgba(34, 211, 238, .42) transparent; }
*::-webkit-scrollbar-thumb { background: rgba(34, 211, 238, .42); }
body {
  color: var(--text);
  background:
    radial-gradient(circle at 12% 8%, rgba(236, 72, 153, .17), transparent 30%),
    radial-gradient(circle at 88% 90%, rgba(34, 211, 238, .15), transparent 34%),
    linear-gradient(135deg, #070b17 0%, #0d1027 50%, #07111d 100%);
}
body::before {
  content: "";
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  opacity: .2;
  background-image:
    linear-gradient(rgba(34, 211, 238, .12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, .12) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

.side-nav {
  border-right-color: rgba(34, 211, 238, .2);
  background: linear-gradient(180deg, rgba(11, 16, 36, .92), rgba(8, 13, 28, .76));
  box-shadow: 14px 0 42px rgba(0, 0, 0, .24);
  backdrop-filter: blur(18px);
}
.side-nav-logo-base { filter: brightness(0) invert(1) drop-shadow(0 0 14px rgba(34, 211, 238, .26)); }
.side-nav-item { color: #a9b8cf; }
.side-nav-item:hover { color: #e6fbff; background: rgba(34, 211, 238, .09); }
.side-nav-item.active {
  color: #ecfeff;
  background: linear-gradient(90deg, rgba(34, 211, 238, .18), rgba(236, 72, 153, .1));
  box-shadow: inset 3px 0 var(--cyber-cyan), 0 0 22px rgba(34, 211, 238, .08);
}
.nav-icon { filter: drop-shadow(0 0 5px currentColor); }

.workspace-column {
  border-color: rgba(34, 211, 238, .16);
  background: linear-gradient(180deg, rgba(16, 24, 48, .48), rgba(10, 16, 33, .38));
  backdrop-filter: blur(18px);
}
.column-resize-handle::before { background: rgba(34, 211, 238, .24); }
.column-resize-handle:hover::before { background: var(--cyber-cyan); box-shadow: 0 0 12px var(--cyber-cyan); }
h1, h2, h3, strong { color: #f8fafc; }
h2 { text-shadow: 0 0 18px rgba(34, 211, 238, .16); }
label, .prompt-head, .select-all, .detail, .hook { color: #c4d0e3; }
.hint, .eyebrow, .upload-box span, .progress-count, .progress-head span, .progress-empty { color: #91a3bf; }

.panel, .item, .progress-item, .prompt-library-item,
.mention-panel, .library-context-menu, dialog {
  border-color: rgba(148, 163, 184, .18);
  background: linear-gradient(145deg, rgba(23, 34, 65, .78), rgba(12, 20, 42, .66));
  box-shadow: var(--shadow-panel), inset 0 1px rgba(255, 255, 255, .05);
  backdrop-filter: blur(18px);
}
.item:hover, .progress-item:hover {
  border-color: rgba(34, 211, 238, .42);
  background: linear-gradient(145deg, rgba(26, 42, 76, .88), rgba(14, 24, 49, .78));
  box-shadow: 0 16px 38px rgba(0, 0, 0, .28), 0 0 24px rgba(34, 211, 238, .08);
}

input, textarea, select {
  color: #edf7ff;
  border-color: rgba(148, 163, 184, .2);
  background: rgba(4, 10, 24, .62);
  color-scheme: dark;
}
input::placeholder, textarea::placeholder { color: #71829e; }
input:focus, textarea:focus, select:focus {
  color: #fff;
  border-color: var(--cyber-cyan);
  background: rgba(5, 13, 29, .84);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, .12), 0 0 20px rgba(34, 211, 238, .09);
}
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline-color: rgba(34, 211, 238, .72);
}
.primary {
  color: #06121a;
  background: linear-gradient(100deg, var(--cyber-cyan), #67e8f9 48%, #c4b5fd);
  box-shadow: 0 8px 24px rgba(34, 211, 238, .16);
}
.primary:hover {
  color: #020617;
  background: linear-gradient(100deg, #67e8f9, #a5f3fc 48%, #f0abfc);
  box-shadow: 0 0 26px rgba(34, 211, 238, .28);
}
.primary.danger, .danger { color: #fff; background: linear-gradient(100deg, #be123c, #f43f5e); }
.secondary, .item-toggle, .item-copy, .item-delete, .icon-action {
  color: #c8d5e8;
  border-color: rgba(148, 163, 184, .2);
  background: rgba(30, 41, 70, .56);
}
.secondary:hover, .item-toggle:hover, .item-copy:hover, .item-delete:hover, .icon-action:hover {
  color: #ecfeff;
  border-color: rgba(34, 211, 238, .42);
  background: rgba(34, 211, 238, .11);
}
.icon-button { color: #8fa2bd; }
.icon-button:hover { color: var(--cyber-cyan); background: rgba(34, 211, 238, .1); }

.upload-box {
  color: #e7faff;
  border-color: rgba(34, 211, 238, .34);
  background: linear-gradient(145deg, rgba(34, 211, 238, .07), rgba(236, 72, 153, .05));
}
.upload-box:hover, .upload-box.dragging {
  border-color: var(--cyber-cyan);
  background: rgba(34, 211, 238, .09);
  box-shadow: inset 0 0 28px rgba(34, 211, 238, .05), 0 0 24px rgba(34, 211, 238, .1);
}
.thumb, .pick-thumb { border-color: rgba(34, 211, 238, .22); background: #0b1226; }
.pick-selected { border-color: var(--cyber-cyan); box-shadow: 0 0 18px rgba(34, 211, 238, .28); }
.tag, .video-result { color: #b9c8dc; background: rgba(34, 211, 238, .07); }
.progress-bar { background: rgba(148, 163, 184, .18); }
.progress-fill, .progress-done { background: linear-gradient(90deg, var(--cyber-cyan), #34d399); box-shadow: 0 0 10px rgba(34, 211, 238, .45); }
.progress-failed-fill { background: #fb7185; }
.progress-bottom span, .progress-bottom small, .progress-item b { color: #b8c7da; }

.settings { background: linear-gradient(160deg, rgba(18, 27, 53, .97), rgba(8, 14, 31, .98)); }
dialog::backdrop { background: rgba(2, 6, 23, .68); backdrop-filter: blur(8px); }
.library-context-menu button, .mention-name { color: #d9e6f5; }
.library-context-menu button:hover, .mention-row:hover, .mention-library-item:hover { background: rgba(34, 211, 238, .1); }
.mention-row, .mention-library-item, .prompt-library-item { color: #c6d3e5; background: rgba(22, 32, 61, .7); }
.dialog-status { color: #fda4af; }

@media (max-width: 760px) {
  .side-nav { backdrop-filter: blur(14px); }
}

/* 全站操作按钮统一使用蓝紫渐变；上传区保留卡片形态，仅复用同一渐变描边。 */
.app button:not(.upload-box),
.app button.danger,
.app button.primary.danger,
.app .side-nav-link,
.app .asset-download,
.login-page button,
.admin-page button,
.admin-page button.danger {
  color: #04131d;
  border-color: transparent;
  background: var(--action-gradient);
  box-shadow: 0 8px 22px rgba(52, 205, 232, .18);
  font-weight: 700;
}
.app button:not(.upload-box):hover,
.app .side-nav-link:hover,
.app .asset-download:hover,
.login-page button:hover,
.admin-page button:hover,
.admin-page button.danger:hover {
  color: #020617;
  border-color: transparent;
  background: var(--action-gradient);
  box-shadow: 0 0 26px rgba(52, 205, 232, .32);
  filter: brightness(1.06);
}
.app button:not(.upload-box):disabled,
.login-page button:disabled,
.admin-page button:disabled { cursor: not-allowed; opacity: .48; filter: grayscale(.2); }
.app button.upload-box {
  border: 1px dashed transparent;
  background: linear-gradient(145deg, rgba(10, 18, 38, .96), rgba(13, 20, 42, .94)) padding-box, var(--action-gradient) border-box;
}
.app button.upload-box:hover,
.app button.upload-box.dragging {
  border-color: transparent;
  background: linear-gradient(145deg, rgba(17, 31, 57, .98), rgba(20, 28, 54, .96)) padding-box, var(--action-gradient) border-box;
}
.app .side-nav-item.active,
.app .library-tabs button.active {
  color: #020617;
  border-color: rgba(255, 255, 255, .9);
  background: var(--action-gradient);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .72), 0 0 24px rgba(52, 205, 232, .32);
}
.app .side-nav-item { margin-bottom: 4px; }
.app .side-nav-link { text-decoration: none; }
.app .library-tabs button { min-width: 96px; }
.resource-card:hover, .prompt-page-card:hover, .tool-card:hover {
  border-color: rgba(52, 205, 232, .38);
  box-shadow: 0 20px 48px rgba(0, 0, 0, .26), 0 0 24px rgba(52, 205, 232, .08);
}

/* 资产库：标题和分类共用一个顶部卡片，所有分类保持同一排版。 */
.asset-page { display: block; padding: clamp(18px, 2.5vw, 32px) clamp(18px, 3vw, 38px) 40px; }
.asset-page .tool-page-header { padding: 22px 24px 18px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 12px; border-radius: 16px; }
.asset-page .tool-page-header h1 { margin: 2px 0 4px; font-size: clamp(24px, 2.4vw, 28px); }
.asset-page .tool-page-header p:not(.tool-page-kicker) { max-width: 620px; margin: 0; font-size: 14px; }
.asset-page .asset-tabs {
  grid-column: 1;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-template-rows: 40px;
  align-content: center;
  width: 100%;
  height: 52px;
  gap: 8px;
  margin: 0;
  padding: 6px;
  background: var(--surface-soft);
  box-shadow: none;
}
.asset-page .asset-tabs button { min-width: 0; height: 40px; min-height: 40px; padding: 0 14px; border-radius: 9px; font-size: 13px; box-shadow: none; }
.asset-page :is(.asset-tabs button, .asset-add-actions button, .resource-actions > *) { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.asset-page :is(.asset-tabs button, .asset-add-actions button, .resource-actions > *) svg { width: 15px; height: 15px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.asset-page .asset-tabs button.active { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .72), 0 0 24px rgba(52, 205, 232, .32); }
.asset-page .asset-add-actions { width: min(1180px, 100%); min-height: 37px; margin: 10px auto 0; display: flex; align-items: center; justify-content: flex-end; }
.asset-page .asset-add-actions button { border: 0; border-radius: 8px; background: transparent; box-shadow: none; font-size: 13px; }
.asset-page .asset-add-actions button:hover { background: #d1d5db; }
.asset-page .asset-add-actions button svg { stroke-width: 2.4; }
.asset-page [data-asset-panel] { width: min(1180px, 100%); margin: 14px auto 0; padding-bottom: 24px; }
.asset-page .resource-grid { width: 100%; margin: 0; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.asset-page .resource-card {
  height: 100%;
  grid-template-rows: auto 20px minmax(48px, auto) minmax(18px, auto) 34px;
  gap: 9px;
  padding: 10px;
  border-radius: 12px;
  transition: transform .16s ease, border-color .18s ease, box-shadow .18s ease;
}
.asset-page .resource-card:hover { z-index: 2; transform: none; }
.asset-page .resource-card img { aspect-ratio: 16 / 9; object-fit: contain; border-radius: 11px; background: #020617; }
.asset-page .resource-card > strong { min-height: 20px; color: #000; font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
.asset-page .resource-actions { justify-content: center; gap: 8px; }
.asset-page .resource-actions > * { flex: 0 0 34px; width: 34px; min-width: 34px; min-height: 34px; padding: 0; border-radius: 8px; font-size: 0; }
.asset-page .resource-actions > * svg { width: 19px; height: 19px; stroke-width: 2.2; }
.asset-page .resource-actions > * > :is(.asset-download-icon, .asset-rename-icon) { stroke-width: 4; }
.asset-page .asset-card video { border-radius: 11px; }
.asset-page .asset-card > :is(img, video) { transition: transform .18s ease, box-shadow .18s ease; transform-origin: center; }
.asset-page .asset-card > :is(img, video):hover { position: relative; z-index: 3; transform: scale(2.25); box-shadow: 0 18px 44px rgba(15, 23, 42, .34); }
.asset-page .asset-card[data-asset-kind="generatedVideo"] { grid-template-rows: auto 20px minmax(48px, auto) 34px; }
.asset-page .asset-media-preview { width: 100%; aspect-ratio: 16 / 9; display: grid; place-items: center; padding: 14px; border-radius: 11px; background: #020617; }
.asset-page .asset-media-preview audio { width: 100%; }
.asset-page .asset-card-note { color: #aebed3; font-size: 13px; }
.asset-page .asset-card > strong { display: block; width: 100%; min-height: 21px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-page .asset-meta { gap: 5px; font-size: 12px; line-height: 1.45; }
.asset-page .asset-card details { color: #aebed3; font-size: 13px; }
.asset-page .asset-card pre { font-size: 12px; line-height: 1.55; }
.asset-page .library-card { grid-template-rows: auto 20px 34px; }
.asset-prompt-dialog { width: min(680px, calc(100vw - 72px)); }
.asset-prompt-dialog pre { min-height: 180px; max-height: 55vh; margin: 0; padding: 16px; overflow: auto; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; border-radius: 12px; background: var(--surface-soft); }
.asset-prompt-dialog #assetPromptCopy { display: inline-flex; align-items: center; gap: 6px; }
.asset-prompt-dialog #assetPromptCopy svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

@media (max-width: 1180px) and (min-width: 761px) {
  .asset-page .resource-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .app { height: auto; min-height: 100vh; overflow: visible; }
  .side-nav {
    position: static;
    width: 100%;
    padding: 12px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    border: 1px solid rgba(52, 205, 232, .2);
    border-radius: 16px;
  }
  .side-nav-logo { grid-column: 1 / -1; width: min(180px, 70%); margin: 0 auto 8px; }
  .side-nav-item { justify-content: center; margin: 0; }
  .tool-page { height: auto; min-height: calc(100vh - 20px); padding: 10px 0; }
  .tool-page-header, .tool-page-toolbar, .resource-grid, .prompt-page-list { border-radius: 14px; }
  .asset-page { padding: 12px 10px 28px; }
  .asset-page .tool-page-header { height: auto; padding: 18px; }
  .asset-page .asset-page-header { grid-template-columns: 1fr; }
  .asset-page .asset-tabs { height: 54px; grid-template-rows: 42px; margin: 0; }
  .asset-page .asset-tabs button { height: 42px; min-height: 42px; padding: 0 8px; font-size: 13px; }
  .asset-page .asset-add-actions { grid-column: 1; }
  .asset-page .resource-grid { grid-template-columns: 1fr; gap: 12px; }
  .asset-page .resource-card { padding: 10px; }
  .asset-page .resource-card > strong { font-size: 14px; }
}

@media (max-width: 640px) {
  .asset-page .asset-tabs {
    height: auto;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(2, 42px);
  }
}
