/* ========================================================================
   漫剧创作者中心 · 设计系统
   ===================================================================== */
:root {
  --brand: #4b5cf5;
  --brand-600: #3d4be0;
  --brand-700: #333fc4;
  --brand-50: #eef1ff;
  --brand-100: #e0e5ff;
  --brand-ghost: rgba(75, 92, 245, 0.08);
  --ink: #0f172a;
  --ink-2: #344054;
  --ink-3: #475467;
  --muted: #667085;
  --muted-2: #98a2b3;
  --line: #eaecf0;
  --line-2: #f2f4f7;
  --bg: #f6f7fb;
  --card: #ffffff;
  --green: #12b76a;
  --green-50: #e9f9f1;
  --amber: #f79009;
  --amber-50: #fef4e6;
  --red: #f04438;
  --red-50: #feecea;
  --purple: #7a5af8;
  --purple-50: #f1edff;
  --cyan: #0ba5ec;
  --cyan-50: #e7f6fe;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.06), 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 12px 32px -16px rgba(16, 24, 40, 0.24);
  --shadow-pop: 0 24px 64px -20px rgba(16, 24, 40, 0.28);
  --sidebar-w: 232px;
  --font: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Hiragino Sans GB", -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
}
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a {
  color: var(--brand);
  text-decoration: none;
}
button {
  font-family: inherit;
}
::selection {
  background: var(--brand-100);
}
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-thumb {
  background: #d9dde7;
  border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover {
  background: #c3c9d6;
}
::-webkit-scrollbar-track {
  background: transparent;
}
input,
select,
textarea {
  font-family: inherit;
}

/* --------------------------------- 启动态 -------------------------------- */
.boot-loading {
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.boot-logo {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand), var(--purple));
  animation: bootPulse 1.2s ease-in-out infinite;
}
.boot-text {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.08em;
}
@keyframes bootPulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(0.92);
    opacity: 0.65;
  }
}

/* -------------------------------- 登录注册 ------------------------------- */
.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  background: var(--card);
}
.auth-brand {
  position: relative;
  overflow: hidden;
  padding: 48px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #fff;
  background: radial-gradient(120% 120% at 0% 0%, #5b6cff 0%, #4b5cf5 38%, #2f2a8f 100%);
}
.auth-brand::before,
.auth-brand::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  pointer-events: none;
}
.auth-brand::before {
  width: 520px;
  height: 520px;
  right: -190px;
  top: -170px;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.28), transparent 62%);
}
.auth-brand::after {
  width: 420px;
  height: 420px;
  left: -160px;
  bottom: -190px;
  background: radial-gradient(circle at 60% 40%, rgba(122, 90, 248, 0.65), transparent 65%);
}
.auth-brand-inner {
  position: relative;
  z-index: 1;
  margin: auto 0;
}
.auth-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 17px;
  letter-spacing: 0.02em;
}
.auth-logo-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.28);
  display: grid;
  place-items: center;
  backdrop-filter: blur(6px);
}
.auth-headline {
  font-size: 40px;
  line-height: 1.28;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 18px;
}
.auth-headline span {
  background: linear-gradient(100deg, #fff, #cfd4ff 60%, #b9a9ff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.auth-sub {
  color: rgba(255, 255, 255, 0.75);
  font-size: 14px;
  max-width: 420px;
  line-height: 1.9;
}
.auth-stats {
  display: flex;
  gap: 36px;
  margin-top: 36px;
}
.auth-stat b {
  display: block;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.auth-stat span {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.62);
}
.auth-foot {
  position: relative;
  z-index: 1;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}

.auth-mobile-head {
  display: none;
}

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
}
.auth-card {
  width: 100%;
  max-width: 396px;
}
.auth-title {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
}
.auth-desc {
  color: var(--muted);
  font-size: 13.5px;
  margin: 0 0 28px;
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.auth-form .field-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
}
.auth-extra {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
}
.auth-submit {
  width: 100%;
  height: 46px;
  font-size: 15px;
  border-radius: 11px;
  margin-top: 4px;
}
.auth-switch {
  margin-top: 22px;
  text-align: center;
  font-size: 13.5px;
  color: var(--muted);
}
.auth-demo {
  margin-top: 26px;
  border: 1px dashed var(--line);
  background: #fbfcff;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 12.5px;
  color: var(--muted);
}
.auth-demo-title {
  font-weight: 600;
  color: var(--ink-3);
  margin-bottom: 6px;
  font-size: 12px;
}
.auth-demo-row {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
  padding: 3px 0;
}
.auth-demo-row code {
  background: #eef1ff;
  color: var(--brand-700);
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 11.5px;
}
.auth-demo-btn {
  color: var(--brand);
  cursor: pointer;
  font-size: 12px;
  background: none;
  border: 0;
  padding: 0;
}
.sms-row {
  display: flex;
  gap: 8px;
}
.sms-row .input {
  flex: 1;
}
.sms-btn {
  white-space: nowrap;
  min-width: 108px;
  justify-content: center;
}

