:root {
  --bg: #f5f5f7;
  --panel: #fff;
  --text: #17181c;
  --muted: #707783;
  --line: rgba(0, 0, 0, .08);
  --primary: #292d35;
  --primary-2: #456ce0;
  --danger: #ef4444;
  --success: #485a78;
  --shadow: 0 22px 70px rgba(30, 35, 50, .14);
  --glass: #fff;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(85,106,241,.13), transparent 34%),
    linear-gradient(180deg, #fbfcff 0%, var(--bg) 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", Arial, sans-serif;
}
body.template-surface {
  min-height: 100vh;
  padding-bottom: 330px;
  background:
    radial-gradient(circle at 14% -12%, rgba(0,122,255,.18), transparent 30%),
    radial-gradient(circle at 80% 2%, rgba(255,45,85,.12), transparent 24%),
    radial-gradient(circle at 52% 18%, rgba(104,117,137,.10), transparent 26%),
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(242,244,249,.98)),
    #f5f5f7;
}
body.template-surface .topbar {
  display: none;
}
body.template-surface .page {
  width: min(1500px, calc(100% - 80px));
  margin-top: 24px;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button,
.send-btn,
.tool-pill,
.mini-pill,
.pill,
.nav button,
td button,
.row-form button {
  -webkit-tap-highlight-color: transparent;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease, opacity .18s ease;
}
button:active,
.send-btn:active,
.tool-pill:active,
.mini-pill:active,
.pill:active,
td button:active {
  transform: scale(.97);
}
img { max-width: 100%; display: block; }

.topbar {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255,255,255,.78);
  backdrop-filter:none;
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; }
.brand-mark {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}
.nav { display: flex; align-items: center; gap: 18px; font-size: 14px; }
.pill, .nav button {
  border: 0;
  border-radius: 999px;
  padding: 9px 14px;
  color: #fff;
  background: var(--primary);
  cursor: pointer;
}
.notify-button {
  position: relative;
}
.notify-button span,
[data-notify-count] {
  min-width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  margin-left: 6px;
  border-radius: 999px;
  color: #fff;
  background: #ff2d55;
  font-size: 11px;
  font-weight: 900;
}
.notify-panel {
  position: fixed;
  top: 78px;
  right: 24px;
  z-index: 80;
  width: min(360px, calc(100vw - 28px));
  padding: 14px;
  border-radius: 20px;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(255,255,255,.78);
  box-shadow: 0 24px 80px rgba(20,24,35,.18);
  backdrop-filter:none;
  backdrop-filter:none;
}
.notify-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.notify-head button {
  border: 0;
  border-radius: 10px;
  padding: 7px 10px;
  color: var(--primary);
  background: rgba(0,122,255,.09);
  font-weight: 900;
}
.notify-list {
  display: grid;
  gap: 8px;
  max-height: 420px;
  overflow: auto;
}
.notify-item {
  display: grid;
  gap: 4px;
  padding: 11px;
  border-radius: 14px;
  background: #f7f8fb;
  border: 1px solid rgba(0,0,0,.05);
}
.notify-item.unread {
  background: rgba(0,122,255,.07);
  border-color: rgba(0,122,255,.12);
}
.notify-item span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.inline-form { margin: 0; }

