/* =====================================================================
   红色漫剧 · 平面化主题(Flat Premium)
   设计原则:白色实底卡片 + 1px 细边框 + 极轻阴影 + 单一克制红 + 无玻璃无渐变
   本文件后于 styles.css 加载:先重定义设计令牌,再定点覆盖,最后是外壳组件
   ===================================================================== */

/* ---------- 1. 双主题设计令牌 ---------- */
/* 浅色:暖米白宣纸风(红 + 金) */
:root {
  --bg: #f4efe3;
  --bg-2: #efe7d8;
  --surface: #fffdf8;
  --surface-strong: #fffdf8;
  --surface-soft: #faf5ea;
  --card: #fffdf8;
  --card-2: #f9f3e7;
  --text: #2b241b;
  --muted: #8f8477;
  --line: #ebe2d0;
  --line-strong: #ddd0b8;
  --accent: #c62828;
  --accent-2: #c62828;
  --accent-3: #c62828;
  --accent-strong: #a81f22;
  --accent-soft: #fbe9e2;
  --gold: #b6952f;
  --gold-2: #d7b85b;
  --cta-grad: linear-gradient(96deg, #d5342f, #b21f22);
  --cta-glow: 0 14px 30px rgba(180, 34, 34, 0.28);
  --sidebar-bg: #f4efe3;
  --sidebar-text: #6c6153;
  --sidebar-active-bg: #fffdf8;
  --sidebar-active-text: var(--accent);
  --sidebar-active-shadow: 0 8px 20px rgba(150, 40, 40, 0.12);
  --brand-grad: linear-gradient(135deg, #d5342f, #a81f22);
  --shadow: 0 16px 40px rgba(120, 70, 40, 0.08);
  --card-hover: 0 18px 44px rgba(120, 70, 40, 0.14);
  --inner-light: none;
  --inner-depth: none;
  --edge-light: transparent;
  --edge-dark: transparent;
  --button-glow: transparent;
  --blur: blur(0px);
  --frame-border: #ebe2d0;
  --field-bg: #fffefb;
  --control-bg: #fffefb;
  --secondary-bg: #fffdf8;
  --body-glow-a: transparent;
  --body-glow-b: transparent;
  --ambient-a: transparent;
  --ambient-b: transparent;
  --ambient-c: transparent;
  --active-shadow: rgba(198, 40, 40, 0.14);
}

/* 深色:电影级黑金红辉光 */
body[data-theme="dark"] {
  --bg: #0b0b0f;
  --bg-2: #08080b;
  --surface: #16151b;
  --surface-strong: #1a191f;
  --surface-soft: #121116;
  --card: #16151b;
  --card-2: #100f14;
  --text: #ece7df;
  --muted: #8b857c;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --accent: #e51d33;
  --accent-2: #e51d33;
  --accent-3: #e51d33;
  --accent-strong: #ff2740;
  --accent-soft: rgba(229, 29, 51, 0.16);
  --gold: #d9a441;
  --gold-2: #ecc470;
  --cta-grad: linear-gradient(96deg, #ff2038, #cc111f);
  --cta-glow: 0 0 34px rgba(229, 29, 51, 0.55), 0 14px 30px rgba(229, 29, 51, 0.3);
  --sidebar-bg: #0a0a0d;
  --sidebar-text: rgba(255, 255, 255, 0.6);
  --sidebar-active-bg: rgba(229, 29, 51, 0.14);
  --sidebar-active-text: #ff4d5f;
  --sidebar-active-shadow: 0 0 22px rgba(229, 29, 51, 0.4), inset 0 0 0 1px rgba(229, 29, 51, 0.5);
  --brand-grad: linear-gradient(135deg, #ff2038, #c9101f);
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
  --card-hover: 0 20px 48px rgba(0, 0, 0, 0.6);
  --frame-border: rgba(255, 255, 255, 0.08);
  --field-bg: #121116;
  --control-bg: #121116;
  --secondary-bg: #1a191f;
  --active-shadow: rgba(229, 29, 51, 0.3);
}

/* ---------- 2. 全局平面化定点覆盖 ---------- */
.ambient-bg {
  display: none;
}
body {
  background:
    radial-gradient(circle at 85% 8%, rgba(198, 40, 40, 0.05), transparent 42%),
    linear-gradient(160deg, var(--bg), var(--bg-2));
  background-attachment: fixed;
  color: var(--text);
  font-family: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}
body[data-theme="dark"] {
  background:
    radial-gradient(circle at 82% 6%, rgba(229, 29, 51, 0.16), transparent 40%),
    radial-gradient(circle at 12% 88%, rgba(229, 29, 51, 0.08), transparent 42%),
    linear-gradient(160deg, #0c0c10, #08080b);
  background-attachment: fixed;
}
button {
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  box-shadow: none;
  font-weight: 600;
}
button:hover {
  filter: none;
  background: #c21f3f;
  transform: none;
  box-shadow: none;
}
button.secondary,
body button.secondary {
  background: #ffffff;
  border: 1px solid var(--line-strong);
  color: var(--text);
  box-shadow: none;
}
button.secondary:hover {
  background: #f6f7f9;
  border-color: #c9cdd6;
}
body .glass-frame,
body .tool-panel,
body .preview-block,
body .card,
body .style-prompt,
body .drawer-panel {
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
body .tool-panel,
body .preview-block {
  background: #fafafb;
}
input,
select,
textarea {
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  box-shadow: none;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(217, 38, 74, 0.12);
  outline: none;
}
body .topbar {
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
body .step-tab {
  background: transparent;
  border: 0;
  color: var(--muted);
  box-shadow: none;
  border-radius: 10px;
}
body .step-tab:hover {
  background: #f3f4f6;
  color: var(--text);
}
body .step-tab.active {
  background: var(--accent);
  color: #fff;
  box-shadow: none;
}
body .step-tab span {
  background: transparent;
  border: 1px solid currentColor;
  box-shadow: none;
}
body .pill-tabs button {
  background: #ffffff;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  box-shadow: none;
}
body .pill-tabs button.active {
  background: #fdebef;
  border-color: var(--accent);
  color: var(--accent);
}
body .primary-wide {
  background: var(--accent);
  border: 0;
  box-shadow: none;
  border-radius: 12px;
}
body .primary-wide:hover {
  background: #c21f3f;
}
body .icon-btn {
  background: #ffffff;
  border: 1px solid var(--line-strong);
  color: var(--text);
  box-shadow: none;
}

/* ---------- 3. 平台外壳 ---------- */
.platform-shell {
  display: flex;
  min-height: 100vh;
  background:
    radial-gradient(circle at 78% 16%, rgba(229, 54, 88, 0.08), transparent 28%),
    linear-gradient(130deg, rgba(255, 255, 255, 0.38), rgba(255, 247, 251, 0.46));
}

/* 侧栏:白底 + 细分割线 */
.side-nav {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 232px;
  flex: 0 0 232px;
  display: flex;
  flex-direction: column;
  padding: 28px 18px 22px;
  background:
    radial-gradient(circle at 22% 74%, rgba(229, 54, 88, 0.22), transparent 28%),
    linear-gradient(180deg, #171522 0%, #0d0e18 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 30;
}
.side-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 18px;
}
.side-brand strong {
  font-size: 20px;
  letter-spacing: 0.5px;
  color: #fff;
}
.side-brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 15px;
  color: #fff;
  background: linear-gradient(135deg, #ff5574, #d81f45);
  box-shadow: 0 12px 24px rgba(229, 54, 88, 0.25);
}
.side-menu {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 34px;
}
.side-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: rgba(255, 255, 255, 0.66);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.side-link span {
  font-size: 15px;
  width: 20px;
  text-align: center;
}
.side-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.side-link.active {
  background: linear-gradient(135deg, #ee4265, #c52445);
  color: #fff;
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 14px 28px rgba(229, 54, 88, 0.22);
}
.side-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.side-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
}
.side-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  background: var(--accent);
  flex: 0 0 36px;
}
.side-user-meta strong {
  display: block;
  font-size: 13.5px;
  color: #fff;
}
.side-user-meta small {
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
}
.side-credits {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
  color: #fff;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.side-credits small {
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
}
.side-credits strong {
  font-size: 18px;
  color: #fff;
}
.side-credits:hover {
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.14);
}

/* 主区域 / 视图 */
.platform-main {
  flex: 1;
  min-width: 0;
}
.app-view {
  display: none;
}
.app-view.active {
  display: block;
}
#workView .app-shell {
  min-height: auto;
  width: auto;
  max-width: 1530px;
  margin: 24px;
}
@media (min-width: 1620px) {
  #workView .app-shell {
    margin: 24px auto;
  }
}
#workView .brand-mark,
#workView .brand-block h1 {
  display: none;
}
#workView .brand-block p {
  font-size: 13px;
}

/* 积分标签 */
.cost-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.22);
  color: inherit;
  vertical-align: 1px;
}
.secondary .cost-badge,
.batch-action .cost-badge {
  background: #fdebef;
  color: var(--accent);
}