/* -------------------------------- 应用骨架 ------------------------------- */
.app-shell {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--card);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid var(--line-2);
}
.logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), #7a5af8);
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 6px 14px -6px rgba(75, 92, 245, 0.7);
  flex: 0 0 auto;
}
.logo-text {
  min-width: 0;
}
.logo-text b {
  display: block;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.logo-text span {
  font-size: 10.5px;
  color: var(--muted-2);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px 20px;
}
.nav-group-title {
  font-size: 11px;
  color: var(--muted-2);
  letter-spacing: 0.1em;
  padding: 14px 12px 6px;
  font-weight: 500;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 12px;
  border-radius: 9px;
  color: var(--ink-3);
  font-size: 13.5px;
  cursor: pointer;
  position: relative;
  transition: background 0.14s, color 0.14s;
  user-select: none;
}
.nav-item + .nav-item {
  margin-top: 2px;
}
.nav-item svg {
  width: 17px;
  height: 17px;
  color: var(--muted-2);
  flex: 0 0 auto;
  transition: color 0.14s;
}
.nav-item:hover {
  background: #f6f7fb;
  color: var(--ink);
}
.nav-item.active {
  background: var(--brand-50);
  color: var(--brand-700);
  font-weight: 500;
}
.nav-item.active svg {
  color: var(--brand);
}
.nav-badge {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: 10.5px;
  min-width: 17px;
  height: 17px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  font-weight: 500;
}
.sidebar-foot {
  padding: 12px;
  border-top: 1px solid var(--line-2);
}
.side-card {
  background: linear-gradient(135deg, #f4f5ff, #eef7ff);
  border: 1px solid #e7e9ff;
  border-radius: 12px;
  padding: 12px;
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.7;
}
.side-card b {
  display: block;
  font-size: 12.5px;
  color: var(--ink);
  margin-bottom: 2px;
}
.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.topbar {
  height: 58px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 30;
}
.crumb {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--muted);
  min-width: 0;
}
.crumb b {
  color: var(--ink);
  font-weight: 500;
}
.crumb-sep {
  color: #d0d5dd;
}
.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  display: grid;
  place-items: center;
  color: var(--ink-3);
  cursor: pointer;
}
.icon-btn:hover {
  background: #f2f4f7;
}
.topbar-user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 9px 5px 5px;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid transparent;
  position: relative;
}
.topbar-user:hover {
  background: #f6f7fb;
}
.avatar {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, #eef1ff, #e6e9ff);
  color: var(--brand-700);
  display: grid;
  place-items: center;
  font-size: 12.5px;
  font-weight: 600;
  flex: 0 0 auto;
}
.avatar.lg {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  font-size: 16px;
}
.avatar.sm {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  font-size: 11px;
}
.topbar-user-name {
  font-size: 13px;
  line-height: 1.2;
}
.topbar-user-name span {
  display: block;
  font-size: 10.5px;
  color: var(--muted-2);
}
.dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-pop);
  min-width: 180px;
  padding: 6px;
  display: none;
  z-index: 60;
}
.dropdown.open {
  display: block;
  animation: popIn 0.16s ease-out;
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
}
.dropdown-item:hover {
  background: #f6f7fb;
}
.dropdown-item.danger {
  color: var(--red);
}
.dropdown-sep {
  height: 1px;
  background: var(--line-2);
  margin: 5px 0;
}
.content {
  flex: 1;
  padding: 22px 24px 48px;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  animation: fadeUp 0.22s ease-out;
}
.page-head {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.page-title {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 9px;
}
.page-sub {
  color: var(--muted);
  font-size: 13px;
  margin: 4px 0 0;
}
.page-actions {
  margin-left: auto;
  display: flex;
  gap: 9px;
  align-items: center;
  flex-wrap: wrap;
}

/* --------------------------------- 组件 ---------------------------------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
}
.card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line-2);
}
.card-title {
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-sub {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 400;
}
.card-extra {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.card-body {
  padding: 18px;
}
.card-body.tight {
  padding: 6px 0;
}
.card-body.flush {
  padding: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.14s;
  box-shadow: var(--shadow-xs);
}
.btn svg {
  width: 15px;
  height: 15px;
}
.btn:hover {
  border-color: #d6dae6;
  background: #fbfcfe;
  color: var(--ink);
}
.btn:active {
  transform: translateY(0.5px);
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn-primary {
  background: linear-gradient(180deg, #5666f7, var(--brand));
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 6px 14px -8px rgba(75, 92, 245, 0.8);
}
.btn-primary:hover {
  background: linear-gradient(180deg, #4b5cf5, var(--brand-600));
  border-color: var(--brand-600);
  color: #fff;
}
.btn-danger {
  background: #fff;
  border-color: #f7c9c4;
  color: var(--red);
}
.btn-danger:hover {
  background: var(--red-50);
  border-color: #f2ada6;
  color: var(--red);
}
.btn-ghost {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}
.btn-ghost:hover {
  background: #f2f4f7;
  border-color: transparent;
}
.btn-sm {
  height: 30px;
  padding: 0 10px;
  font-size: 12.5px;
  border-radius: 8px;
}
.btn-xs {
  height: 26px;
  padding: 0 8px;
  font-size: 12px;
  border-radius: 7px;
}
.btn-lg {
  height: 42px;
  padding: 0 18px;
  font-size: 14px;
}
.btn-block {
  width: 100%;
}
.btn-link {
  border: 0;
  background: none;
  box-shadow: none;
  color: var(--brand);
  padding: 0 4px;
  height: auto;
  font-size: 13px;
}
.btn-link:hover {
  background: none;
  color: var(--brand-700);
  text-decoration: underline;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field-label {
  font-size: 12.5px;
  color: var(--ink-3);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}
.field-label .req {
  color: var(--red);
}
.field-hint {
  font-size: 11.5px;
  color: var(--muted-2);
  line-height: 1.6;
}
.input,
.select,
.textarea {
  width: 100%;
  height: 36px;
  border: 1px solid #e3e6ee;
  border-radius: 9px;
  padding: 0 11px;
  font-size: 13px;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color 0.14s, box-shadow 0.14s;
}
.textarea {
  height: auto;
  min-height: 84px;
  padding: 9px 11px;
  resize: vertical;
  line-height: 1.7;
}
.input::placeholder,
.textarea::placeholder {
  color: #b6bdcc;
}
.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(75, 92, 245, 0.12);
}
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  padding-right: 30px;
  cursor: pointer;
}
.input-sm,
.select-sm {
  height: 32px;
  font-size: 12.5px;
}
.input-group {
  display: flex;
  gap: 8px;
}
.input-affix {
  position: relative;
}
.input-affix .input {
  padding-left: 32px;
}
.input-affix svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--muted-2);
}
.check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--ink-3);
  cursor: pointer;
  user-select: none;
}
.check input {
  width: 15px;
  height: 15px;
  accent-color: var(--brand);
  cursor: pointer;
}
.switch {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  font-size: 13px;
  color: var(--ink-3);
}
.switch input {
  display: none;
}
.switch-track {
  width: 38px;
  height: 22px;
  border-radius: 12px;
  background: #dfe3ec;
  position: relative;
  transition: background 0.18s;
  flex: 0 0 auto;
}
.switch-track::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  top: 2px;
  left: 2px;
  transition: transform 0.18s;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.2);
}
.switch input:checked + .switch-track {
  background: var(--brand);
}
.switch input:checked + .switch-track::after {
  transform: translateX(16px);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 500;
  background: #f2f4f7;
  color: var(--ink-3);
  white-space: nowrap;
}
.tag-green {
  background: var(--green-50);
  color: #087443;
}
.tag-amber {
  background: var(--amber-50);
  color: #b54708;
}
.tag-red {
  background: var(--red-50);
  color: #b42318;
}
.tag-blue {
  background: var(--brand-50);
  color: var(--brand-700);
}
.tag-purple {
  background: var(--purple-50);
  color: #5b34d6;
}
.tag-cyan {
  background: var(--cyan-50);
  color: #026aa2;
}
.tag-dot::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.85;
}
.tag-lg {
  height: 26px;
  padding: 0 10px;
  font-size: 12px;
  border-radius: 7px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.kpi {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: box-shadow 0.18s, transform 0.18s;
}
.kpi:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.kpi-top {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12.5px;
}
.kpi-ico {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--brand-50);
  color: var(--brand);
  margin-left: auto;
}
.kpi-ico svg {
  width: 14px;
  height: 14px;
}
.kpi-value {
  font-size: 25px;
  font-weight: 650;
  letter-spacing: -0.02em;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: baseline;
  gap: 5px;
}
.kpi-value small {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
}
.kpi-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--muted-2);
  margin-top: 4px;
}
.delta {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-weight: 600;
  font-size: 11.5px;
}
.delta.up {
  color: var(--green);
}
.delta.down {
  color: var(--red);
}
.kpi.accent {
  background: linear-gradient(140deg, #4b5cf5 0%, #5f5af6 45%, #7a5af8 100%);
  border-color: transparent;
  color: #fff;
}
.kpi.accent .kpi-top,
.kpi.accent .kpi-foot,
.kpi.accent .kpi-value small {
  color: rgba(255, 255, 255, 0.72);
}
.kpi.accent .kpi-ico {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}
.kpi.accent::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  right: -70px;
  bottom: -110px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.22), transparent 65%);
}

.grid {
  display: grid;
  gap: 14px;
  align-items: start;
}
.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.grid-2-1 {
  grid-template-columns: minmax(0, 1.85fr) minmax(0, 1fr);
}
.grid-1-2 {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.85fr);
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.wrap {
  flex-wrap: wrap;
}
.grow {
  flex: 1;
  min-width: 0;
}
.muted {
  color: var(--muted);
}
.muted-2 {
  color: var(--muted-2);
}
.small {
  font-size: 12.5px;
}
.tiny {
  font-size: 11.5px;
}
.strong {
  font-weight: 600;
}
.num {
  font-variant-numeric: tabular-nums;
}
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}
.nowrap {
  white-space: nowrap;
}
.ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.text-green {
  color: var(--green);
}
.text-red {
  color: var(--red);
}
.text-amber {
  color: var(--amber);
}
.text-brand {
  color: var(--brand);
}
.mt-0 {
  margin-top: 0;
}
.mt-8 {
  margin-top: 8px;
}
.mt-12 {
  margin-top: 12px;
}
.mt-16 {
  margin-top: 16px;
}
.mt-24 {
  margin-top: 24px;
}
.mb-0 {
  margin-bottom: 0;
}

/* --------------------------------- 表格 ---------------------------------- */
.table-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-2);
  flex-wrap: wrap;
}
.table-toolbar .grow {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.table-wrap {
  overflow-x: auto;
}
table.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
table.table th {
  text-align: left;
  font-weight: 500;
  font-size: 12px;
  color: var(--muted);
  background: #fafbfd;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-2);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}
table.table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-2);
  color: var(--ink-2);
  vertical-align: middle;
}
table.table tbody tr:last-child td {
  border-bottom: 0;
}
table.table tbody tr {
  transition: background 0.12s;
}
table.table tbody tr:hover {
  background: #fafbff;
}
table.table td.num,
table.table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
table.table th.center,
table.table td.center {
  text-align: center;
}
.row-actions {
  display: flex;
  gap: 2px;
  align-items: center;
}
.cell-main {
  font-weight: 500;
  color: var(--ink);
}
.cell-sub {
  font-size: 11.5px;
  color: var(--muted-2);
  margin-top: 1px;
}
.cell-drama {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 180px;
}
.cell-user {
  display: flex;
  align-items: center;
  gap: 9px;
}
.empty {
  padding: 54px 20px;
  text-align: center;
  color: var(--muted-2);
  font-size: 13px;
}
.empty svg {
  width: 34px;
  height: 34px;
  color: #d6dbe7;
  margin-bottom: 10px;
}
.pager {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 18px;
  border-top: 1px solid var(--line-2);
  font-size: 12.5px;
  color: var(--muted);
  flex-wrap: wrap;
}
.pager-total {
  margin-right: auto;
}
.pager-btn {
  min-width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-3);
  cursor: pointer;
  font-size: 12.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
}
.pager-btn:hover:not(:disabled) {
  border-color: var(--brand);
  color: var(--brand);
}
.pager-btn.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.pager-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* --------------------------------- 图表 ---------------------------------- */
.chart-box {
  position: relative;
  width: 100%;
}
.chart-box canvas {
  display: block;
  width: 100%;
}
.chart-legend {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}
.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 3px;
  display: inline-block;
  margin-right: 6px;
}
.chart-tip {
  position: absolute;
  pointer-events: none;
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  font-size: 11.5px;
  padding: 7px 10px;
  border-radius: 8px;
  transform: translate(-50%, -120%);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.12s;
  z-index: 5;
  line-height: 1.7;
}
.chart-tip.show {
  opacity: 1;
}
.chart-tip b {
  font-weight: 600;
}