.page { width: min(1440px, calc(100% - 40px)); margin: 28px auto 70px; }
.panel {
  background: var(--panel);
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter:none;
  backdrop-filter:none;
}
.studio { display: grid; grid-template-columns: 410px 1fr; gap: 24px; align-items: start; }
.composer { padding: 22px; position: sticky; top: 88px; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.tabs button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 7px 11px;
  color: var(--muted);
}
.tabs .active { color: #fff; background: var(--primary); border-color: var(--primary); }
h1, h2, h3 { margin: 0; letter-spacing: 0; }
h1 { font-size: 30px; }
h2 { font-size: 23px; }
h3 { font-size: 16px; }
.muted, .section-head p { color: var(--muted); line-height: 1.65; }
.generate-form textarea, .stack-form input, .stack-form textarea, .stack-form select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  outline: none;
  background: #fff;
}
.generate-form textarea:focus, .stack-form input:focus, .stack-form textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(85,106,241,.13);
}
.ratio-row { display: flex; flex-wrap: wrap; gap: 9px; margin: 14px 0; }
.ratio-row label, .check-line {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  color: var(--muted);
}
.send-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 48px;
  border: 0;
  border-radius: 16px;
  padding: 0 22px;
  color: #fff;
  background: linear-gradient(135deg, #007aff, #5856d6);
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(0,122,255,.24);
}
.generate-form .send-btn { width: 100%; }
.link-btn { margin-top: 8px; }
.ghost { background: #151923; }

.template-panel, .gallery-block { min-width: 0; }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 16px;
}
.section-head a { color: var(--primary); font-weight: 700; }
.template-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.template-grid.large { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.template-card {
  overflow: hidden;
  min-height: 260px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
}
.template-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.template-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #e8ebf4; }
.template-card h3, .template-card p { padding: 0 14px; }
.template-card h3 { margin-top: 13px; }
.template-card p { color: var(--muted); font-size: 13px; line-height: 1.55; }
.template-library-card {
  cursor: default;
}
.template-library-card .prompt-preview {
  display: -webkit-box;
  min-height: 62px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}
.template-library-card.expanded .prompt-preview {
  display: block;
  min-height: 0;
  overflow: visible;
}
.template-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 14px 14px;
}
.template-card-actions .mini-pill {
  min-height: 34px;
  padding: 0 11px;
  border-radius: 11px;
  font-size: 13px;
  white-space: nowrap;
}
.prompt-toggle {
  cursor: pointer;
}
.gallery-block { margin-top: 34px; }
.image-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.image-card {
  padding: 10px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--line);
}
.image-card img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 12px; }
.image-card strong, .image-card span { display: block; padding: 8px 4px 0; }
.image-card span { color: var(--muted); font-size: 13px; }
.image-card small {
  display: block;
  padding: 6px 4px 0;
  color: var(--primary);
  line-height: 1.45;
}
.image-card-pending {
  cursor: default;
}
.image-placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  border-radius: 12px;
  color: #182033;
  background:
    radial-gradient(circle at 28% 22%, rgba(0,122,255,.18), transparent 34%),
    linear-gradient(145deg, rgba(255,255,255,.88), rgba(237,241,248,.92));
  border: 1px solid rgba(0,0,0,.06);
}
.image-placeholder b {
  font-size: 18px;
}
.image-placeholder em {
  color: var(--muted);
  font-style: normal;
  font-size: 13px;
}
.loader-dot {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(0,122,255,.16);
  border-top-color: var(--primary);
  animation: spin .9s linear infinite;
}
.image-card.failed .image-placeholder {
  background: #fff1f2;
  color: var(--danger);
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.auth-card { width: min(460px, 100%); margin: 70px auto; padding: 28px; }
.stack-form { display: grid; gap: 14px; }
.stack-form label { display: grid; gap: 7px; color: var(--muted); }
.flash { margin-bottom: 14px; padding: 12px 14px; border-radius: 12px; background: #eef2ff; color: var(--primary); }
.flash.error { background: #fef2f2; color: var(--danger); }
.flash.success { background: #f5f4f0; color: var(--success); }
.wallet-layout, .detail-layout { display: grid; grid-template-columns: 380px 1fr; gap: 22px; align-items: start; }
.wallet-layout .panel, .detail-layout .panel { padding: 24px; }
.balance { font-size: 66px; font-weight: 900; color: var(--primary); }
.invite-box {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}
.package-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.package-grid label {
  min-height: 82px;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255,255,255,.78);
  cursor: pointer;
}
.package-grid input {
  display: none;
}
.package-grid strong,
.package-grid span {
  display: block;
}
.package-grid strong {
  font-size: 18px;
  color: #111827;
}
.package-grid span {
  margin-top: 5px;
  color: var(--primary);
  font-weight: 900;
}
.package-grid label:has(input:checked) {
  color: #fff;
  background: linear-gradient(135deg, #007aff, #5856d6);
}
.package-grid label:has(input:checked) strong,
.package-grid label:has(input:checked) span {
  color: #fff;
}
.mini-list {
  margin-top: 16px;
}
.mini-list h3 {
  margin-bottom: 8px;
}
.mini-list p {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.mini-list p span {
  color: var(--muted);
}
.invite-box label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 800;
}
.invite-box input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: #fff;
  color: #111827;
}
.invite-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.invite-stats div {
  padding: 14px;
  border-radius: 16px;
  background: rgba(0,122,255,.07);
  border: 1px solid rgba(0,122,255,.12);
}
.invite-stats strong {
  display: block;
  font-size: 28px;
  color: var(--primary);
}
.invite-stats span {
  color: var(--muted);
  font-size: 13px;
}
.member-plan-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.member-plan-grid article {
  padding: 14px;
  border-radius: 16px;
  background: rgba(0,122,255,.06);
  border: 1px solid rgba(0,122,255,.12);
}
.member-plan-grid strong {
  display: block;
  margin-bottom: 6px;
}
.member-plan-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}
.redeem-box {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(104,117,137,.08);
  border: 1px solid rgba(104,117,137,.18);
}
.redeem-box label {
  display: grid;
  gap: 7px;
  color: #343c4c;
  font-weight: 900;
}
.redeem-box input {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(104,117,137,.20);
  border-radius: 14px;
  padding: 0 13px;
  background: #fff;
  text-transform: uppercase;
}
.detail-image { width: 100%; border-radius: 18px; box-shadow: var(--shadow); background: #fff; }
.prompt-box { padding: 14px; border-radius: 14px; background: #f5f7fb; line-height: 1.8; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-size: 13px; }

.admin-body { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.admin-side {
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(22,25,32,.96), rgba(10,12,18,.98)),
    #151923;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.admin-side .brand {
  margin-bottom: 18px;
}
.admin-nav-group {
  margin: 14px 8px 4px;
  color: rgba(255,255,255,.46);
  font-size: 12px;
  font-weight: 900;
}
.admin-side a {
  padding: 12px 13px;
  border-radius: 14px;
  color: rgba(255,255,255,.86);
  font-weight: 800;
  transition: background .18s ease, transform .18s ease;
}
.admin-side a:hover { background: rgba(255,255,255,.1); transform: translateX(2px); }
.admin-main { padding: 30px; min-width: 0; }
.admin-head { margin-bottom: 20px; }
.admin-sync-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
}
.admin-sync-head h2 {
  margin: 0 0 6px;
}
.admin-sync-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}
.sync-stats {
  display: grid;
  grid-template-columns: auto auto;
  gap: 4px 10px;
  align-items: baseline;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255,255,255,.72);
  border: 1px solid var(--line);
}
.sync-stats strong {
  font-size: 24px;
}
.sync-stats span {
  color: var(--muted);
  font-size: 12px;
}
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; }
.stat { padding: 24px; border-radius: 24px; background: rgba(255,255,255,.78); box-shadow: var(--shadow); border: 1px solid rgba(255,255,255,.8); }
.stat strong { display: block; font-size: 38px; color: var(--primary); }
.stat span { color: var(--muted); }
.wide-form { padding: 22px; margin-bottom: 22px; }
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.settings-card {
  padding: 22px;
  display: grid;
  gap: 14px;
  align-content: start;
}
.settings-card h2 {
  font-size: 20px;
}
.settings-card p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.6;
}
.settings-card label {
  display: grid;
  gap: 7px;
  color: #4f5663;
  font-weight: 800;
}
.settings-card input,
.settings-card select,
.settings-card textarea {
  width: 100%;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 14px;
  padding: 12px 13px;
  background: rgba(255,255,255,.86);
  outline: none;
}
.settings-inline {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.callback-preview {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(0,122,255,.06);
  border: 1px solid rgba(0,122,255,.12);
}
.callback-preview span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}
.callback-preview code {
  overflow-wrap: anywhere;
  font-size: 12px;
  color: #0f172a;
}
.settings-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
}
.table-wrap { padding: 14px; overflow: auto; }
.row-form { display: flex; gap: 8px; align-items: center; margin: 0; }
.vertical-row {
  display: grid;
  align-items: stretch;
}
.row-form input[type="number"] { width: 110px; }
.row-form input,
.row-form textarea,
.table-wrap input,
.table-wrap textarea {
  max-width: 160px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.table-wrap textarea {
  min-width: 260px;
  max-width: 420px;
}
.row-form button, td button {
  border: 0;
  border-radius: 12px;
  padding: 9px 13px;
  background: rgba(0,122,255,.11);
  color: #006ee6;
  font-weight: 900;
  cursor: pointer;
}
.thumb { width: 72px; height: 54px; object-fit: cover; border-radius: 10px; background: #eef0f5; }
.video-thumb { display: block; }
.template-meta {
  display: block;
  padding: 8px 14px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.template-filter {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(140px, 220px) auto;
  gap: 10px;
  margin: 0 0 20px;
  padding: 10px;
  border-radius: 20px;
  background: rgba(255,255,255,.62);
  border: 1px solid rgba(255,255,255,.82);
  box-shadow: 0 12px 36px rgba(20,24,35,.07);
}
.inline-filter {
  margin-bottom: 18px;
  background: #f7f8fb;
  border-color: var(--line);
  box-shadow: none;
}
.template-filter input,
.template-filter select {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 13px;
  min-height: 40px;
  background: #fff;
  outline: none;
}
.table-wrap code {
  overflow-wrap: anywhere;
}
.install-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }

.template-home {
  padding: 0 0 18px;
}
.site-notice {
  margin: 0 0 16px;
  padding: 13px 16px;
  border-radius: 18px;
  color: #0f172a;
  font-weight: 800;
  background: linear-gradient(135deg, rgba(255,204,0,.18), rgba(0,122,255,.10));
  border: 1px solid rgba(255,255,255,.75);
  box-shadow: 0 12px 30px rgba(20,24,35,.07);
}
.template-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin: 4px 0 30px;
  padding: 14px 16px;
  border: 1px solid rgba(255,255,255,.78);
  border-radius: 28px;
  background: rgba(255,255,255,.54);
  box-shadow: 0 18px 46px rgba(20,24,35,.08), inset 0 1px 0 rgba(255,255,255,.9);
  backdrop-filter:none;
  backdrop-filter:none;
}
.template-toolbar h1 {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 40px;
  font-weight: 900;
  color: #101114;
}
.title-mark {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 50%, rgba(255,255,255,.96) 0 12%, transparent 13%),
    conic-gradient(from 0deg, #007aff, #687589, #ffcc00, #ff2d55, #5856d6, #007aff);
  box-shadow: 0 16px 32px rgba(0,122,255,.22), inset 0 1px 0 rgba(255,255,255,.72);
  animation: titleMarkFloat 3.6s ease-in-out infinite;
}
.title-mark:before {
  content: "";
  position: absolute;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.86);
  border-left-color: transparent;
  border-bottom-color: rgba(255,255,255,.28);
  animation: titleMarkSpin 2.4s linear infinite;
}
.title-mark:after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  box-shadow:
    16px 0 0 rgba(255,255,255,.62),
    -12px 11px 0 rgba(255,255,255,.50),
    4px -15px 0 rgba(255,255,255,.70);
  animation: titleMarkSpark 1.8s ease-in-out infinite alternate;
}
@keyframes titleMarkSpin {
  to { transform: rotate(360deg); }
}
@keyframes titleMarkFloat {
  0%, 100% { transform: translateY(0) scale(1); filter: saturate(1); }
  50% { transform: translateY(-2px) scale(1.04); filter: saturate(1.18); }
}
@keyframes titleMarkSpark {
  from { transform: rotate(0deg) scale(.82); opacity: .72; }
  to { transform: rotate(28deg) scale(1.04); opacity: 1; }
}
.template-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}
.tool-pill,
.template-actions button {
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,.78);
  border-radius: 15px;
  padding: 0 15px;
  background: linear-gradient(180deg, rgba(255,255,255,.88), rgba(255,255,255,.64));
  color: #17191f;
  font-weight: 800;
  box-shadow: 0 10px 28px rgba(20,24,35,.07), inset 0 1px 0 rgba(255,255,255,.95);
  backdrop-filter:none;
  backdrop-filter:none;
  cursor: pointer;
}
.tool-pill:hover,
.template-actions button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(20,24,35,.12), inset 0 1px 0 rgba(255,255,255,.95);
}
.active-pill {
  color: #fff;
  background: linear-gradient(135deg, #111827, #2f3645);
  border-color: rgba(17,24,39,.08);
}
.creation-mode-switch {
  width: min(520px, 100%);
  margin: -6px auto 26px;
  padding: 7px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  border-radius: 24px;
  background: rgba(255,255,255,.62);
  border: 1px solid rgba(255,255,255,.82);
  box-shadow: 0 18px 44px rgba(20,24,35,.08), inset 0 1px 0 rgba(255,255,255,.9);
  backdrop-filter:none;
  backdrop-filter:none;
}
.creation-mode-switch a {
  min-height: 62px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-radius: 18px;
  color: #5c6472;
  text-align: center;
  font-weight: 900;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
}
.creation-mode-switch a:hover {
  transform: translateY(-1px);
  color: #17191f;
}
.creation-mode-switch a.active {
  color: #fff;
  background:
    radial-gradient(circle at 20% 0%, rgba(255,255,255,.34), transparent 34%),
    linear-gradient(135deg, #111827, #3b4252);
  box-shadow: 0 14px 30px rgba(17,24,39,.22), inset 0 1px 0 rgba(255,255,255,.2);
}
.creation-mode-switch span {
  font-size: 16px;
  line-height: 1.1;
}
.creation-mode-switch small {
  font-size: 12px;
  color: inherit;
  opacity: .72;
}
.masonry-grid {
  column-count: 5;
  column-gap: 20px;
  perspective: 1200px;
}
.video-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.video-template-card {
  overflow: hidden;
  border-radius: 28px;
  background: rgba(255,255,255,.78);
  border: 1px solid rgba(255,255,255,.82);
  box-shadow: 0 14px 38px rgba(20,24,35,.10);
  cursor: pointer;
}
.video-template-card video,
.video-record video {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #111827;
}
.video-template-card h3,
.video-template-card p {
  padding: 0 16px;
}
.video-template-card h3 {
  margin-top: 14px;
}
.video-template-card p {
  color: var(--muted);
  line-height: 1.55;
  font-size: 13px;
}
.load-more-wrap {
  display: flex;
  justify-content: center;
  padding: 26px 0 8px;
}
.load-more-videos {
  min-width: 190px;
}
.load-more-videos:disabled {
  opacity: .65;
  cursor: wait;
  transform: none;
}
.masonry-card {
  position: relative;
  overflow: hidden;
  display: inline-block;
  width: 100%;
  margin: 0 0 20px;
  border-radius: 32px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.7), rgba(255,255,255,.18)),
    #e9ebef;
  cursor: pointer;
  isolation: isolate;
  box-shadow: 0 12px 34px rgba(20,24,35,.08), inset 0 1px 0 rgba(255,255,255,.5);
  transform: translateZ(0);
  transition: transform .24s ease, box-shadow .24s ease, filter .24s ease;
}
.masonry-card.span-1 { aspect-ratio: 1 / 1.23; }
.masonry-card.span-2 { aspect-ratio: 1 / .97; }
.masonry-card.span-3 { aspect-ratio: 1 / 1.34; }
.masonry-card.span-4 { aspect-ratio: 1 / 1.04; }
.masonry-card.span-5 { aspect-ratio: 1 / 1.18; }
.masonry-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .28s ease;
}
.masonry-card:hover {
  transform: translateY(-6px) rotateX(.8deg);
  box-shadow: 0 24px 58px rgba(20,24,35,.15);
}
.masonry-card:hover img {
  transform: scale(1.035);
}
.card-shade {
  position: absolute;
  inset: auto 0 0;
  height: 45%;
  z-index: 1;
  background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,.18) 32%, rgba(0,0,0,.68) 100%);
}
.masonry-card h3 {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 20px;
  z-index: 2;
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  text-shadow: 0 2px 16px rgba(0,0,0,.45);
}
.composer-dock {
  position: fixed;
  left: max(18px, calc((100vw - 1500px) / 2 + 18px));
  right: max(18px, calc((100vw - 1500px) / 2 + 18px));
  bottom: 18px;
  z-index: 30;
  margin: 0;
  padding: 16px;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 18px;
  border-radius: 30px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.90), rgba(248,250,255,.78)),
    radial-gradient(circle at 6% 0%, rgba(0,122,255,.10), transparent 24%);
  border: 1px solid rgba(255,255,255,.82);
  box-shadow: 0 26px 86px rgba(20,24,35,.18), inset 0 1px 0 rgba(255,255,255,.9);
  max-height: min(56vh, 520px);
  overflow: auto;
  backdrop-filter:none;
  backdrop-filter:none;
}
.composer-dock .generate-form {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 12px;
  align-items: start;
  grid-column: 2;
  grid-row: 1 / span 2;
}
.composer-mode-tabs {
  grid-column: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  padding: 5px;
  border-radius: 18px;
  background: rgba(17,24,39,.06);
  border: 1px solid rgba(17,24,39,.06);
}
.composer-mode-tabs a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  color: #596170;
  font-weight: 900;
  font-size: 13px;
}
.composer-mode-tabs a.active {
  color: #fff;
  background: linear-gradient(135deg, #111827, #343b4a);
  box-shadow: 0 10px 22px rgba(17,24,39,.16);
}
.composer-title {
  grid-column: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}
.composer-title > div {
  min-width: 0;
  flex: 1;
}
.composer-title h2 {
  font-size: 20px;
}
.composer-title p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 13px;
}
.composer-orb {
  width: 46px;
  height: 46px;
  border-radius: 17px;
  background:
    radial-gradient(circle at 30% 18%, rgba(255,255,255,.74), transparent 26%),
    conic-gradient(from 180deg, #007aff, #687589, #ffcc00, #ff2d55, #5856d6, #007aff);
  box-shadow: 0 14px 30px rgba(0,122,255,.27);
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 13px;
  font-weight: 1000;
  letter-spacing: 0;
  position: relative;
  overflow: hidden;
  animation: composerOrbGlow 4.8s ease-in-out infinite;
}
.composer-orb:before {
  content: "AI";
  position: relative;
  z-index: 1;
}
.composer-orb:after {
  content: "";
  position: absolute;
  inset: auto;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.34);
  border-right-color: transparent;
  animation: titleMarkSpin 5.2s linear infinite;
}
@keyframes composerOrbGlow {
  0%, 100% { filter: saturate(1); }
  50% { filter: saturate(1.2) brightness(1.03); }
}
.composer-toggle {
  display: none;
  min-height: 36px;
  border: 0;
  border-radius: 13px;
  padding: 0 13px;
  color: #fff;
  background: #111827;
  font-weight: 900;
  cursor: pointer;
}
.composer-pulse {
  animation: composerPulse .65s ease;
}
@keyframes composerPulse {
  0%, 100% { transform: translateY(0) scale(1); }
  45% { transform: translateY(-4px) scale(1.01); }
}
.control-block {
  display: grid;
  gap: 8px;
  grid-column: 1 / -1;
}
.control-block strong {
  font-size: 14px;
}
.ratio-row label {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 999px;
  background: rgba(255,255,255,.72);
  color: #30333a;
  font-weight: 700;
  cursor: pointer;
}
.ratio-row input,
.segmented input {
  display: none;
}
.ratio-row label:has(input:checked) {
  color: #fff;
  background: #111827;
  border-color: #111827;
}
.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  min-width: 300px;
  border-radius: 16px;
  background: rgba(118,118,128,.12);
}
.segmented label {
  min-height: 40px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: #555b66;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}
.segmented input:checked + span {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  color: #111;
  background: rgba(255,255,255,.96);
  box-shadow: 0 5px 14px rgba(0,0,0,.12);
}
.quick-controls {
  display: flex;
  align-items: stretch;
  gap: 10px;
}
.quick-controls .send-btn {
  width: auto;
  white-space: nowrap;
}
.reference-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  grid-column: 1 / -1;
}
.reference-grid label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}
.reference-grid input,
.reference-grid textarea,
.generate-form textarea {
  width: 100%;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255,255,255,.82);
  outline: none;
}
.reference-grid input[type="file"] {
  padding: 8px;
  color: #5b6472;
  cursor: pointer;
}
.reference-grid input[type="file"]::file-selector-button {
  margin-right: 10px;
  border: 0;
  border-radius: 12px;
  padding: 9px 13px;
  color: #fff;
  background: linear-gradient(135deg, #111827, #2f3645);
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(17,24,39,.18);
}
.reference-grid input[type="file"]::-webkit-file-upload-button {
  margin-right: 10px;
  border: 0;
  border-radius: 12px;
  padding: 9px 13px;
  color: #fff;
  background: linear-gradient(135deg, #111827, #2f3645);
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(17,24,39,.18);
}
.reference-grid input[type="file"]:hover::file-selector-button {
  background: linear-gradient(135deg, #007aff, #5856d6);
}
.generate-form > textarea {
  min-height: 96px;
  resize: vertical;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.72);
}
.generate-form textarea:focus,
.reference-grid input:focus,
.reference-grid textarea:focus {
  border-color: rgba(0,122,255,.42);
  box-shadow: 0 0 0 4px rgba(0,122,255,.10), inset 0 1px 0 rgba(255,255,255,.72);
}
.advanced-panel {
  grid-column: 1 / -1;
  border-radius: 18px;
  background: rgba(255,255,255,.52);
  border: 1px solid rgba(255,255,255,.72);
  padding: 10px 12px;
}
.advanced-panel summary {
  cursor: pointer;
  font-weight: 900;
  color: #20232a;
  list-style: none;
}
.advanced-panel summary::-webkit-details-marker {
  display: none;
}
.advanced-panel summary:after {
  content: "展开";
  float: right;
  color: var(--primary);
}
.advanced-panel[open] summary:after {
  content: "收起";
}
.records-page {
  padding: 24px;
}
.mini-pill {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--primary);
  font-weight: 800;
}
.plus { color: var(--success); font-weight: 800; }
.minus { color: var(--danger); font-weight: 800; }
.guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.guide-grid article {
  padding: 18px;
  border-radius: 16px;
  background: #f8f9fc;
  border: 1px solid var(--line);
}
.guide-grid p {
  color: var(--muted);
  line-height: 1.7;
}

@media (max-width: 1300px) {
  .masonry-grid { column-count: 4; }
}
@media (max-width: 1000px) {
  .studio, .wallet-layout, .detail-layout { grid-template-columns: 1fr; }
  .composer { position: static; }
  .template-grid, .template-grid.large, .image-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  body.template-surface .page { width: min(100% - 36px, 1440px); }
  .masonry-grid { column-count: 3; }
  .video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .composer-dock {
    left: 14px;
    right: 14px;
    bottom: 14px;
    grid-template-columns: 1fr;
  }
  .composer-dock .generate-form { grid-template-columns: 1fr; }
  .composer-title,
  .composer-mode-tabs,
  .composer-dock .generate-form {
    grid-column: auto;
    grid-row: auto;
  }
  .quick-controls { justify-content: space-between; }
  .segmented {
    min-width: 0;
    width: 100%;
  }
  .settings-grid { grid-template-columns: 1fr; }
  .settings-actions { justify-content: stretch; }
  .settings-actions .send-btn { width: 100%; }
  .template-toolbar { align-items: flex-start; flex-direction: column; margin-bottom: 22px; }
  .template-toolbar h1 { white-space: nowrap; }
  .template-actions { justify-content: flex-start; }
  .creation-mode-switch { margin-top: 0; }
}
@media (max-width: 760px) {
  .masonry-grid { column-count: 2; }
}
@media (max-width: 700px) {
  .topbar { padding: 0 16px; height: auto; min-height: 64px; flex-wrap: wrap; gap: 10px; }
  .nav { gap: 9px; flex-wrap: wrap; padding-bottom: 10px; }
  .page { width: min(100% - 22px, 1440px); margin-top: 16px; }
  .template-grid, .template-grid.large, .image-grid, .stat-grid { grid-template-columns: 1fr; }
  .admin-body { grid-template-columns: 1fr; }
  .admin-sync-head { grid-template-columns: 1fr; }
  .admin-side { position: static; padding: 14px; }
  .admin-side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-side .brand, .admin-nav-group { grid-column: 1 / -1; }
  .admin-main { padding: 16px; }
  body.template-surface .page { width: min(100% - 22px, 1440px); }
  .template-toolbar {
    gap: 12px;
    margin: 0 0 14px;
    padding: 12px;
    overflow: hidden;
    border-radius: 24px;
    background:
      linear-gradient(180deg, rgba(255,255,255,.72), rgba(255,255,255,.44)),
      radial-gradient(circle at 12% 0%, rgba(0,122,255,.16), transparent 36%);
  }
  .template-toolbar h1 {
    width: 100%;
    gap: 10px;
    font-size: 26px;
    line-height: 1.12;
  }
  .title-mark {
    width: 34px;
    height: 34px;
    border-radius: 13px;
  }
  .title-mark:before {
    width: 23px;
    height: 23px;
  }
  .template-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 8px;
    margin: 0;
    padding: 1px 22px 6px 1px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 26px), transparent 100%);
    -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 26px), transparent 100%);
  }
  .template-actions::-webkit-scrollbar {
    display: none;
  }
  .template-actions .inline-form {
    flex: 0 0 auto;
  }
  .tool-pill, .template-actions button {
    height: 34px;
    flex: 0 0 auto;
    scroll-snap-align: start;
    padding: 0 12px;
    border-radius: 13px;
    font-size: 13px;
    box-shadow: 0 8px 18px rgba(20,24,35,.06), inset 0 1px 0 rgba(255,255,255,.95);
  }
  .creation-mode-switch {
    margin-bottom: 18px;
    border-radius: 20px;
    padding: 5px;
  }
  .creation-mode-switch a {
    min-height: 54px;
    border-radius: 15px;
  }
  .creation-mode-switch span { font-size: 14px; }
  .creation-mode-switch small { font-size: 11px; }
  .masonry-grid { column-count: 1; }
  .video-grid { grid-template-columns: 1fr; }
  .masonry-card { border-radius: 22px; }
  .template-library-card .prompt-preview {
    min-height: 0;
    -webkit-line-clamp: 3;
  }
  .template-card-actions {
    flex-wrap: wrap;
  }
  .template-card-actions .mini-pill {
    flex: 1;
    justify-content: center;
  }
  .reference-grid, .guide-grid { grid-template-columns: 1fr; }
  .package-grid { grid-template-columns: 1fr; }
  .member-plan-grid { grid-template-columns: 1fr; }
  .settings-inline { grid-template-columns: 1fr; }
  .template-filter { grid-template-columns: 1fr; }
  body.template-surface { padding-bottom: 118px; }
  .composer-dock {
    left: 8px;
    right: 8px;
    bottom: 8px;
    padding: 10px;
    border-radius: 22px;
    max-height: calc(100vh - 22px);
    grid-template-columns: 1fr;
    gap: 10px;
  }
  body.template-surface.composer-expanded,
  body.template-surface:has(.composer-dock.composer-open) {
    padding-bottom: 390px;
  }
  .composer-dock:not(.composer-open) .generate-form {
    display: none;
  }
  .composer-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
  }
  .composer-dock.composer-open .composer-toggle {
    background: rgba(17,24,39,.12);
    color: #111827;
  }
  .composer-title h2 { font-size: 18px; }
  .composer-title p { display: none; }
  .composer-orb {
    width: 38px;
    height: 38px;
    border-radius: 14px;
  }
  .quick-controls { flex-direction: column; }
  .quick-controls .send-btn, .send-btn { width: 100%; }
}
@media (max-width: 560px) {
  .masonry-grid { column-count: 1; }
}