/* ---------- 首页 ---------- */
#homeView {
  padding: 34px 42px 56px;
  max-width: 1420px;
  margin: 0 auto;
}
.home-top {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 14px;
}
.home-login-btn {
  border: 0;
  border-radius: 14px;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, #ff5574, #e53658);
  box-shadow: 0 16px 34px rgba(229, 54, 88, 0.24);
}
.hero-carousel {
  position: relative;
  height: 370px;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.82);
  box-shadow: 0 24px 60px rgba(92, 31, 50, 0.16);
  background: #241219;
}
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.75s ease, transform 5s ease;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  transform: scale(1.02);
}
.hero-slide.active {
  opacity: 1;
  transform: scale(1);
}
.hero-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(38, 11, 18, 0.36), rgba(38, 11, 18, 0.04) 52%, rgba(38, 11, 18, 0.16));
  pointer-events: none;
}
.hero-slide-body {
  position: relative;
  z-index: 1;
  padding: 0 52px;
  color: #fff;
}
.hero-slide-body h2 {
  font-size: 40px;
  margin: 0 0 8px;
  letter-spacing: 2px;
  font-weight: 700;
}
.hero-slide-body p {
  font-size: 15px;
  margin: 0 0 22px;
  opacity: 0.85;
}
.hero-slide-body button {
  border: 0;
  border-radius: 14px;
  padding: 12px 24px;
  font-size: 14.5px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, #ff5574, #e53658);
  box-shadow: 0 14px 32px rgba(229, 54, 88, 0.32);
}
.hero-slide-body button:hover {
  background: linear-gradient(135deg, #ff6380, #d92f50);
}
.hero-slide-body.slim {
  align-self: flex-end;
  padding: 0 0 28px 42px;
}
.hero-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 14px;
  display: flex;
  justify-content: center;
  gap: 7px;
}
.hero-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
}
.hero-dots i.active {
  background: #fff;
  width: 20px;
  border-radius: 999px;
}
.home-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 34px 2px 18px;
}
.home-section-head h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  margin: 0;
  color: var(--text);
}
.home-section-head h3 i {
  width: 4px;
  height: 18px;
  border-radius: 4px;
  background: var(--accent);
}
.home-section-head span {
  cursor: pointer;
  font-size: 13.5px;
}
.works-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}
.work-card {
  border-radius: 20px;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.76);
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 16px 38px rgba(82, 24, 42, 0.08);
}
.work-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-hover);
}
.work-cover {
  aspect-ratio: 16 / 9;
  height: auto;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-end;
  padding: 14px 16px;
  border-radius: 16px;
  margin: 12px 12px 0;
  overflow: hidden;
}
.work-cover strong {
  color: #fff;
  font-size: 23px;
  letter-spacing: 3px;
  font-weight: 700;
}
.work-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 18px;
}
.work-meta strong {
  display: block;
  font-size: 15px;
  color: var(--text);
}
.work-meta small {
  color: var(--muted);
}
.work-meta button {
  width: 42px;
  height: 42px;
  min-height: 42px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, #ff5574, #e53658);
  box-shadow: 0 12px 24px rgba(229, 54, 88, 0.22);
  padding: 0;
}