/* --------------------------------- 弹窗 ---------------------------------- */
.modal-root {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
}
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 6vh 16px 32px;
  overflow-y: auto;
  pointer-events: auto;
  animation: fadeIn 0.16s ease-out;
}
.modal {
  width: 520px;
  max-width: 100%;
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow-pop);
  animation: modalIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  margin: auto 0;
}
.modal.wide {
  width: 760px;
}
.modal.xwide {
  width: 940px;
}
.modal.narrow {
  width: 420px;
}
.modal-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 20px 14px;
}
.modal-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.5;
}
.modal-desc {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px;
}
.modal-close {
  margin-left: auto;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: var(--muted-2);
  cursor: pointer;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.modal-close:hover {
  background: #f2f4f7;
  color: var(--ink);
}
.modal-body {
  padding: 0 20px 4px;
  max-height: 70vh;
  overflow-y: auto;
}
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 20px 18px;
}
.modal-alert {
  background: #fffbf4;
  border: 1px solid #fde9c8;
  color: #93370d;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12.5px;
  line-height: 1.7;
  margin: 0 0 14px;
}
.modal-alert.danger {
  background: #fff6f5;
  border-color: #fbd9d4;
  color: #912018;
}
.modal-alert.info {
  background: #f5f8ff;
  border-color: #e2e8ff;
  color: #3538cd;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.form-grid .col-2 {
  grid-column: span 2;
}
.modal-body .form-grid {
  margin-bottom: 10px;
}