/* Polished admin console */
body.admin-body {
  grid-template-columns: 270px minmax(0, 1fr);
  min-height: 100dvh;
  background:
    radial-gradient(circle at 8% -6%, rgba(0,122,255,.14), transparent 30%),
    radial-gradient(circle at 84% 8%, rgba(104,117,137,.10), transparent 24%),
    linear-gradient(180deg, #fbfcff 0%, #f2f4f8 100%);
}
.admin-side {
  position: sticky;
  top: 0;
  height: 100dvh;
  padding: 22px 16px;
  gap: 6px;
  overflow: auto;
  background:
    radial-gradient(circle at 0 0, rgba(0,122,255,.26), transparent 34%),
    linear-gradient(180deg, #141821, #0c1018 78%);
  box-shadow: 18px 0 50px rgba(20,24,35,.13);
}
.admin-brand {
  padding: 8px 10px;
  margin: 0 0 4px;
  font-size: 18px;
}
.admin-side-note {
  margin: 0 8px 14px;
  color: rgba(255,255,255,.56);
  font-size: 13px;
  line-height: 1.6;
}
.admin-nav-group {
  margin: 18px 10px 6px;
  letter-spacing: 0;
  text-transform: none;
}
.admin-side a:not(.brand) {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 12px 0 14px;
  border: 1px solid transparent;
  border-radius: 16px;
}
.admin-side a em {
  min-width: 34px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.62);
  font-style: normal;
  font-size: 12px;
}
.admin-side a.active,
.admin-side a:not(.brand):hover {
  background: rgba(255,255,255,.13);
  border-color: rgba(255,255,255,.14);
  color: #fff;
  transform: translateX(2px);
}
.admin-side a.active em {
  background: #fff;
  color: #0f172a;
}
.admin-main {
  padding: 22px;
}
.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 9;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: -22px -22px 22px;
  padding: 14px 24px;
  background: rgba(255,255,255,.76);
  border-bottom: 1px solid rgba(0,0,0,.06);
  backdrop-filter:none;
  backdrop-filter:none;
}
.admin-topbar strong {
  display: block;
  margin-top: 2px;
  font-size: 20px;
}
.admin-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mini-pill.primary {
  color: #fff;
  border-color: rgba(0,122,255,.18);
  background: linear-gradient(135deg, #007aff, #5856d6);
  box-shadow: 0 12px 24px rgba(0,122,255,.18);
}
.admin-content {
  max-width: 1480px;
  margin: 0 auto;
}
.admin-head {
  display: grid;
  gap: 7px;
  margin: 0 0 20px;
}
.admin-head h1 {
  margin: 0;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.08;
}
.admin-head p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}
.admin-kicker {
  color: #007aff;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}
.admin-metric-hero {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.admin-metric-hero article {
  min-height: 154px;
  display: grid;
  align-content: space-between;
  padding: 22px;
  border-radius: 26px;
  color: #fff;
  background:
    radial-gradient(circle at 12% 10%, rgba(255,255,255,.28), transparent 26%),
    linear-gradient(135deg, #111827, #2f3645);
  box-shadow: 0 24px 58px rgba(20,24,35,.18);
}
.admin-metric-hero article:nth-child(2) {
  background:
    radial-gradient(circle at 12% 10%, rgba(255,255,255,.28), transparent 26%),
    linear-gradient(135deg, #006ee6, #687589);
}
.admin-metric-hero article:nth-child(3) {
  background:
    radial-gradient(circle at 12% 10%, rgba(255,255,255,.25), transparent 26%),
    linear-gradient(135deg, #5856d6, #ff2d55);
}
.admin-metric-hero span,
.admin-metric-hero em {
  color: rgba(255,255,255,.76);
  font-style: normal;
  font-weight: 800;
}
.admin-metric-hero strong {
  font-size: clamp(36px, 5vw, 58px);
  line-height: 1;
}
.admin-stat-grid {
  margin-bottom: 18px;
}
.stat {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  background: rgba(255,255,255,.82);
  border: 1px solid rgba(255,255,255,.9);
  box-shadow: 0 18px 46px rgba(20,24,35,.09);
}
.stat:after {
  content: "";
  position: absolute;
  inset: auto 18px 14px auto;
  width: 42px;
  height: 42px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(0,122,255,.16), rgba(104,117,137,.16));
}
.stat span {
  display: block;
  margin-bottom: 8px;
  color: #596170;
  font-weight: 900;
}
.stat strong {
  color: #111827;
  font-variant-numeric: tabular-nums;
}
.stat em {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-style: normal;
  font-size: 13px;
}
.settings-grid {
  align-items: start;
}
.settings-card {
  border-radius: 24px;
  background: rgba(255,255,255,.84);
  border: 1px solid rgba(255,255,255,.9);
  box-shadow: 0 16px 42px rgba(20,24,35,.08);
}
.settings-card h2,
.table-title h2,
.wide-form h2 {
  margin: 0;
  color: #111827;
}
.settings-card label {
  color: #303846;
}
.settings-card input,
.settings-card select,
.settings-card textarea,
.table-wrap input,
.table-wrap select,
.table-wrap textarea,
.row-form input,
.row-form select,
.row-form textarea {
  min-height: 40px;
  border-color: rgba(15,23,42,.10);
  background: rgba(255,255,255,.92);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.78);
}
.settings-card input:focus,
.settings-card select:focus,
.settings-card textarea:focus,
.table-wrap input:focus,
.table-wrap select:focus,
.table-wrap textarea:focus {
  border-color: rgba(0,122,255,.42);
  box-shadow: 0 0 0 4px rgba(0,122,255,.10);
}
.settings-actions {
  position: sticky;
  bottom: 14px;
  z-index: 8;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border-radius: 22px;
  background: rgba(255,255,255,.82);
  border: 1px solid rgba(255,255,255,.92);
  box-shadow: 0 20px 54px rgba(20,24,35,.15);
  backdrop-filter:none;
  backdrop-filter:none;
}
.settings-actions span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.table-wrap {
  border-radius: 24px;
  background: rgba(255,255,255,.86);
  border: 1px solid rgba(255,255,255,.92);
  box-shadow: 0 18px 50px rgba(20,24,35,.08);
}
.table-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 8px 16px;
}
.table-title p {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.5;
}
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
th {
  position: sticky;
  top: 72px;
  z-index: 2;
  padding: 12px;
  background: #f5f7fb;
  color: #5f6876;
  text-align: left;
  font-size: 12px;
  font-weight: 900;
}
td {
  padding: 12px;
  border-top: 1px solid rgba(15,23,42,.07);
  vertical-align: middle;
  color: #252b36;
}
tr:hover td {
  background: rgba(0,122,255,.035);
}
.status-badge {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(0,122,255,.10);
  color: #006ee6;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}
.status-badge.success {
  background: rgba(72,90,120,.12);
  color: #343c4c;
}
.status-badge.warn {
  background: rgba(245,158,11,.14);
  color: #a15c00;
}
.status-badge.danger {
  background: rgba(239,68,68,.12);
  color: #c51f1f;
}
.status-badge.hot {
  background: rgba(88,86,214,.13);
  color: #4d49c8;
}
.admin-action-btn,
.row-form button.admin-action-btn,
td button.admin-action-btn {
  min-height: 36px;
  border: 0;
  border-radius: 12px;
  padding: 0 13px;
  background: linear-gradient(135deg, #007aff, #4f8dff);
  color: #fff;
  box-shadow: 0 10px 22px rgba(0,122,255,.18);
}
.admin-action-btn.danger,
td button.admin-action-btn.danger {
  background: rgba(239,68,68,.10);
  color: #c51f1f;
  box-shadow: none;
}
.admin-filter {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(2, minmax(150px, 220px)) auto auto;
  gap: 10px;
  align-items: center;
  margin: 0 0 16px;
  padding: 12px;
  border-radius: 22px;
}
.admin-filter input,
.admin-filter select,
.bulk-actions input,
.bulk-actions select {
  min-height: 40px;
  min-width: 0;
  border: 1px solid rgba(15,23,42,.10);
  border-radius: 13px;
  padding: 0 12px;
  background: rgba(255,255,255,.92);
}
.bulk-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.bulk-actions input {
  width: 120px;
}
.pager {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 16px 8px 4px;
}
.pager a {
  min-width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
  color: #4b5563;
  font-weight: 900;
}
.pager a.active {
  background: #111827;
  color: #fff;
}
.reason-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 16px;
  padding: 14px;
  border-radius: 22px;
}
.reason-strip strong {
  margin-right: 4px;
}
.admin-subrow td {
  background: rgba(0,122,255,.035);
  border-top: 0;
}
.grant-form {
  flex-wrap: wrap;
}
.grant-form input[name="remark"] {
  max-width: 320px;
}
.thumb {
  width: 86px;
  height: 62px;
  border-radius: 14px;
}
.video-thumb {
  width: 96px;
  height: 64px;
}
.check-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.check-line input {
  width: 16px;
  height: 16px;
  min-height: 0;
  accent-color: #007aff;
}
code {
  padding: 3px 6px;
  border-radius: 8px;
  background: rgba(15,23,42,.06);
  color: #1f2937;
}
.announcement-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(15,23,42,.30);
  backdrop-filter:none;
  backdrop-filter:none;
}
.announcement-modal[hidden] {
  display: none;
}
.announcement-card {
  position: relative;
  width: min(480px, 100%);
  padding: 26px;
  border-radius: 28px;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(255,255,255,.96);
  box-shadow: 0 30px 90px rgba(15,23,42,.25);
}
.announcement-card h2 {
  margin: 8px 0 10px;
  font-size: 28px;
}
.announcement-card p {
  color: #4b5563;
  line-height: 1.8;
}
.announcement-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(17,24,39,.08);
  cursor: pointer;
}
.reference-preview-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 10px;
  margin: 10px 0 18px;
}
.reference-preview-row img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 14px;
  background: #eef0f5;
}