/* ---------- 个人中心 ---------- */
#profileView {
  padding: 28px 32px 44px;
  max-width: 1200px;
  margin: 0 auto;
}
.profile-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}
.profile-grid.two {
  grid-template-columns: 1.9fr 1fr;
  align-items: start;
}
.profile-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 24px 26px;
  border-radius: 14px;
}
.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  flex: 0 0 64px;
}
.profile-info h3 {
  margin: 0 0 6px;
  font-size: 19px;
  color: var(--text);
}
.lv-badge {
  font-style: normal;
  font-size: 11.5px;
  padding: 2px 9px;
  border-radius: 999px;
  color: var(--accent);
  background: #fdebef;
  vertical-align: 3px;
  font-weight: 600;
}
.profile-info p {
  margin: 0 0 4px;
  font-size: 14.5px;
}
.profile-info small {
  color: var(--muted);
}
.credits-card {
  border-radius: 14px;
  padding: 22px 26px;
  color: #fff;
  background: var(--accent);
  display: flex;
  flex-direction: column;
}
.credits-card small {
  opacity: 0.85;
  font-size: 13px;
}
.credits-card strong {
  font-size: 40px;
  line-height: 1.2;
  font-weight: 700;
}
.credits-card strong::after {
  content: " 积分";
  font-size: 14px;
  font-weight: 500;
}
.credits-card button {
  align-self: flex-start;
  margin-top: 10px;
  border: 0;
  border-radius: 999px;
  padding: 7px 20px;
  min-height: 34px;
  font-weight: 600;
  color: var(--accent);
  background: #fff;
  cursor: pointer;
}
.credits-card button:hover {
  background: #f6f7f9;
}
.records-card {
  border-radius: 14px;
  padding: 18px 22px;
}
.records-tabs {
  display: flex;
  gap: 16px;
  margin-bottom: 4px;
}
.records-tabs button {
  border: 0;
  background: none;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--muted);
  padding: 8px 2px;
  min-height: 0;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  border-radius: 0;
}
.records-tabs button:hover {
  background: none;
  color: var(--text);
}
.records-tabs button.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.records-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.records-table th {
  text-align: left;
  color: var(--muted);
  font-weight: 500;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
}
.records-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
}
.records-table td.neg {
  color: var(--accent);
  font-weight: 600;
}
.records-table td.pos {
  color: #12965a;
  font-weight: 600;
}
.price-card {
  border-radius: 14px;
  padding: 18px 22px;
}
.price-card h4 {
  margin: 0 0 12px;
  color: var(--text);
}
.price-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 14px;
  margin-bottom: 8px;
  background: #fafafb;
}
.price-item strong {
  display: block;
  color: var(--text);
  font-size: 14px;
}
.price-item small {
  color: var(--muted);
}
.price-card .secondary {
  margin-top: 8px;
  width: 100%;
}