/* --------------------------------- Toast --------------------------------- */
.toast-root {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-pop);
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 13px;
  color: var(--ink-2);
  animation: toastIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: min(560px, 88vw);
}
.toast svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}
.toast.success svg {
  color: var(--green);
}
.toast.error svg {
  color: var(--red);
}
.toast.info svg {
  color: var(--brand);
}
.toast.warn svg {
  color: var(--amber);
}
.toast.out {
  animation: toastOut 0.18s ease-in forwards;
}

/* -------------------------------- 其他元素 -------------------------------- */
.poster {
  width: 46px;
  height: 60px;
  border-radius: 8px;
  flex: 0 0 auto;
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.poster::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 80% at 20% 0%, rgba(255, 255, 255, 0.32), transparent 60%);
}
.poster span {
  position: relative;
  z-index: 1;
  writing-mode: vertical-rl;
  letter-spacing: 0.16em;
  font-size: 12px;
}
.poster.lg {
  width: 118px;
  height: 158px;
  border-radius: 12px;
}
.poster.lg span {
  font-size: 15px;
}
.poster.xs {
  width: 34px;
  height: 44px;
  border-radius: 6px;
  font-size: 10px;
}
.poster.xs span {
  font-size: 9px;
}

.seg {
  display: inline-flex;
  background: #f2f4f7;
  border-radius: 9px;
  padding: 3px;
  gap: 2px;
}
.seg button {
  border: 0;
  background: transparent;
  height: 28px;
  padding: 0 12px;
  border-radius: 7px;
  font-size: 12.5px;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}