@media (max-width: 1100px) {
  body.admin-body {
    grid-template-columns: 1fr;
  }
  .admin-side {
    position: static;
    height: auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 14px;
    border-radius: 0 0 26px 26px;
  }
  .admin-brand,
  .admin-side-note,
  .admin-nav-group {
    grid-column: 1 / -1;
  }
  .admin-main {
    padding: 16px;
  }
  .admin-topbar {
    margin: -16px -16px 16px;
  }
  .admin-metric-hero {
    grid-template-columns: 1fr;
  }
  .admin-filter {
    grid-template-columns: 1fr 1fr;
  }
  th {
    top: 70px;
  }
}

@media (max-width: 700px) {
  .admin-topbar {
    align-items: flex-start;
    flex-direction: column;
    min-height: 0;
  }
  .admin-top-actions {
    width: 100%;
  }
  .admin-top-actions .mini-pill {
    flex: 1;
    justify-content: center;
  }
  .admin-side {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }
  .admin-side::-webkit-scrollbar {
    display: none;
  }
  .admin-brand {
    position: sticky;
    left: 0;
    z-index: 2;
    flex: 0 0 auto;
    margin: 0;
    background: rgba(15,23,42,.92);
    border-radius: 16px;
  }
  .admin-side-note,
  .admin-nav-group {
    display: none;
  }
  .admin-side a:not(.brand) {
    flex: 0 0 auto;
    min-height: 42px;
    padding: 0 10px 0 12px;
  }
  .admin-side a em {
    display: none;
  }
  .settings-grid,
  .settings-inline,
  .admin-stat-grid {
    grid-template-columns: 1fr;
  }
  .settings-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .admin-filter {
    grid-template-columns: 1fr;
  }
  .bulk-actions {
    width: 100%;
    justify-content: stretch;
  }
  .bulk-actions input,
  .bulk-actions select,
  .bulk-actions button {
    flex: 1 1 100%;
  }
  .table-title {
    align-items: flex-start;
    flex-direction: column;
  }
  th,
  td {
    padding: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .title-mark,
  .title-mark:before,
  .title-mark:after,
  .composer-orb,
  .composer-orb:after,
  .masonry-card,
  .masonry-card img {
    animation: none !important;
    transition: none !important;
  }
}