/* ---------- 登录 ---------- */
.login-view[hidden] {
  display: none !important;
}
.login-view {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(23, 24, 28, 0.4);
  display: grid;
  place-items: center;
  padding: 30px;
}
.login-wrap {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  width: min(1120px, 100%);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 28px 70px rgba(82, 24, 42, 0.22);
}
.login-brand {
  padding: 42px 40px;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(45, 12, 20, 0.88), rgba(111, 18, 33, 0.58)),
    url("assets/faith-power.png") center/cover no-repeat;
  display: flex;
  flex-direction: column;
  min-height: 560px;
}
.login-brand .side-brand {
  padding-bottom: 28px;
}
.login-brand .side-brand strong {
  color: #fff;
}
.login-brand h2 {
  font-size: 34px;
  line-height: 1.45;
  margin: 0 0 12px;
  font-weight: 700;
}
.login-brand h2 em {
  font-style: normal;
  color: #ff9eb0;
}
.login-brand p {
  opacity: 0.8;
  margin: 0;
  font-size: 14px;
}
.login-feature-row {
  margin-top: auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  background: rgba(56, 19, 28, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  padding: 14px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.login-feature-row strong {
  display: block;
  font-size: 13px;
}
.login-feature-row small {
  opacity: 0.7;
  font-size: 11.5px;
}
.login-card {
  position: relative;
  background: #fff;
  padding: 56px 52px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.login-card h2 {
  text-align: center;
  font-size: 28px;
  margin: 0 0 6px;
  color: var(--text);
}
.login-card h2 em {
  font-style: normal;
  color: var(--accent);
}
.login-card > p {
  text-align: center;
  margin: 0 0 24px;
}
.login-field {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 3px 12px;
  margin-bottom: 12px;
  background: #fff;
}
.login-field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(217, 38, 74, 0.1);
}
.login-field span {
  color: var(--muted);
  border-right: 1px solid var(--line);
  padding-right: 10px;
  font-size: 14px;
}
.login-field input {
  flex: 1;
  border: 0;
  outline: 0;
  padding: 11px 0;
  font-size: 15px;
  background: transparent;
  box-shadow: none;
}
.login-field input:focus {
  box-shadow: none;
  border: 0;
}
.login-field.code button {
  border: 0;
  border-radius: 8px;
  padding: 8px 13px;
  min-height: 0;
  font-size: 13px;
  color: var(--accent);
  cursor: pointer;
  white-space: nowrap;
  background: #fdebef;
  font-weight: 600;
}
.login-field.code button:hover {
  background: #fbdce4;
}
.login-field.code button:disabled {
  opacity: 0.5;
  cursor: default;
}
.login-submit {
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 15px;
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: 4px;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, #ff5574, #e53658);
  margin-top: 6px;
}
.login-submit:hover {
  background: linear-gradient(135deg, #ff6380, #d92f50);
}
.login-agree {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 16px;
  white-space: nowrap;
}
.login-agree input[type="checkbox"] {
  width: auto;
  flex: 0 0 auto;
  margin: 0;
}
.login-agree a {
  color: var(--accent);
  text-decoration: none;
}
.login-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 32px;
  height: 32px;
  min-height: 32px;
  border: 0;
  border-radius: 50%;
  background: #f3f4f6;
  color: var(--muted);
  font-size: 17px;
  cursor: pointer;
  padding: 0;
}
.login-close:hover {
  background: #e7e9ee;
  color: var(--text);
}

/* ---------- 充值弹窗 ---------- */
.recharge-modal .recharge-panel {
  width: min(680px, 94vw);
  padding: 24px 28px 28px;
  border-radius: 16px;
}
.recharge-panel h4 {
  margin: 18px 0 10px;
  color: var(--text);
}
.recharge-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.recharge-grid .pkg {
  position: relative;
  border: 1.5px solid var(--line-strong);
  border-radius: 12px;
  background: #fff;
  padding: 16px 10px 12px;
  cursor: pointer;
  text-align: center;
  min-height: 0;
  transition: border-color 0.15s, background 0.15s;
}
.recharge-grid .pkg:hover {
  border-color: #c9cdd6;
  background: #fff;
}
.recharge-grid .pkg.active {
  border-color: var(--accent);
  background: #fffafb;
  box-shadow: none;
}
.recharge-grid .pkg strong {
  display: block;
  font-size: 27px;
  color: var(--accent);
  font-weight: 700;
}
.recharge-grid .pkg strong small {
  font-size: 13px;
  margin-left: 2px;
}
.recharge-grid .pkg span {
  font-size: 12.5px;
  color: var(--muted);
}
.recharge-grid .pkg em {
  position: absolute;
  top: -1px;
  right: -1px;
  font-style: normal;
  font-size: 11px;
  color: #fff;
  padding: 3px 9px;
  border-radius: 0 12px 0 10px;
  background: var(--accent);
}
.pay-methods {
  display: flex;
  gap: 12px;
}
.pay-methods label {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 11px 14px;
  cursor: pointer;
  background: #fff;
  font-size: 14px;
}
.pay-methods input[type="radio"] {
  width: auto;
  flex: 0 0 auto;
  margin: 0;
}
.recharge-panel .login-submit {
  margin-top: 16px;
}
.recharge-panel .muted.small {
  font-size: 12px;
  text-align: center;
  margin-top: 10px;
}
.wechat-payment-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0 2px;
  text-align: center;
}
.wechat-payment-stage[hidden] {
  display: none;
}
.wechat-payment-title {
  margin: 6px 0 14px;
  font-weight: 700;
}
.wechat-qr-card {
  width: 240px;
  height: 240px;
  padding: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fff;
}
.wechat-qr-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.wechat-order-amount {
  margin-top: 14px;
  color: var(--accent);
  font-size: 28px;
}
.wechat-payment-stage .secondary {
  margin-top: 8px;
}

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) {
  .works-grid,
  .recharge-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .profile-grid,
  .profile-grid.two,
  .login-wrap {
    grid-template-columns: 1fr;
  }
  .login-brand {
    display: none;
  }
}
@media (max-width: 780px) {
  .platform-shell {
    flex-direction: column;
  }
  .side-nav {
    position: static;
    height: auto;
    width: auto;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    overflow-x: auto;
  }
  .side-menu {
    flex-direction: row;
    margin: 0 auto;
  }
  .side-bottom {
    margin: 0;
    flex-direction: row;
    align-items: center;
  }
  .hero-carousel {
    height: 230px;
    border-radius: 18px;
  }
  .hero-slide-body {
    padding: 0 26px;
  }
  .hero-slide-body h2 {
    font-size: 28px;
  }
  #homeView {
    padding: 18px 14px 34px;
  }
  .works-grid {
    grid-template-columns: 1fr;
  }
  .side-user,
  .side-credits {
    display: none;
  }
}