.seg button.active {
  background: #fff;
  color: var(--ink);
  font-weight: 500;
  box-shadow: var(--shadow-xs);
}
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  padding: 0 18px;
  overflow-x: auto;
}
.tab {
  padding: 11px 2px;
  margin-right: 20px;
  font-size: 13.5px;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.tab:hover {
  color: var(--ink);
}
.tab.active {
  color: var(--brand-700);
  border-bottom-color: var(--brand);
  font-weight: 500;
}
.tab .count {
  font-size: 11px;
  background: #f2f4f7;
  color: var(--muted);
  border-radius: 8px;
  padding: 0 5px;
  margin-left: 5px;
}
.tab.active .count {
  background: var(--brand-50);
  color: var(--brand-700);
}

.dl {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 10px 12px;
  font-size: 13px;
}
.dl dt {
  color: var(--muted);
  font-size: 12.5px;
}
.dl dd {
  margin: 0;
  color: var(--ink-2);
  word-break: break-all;
}
.divider {
  height: 1px;
  background: var(--line-2);
  margin: 16px 0;
}
.notice {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  background: #f5f8ff;
  border: 1px solid #e5eaff;
  color: #3538cd;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12.5px;
  line-height: 1.75;
}
.notice svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  margin-top: 2px;
}
.notice.warn {
  background: #fffbf4;
  border-color: #fde9c8;
  color: #93370d;
}
.notice.gray {
  background: #f9fafb;
  border-color: var(--line);
  color: var(--ink-3);
}
.list {
  display: flex;
  flex-direction: column;
}
.list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-2);
}
.list-item:last-child {
  border-bottom: 0;
}
.list-item:first-child {
  padding-top: 0;
}
.list-main {
  min-width: 0;
  flex: 1;
}
.list-title {
  font-size: 13px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 6px;
}
.list-sub {
  font-size: 11.5px;
  color: var(--muted-2);
  margin-top: 2px;
}
.list-amount {
  font-size: 13.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.qr-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 8px 0 4px;
}
.qr-canvas {
  width: 208px;
  height: 208px;
  border-radius: 14px;
  border: 1px solid var(--line);
  padding: 10px;
  background: #fff;
  display: grid;
  place-items: center;
}
.qr-canvas img,
.qr-canvas canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.qr-meta {
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
}
.qr-meta b {
  color: var(--ink);
  font-weight: 600;
}
.countdown {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--amber-50);
  color: #b54708;
  border-radius: 7px;
  padding: 3px 8px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.drama-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
}
.drama-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: #dfe3f5;
}
.drama-cover {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.drama-cover .poster-title {
  position: relative;
  letter-spacing: 0.14em;
  z-index: 2;
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.1em;
  writing-mode: vertical-rl;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.28);
  max-height: 82%;
  line-height: 1.5;
}
.drama-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 90% at 15% 0%, rgba(255, 255, 255, 0.3), transparent 55%),
    linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, 0.34));
}
.drama-cover .cover-badge {
  position: absolute;
  z-index: 3;
  top: 10px;
  left: 10px;
  display: flex;
  gap: 5px;
}
.cover-tag {
  background: rgba(15, 23, 42, 0.42);
  color: #fff;
  backdrop-filter: blur(6px);
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 10.5px;
  font-weight: 500;
}
.cover-tag.hot {
  background: rgba(240, 68, 56, 0.9);
}
.drama-body {
  padding: 12px 13px 13px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.drama-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.drama-meta {
  font-size: 11.5px;
  color: var(--muted-2);
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.drama-meta .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #d0d5dd;
}
.drama-foot {
  margin-top: auto;
  padding-top: 9px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px dashed var(--line);
}
.drama-price {
  font-size: 12px;
  color: var(--muted);
}
.drama-price b {
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}
.filter-bar {
  display: flex;
  gap: 9px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.chip-row {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.chip {
  height: 30px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-3);
  font-size: 12.5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.chip:hover {
  border-color: #cfd6ff;
  color: var(--brand-700);
}
.chip.active {
  background: var(--brand-50);
  border-color: #c9d0ff;
  color: var(--brand-700);
  font-weight: 500;
}
.progress {
  height: 6px;
  border-radius: 4px;
  background: #f0f2f7;
  overflow: hidden;
}
.progress i {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--brand), #7a5af8);
}
.stat-line {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.stat-big {
  font-size: 30px;
  font-weight: 650;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stat-label {
  font-size: 12.5px;
  color: var(--muted);
}
.badge-soft {
  font-size: 11px;
  color: var(--brand-700);
  background: var(--brand-50);
  padding: 2px 7px;
  border-radius: 6px;
  font-weight: 500;
}
.banner {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  padding: 20px 22px;
  background: linear-gradient(120deg, #4b5cf5 0%, #5b57f6 42%, #7a5af8 100%);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 18px;
}
.banner::after {
  content: "";
  position: absolute;
  width: 320px;
  height: 320px;
  right: -80px;
  top: -140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.22), transparent 62%);
}
.banner h3 {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 600;
}
.banner p {
  margin: 0;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.78);
  max-width: 560px;
  line-height: 1.7;
}
.banner .btn {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
  box-shadow: none;
  position: relative;
  z-index: 1;
}
.banner .btn:hover {
  background: rgba(255, 255, 255, 0.24);
  color: #fff;
}
.invite-code {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 22px;
  letter-spacing: 0.16em;
  font-weight: 600;
  color: var(--brand-700);
  background: var(--brand-50);
  border: 1px dashed #c5cdff;
  border-radius: 10px;
  padding: 8px 16px;
  display: inline-block;
}
.upload-box {
  border: 1px dashed #d6dbe7;
  border-radius: 10px;
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
  background: #fbfcfe;
  overflow: hidden;
}
.upload-box:hover {
  border-color: var(--brand);
  color: var(--brand);
}
.upload-box img {
  height: 100%;
  width: 100%;
  object-fit: cover;
}
.skeleton {
  background: linear-gradient(90deg, #f2f4f7 25%, #f8fafc 37%, #f2f4f7 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease infinite;
  border-radius: 8px;
}
.page-loading {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.mobile-toggle {
  display: none;
}
.scrim {
  display: none;
}


.panel {
  background: #fafbfd;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  padding: 13px 14px;
}
.panel-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.panel-title svg {
  color: var(--muted);
}
.dl-2 {
  grid-template-columns: 82px 1fr 82px 1fr;
}
@media (max-width: 640px) {
  .dl-2 {
    grid-template-columns: 82px 1fr;
  }
}

/* --------------------------------- 动画 ---------------------------------- */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
}
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}
@keyframes popIn {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
}
@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
}
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
}
@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateY(-8px);
  }
}
@keyframes shimmer {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}

/* -------------------------------- 响应式 -------------------------------- */
@media (max-width: 1180px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid-2-1,
  .grid-1-2 {
    grid-template-columns: minmax(0, 1fr);
  }
  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 960px) {
  .auth-mobile-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
  }
  .auth-mobile-head b {
    display: block;
    font-size: 14px;
  }
  .auth-mobile-head span {
    font-size: 10px;
    color: var(--muted-2);
    letter-spacing: 0.12em;
  }
  .auth {
    grid-template-columns: 1fr;
  }
  .auth-brand {
    display: none;
  }
  .auth-panel {
    padding: 30px 22px;
  }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
    transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow-pop);
  }
  body.nav-open .sidebar {
    transform: translateX(0);
  }
  body.nav-open .scrim {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    z-index: 35;
  }
  .mobile-toggle {
    display: grid;
  }
  .content {
    padding: 16px 14px 40px;
  }
  .topbar {
    padding: 0 14px;
  }
  .topbar-user-name {
    display: none;
  }
  .grid-2,
  .grid-3 {
    grid-template-columns: minmax(0, 1fr);
  }
  .kpi-grid {
    gap: 10px;
  }
  .kpi-value {
    font-size: 21px;
  }
  .page-title {
    font-size: 18px;
  }
  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .form-grid .col-2 {
    grid-column: span 1;
  }
  .modal-body {
    max-height: 70vh;
  }
}
@media (max-width: 560px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .kpi {
    padding: 12px 14px;
  }
  .kpi-value {
    font-size: 19px;
  }
  .drama-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .banner {
    flex-direction: column;
    align-items: flex-start;
  }
}