/* ---------- 登录双 Tab + 邀请码(阶段2.5) ---------- */
.login-tabs {
  display: flex;
  justify-content: center;
  gap: 26px;
  margin-bottom: 8px;
}
.login-tabs button {
  border: 0;
  background: none;
  min-height: 0;
  padding: 8px 2px;
  font-size: 17px;
  font-weight: 700;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  border-radius: 0;
  cursor: pointer;
}
.login-tabs button:hover {
  background: none;
  color: var(--text);
}
.login-tabs button.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
#loginModeHint {
  text-align: center;
  margin: 0 0 20px;
}
.invite-title {
  margin: 16px 0 10px;
  color: var(--text);
}
.invite-redeem {
  display: flex;
  gap: 8px;
}
.invite-redeem input {
  flex: 1;
  min-width: 0;
}
.invite-redeem button {
  white-space: nowrap;
}
.invite-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow: auto;
}
.invite-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12.5px;
  background: #fafafb;
}
.invite-item code {
  font-weight: 700;
  color: var(--accent);
}
.invite-item.used {
  opacity: 0.55;
}
.invite-item.used code {
  text-decoration: line-through;
}
#adminInviteBox {
  margin-top: 10px;
}
#adminInviteBox .secondary {
  width: 100%;
  margin-bottom: 4px;
}

/* ---------- 我的作品(用户历史) ---------- */
.works-panel {
  border-radius: 14px;
  padding: 18px 22px;
  margin-bottom: 18px;
}
.works-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.works-head h4 {
  margin: 0;
  color: var(--text);
}
.works-tabs {
  display: flex;
  gap: 8px;
}
.works-tabs button {
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--muted);
  border-radius: 999px;
  padding: 5px 14px;
  min-height: 0;
  font-size: 13px;
  cursor: pointer;
}
.works-tabs button.active {
  background: #fdebef;
  border-color: var(--accent);
  color: var(--accent);
}
.works-gallery {
  display: block;
}
.work-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fafafb;
}
.work-item img,
.work-item video {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
  background: #000;
}
.work-item span {
  display: block;
  padding: 7px 10px;
  font-size: 12px;
  color: var(--muted);
}

/* ---------- 我的作品:项目抽屉式分组 ---------- */
.works-group {
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 10px;
  overflow: hidden;
  background: #fff;
}
.works-group:last-child {
  margin-bottom: 0;
}
.works-group-head {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  font-weight: 600;
}
.works-group-head:hover {
  background: #fafafb;
}
.works-group.open .works-group-head {
  background: #fdebef;
  color: var(--accent);
  border-bottom: 1px solid var(--line);
}
.works-caret {
  color: var(--accent);
  font-size: 12px;
  transition: transform 0.18s ease;
}
.works-group.open .works-caret {
  transform: rotate(90deg);
}
.works-group-head strong {
  flex: 1;
  font-size: 14.5px;
}
.works-group-head em {
  font-style: normal;
  font-size: 12px;
  color: var(--muted);
}
.works-group.open .works-group-head em {
  color: var(--accent);
}
.works-group-grid {
  display: none; /* 默认折叠;由 .open 类驱动显隐,避免 [hidden] 被 class 优先级覆盖 */
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  padding: 14px 16px;
}
.works-group.open .works-group-grid {
  display: grid;
}

/* =====================================================================
   主题皮肤重制(红金双主题)—— 覆盖前面遗留的粉色/白色硬编码
   ===================================================================== */

/* ---------- 全局:按钮 / 卡片 / 输入 / 步骤条 ---------- */
/* 基础主按钮=实心红(见前置 button 规则)。不再广撒网渐变,
   避免误染 step-tab / pill-tab 等导航按钮;只加悬停高亮 */
body button:not(.secondary):not(.side-link):not(.works-group-head):not(.step-tab):not(.pill-tabs button):not(.records-tabs button):not(.works-tabs button):hover {
  filter: brightness(1.07);
}
/* pill 筛选标签:暗色可用(修正旧硬编码白底) */
body .pill-tabs button {
  background: var(--card);
  border: 1px solid var(--line-strong);
  color: var(--muted);
}
body button.secondary {
  background: var(--secondary-bg);
  border: 1px solid var(--line-strong);
  color: var(--text);
}
body button.secondary:hover {
  background: var(--card-2);
  border-color: var(--accent);
  color: var(--accent);
}
body .glass-frame,
body .tool-panel,
body .preview-block,
body .card,
body .style-prompt,
body .drawer-panel {
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
body .tool-panel,
body .preview-block {
  background: var(--card-2);
}
input, select, textarea {
  background: var(--field-bg);
  border: 1px solid var(--line-strong);
  color: var(--text);
}
body .topbar {
  background: var(--card);
  border: 1px solid var(--line);
}
body .primary-wide {
  background: var(--cta-grad);
  box-shadow: var(--cta-glow);
  color: #fff;
  font-size: 17px;
  letter-spacing: 1px;
}
body .primary-wide:hover {
  filter: brightness(1.06);
}
body .step-tab.active {
  background: var(--cta-grad);
  color: #fff;
  box-shadow: var(--cta-glow);
}
body .step-tab:hover {
  background: var(--accent-soft);
  color: var(--accent);
}
body .pill-tabs button.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
body .icon-btn {
  background: var(--card);
  border: 1px solid var(--line-strong);
  color: var(--text);
}

/* ---------- 侧栏(主题化) ---------- */
.side-nav {
  background: var(--sidebar-bg);
  border-right: 1px solid var(--line);
}
.side-brand strong { color: var(--text); }
.side-brand-mark { background: var(--brand-grad); box-shadow: none; }
.side-link { color: var(--sidebar-text); border: 1px solid transparent; }
.side-link:hover { background: var(--accent-soft); color: var(--accent); }
.side-link.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
  box-shadow: var(--sidebar-active-shadow);
}
.side-user { background: var(--card-2); border: 1px solid var(--line); }
.side-user-meta strong { color: var(--text); }
.side-user-meta small { color: var(--muted); }
.side-avatar { background: var(--brand-grad); }
.side-credits { background: var(--card-2); border: 1px solid var(--line); color: var(--text); }
.side-credits small { color: var(--muted); }
.side-credits strong { color: var(--gold); }
.side-credits:hover { border-color: var(--accent); }

/* ---------- 首页 ---------- */
.home-login-btn { background: var(--cta-grad); box-shadow: var(--cta-glow); }
.hero-slide-body button { background: var(--cta-grad); box-shadow: var(--cta-glow); }
.hero-slide-body button:hover { filter: brightness(1.06); }
.hero-carousel { border: 1px solid var(--line); }
.home-section-head h3 i { background: var(--accent); }
.work-card { background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.work-meta strong { color: var(--text); }
.work-meta button { background: var(--cta-grad); box-shadow: none; }

/* ---------- 个人中心 ---------- */
.profile-avatar { background: var(--brand-grad); }
.lv-badge { color: var(--accent); background: var(--accent-soft); }
.credits-card {
  background: linear-gradient(120deg, var(--accent-strong), var(--accent));
  box-shadow: var(--cta-glow);
}
.credits-card strong { color: #fff; }
.credits-card button { background: var(--gold); color: #3a2a00; }
.credits-card button:hover { background: var(--gold-2); }
.records-tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }
.records-table td.neg { color: var(--accent); }
.price-item { background: var(--card-2); border: 1px solid var(--line); }
.price-item strong { color: var(--text); }

/* ---------- 我的作品(抽屉) ---------- */
.works-group { background: var(--card); border: 1px solid var(--line); }
.works-group-head { background: var(--card); color: var(--text); }
.works-group-head:hover { background: var(--card-2); }
.works-group.open .works-group-head { background: var(--accent-soft); color: var(--accent); border-bottom: 1px solid var(--line); }
.works-caret { color: var(--accent); }
.work-item { background: var(--card-2); border: 1px solid var(--line); }

/* ---------- 登录 ---------- */
.login-view { background: rgba(10, 8, 10, 0.55); }
.login-brand { background: linear-gradient(150deg, #5a1418, #93171d 55%, #c62828); }
.login-card { background: var(--card); }
.login-card h2 { color: var(--text); }
.login-tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }
.login-field { background: var(--field-bg); border: 1px solid var(--line-strong); }
.login-field input { color: var(--text); background: transparent; }
.login-field.code button { background: var(--accent-soft); color: var(--accent); }
.login-submit { background: var(--cta-grad); box-shadow: var(--cta-glow); }
.login-close { background: var(--card-2); color: var(--muted); }

/* ---------- 充值弹窗 ---------- */
.recharge-grid .pkg { background: var(--card); border: 1.5px solid var(--line-strong); }
.recharge-grid .pkg strong { color: var(--accent); }
.recharge-grid .pkg span { color: var(--muted); }
.recharge-grid .pkg.active { border-color: var(--accent); background: var(--accent-soft); }
.recharge-grid .pkg em { background: var(--gold); color: #3a2a00; }
.pay-methods label { background: var(--card); border: 1px solid var(--line-strong); color: var(--text); }
.recharge-panel .login-submit { background: var(--cta-grad); }

/* ---------- 积分标签(金色) ---------- */
.cost-badge { background: var(--accent-soft); color: var(--accent); }
.secondary .cost-badge, .batch-action .cost-badge { background: var(--accent-soft); color: var(--accent); }

/* ---------- 深色专属:辉光点缀 ---------- */
body[data-theme="dark"] .side-brand strong,
body[data-theme="dark"] .login-card h2 { color: #fff; }
body[data-theme="dark"] .credits-card {
  background: linear-gradient(120deg, #7a0f1a, #c11226);
  border: 1px solid rgba(229, 29, 51, 0.4);
}
body[data-theme="dark"] .work-cover strong,
body[data-theme="dark"] .hero-slide-body h2 { text-shadow: 0 2px 16px rgba(0, 0, 0, 0.6); }
body[data-theme="dark"] .home-login-btn,
body[data-theme="dark"] .primary-wide,
body[data-theme="dark"] .step-tab.active { text-shadow: 0 1px 8px rgba(0, 0, 0, 0.3); }

/* ---------- 补充:容器背景 + 聚焦色随主题 ---------- */
.platform-shell {
  background: transparent;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
body[data-theme="dark"] .hero-carousel { border-color: rgba(255,255,255,0.1); }

/* =====================================================================
   工作台步骤条:按键 UI + 当前步骤循环灯光
   ===================================================================== */
@property --step-ang {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

/* 每个步骤 = 一颗暗色按键 */
body .step-tab {
  background: var(--card);
  border: 1px solid var(--line-strong);
  color: var(--muted);
  min-height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
body .step-tab span {
  background: var(--card-2);
  border: 1px solid var(--line-strong);
  color: var(--muted);
  font-weight: 700;
}
body .step-tab:not(.active):hover {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line-strong));
  color: var(--text);
  background: var(--card);
}

/* 当前运行步骤:亮红渐变 + 白号 + 外发光 */
body .step-tab.active {
  background: var(--cta-grad);
  border: 1px solid transparent;
  color: #fff;
  box-shadow: var(--cta-glow);
  z-index: 1;
}
body .step-tab.active span {
  background: rgba(255, 255, 255, 0.92);
  border: 0;
  color: var(--accent);
}

/* 四周循环流动灯光(旋转 conic 边框,masked 成一圈) */
body .step-tab.active::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 999px;
  padding: 2px;
  background: conic-gradient(
    from var(--step-ang),
    transparent 0deg,
    transparent 205deg,
    rgba(255, 150, 165, 0.55) 275deg,
    #ffffff 315deg,
    rgba(255, 90, 110, 0.85) 350deg,
    transparent 360deg
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: stepRunLight 2.6s linear infinite;
  pointer-events: none;
}
@keyframes stepRunLight {
  to {
    --step-ang: 360deg;
  }
}

/* 步骤之间的连接:虚线段(替换原来的 › ) */
body .step-tab + .step-tab::before {
  content: "";
  left: -20px;
  top: 50%;
  width: 14px;
  height: 0;
  border-top: 2px dashed var(--line-strong);
  transform: translateY(-50%);
  color: transparent;
}

/* 尊重"减少动画"偏好 */
@media (prefers-reduced-motion: reduce) {
  body .step-tab.active::after {
    animation: none;
    background: var(--accent);
    opacity: 0.5;
  }
}
