:root {
  color-scheme: light;
  --paper: #f2eee6;
  --paper-soft: #f8f5ee;
  --ink: #151411;
  --muted: #8a8275;
  --faint: #bdb5a7;
  --line: rgba(35, 31, 25, 0.11);
  --line-strong: rgba(35, 31, 25, 0.2);
  --red: #c7353c;
  --green: #1aaa91;
  --green-soft: #d7f5e4;
  --blue: #1d70a2;
  --orange: #d85a3e;
  --black: #11100e;
  --white: #fffdf8;
  --shadow: 0 26px 72px rgba(55, 47, 34, 0.14);
  --serif: "Times New Roman", "Noto Serif SC", "Songti SC", SimSun, serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  background: var(--paper);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--serif);
  letter-spacing: 0;
  background:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px),
    radial-gradient(circle at 22% 22%, rgba(210, 194, 166, 0.26), transparent 27%),
    var(--paper);
  background-size: 56px 56px, 56px 56px, auto, auto;
}

body.dark-mode {
  color-scheme: dark;
  --paper: #171614;
  --paper-soft: #201e1a;
  --ink: #f4efe7;
  --muted: #a99f8d;
  --faint: #777065;
  --line: rgba(244, 239, 231, 0.08);
  --line-strong: rgba(244, 239, 231, 0.17);
  --white: #24211d;
  --black: #f4efe7;
  --shadow: 0 26px 72px rgba(0, 0, 0, 0.42);
}

button,
input,
textarea,
select {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.paper-cross {
  position: fixed;
  z-index: 10;
  width: 26px;
  height: 26px;
  pointer-events: none;
  opacity: 0.58;
}

.paper-cross::before,
.paper-cross::after {
  content: "";
  position: absolute;
  background: var(--line-strong);
}

.paper-cross::before {
  left: 12px;
  top: 0;
  width: 1px;
  height: 26px;
}

.paper-cross::after {
  left: 0;
  top: 12px;
  width: 26px;
  height: 1px;
}

.cross-tl { left: 28px; top: 28px; }
.cross-tr { right: 28px; top: 28px; }
.cross-bl { left: 28px; bottom: 28px; }
.cross-br { right: 28px; bottom: 28px; }

.diamond {
  display: inline-block;
  width: 12px;
  height: 12px;
  transform: rotate(45deg);
  background: var(--red);
}

.login-view {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 0.84fr) minmax(500px, 1fr);
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
}

.auth-screen {
  overflow-x: hidden;
}

.login-top {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 8;
  height: 104px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 0 66px;
  pointer-events: none;
}

.wordmark {
  justify-self: start;
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  font-size: 28px;
  font-weight: 800;
}

.issue {
  align-self: center;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.language-switch {
  justify-self: end;
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 18px;
  height: 42px;
  border-bottom: 1px solid var(--line-strong);
  padding: 0 0 20px clamp(90px, 14vw, 260px);
  font-weight: 800;
  font-size: 20px;
}

.language-switch button,
.language-switch a,
.text-button,
.field-action {
  border: 0;
  background: transparent;
  color: inherit;
}

.language-switch a {
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}

.language-switch button:not(.active) {
  color: var(--muted);
}

.language-switch button.active {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 8px;
  text-decoration-thickness: 2px;
}

.login-editorial,
.auth-panel {
  min-height: 100vh;
  padding-top: clamp(132px, 14vh, 176px);
}

.login-editorial {
  border-right: 1px solid var(--line-strong);
  padding-left: clamp(28px, 5vw, 68px);
  padding-right: clamp(28px, 4vw, 70px);
}

.chapter-label {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--faint);
  font-size: 14px;
  letter-spacing: 0.18em;
}

.chapter-label span {
  width: 18px;
  height: 1px;
  background: var(--faint);
}

.login-editorial h1 {
  margin: clamp(34px, 5vh, 54px) 0 26px;
  font-family: var(--sans);
  font-weight: 950;
  font-size: clamp(50px, 5.4vw, 74px);
  line-height: 1.13;
  letter-spacing: 0;
}

.login-editorial h1 em,
.auth-panel h2 em,
.subscription-hero em,
.dashboard-hero em {
  color: var(--red);
  font-style: italic;
}

.login-editorial h1 em {
  position: relative;
  display: inline-block;
}

.login-editorial h1 em::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 4px;
  height: 6px;
  background: var(--red);
}

.login-editorial p {
  max-width: 660px;
  margin: 0;
  color: #756d61;
  font-size: 18px;
  line-height: 1.75;
  font-weight: 600;
}

.login-editorial .geo-summary {
  max-width: 620px;
  margin-top: 16px;
  font-size: 16px;
  line-height: 1.65;
}

body.dark-mode .login-editorial p {
  color: var(--muted);
}

.keeper-plate {
  width: min(560px, 92%);
  margin: clamp(34px, 5vh, 56px) auto 0;
  text-align: center;
}

.plate-line {
  width: 80%;
  height: 1px;
  margin: 0 auto 8px;
  background: var(--line-strong);
}

.keeper-image-frame {
  width: 100%;
  min-height: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px),
    rgba(255, 255, 255, 0.25);
  background-size: 34px 34px;
}

.keeper-image-frame picture,
.keeper-image-frame img {
  display: block;
  max-width: 100%;
  max-height: min(330px, 42vh);
  width: auto;
  height: auto;
  object-fit: contain;
}

.keeper-plate figcaption {
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  padding: 8px 0;
  font-size: 16px;
  font-weight: 800;
}

.keeper-plate figcaption em {
  font-style: italic;
}

.login-status {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 12px;
}

.login-status a {
  color: var(--red);
  font-family: var(--sans);
  font-weight: 900;
  text-decoration: none;
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #4aa869;
}

.auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(132px, 14vh, 176px) clamp(28px, 7vw, 200px) 46px;
}

.auth-panel h2 {
  margin: clamp(28px, 4vh, 46px) 0 16px;
  font-family: var(--sans);
  font-weight: 950;
  font-size: clamp(48px, 4.8vw, 64px);
  line-height: 1.08;
}

.auth-subtitle {
  margin: 0 0 34px;
  color: var(--muted);
  font-size: 18px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-bottom: 22px;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}

.auth-tabs button {
  height: 42px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.auth-tabs button.active {
  color: var(--ink);
}

.auth-form {
  display: grid;
  gap: 20px;
}

.register-contact {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 24px 0 8px;
  text-align: center;
}

.register-contact h3 {
  margin: 0;
  font-family: var(--sans);
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 950;
}

.register-contact p {
  max-width: 420px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.register-qr-frame {
  width: min(330px, 80vw);
  max-height: min(430px, 48vh);
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: #fff;
}

.register-qr-frame img {
  display: block;
  max-width: 100%;
  max-height: min(430px, 48vh);
  width: auto;
  height: auto;
  object-fit: contain;
}

.field-line {
  position: relative;
  display: grid;
  gap: 12px;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 18px;
}

.field-line > span {
  color: var(--muted);
  font-size: 16px;
}

.field-line > span b {
  color: var(--red);
  font-family: var(--sans);
  font-size: 14px;
}

.field-line input {
  width: 100%;
  min-width: 0;
  height: 44px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 25px;
  font-weight: 600;
}

.field-line input::placeholder {
  color: #b6ad9c;
}

.field-action {
  position: absolute;
  right: 0;
  bottom: 22px;
  color: var(--muted);
}

.verify-only input {
  padding-right: 138px;
}

#send-verify-code {
  min-width: 116px;
  text-align: right;
}

.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 17px;
}

.check-line {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--sans);
  font-weight: 650;
}

.check-line input {
  width: 22px;
  height: 22px;
  accent-color: var(--black);
}

.text-button {
  font-weight: 800;
}

.ink-button,
.solid-button,
.ghost-button {
  min-height: 56px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 0 26px;
  font-weight: 900;
  text-decoration: none;
}

.ink-button,
.solid-button {
  background: var(--black);
  color: var(--paper);
}

.ink-button {
  margin-top: 6px;
  width: 100%;
  position: relative;
}

.ink-button::before,
.ink-button::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border-color: rgba(255, 255, 255, 0.32);
}

.ink-button::before {
  left: 12px;
  top: 12px;
  border-left: 1px solid;
  border-top: 1px solid;
}

.ink-button::after {
  right: 12px;
  bottom: 12px;
  border-right: 1px solid;
  border-bottom: 1px solid;
}

.ghost-button {
  background: var(--white);
  color: var(--ink);
}

.form-message {
  min-height: 22px;
  margin: -8px 0 0;
  color: var(--red);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 700;
}

.form-message.success {
  color: var(--green);
}

.auth-onboarding {
  display: grid;
  gap: 10px;
  margin: 18px 0 20px;
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--white);
}

.auth-onboarding strong {
  font-size: 17px;
}

.auth-onboarding p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.auth-onboarding div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.auth-onboarding span {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.auth-onboarding a {
  color: var(--red);
  font-weight: 900;
  text-decoration: none;
}

.auth-footer {
  margin-top: auto;
  display: grid;
  justify-items: center;
  gap: 12px;
  padding-top: 44px;
  border-top: 1px solid var(--line-strong);
  color: var(--muted);
}

.auth-footer small {
  font-size: 14px;
}

.app-view {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line-strong);
  background: rgba(245, 241, 233, 0.84);
  backdrop-filter: blur(12px);
  z-index: 5;
}

body.dark-mode .sidebar {
  background: rgba(28, 26, 22, 0.9);
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 120px;
  padding: 24px 26px;
}

.brand-letter {
  font-family: var(--serif);
  font-size: 64px;
  font-weight: 900;
  line-height: 0.9;
}

.side-brand strong {
  display: block;
  font-style: italic;
  font-size: 22px;
}

.side-brand small {
  display: inline-flex;
  margin-top: 8px;
  padding: 1px 12px;
  border: 1px solid #f0c6bb;
  border-radius: 999px;
  color: var(--orange);
  font-size: 11px;
}

.side-nav {
  display: grid;
  gap: 8px;
  padding: 0 14px;
}

.nav-button,
.side-utility {
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  font-family: var(--sans);
  font-size: 18px;
  font-weight: 800;
  text-align: left;
}

.nav-button svg {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
}

.nav-button.active,
.nav-button:hover,
.side-utility:hover {
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 14px 32px rgba(57, 48, 35, 0.08);
}

body.dark-mode .nav-button.active,
body.dark-mode .nav-button:hover,
body.dark-mode .side-utility:hover {
  background: rgba(255, 255, 255, 0.08);
}

.side-section-title {
  margin: 12px 22px 4px;
  color: var(--muted);
  font-size: 16px;
  font-weight: 900;
}

.side-bottom {
  margin-top: auto;
  padding: 18px 14px 24px;
  border-top: 1px solid var(--line);
}

.workspace {
  min-width: 0;
  padding: 0 clamp(24px, 3vw, 62px) 60px;
}

.app-header {
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

.app-header h2 {
  margin: 0;
  font-size: 27px;
  font-weight: 900;
}

.app-header p {
  margin: 6px 0 0;
  color: var(--muted);
}

.header-tools {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--sans);
}

.icon-plain,
.language-chip,
.tiny-badge,
.wallet-badge,
.user-chip {
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--ink);
  font-weight: 800;
}

.icon-plain {
  background: transparent;
  padding: 0 4px;
  font-size: 22px;
}

.tiny-badge {
  color: #7e22ce;
  background: #f4e8ff;
}

.wallet-badge {
  background: var(--black);
  color: var(--paper);
}

.user-chip {
  background: transparent;
}

#user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  background: var(--green);
  color: #fff;
  font-weight: 900;
}

.user-chip b,
.user-chip small {
  display: block;
}

.user-chip small {
  color: var(--muted);
  font-weight: 600;
}

.user-menu {
  position: absolute;
  right: 0;
  top: 48px;
  z-index: 20;
  width: 330px;
  display: grid;
  gap: 0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  overflow: hidden;
  background: var(--white);
  box-shadow: var(--shadow);
}

.user-menu strong,
.user-menu span,
.user-menu button,
.user-menu a {
  padding: 16px 24px;
}

.user-menu strong {
  padding-bottom: 4px;
}

.user-menu span {
  padding-top: 0;
  color: var(--muted);
}

.user-menu button,
.user-menu a {
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: left;
  text-decoration: none;
  font-size: 20px;
}

.user-menu .danger {
  color: #e33434;
}

.mobile-shell-bar {
  display: none;
}

.page {
  display: none;
}

.page.active-page {
  display: block;
}

.dashboard-hero,
.subscription-hero {
  padding: 58px 0 44px;
  border-bottom: 1px solid var(--line-strong);
}

.page-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 52px 0 30px;
  border-bottom: 1px solid var(--line-strong);
}

.page-intro h1 {
  margin: 10px 0 8px;
  font-size: clamp(42px, 5vw, 72px);
  line-height: 1.05;
  font-weight: 500;
}

.page-intro p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 19px;
  font-weight: 700;
}

.eyebrow {
  color: var(--red);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.18em;
}

.intro-actions,
.hero-actions,
.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-actions {
  margin-top: 26px;
}

.date-line,
.breadcrumb-line {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--muted);
  font-size: 16px;
  letter-spacing: 0.26em;
}

.date-line::before,
.breadcrumb-line::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 99px;
  background: var(--red);
}

.dashboard-hero h1,
.subscription-hero h1 {
  margin: 34px 0 18px;
  font-size: clamp(58px, 7vw, 96px);
  line-height: 1.05;
  font-weight: 400;
}

.dashboard-hero p,
.subscription-hero p {
  margin: 0;
  color: #70685d;
  font-size: 21px;
  font-weight: 700;
}

body.dark-mode .dashboard-hero p,
body.dark-mode .subscription-hero p {
  color: var(--muted);
}

.metrics-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-bottom: 1px solid var(--line-strong);
}

.announcement-strip {
  display: grid;
  grid-template-columns: auto minmax(180px, 0.55fr) minmax(240px, 1fr);
  align-items: center;
  gap: 18px;
  margin: 28px 0 0;
  padding: 18px 22px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--shadow);
}

body.dark-mode .announcement-strip {
  background: rgba(255, 255, 255, 0.055);
}

.announcement-strip strong {
  font-size: 18px;
}

.announcement-strip span:last-child {
  color: var(--muted);
  line-height: 1.5;
}

.metric-cell {
  min-height: 170px;
  padding: 34px;
  border-right: 1px solid var(--line-strong);
}

.metric-cell:last-child {
  border-right: 0;
}

.metric-label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.metric-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.metric-main strong {
  font-size: clamp(42px, 5vw, 64px);
  font-weight: 400;
}

.metric-dash {
  flex: 1;
  max-width: 120px;
  height: 3px;
  background: var(--red);
}

.metric-cell:nth-child(2) .metric-dash {
  background: var(--blue);
}

.metric-cell:nth-child(3) .metric-dash {
  background: var(--line-strong);
}

.metric-note {
  color: var(--muted);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.8fr);
  gap: 28px;
  margin-top: 34px;
  min-width: 0;
}

.content-grid.equal {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card,
.wide-card,
.filter-card,
.table-card,
.subscription-card,
.redeem-card,
.profile-card {
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: var(--shadow);
}

body.dark-mode .card,
body.dark-mode .wide-card,
body.dark-mode .filter-card,
body.dark-mode .table-card,
body.dark-mode .subscription-card,
body.dark-mode .redeem-card,
body.dark-mode .profile-card {
  background: rgba(255, 255, 255, 0.055);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  min-height: 88px;
  padding: 26px 30px;
  border-bottom: 1px solid var(--line);
}

.card-header h3 {
  margin: 0;
  font-size: 30px;
}

.card-header p,
.card-body p {
  margin: 6px 0 0;
  color: var(--muted);
}

.card-body {
  min-width: 0;
  padding: 28px 30px;
}

.heatmap {
  display: grid;
  grid-template-columns: repeat(14, 1fr);
  gap: 8px;
  width: 100%;
  max-width: 820px;
  margin-top: 26px;
}

.heat-cell {
  aspect-ratio: 2 / 1;
  border-radius: 4px;
  background: #cfdfc6;
}

.heat-cell.hot { background: #d9573e; }
.heat-cell.mid { background: #6dad6e; }
.heat-cell.low { background: #a8cc9a; }

.balance-amount {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.balance-amount strong {
  font-size: 70px;
  font-weight: 400;
}

.balance-line {
  height: 12px;
  margin: 22px 0;
  background: linear-gradient(90deg, #cdecc4, #7bb273, #e25843);
}

.copy-button,
.icon-button,
.refresh-button,
.small-button {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 15px;
  font-family: var(--sans);
  font-weight: 800;
}

.copy-button {
  border: 0;
  background: transparent;
  color: inherit;
  min-height: 30px;
  padding: 0;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  color: var(--muted);
  min-width: 0;
}

.status-grid strong {
  display: block;
  color: var(--ink);
  font-size: 18px;
}

.key-overview {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 24px;
  min-width: 0;
}

.key-overview > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.model-list,
.live-list,
.simple-list {
  display: grid;
  gap: 18px;
}

.model-row,
.live-row,
.simple-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto;
  gap: 18px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.model-bar {
  height: 3px;
  margin-top: 9px;
  background: var(--red);
}

.live-row {
  grid-template-columns: 1fr auto auto;
}

.price {
  color: var(--red);
}

.filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  margin: 40px 0 20px;
}

.filters-row.compact {
  margin-top: 0;
}

.filter-input,
.filter-select,
.line-input {
  min-height: 52px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.75);
  color: var(--ink);
  padding: 0 18px;
  outline: 0;
}

body.dark-mode .filter-input,
body.dark-mode .filter-select,
body.dark-mode .line-input {
  background: rgba(255, 255, 255, 0.05);
}

.filter-input {
  min-width: min(320px, 100%);
}

.toolbar {
  margin-left: auto;
  display: flex;
  gap: 12px;
}

.table-card {
  overflow: hidden;
}

.table-scroll {
  overflow: auto;
  max-width: 100%;
  scrollbar-color: #8f959d transparent;
}

table {
  width: 100%;
  min-width: 1100px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 18px;
}

th,
td {
  padding: 24px 26px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: #5f6878;
  font-weight: 700;
  background: rgba(250, 250, 250, 0.72);
}

body.dark-mode th {
  background: rgba(255, 255, 255, 0.04);
}

.masked-key {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 8px;
  background: var(--black);
  color: var(--paper);
  padding: 0 10px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 14px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 8px;
  padding: 0 10px;
  background: #d6f9e8;
  color: #169a79;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.badge.orange {
  background: #ffe7cf;
  color: #d85a3e;
}

.badge.gray {
  background: #efede8;
  color: var(--muted);
}

.badge.red {
  background: #ffe1e1;
  color: #c7353c;
}

.key-group-control {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 260px;
}

.key-group-control .badge {
  max-width: 132px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.key-group-select {
  width: 132px;
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  padding: 0 24px 0 8px;
  outline: 0;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 800;
}

.key-group-select:hover,
.key-group-select:focus {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
}

body.dark-mode .key-group-select:hover,
body.dark-mode .key-group-select:focus {
  background: rgba(255, 255, 255, 0.08);
}

.key-group-select:disabled {
  cursor: wait;
  opacity: 0.58;
}

.announcement-screen {
  min-height: 100vh;
}

.announcement-top {
  position: sticky;
  top: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 86px;
  padding: 0 clamp(18px, 4vw, 66px);
  border-bottom: 1px solid var(--line-strong);
  background: rgba(242, 238, 230, 0.9);
  backdrop-filter: blur(14px);
}

body.dark-mode .announcement-top {
  background: rgba(23, 22, 20, 0.9);
}

.announcement-page {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 56px 0 86px;
}

.announcement-hero {
  padding: 36px 0 44px;
  border-bottom: 1px solid var(--line-strong);
}

.announcement-hero h1 {
  max-width: 900px;
  margin: 28px 0 18px;
  font-size: clamp(46px, 6vw, 82px);
  line-height: 1.06;
  font-weight: 400;
}

.announcement-hero h1 em {
  color: var(--red);
}

.announcement-hero p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 21px;
  font-weight: 700;
  line-height: 1.65;
}

.announcement-card {
  margin-top: 28px;
  padding: clamp(24px, 4vw, 42px);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
}

body.dark-mode .announcement-card {
  background: rgba(255, 255, 255, 0.055);
}

.announcement-card h2 {
  margin: 0 0 18px;
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 500;
}

.announcement-card p,
.announcement-card li {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.75;
}

.announcement-card ul {
  margin: 0;
  padding-left: 22px;
}

.announcement-card code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.announcement-card p code,
.announcement-card li code {
  color: var(--ink);
  background: rgba(199, 53, 60, 0.08);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.announcement-card pre {
  max-width: 100%;
  overflow: auto;
  margin: 14px 0 22px;
  padding: 20px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--black);
  color: var(--paper);
  line-height: 1.7;
  white-space: pre;
  scrollbar-color: #8f959d transparent;
}

.announcement-card pre code {
  display: block;
  min-width: 100%;
  width: max-content;
}

.quota-bar {
  width: 150px;
  height: 8px;
  border-radius: 999px;
  background: #e7e3dc;
  overflow: hidden;
}

.quota-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #95d399, #d85a3e);
}

.row-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.row-actions button {
  border: 0;
  background: transparent;
  color: #6f7785;
  display: grid;
  gap: 4px;
  justify-items: center;
  font-size: 13px;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 34px;
  padding: 16px 26px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
}

.pager-pages {
  display: flex;
  gap: 0;
}

.pager-pages button {
  min-width: 48px;
  height: 44px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
}

.pager-pages button.active {
  border-color: var(--green);
  color: var(--green);
}

.empty-state {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 12px;
  min-height: 520px;
  color: var(--muted);
  text-align: center;
  padding: 36px 20px;
}

.empty-state h3,
.empty-state p {
  margin: 0;
}

.empty-icon {
  width: 96px;
  height: 96px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  margin-bottom: 24px;
  background: rgba(255, 255, 255, 0.62);
  color: #c9cfd4;
  font-size: 42px;
}

.channel-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  margin: 62px 0 80px;
}

.operational {
  color: var(--green);
  background: #d7f7e5;
  border-radius: 999px;
  padding: 9px 18px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.subscription-card {
  display: grid;
  grid-template-columns: minmax(360px, 0.45fr) minmax(0, 1fr) 260px;
  overflow: hidden;
  margin-bottom: 30px;
}

.ticket-dark {
  background: var(--black);
  color: var(--paper);
  padding: 48px;
  min-height: 260px;
}

.ticket-dark small {
  display: block;
  color: var(--muted);
  letter-spacing: 0.2em;
  margin-bottom: 28px;
}

.ticket-dark h3 {
  margin: 0;
  font-size: 44px;
  font-style: italic;
  font-weight: 400;
  line-height: 1.2;
}

.ticket-main {
  padding: 36px 40px;
  border-right: 1px solid var(--line);
}

.ticket-main h3 {
  margin: 0 0 12px;
  font-size: 38px;
  font-weight: 400;
}

.ticket-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.progress-line {
  height: 13px;
  background: #e5e1d9;
  overflow: hidden;
  margin: 18px 0 26px;
}

.progress-line span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #c8edc7, #76b76f, #d85a3e);
}

.ticket-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.ticket-facts span {
  display: block;
  color: var(--muted);
}

.ticket-actions {
  display: grid;
  align-content: center;
  gap: 18px;
  padding: 26px 34px;
  background: rgba(255, 244, 244, 0.52);
}

.redeem-layout {
  display: grid;
  justify-items: center;
  gap: 30px;
  padding-top: 48px;
}

.balance-hero-card {
  width: min(840px, 100%);
  min-height: 290px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: white;
  background: linear-gradient(135deg, #23c7b4, #0f9b83);
  text-align: center;
}

.balance-hero-card strong {
  display: block;
  font-size: 58px;
  font-weight: 400;
  margin: 10px 0;
}

.redeem-card {
  width: min(840px, 100%);
  padding: 34px;
}

.profile-page-title {
  width: min(100%, 980px);
  margin: 16px auto 0;
  font-family: var(--sans);
}

.profile-page-title h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.05;
}

.profile-page-title p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.profile-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(360px, 0.56fr);
  gap: 28px;
  margin-top: 34px;
  min-width: 0;
}

.profile-settings-layout {
  width: min(100%, 980px);
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
  margin: 28px auto 0;
}

.profile-card {
  padding: 34px;
}

.profile-identity-card,
.profile-balance-card {
  min-height: 250px;
}

.redeem-form {
  display: grid;
  gap: 12px;
}

.redeem-form .line-input {
  width: 100%;
  height: 64px;
  font-size: 24px;
}

.info-list {
  color: #168675;
  line-height: 1.8;
  font-family: var(--sans);
}

.profile-grid {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 26px;
  align-items: center;
}

.profile-avatar {
  width: 132px;
  height: 132px;
  border-radius: 28px;
  display: grid;
  place-items: center;
  background: var(--green);
  color: white;
  font-size: 42px;
  font-weight: 900;
  overflow: hidden;
  font-family: var(--sans);
}

.profile-avatar.has-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-summary {
  min-width: 0;
}

.profile-kicker {
  display: inline-flex;
  color: var(--red);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.profile-summary h2,
.profile-info-card h3 {
  margin: 8px 0 0;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 0.98;
  overflow-wrap: anywhere;
}

.profile-summary p {
  margin: 10px 0 0;
  color: var(--muted);
  font-family: var(--sans);
  overflow-wrap: anywhere;
}

.profile-hero-grid {
  grid-template-columns: 96px minmax(0, 1fr);
}

.profile-hero-grid .profile-avatar {
  width: 88px;
  height: 88px;
  border-radius: 24px;
  font-size: 30px;
  box-shadow: 0 18px 36px rgba(26, 170, 145, 0.22);
}

.profile-settings-layout .profile-summary h2 {
  font-size: clamp(28px, 4vw, 40px);
}

.profile-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.profile-chip {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--white);
  padding: 0 12px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.profile-chip.good {
  border-color: rgba(26, 170, 145, 0.38);
  background: rgba(215, 245, 228, 0.58);
  color: #168675;
}

.profile-chip.bad {
  border-color: rgba(199, 53, 60, 0.35);
  background: rgba(199, 53, 60, 0.08);
  color: var(--red);
}

.profile-chip.neutral {
  color: var(--muted);
}

.profile-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 28px;
}

.profile-hero-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.profile-stat-grid div {
  min-width: 0;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.profile-stat-grid span {
  display: block;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile-stat-grid strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 400;
  overflow-wrap: anywhere;
}

.profile-info-card {
  grid-column: 1 / -1;
}

.profile-section-card {
  padding: 0;
  overflow: hidden;
}

.profile-section-header {
  padding: 26px 28px 18px;
  border-bottom: 1px solid var(--line);
  font-family: var(--sans);
}

.profile-section-header h3,
.profile-support-card h3,
.profile-quota-card h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.18;
}

.profile-section-header p,
.profile-support-card p,
.profile-security-state p {
  margin: 8px 0 0;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
}

.profile-edit-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1fr);
  gap: 24px;
  padding: 26px 28px 28px;
}

.profile-avatar-panel {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 22px;
  font-family: var(--sans);
}

.profile-avatar-panel .profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  font-size: 24px;
}

.profile-avatar-panel strong {
  font-size: 16px;
}

.profile-avatar-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.profile-info-list {
  display: grid;
  gap: 0;
  margin: 20px 0 0;
  border-top: 1px solid var(--line-strong);
}

.profile-info-list.compact {
  margin: 0;
  border-top: 0;
}

.profile-info-row {
  display: grid;
  grid-template-columns: minmax(160px, 0.36fr) minmax(0, 1fr);
  gap: 20px;
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
}

.profile-info-row dt,
.profile-info-row dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.profile-info-row dt {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.profile-info-row dd {
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 650;
  text-align: right;
}

.profile-binding-list {
  display: grid;
  gap: 14px;
  padding: 26px 28px 28px;
}

.profile-binding-row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 18px;
  font-family: var(--sans);
}

.profile-binding-icon,
.profile-support-icon,
.profile-security-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(26, 170, 145, 0.12);
  color: var(--green);
  font-weight: 850;
}

.profile-binding-icon svg,
.profile-support-icon svg,
.profile-security-icon svg {
  width: 20px;
  height: 20px;
}

.profile-binding-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.profile-binding-main {
  min-width: 0;
}

.profile-binding-main p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.profile-binding-action {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.profile-support-card {
  display: flex;
  align-items: center;
  gap: 18px;
  background: rgba(26, 170, 145, 0.1);
  font-family: var(--sans);
}

.profile-support-card p {
  margin-top: 4px;
  color: var(--ink);
  font-weight: 750;
}

.profile-password-form {
  display: grid;
  gap: 18px;
  padding: 26px 28px 28px;
  font-family: var(--sans);
}

.profile-password-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.profile-password-form input {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink);
  padding: 0 14px;
}

body.dark-mode .profile-password-form input {
  background: rgba(255, 255, 255, 0.075);
}

.profile-password-form label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.profile-form-actions {
  display: flex;
  justify-content: flex-end;
}

.profile-security-state {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 26px 28px 28px;
  font-family: var(--sans);
}

.profile-security-state strong {
  font-size: 17px;
}

.profile-security-state.is-enabled .profile-security-icon {
  background: rgba(26, 170, 145, 0.14);
  color: var(--green);
}

.profile-quota-card {
  padding: 28px;
}

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(10, 10, 10, 0.34);
  padding: 22px;
}

.modal {
  width: min(560px, 100%);
  max-height: min(86vh, 920px);
  overflow: auto;
  border-radius: 8px;
  background: var(--paper-soft);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  padding: 28px;
}

.modal-wide {
  width: min(860px, 100%);
}

.modal h3 {
  margin: 0 0 18px;
  font-size: 28px;
}

.modal-copy {
  margin: -6px 0 18px;
  color: var(--muted);
}

.modal form {
  display: grid;
  gap: 16px;
}

.modal label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-family: var(--sans);
  font-weight: 800;
}

.modal input,
.modal select,
.modal textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: var(--white);
}

.modal input,
.modal select {
  height: 48px;
}

.modal textarea {
  min-height: 96px;
  padding: 12px;
  resize: vertical;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ccs-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 8px 0 16px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.ccs-actions {
  justify-content: flex-start;
}

.ccs-hint {
  margin: -4px 0 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.ccs-snippet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.ccs-snippet-grid section {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--white);
}

.ccs-snippet-grid h4 {
  margin: 0 0 10px;
  font-size: 15px;
}

.ccs-snippet-grid textarea {
  min-height: 190px;
  margin-bottom: 10px;
}

/* 20260706 relay video generator */
.video-dream-shell {
  min-height: calc(100vh - 90px);
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  margin: -18px -22px 0;
  background: #f7f8fa;
  color: #151922;
}

.video-dream-sidebar {
  position: sticky;
  top: 0;
  min-height: calc(100vh - 90px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 28px 10px;
  background: rgba(255, 255, 255, 0.72);
  border-right: 1px solid #eef0f3;
}

.video-dream-logo {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: linear-gradient(135deg, #16c8ff, #7d5cff);
  color: #fff;
  font-weight: 950;
  margin-bottom: 62px;
}

.video-dream-sidebar button {
  width: 48px;
  min-height: 48px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: #667085;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.video-dream-sidebar button.is-active,
.video-dream-sidebar button:hover {
  background: #ffffff;
  color: #101828;
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.08);
}

.video-dream-main {
  min-width: 0;
  padding: 0 48px 64px;
}

.video-dream-promo {
  margin: 0 -48px 72px;
  height: 34px;
  display: grid;
  place-items: center;
  background: linear-gradient(90deg, #ffdb7c, #20c8ff 34%, #1198f6);
  color: #fff;
  font-weight: 950;
  font-size: 14px;
}

.video-dream-hero {
  max-width: 1220px;
  margin: 0 auto 36px;
}

.video-dream-hero h1 {
  margin: 0 0 44px;
  text-align: center;
  font-size: 30px;
  font-weight: 950;
  color: #121722;
}

.video-dream-hero h1 em {
  color: #00a8d8;
  font-style: normal;
}

/* ═══════════════════════════════════════════
   新版视频生成 UI（.vg-* 命名空间）
═══════════════════════════════════════════ */

/* 整体容器 */
.vg-shell {
  min-height: calc(100vh - 90px);
  display: flex;
  flex-direction: column;
  gap: 0;
  background: #f4f6f9;
  margin: -18px -22px 0;
  color: #151922;
}

/* 顶部标题栏 */
.vg-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  background: #fff;
  border-bottom: 1px solid #e8ebf0;
  gap: 14px;
  flex-wrap: wrap;
}

.vg-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.vg-title {
  margin: 0;
  font-size: 17px;
  font-weight: 900;
  color: #101828;
}

.vg-model-badge {
  padding: 2px 9px;
  border-radius: 999px;
  background: linear-gradient(90deg, #e8f4ff, #edf0ff);
  border: 1px solid #c7d9f5;
  font-size: 11px;
  font-weight: 800;
  color: #3a5fad;
}

.vg-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.vg-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.vg-status-dot.is-ok  { background: #12b76a; box-shadow: 0 0 0 3px rgba(18,183,106,.15); }
.vg-status-dot.is-err { background: #f04438; box-shadow: 0 0 0 3px rgba(240,68,56,.15); }

.vg-status-text {
  font-size: 12px;
  color: #667085;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vg-refresh-btn {
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid #e8ebf0;
  background: #fff;
  color: #344054;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.12s;
}
.vg-refresh-btn:hover { background: #f4f6f9; }

/* 主区：左右两栏 */
.vg-main {
  display: grid;
  grid-template-columns: minmax(340px, .78fr) minmax(460px, 1.22fr);
  gap: 20px;
  padding: 22px 28px;
  align-items: start;
}

/* 左栏：输入 */
.vg-compose {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e8ebf0;
  box-shadow: 0 4px 20px rgba(16,24,40,.05);
  overflow: hidden;
  width: 100%;
  max-width: 560px;
  justify-self: center;
}

.vg-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
}

.vg-compose-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 30px;
  border-bottom: 1px solid #e8ebf0;
  padding-bottom: 10px;
}

.vg-compose-topline span {
  color: #101828;
  font-size: 13px;
  font-weight: 900;
}

.vg-compose-topline strong {
  border-radius: 999px;
  background: #f1f5f9;
  color: #667085;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.vg-mode-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.vg-mode-button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: #fff;
  color: #101828;
  font-size: 14px;
  font-weight: 850;
  cursor: pointer;
  transition: border-color .12s, background .12s, color .12s;
}

.vg-mode-button span {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  color: inherit;
  font-size: 15px;
}

.vg-mode-button.is-active {
  border-color: #2d87d9;
  background: #f5fbff;
  color: #1f70b7;
  box-shadow: inset 0 0 0 1px rgba(45, 135, 217, .12);
}

.vg-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 800;
  color: #344054;
}

.video-polish-key-control {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 12px;
  color: #475467;
}

.video-polish-controls {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(180px, .75fr);
  gap: 10px;
  align-items: end;
}

.video-polish-key-control select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: #fff;
  color: #101828;
  font-size: 12px;
  font-weight: 800;
}

.video-polish-key-control select#video-polish-model-select {
  min-width: 0;
}

.video-polish-key-empty {
  margin: 0 0 8px;
  font-size: 12px;
  color: #667085;
}

/* 提示词文本框容器 */
.vg-textarea-wrap {
  position: relative;
}

.vg-textarea-wrap textarea {
  width: 100%;
  min-height: 180px;
  padding: 18px 20px 50px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: #fffdf9;
  color: #101828;
  font-size: 14px;
  line-height: 1.7;
  resize: vertical;
  box-shadow: none;
  outline: none;
  box-sizing: border-box;
  transition: border-color .15s;
}
.vg-textarea-wrap textarea:focus {
  border-color: #84adf0;
  background: #fff;
}

.vg-polish-btn {
  position: absolute;
  right: 10px;
  bottom: 9px;
  padding: 4px 11px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 8px;
  border: 1px solid #c9d5e8;
  background: #f5f8ff;
  color: #3a5fad;
  cursor: pointer;
  transition: background .12s, border-color .12s;
  white-space: nowrap;
}
.vg-polish-btn:hover  { background: #e8eeff; border-color: #7a9fd9; }
.vg-polish-btn:disabled { opacity: .5; cursor: not-allowed; }

/* 来源提示 */
.vg-source-note {
  margin: -4px 0 0;
  padding: 8px 12px;
  border-radius: 8px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 12px;
  line-height: 1.5;
}

/* 上传区 */
.vg-upload-zone {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border: 1.5px dashed rgba(45, 135, 217, .42);
  border-radius: 8px;
  background: #fffdf9;
  cursor: pointer;
  transition: border-color .12s, background .12s;
}
.vg-upload-zone:hover,
.vg-upload-zone.is-dragging { border-color: #84adf0; background: #eef4ff; }

.vg-upload-icon {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(45, 135, 217, .34);
  background: #eef8ff;
  color: #1f70b7;
  font-size: 18px;
  line-height: 1;
  font-weight: 900;
  flex-shrink: 0;
}

.vg-upload-zone div { display: flex; flex-direction: column; gap: 2px; }
.vg-upload-zone strong { font-size: 13px; font-weight: 800; color: #344054; }
.vg-upload-zone span  { font-size: 11px; color: #98a2b3; }

/* 参数选项 */
.vg-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.vg-choice-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.vg-choice-stack {
  grid-area: choices;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-self: start;
  min-width: 0;
}

.vg-choice-row > span {
  color: #101828;
  font-size: 13px;
  font-weight: 850;
}

.vg-choice-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.vg-choice-pill {
  min-width: 58px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid #c9d1dc;
  border-radius: 999px;
  background: #fff;
  color: #101828;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.vg-choice-pill.is-active {
  border-color: #2d87d9;
  background: #eef8ff;
  color: #1f70b7;
}

.vg-choice-row--split {
  grid-template-columns: 72px auto;
  justify-content: space-between;
}

.vg-stepper {
  display: inline-grid;
  grid-template-columns: 34px 58px 34px;
  align-items: center;
  justify-self: start;
  width: max-content;
  height: 34px;
  border: 1px solid #c9d1dc;
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
}

.vg-stepper button {
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  color: #101828;
  font-size: 18px;
  font-weight: 900;
  padding: 0;
}

.vg-stepper input {
  width: 58px;
  height: 34px;
  border: 0;
  border-left: 1px solid rgba(45, 39, 30, .08);
  border-right: 1px solid rgba(45, 39, 30, .08);
  background: #fff;
  color: #101828;
  text-align: center;
  font-size: 13px;
  font-weight: 850;
  padding: 0;
}

.vg-cost-note {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(209, 93, 18, .15);
  border-radius: 8px;
  background: #fff8ec;
  color: #d15d12;
}

.vg-cost-note span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #f59e0b;
  color: #fff;
  font-size: 15px;
  font-weight: 950;
}

.vg-cost-note strong {
  font-size: 13px;
  font-weight: 900;
}

.vg-opt {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.vg-opt span {
  font-size: 11px;
  font-weight: 800;
  color: #667085;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.vg-opt select {
  height: 38px;
  padding: 0 10px;
  border: 1px solid #d0d5dd;
  border-radius: 10px;
  background: #fff;
  color: #101828;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .12s;
}
.vg-opt select:focus { border-color: #84adf0; outline: none; }

/* 操作按钮行 */
.vg-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.vg-retry-btn {
  padding: 0 16px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid #d0d5dd;
  background: #fff;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background .12s;
}
.vg-retry-btn:hover    { background: #f4f6f9; }
.vg-retry-btn:disabled { opacity: .45; cursor: not-allowed; }

.vg-submit-btn {
  flex: 1;
  height: 50px;
  border-radius: 8px;
  border: none;
  background: #1f83ee;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: opacity .12s, box-shadow .12s;
  box-shadow: 0 4px 14px rgba(45,110,245,.35);
}
.vg-submit-btn:hover    { opacity: .92; box-shadow: 0 6px 20px rgba(45,110,245,.45); }
.vg-submit-btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }

/* 状态消息 */
.vg-message {
  margin: 0;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.55;
  color: #475467;
  background: #f9fafb;
  border: 1px solid #e8ebf0;
}
.vg-message.is-warning {
  background: #fff5f5;
  border-color: #fecaca;
  color: #b91c1c;
}
.vg-message.success {
  background: #f0fdf4;
  border-color: #86efac;
  color: #15803d;
}

/* 右栏：结果 + 日志 */
.vg-output {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.vg-result-panel,
.vg-log-panel {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e8ebf0;
  box-shadow: 0 4px 20px rgba(16,24,40,.05);
  overflow: hidden;
}

.vg-panel-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #f2f4f7;
  gap: 10px;
}
.vg-panel-hd h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 900;
  color: #101828;
}

.vg-status-badge {
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}
.vg-status-badge.is-err {
  background: #fff5f5;
  color: #dc2626;
  border-color: #fecaca;
}

.vg-panel-body {
  padding: 18px;
  min-height: 120px;
}

.vg-log-hint {
  font-size: 11px;
  color: #98a2b3;
}

.vg-log-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 168px;
  max-height: 168px;
  box-sizing: border-box;
  overflow-y: auto;
  padding: 8px 10px;
}

.vg-log-panel:not(.vg-gallery-panel) {
  max-height: 224px;
  overflow: hidden;
}

.vg-log-body .video-log-row {
  gap: 2px;
  padding: 5px 7px;
  border-radius: 6px;
  font-size: 10px;
  line-height: 1.35;
}

.vg-log-body .video-log-row span,
.vg-log-body .video-log-row strong,
.vg-log-body .video-log-empty {
  font-size: 10px;
  line-height: 1.35;
}

/* 优秀作品区 */
.vg-gallery {
  margin: 0 28px 32px;
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e8ebf0;
  box-shadow: 0 4px 20px rgba(16,24,40,.05);
  overflow: hidden;
}

.vg-gallery-hd {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid #f2f4f7;
}
.vg-gallery-hd h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 900;
  color: #101828;
}
.vg-gallery-hd p {
  margin: 0;
  font-size: 12px;
  color: #98a2b3;
}

.video-prompt-composer {
  display: block;
  min-height: 168px;
  border: 1px solid #e8ebf0;
  border-radius: 26px;
  background: #fff;
  padding: 18px;
  box-shadow: 0 18px 60px rgba(16, 24, 40, 0.06);
}

.video-reference-tile {
  width: 56px;
  height: 74px;
  align-self: start;
  display: none;
  place-items: center;
  gap: 3px;
  border-radius: 4px;
  background: #f1f2f4;
  color: #98a2b3;
  transform: rotate(-7deg);
  font-weight: 950;
}

.video-reference-tile span {
  font-size: 11px;
  font-weight: 800;
}

.video-prompt-composer .video-generator-form {
  padding: 0;
  gap: 10px;
}

.video-prompt-composer .video-generator-form textarea,
.video-prompt-composer .video-generator-form select {
  border-color: transparent;
  background: transparent;
  border-radius: 10px;
}

.video-prompt-composer textarea {
  min-height: 76px;
  border: 0;
  resize: none;
  padding: 2px 0;
  color: #101828;
  font-size: 15px;
  line-height: 1.7;
  box-shadow: none;
}

/* ── AI 润色按钮 ── */
.video-prompt-wrap {
  position: relative;
}

.video-polish-btn {
  position: absolute;
  right: 4px;
  bottom: 6px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 8px;
  border: 1px solid #c9d5e8;
  background: #f5f8ff;
  color: #3a5fad;
  cursor: pointer;
  line-height: 1.6;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
  white-space: nowrap;
  z-index: 2;
}

.video-polish-btn:hover {
  background: #e8eeff;
  border-color: #7a9fd9;
}

.video-polish-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ── 润色结果区 ── */
.video-polish-result {
  margin: 8px 0 4px;
  border: 1px solid #c9d5e8;
  border-radius: 12px;
  background: #f5f8ff;
  padding: 12px 14px;
}

.video-polish-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #3a5fad;
}

.video-polish-lang-tabs {
  display: flex;
  gap: 4px;
}

.video-polish-lang-tab {
  padding: 2px 10px;
  font-size: 12px;
  border-radius: 6px;
  border: 1px solid #c9d5e8;
  background: #fff;
  color: #475467;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.video-polish-lang-tab.is-active {
  background: #3a5fad;
  color: #fff;
  border-color: #3a5fad;
}

.video-polish-text {
  font-size: 14px;
  line-height: 1.7;
  color: #101828;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0 0 10px;
}

.video-polish-actions {
  display: flex;
  gap: 8px;
}

.video-polish-actions .solid-button,
.video-polish-actions .ghost-button {
  padding: 5px 14px;
  font-size: 13px;
  border-radius: 8px;
}

.video-options-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.video-upload-zone {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  border: 1px dashed #cfd6e3;
  border-radius: 14px;
  background: #f8fafc;
  padding: 10px 12px;
  color: #475467;
  cursor: pointer;
}

.video-upload-zone.is-dragging {
  border-color: #00a8d8;
  background: #eefaff;
}

.video-upload-zone span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: #101828;
  color: #fff;
  font-weight: 950;
}

.video-upload-zone strong {
  color: #263241;
  font-size: 13px;
  font-weight: 900;
}

.video-asset-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.video-asset-empty {
  color: #8b95a1;
  font-size: 12px;
  font-weight: 750;
}

.video-asset-chip {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 7px;
  border: 1px solid #e8ebf0;
  border-radius: 999px;
  background: #fff;
  padding: 6px 8px;
  color: #344054;
}

.video-asset-chip span {
  color: #007ea7;
  font-size: 11px;
  font-weight: 950;
}

.video-asset-chip strong {
  overflow: hidden;
  max-width: min(220px, 52vw);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 850;
}

.video-asset-chip em {
  color: #98a2b3;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.video-asset-chip button {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #f1f2f4;
  color: #667085;
  cursor: pointer;
}

.vg-watermark {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #e8d7bd;
  border-radius: 8px;
  background: #fffaf2;
}

.vg-watermark-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #241c14;
  font-size: 14px;
  font-weight: 850;
}

.vg-watermark-check input {
  width: 16px;
  height: 16px;
  accent-color: #f6a400;
}

.vg-watermark-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 124px 74px 110px;
  align-items: stretch;
  gap: 10px;
}

.vg-watermark-controls input,
.vg-watermark-controls select {
  min-width: 0;
  height: 48px;
  border: 1px solid #d8dce3;
  border-radius: 7px;
  background: #fff;
  color: #101828;
  padding: 0 16px;
  font-size: 15px;
  font-weight: 650;
}

.vg-watermark-controls #video-watermark-size {
  padding: 0 10px;
  text-align: center;
}

.vg-watermark-button {
  justify-self: stretch;
  height: 48px;
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  background: #f6a400;
  color: #fff;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
}

.video-options-bar select,
.video-options-bar button,
.video-mode-card,
.video-gallery-tabs button,
.video-gallery-tabs input {
  height: 34px;
  border: 1px solid #e8ebf0;
  border-radius: 10px;
  background: #fff;
  color: #263241;
  font-weight: 850;
}

.video-options-bar select {
  width: auto;
  flex: 0 0 auto;
  padding: 0 12px;
}

.video-options-bar select:first-child {
  max-width: 220px;
}

.video-send-button {
  width: 38px;
  height: 38px;
  margin-left: auto;
  border-radius: 50%;
  padding: 0;
  font-size: 20px;
}

.video-mode-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-top: 40px;
}

.video-mode-card {
  height: 74px;
  display: grid;
  align-content: center;
  justify-items: start;
  padding: 0 22px;
  box-shadow: 0 12px 32px rgba(16, 24, 40, 0.05);
}

.video-mode-card strong,
.video-inspire-meta strong {
  color: #101828;
  font-size: 15px;
}

.video-mode-card span,
.video-inspire-meta p {
  color: #8b95a1;
  font-size: 12px;
}

.video-workbench-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
  gap: 18px;
  max-width: 1220px;
  margin: 22px auto;
}

.video-log-panel,
.video-gallery-section {
  min-width: 0;
  border: 1px solid #e8ebf0;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 14px 44px rgba(16, 24, 40, 0.05);
}

.video-log-body {
  display: grid;
  gap: 4px;
  height: 168px;
  max-height: 168px;
  box-sizing: border-box;
  overflow: auto;
  padding: 8px 10px;
}

.video-log-row {
  display: grid;
  gap: 2px;
  padding: 5px 7px;
  border-radius: 6px;
  background: #f7f8fa;
  color: #475467;
  font-size: 10px;
  line-height: 1.35;
}

.video-log-row span {
  color: #98a2b3;
  font-size: 10px;
}

.video-log-row strong {
  font-size: 10px;
  line-height: 1.35;
}

.video-gallery-section {
  max-width: 1220px;
  margin: 34px auto 0;
  padding: 0 0 18px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.video-gallery-tabs {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}

.video-gallery-tabs button {
  min-width: 64px;
}

.video-gallery-tabs button.is-active {
  background: #eef1f5;
}

.video-gallery-tabs input {
  width: 300px;
  margin-left: 20px;
  padding: 0 16px;
}

.video-gallery-grid {
  columns: 4 220px;
  column-gap: 8px;
}

.video-inspire-card {
  break-inside: avoid;
  display: inline-block;
  width: 100%;
  margin: 0 0 8px;
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 8px 22px rgba(16, 24, 40, 0.06);
}

.video-inspire-card.is-active {
  border: 1px solid rgba(40, 139, 215, 0.54);
  box-shadow: 0 0 0 2px rgba(40, 139, 215, 0.12), 0 8px 22px rgba(16, 24, 40, 0.06);
}

.video-inspire-media {
  position: relative;
  min-height: 190px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #e7f8ff, #f2f4f7);
  color: #98a2b3;
  font-weight: 900;
}

.video-inspire-media video {
  width: 100%;
  height: auto;
  display: block;
}

.video-inline-controls {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 8;
}

.video-inline-controls > button {
  width: 36px;
  height: 36px;
  min-height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.52);
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.video-inline-controls > button:hover {
  background: rgba(0, 0, 0, 0.68);
}

.video-inline-menu {
  position: absolute;
  right: 0;
  bottom: 44px;
  z-index: 12;
  display: none;
  min-width: 92px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(24, 24, 27, 0.92);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
}

.video-inline-controls.is-menu-open .video-inline-menu {
  display: grid;
  gap: 4px;
}

.video-inline-menu button {
  width: 100%;
  height: 30px;
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #fff;
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.video-inline-menu button:hover {
  background: rgba(255, 255, 255, 0.16);
}

.video-inspire-meta {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.video-inspire-meta p {
  display: none;
}

.video-inspire-meta div {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  align-items: center;
}

.video-inspire-meta .small-button {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0 9px;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

.video-gallery-empty,
.video-log-empty {
  padding: 24px;
  color: #8b95a1;
}

.video-generator-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr);
  gap: 28px;
  margin-top: 32px;
  align-items: start;
}

.video-generator-card,
.video-result-panel {
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.9);
  box-shadow: var(--shadow);
}

.video-first-use-panel,
.video-status-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.92);
  padding: 16px 18px;
  box-shadow: 0 12px 30px rgba(72, 55, 36, 0.08);
}

.video-first-use-panel {
  align-items: flex-start;
}

.video-first-use-panel div {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.video-first-use-panel strong,
.video-status-panel span {
  color: var(--red);
  font-weight: 950;
}

.video-first-use-panel span,
.video-status-panel strong {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 850;
}

.video-first-use-panel p {
  max-width: 420px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.video-status-panel.is-ready {
  border-color: rgba(23, 100, 79, .24);
  background: #f3fbf6;
}

.video-status-panel.is-danger {
  border-color: rgba(195, 58, 63, .28);
  background: #fff5f1;
}

.video-generator-form {
  display: grid;
  gap: 18px;
  padding: 28px;
}

.video-generator-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-family: var(--sans);
  font-weight: 850;
}

.video-source-note {
  margin: -6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.video-generator-form textarea,
.video-generator-form select,
.video-raw-result textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  outline: 0;
}

.video-generator-form textarea {
  min-height: 220px;
  padding: 16px;
  resize: vertical;
  line-height: 1.62;
}

.video-generator-form select {
  height: 48px;
  padding: 0 12px;
}

.video-options-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.video-prompt-composer .video-generator-form textarea {
  min-height: 76px;
  border: 0;
  background: transparent;
  padding: 2px 0;
  resize: none;
  box-shadow: none;
}

.video-prompt-composer .video-generator-form select {
  width: auto;
  min-width: 96px;
  max-width: 220px;
  height: 34px;
  border: 1px solid #e8ebf0;
  background: #fff;
  padding: 0 12px;
}

.video-form-actions,
.video-result-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.video-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.video-result-card {
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  overflow: hidden;
  background: var(--white);
}

.video-preview-frame {
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  background: #17130f;
}

.video-preview-frame video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.video-result-meta {
  justify-content: space-between;
  padding: 14px;
}

.video-raw-result {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.video-raw-result summary {
  cursor: pointer;
  font-family: var(--sans);
  font-weight: 900;
}

.video-raw-result textarea {
  min-height: 180px;
  margin: 12px 0;
  padding: 12px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.onboarding-panel,
.keys-copy-panel {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--white);
  padding: 22px;
}

.onboarding-panel h3,
.keys-copy-panel h3,
.quickstart-grid h4 {
  margin: 0;
}

.onboarding-panel p,
.keys-copy-panel p,
.quickstart-grid p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.onboarding-steps,
.onboarding-actions,
.empty-actions,
.quickstart-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.onboarding-steps span {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  color: var(--muted);
  font-weight: 900;
}

.onboarding-steps b {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--muted);
  font-size: 12px;
}

.onboarding-steps .is-done {
  border-color: rgba(34, 137, 94, 0.28);
  color: var(--green);
}

.onboarding-steps .is-done b {
  background: var(--green);
  color: var(--white);
}

.keys-copy-panel {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.quickstart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.quickstart-grid section {
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--white);
  padding: 14px;
}

.quickstart-actions {
  margin-top: 12px;
}

.quickstart-actions .small-button {
  min-height: 34px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
}

#toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 80;
  transform: translate(-50%, 14px);
  min-width: 160px;
  max-width: min(90vw, 520px);
  padding: 12px 18px;
  border-radius: 8px;
  background: var(--black);
  color: var(--paper);
  box-shadow: var(--shadow);
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

#toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.float-language {
  position: fixed;
  right: 18px;
  bottom: 18px;
  top: auto;
  z-index: 11;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 999px;
  background: #f39ab0;
  color: white;
  font-weight: 900;
  box-shadow: var(--shadow);
}

.skeleton {
  min-height: 240px;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.error-note {
  color: var(--red);
  font-family: var(--sans);
  font-weight: 800;
}

.error-panel {
  gap: 12px;
  text-align: center;
}

.loading-note {
  color: var(--muted);
}

body.sidebar-collapsed .app-view {
  grid-template-columns: 94px minmax(0, 1fr);
}

body.sidebar-collapsed .side-brand div,
body.sidebar-collapsed .nav-button span,
body.sidebar-collapsed .side-utility span,
body.sidebar-collapsed .side-section-title {
  display: none;
}

body.sidebar-collapsed .nav-button,
body.sidebar-collapsed .side-utility {
  justify-content: center;
  padding: 0;
}

@media (max-width: 1180px) {
  .login-view {
    display: flex;
    flex-direction: column;
  }

  .login-top {
    position: static;
    height: auto;
    padding: 24px 24px 12px;
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .language-switch {
    justify-self: start;
    padding-left: 0;
  }

  .login-editorial,
  .auth-panel {
    min-height: auto;
    padding-top: 36px;
  }

  .auth-panel {
    order: 1;
    padding: 36px 28px 36px;
  }

  .login-editorial {
    order: 2;
    border-right: 0;
    border-bottom: 1px solid var(--line-strong);
  }

  .app-view {
    grid-template-columns: 1fr;
  }

  .mobile-shell-bar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 58px;
    padding: 0 14px;
    border-bottom: 1px solid var(--line-strong);
    background: rgba(245, 241, 233, 0.94);
    backdrop-filter: blur(12px);
  }

  .mobile-shell-bar button {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    min-height: 36px;
    padding: 0 12px;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(310px, calc(100vw - 42px));
    transform: translateX(-105%);
    transition: transform 0.18s ease;
  }

  body.mobile-nav-open .sidebar {
    transform: translateX(0);
  }

  body.sidebar-collapsed .app-view {
    grid-template-columns: 1fr;
  }

  body.sidebar-collapsed .side-brand div,
  body.sidebar-collapsed .nav-button span,
  body.sidebar-collapsed .side-utility span,
  body.sidebar-collapsed .side-section-title {
    display: block;
  }

  body.sidebar-collapsed .nav-button,
  body.sidebar-collapsed .side-utility {
    justify-content: flex-start;
    padding: 0 18px;
  }

  .workspace {
    padding: 0 16px 40px;
  }

  .app-header {
    align-items: flex-start;
    flex-direction: column;
    padding-top: 18px;
  }

  .header-tools {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .content-grid,
  .content-grid.equal,
  .announcement-strip,
  .metrics-strip,
  .video-generator-layout,
  .video-dream-shell,
  .video-workbench-grid {
    grid-template-columns: 1fr;
  }

  /* 新版 vg-* 移动端 */
  .vg-main {
    grid-template-columns: 1fr;
    padding: 16px;
    gap: 14px;
  }

  .vg-header {
    padding: 12px 16px;
  }

  .vg-status-text {
    display: none;
  }

  .vg-options {
    grid-template-columns: 1fr 1fr;
  }

  .video-polish-controls,
  .vg-choice-row {
    grid-template-columns: 1fr;
  }

  .vg-gallery {
    margin: 0 16px 24px;
  }

  .video-dream-sidebar {
    position: static;
    min-height: auto;
    flex-direction: row;
    justify-content: center;
    border-right: 0;
    border-bottom: 1px solid #eef0f3;
  }

  .video-dream-logo {
    margin: 0;
  }

  .video-dream-main {
    padding: 0 16px 42px;
  }

  .video-dream-promo {
    margin: 0 -16px 38px;
    padding: 0 12px;
    text-align: center;
  }

  .video-prompt-composer,
  .video-mode-strip {
    grid-template-columns: 1fr;
  }

  .video-reference-tile {
    display: none;
  }

  .video-first-use-panel,
  .video-status-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .page-intro {
    align-items: flex-start;
    flex-direction: column;
  }

  .intro-actions {
    width: 100%;
  }

  .intro-actions .solid-button,
  .intro-actions .ghost-button,
  .video-form-actions .solid-button,
  .video-form-actions .ghost-button,
  .hero-actions .solid-button,
  .hero-actions .ghost-button,
  .inline-actions .solid-button,
  .inline-actions .ghost-button {
    flex: 1 1 180px;
  }

  .metric-cell {
    border-right: 0;
    border-bottom: 1px solid var(--line-strong);
  }

  .subscription-card {
    grid-template-columns: 1fr;
  }

  .ticket-main {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 700px) {
  .cross-tr,
  .cross-br {
    display: none;
  }

  .login-top {
    padding: 20px 20px 10px;
    gap: 12px;
  }

  .wordmark {
    font-size: 22px;
    gap: 10px;
  }

  .issue {
    font-size: 11px;
  }

  .language-switch {
    gap: 12px;
    height: auto;
    padding-bottom: 14px;
    font-size: 16px;
  }

  .login-editorial {
    padding: 24px 20px 0;
  }

  .login-editorial h1 {
    margin: 22px 0 18px;
    font-size: 34px;
  }

  .video-options-grid {
    grid-template-columns: 1fr;
  }

  .video-gallery-tabs {
    flex-wrap: wrap;
  }

  .video-gallery-tabs input {
    width: 100%;
    margin-left: 0;
  }

  .vg-watermark-controls {
    grid-template-columns: 1fr;
  }

  .video-options-bar select,
  .video-options-bar button {
    flex: 1 1 150px;
  }

  .video-send-button {
    flex: 0 0 38px;
  }

  .video-generator-form {
    padding: 18px;
  }

  .video-generator-form textarea {
    min-height: 180px;
  }

  .login-editorial p {
    font-size: 15px;
    line-height: 1.68;
  }

  .keeper-plate {
    width: 100%;
    margin-top: 28px;
  }

  .keeper-image-frame img {
    max-height: min(250px, 32vh);
  }

  .login-status {
    flex-direction: column;
    gap: 8px;
  }

  .announcement-top {
    align-items: flex-start;
    flex-direction: column;
    padding-top: 18px;
    padding-bottom: 18px;
  }

  .announcement-top .ghost-button {
    width: 100%;
  }

  .auth-panel h2 {
    margin-top: 16px;
    font-size: 38px;
  }

  .auth-subtitle,
  .field-line input {
    font-size: 16px;
  }

  .auth-subtitle {
    margin-bottom: 22px;
    line-height: 1.6;
  }

  .auth-tabs {
    margin-bottom: 18px;
  }

  .auth-form {
    gap: 16px;
  }

  .field-line {
    gap: 10px;
    padding-bottom: 14px;
  }

  .field-line input {
    height: 40px;
  }

  .auth-row {
    font-size: 15px;
  }

  .ink-button {
    min-height: 52px;
    margin-top: 2px;
  }

  .auth-terms {
    margin-top: 10px;
  }

  .auth-terms details[open] {
    max-height: min(40vh, 320px);
  }

  .float-language {
    right: 12px;
    bottom: 12px;
    width: 44px;
    height: 44px;
    font-size: 14px;
    opacity: 0.9;
  }

  .dashboard-hero,
  .subscription-hero {
    padding: 38px 0 30px;
  }

  .dashboard-hero h1,
  .subscription-hero h1,
  .announcement-hero h1 {
    font-size: 50px;
  }

  .announcement-page {
    width: min(100% - 28px, 1120px);
    padding-top: 34px;
  }

  .announcement-hero p,
  .announcement-card p,
  .announcement-card li {
    font-size: 17px;
  }

  .announcement-card pre {
    padding: 16px;
    font-size: 13px;
  }

  .announcement-card pre code {
    width: max-content;
    max-width: none;
  }

  .card-header,
  .card-body {
    padding: 22px;
  }

  .status-grid {
    grid-template-columns: 1fr;
  }

  .filters-row {
    align-items: stretch;
    flex-direction: column;
  }

  .filter-input,
  .filter-select,
  .toolbar,
  .toolbar .solid-button,
  .toolbar .refresh-button {
    width: 100%;
  }

  .modal-actions .solid-button,
  .modal-actions .ghost-button {
    width: 100%;
  }

  .modal-actions {
    flex-direction: column;
  }

  .toolbar {
    margin-left: 0;
  }

  .pager {
    align-items: flex-start;
    flex-direction: column;
  }

  .profile-overview-grid,
  .profile-grid,
  .profile-info-row,
  .profile-edit-grid,
  .profile-binding-row,
  .profile-hero-stats {
    grid-template-columns: 1fr;
  }

  .profile-page-title {
    margin-top: 8px;
  }

  .profile-hero-grid .profile-avatar {
    width: 76px;
    height: 76px;
    border-radius: 20px;
    font-size: 26px;
  }

  .profile-section-header,
  .profile-edit-grid,
  .profile-binding-list,
  .profile-password-form,
  .profile-security-state,
  .profile-quota-card {
    padding-left: 22px;
    padding-right: 22px;
  }

  .profile-binding-row {
    align-items: flex-start;
  }

  .profile-binding-action {
    justify-self: start;
  }

  .profile-support-card,
  .profile-security-state {
    align-items: flex-start;
  }

  .profile-form-actions .solid-button {
    width: 100%;
  }

  .profile-info-row dd {
    text-align: left;
  }

  .profile-card {
    padding: 26px;
  }

  .profile-stat-grid {
    grid-template-columns: 1fr;
  }

  .ticket-dark,
  .ticket-main,
  .ticket-actions {
    padding: 26px;
  }

  .ticket-dark h3,
  .ticket-main h3 {
    font-size: 32px;
  }
}

/* 20260627 fluid interface refresh */
:root {
  color-scheme: dark;
  --paper: #07111f;
  --paper-soft: #0d1728;
  --ink: #eff8ff;
  --muted: #9aaec6;
  --faint: #657b98;
  --line: rgba(145, 210, 255, 0.12);
  --line-strong: rgba(219, 241, 255, 0.2);
  --red: #ff4f87;
  --green: #2ef0c2;
  --green-soft: rgba(46, 240, 194, 0.18);
  --blue: #6ea7ff;
  --orange: #ffca72;
  --black: #f2fbff;
  --white: rgba(255, 255, 255, 0.075);
  --glass: rgba(9, 18, 34, 0.72);
  --glass-strong: rgba(13, 25, 45, 0.86);
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

body.dark-mode {
  --paper: #050916;
  --paper-soft: #091426;
  --ink: #f2fbff;
  --muted: #94a8c2;
  --faint: #5e738f;
  --line: rgba(145, 210, 255, 0.11);
  --line-strong: rgba(219, 241, 255, 0.19);
  --white: rgba(255, 255, 255, 0.07);
  --glass: rgba(5, 12, 24, 0.76);
  --glass-strong: rgba(8, 17, 31, 0.9);
}

html {
  background: #07111f;
}

body {
  position: relative;
  overflow-x: hidden;
  background:
    linear-gradient(120deg, rgba(6, 11, 25, 0.96), rgba(6, 21, 36, 0.96) 42%, rgba(22, 10, 32, 0.95)),
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: auto, 72px 72px, 72px 72px;
}

body::before {
  content: "";
  position: fixed;
  inset: -20vmax;
  z-index: 0;
  pointer-events: none;
  opacity: 0.86;
  filter: blur(48px) saturate(1.18);
  background:
    conic-gradient(from 215deg at 32% 46%,
      rgba(46, 240, 194, 0.28),
      rgba(110, 167, 255, 0.18) 18%,
      transparent 34%,
      rgba(255, 79, 135, 0.23) 50%,
      rgba(255, 202, 114, 0.12) 65%,
      transparent 82%,
      rgba(46, 240, 194, 0.28));
  animation: relay-fluid-drift 18s ease-in-out infinite alternate;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.36;
  mix-blend-mode: screen;
  background:
    repeating-linear-gradient(115deg, transparent 0 26px, rgba(255, 255, 255, 0.028) 26px 27px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), transparent 38%, rgba(46, 240, 194, 0.05));
}

@keyframes relay-fluid-drift {
  0% {
    transform: translate3d(-2%, -1%, 0) rotate(-4deg) scale(1);
  }
  100% {
    transform: translate3d(2%, 1%, 0) rotate(5deg) scale(1.06);
  }
}

.login-view,
.app-view,
.announcement-screen {
  position: relative;
  z-index: 1;
}

.paper-cross {
  opacity: 0.78;
  filter: drop-shadow(0 0 12px rgba(46, 240, 194, 0.32));
}

.paper-cross::before,
.paper-cross::after {
  background: rgba(176, 231, 255, 0.42);
}

.diamond {
  background: linear-gradient(135deg, var(--green), var(--blue) 55%, var(--red));
  box-shadow: 0 0 24px rgba(46, 240, 194, 0.42);
}

.wordmark,
.side-brand strong,
.app-header h2,
.login-editorial h1,
.auth-panel h2,
.dashboard-hero h1,
.subscription-hero h1,
.announcement-hero h1,
.page-intro h1 {
  letter-spacing: 0 !important;
}

.login-top,
.announcement-top,
.mobile-shell-bar {
  border-color: var(--line-strong);
  background: linear-gradient(180deg, rgba(6, 13, 27, 0.82), rgba(6, 13, 27, 0.52));
  backdrop-filter: blur(22px) saturate(1.18);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05);
}

.language-switch {
  border-color: var(--line-strong);
}

.language-switch button.active {
  color: var(--green);
  text-decoration-color: var(--green);
}

.login-view {
  border-color: var(--line);
}

.login-editorial,
.auth-panel {
  border-color: var(--line-strong);
}

.login-editorial p,
.dashboard-hero p,
.subscription-hero p,
.announcement-hero p {
  color: var(--muted);
}

.auth-panel {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.035)),
    rgba(8, 16, 31, 0.42);
  box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.06);
}

.login-editorial h1 em,
.auth-panel h2 em,
.subscription-hero em,
.dashboard-hero em,
.announcement-hero h1 em {
  color: var(--green);
}

.login-editorial h1 em::after {
  background: linear-gradient(90deg, var(--green), var(--blue), var(--red));
  box-shadow: 0 0 28px rgba(46, 240, 194, 0.38);
}

.chapter-label,
.date-line,
.breadcrumb-line,
.eyebrow {
  color: var(--green);
}

.chapter-label span {
  background: rgba(46, 240, 194, 0.58);
}

.date-line::before,
.breadcrumb-line::before {
  background: var(--green);
  box-shadow: 0 0 18px rgba(46, 240, 194, 0.72);
}

.keeper-image-frame,
.register-qr-frame,
.auth-tabs,
.field-line,
.auth-footer,
.side-bottom,
.metrics-strip,
.announcement-card,
.card,
.wide-card,
.filter-card,
.table-card,
.subscription-card,
.redeem-card,
.profile-card,
.modal,
.user-menu,
.pager {
  border-color: var(--line-strong);
}

.keeper-image-frame,
.register-qr-frame,
.announcement-strip,
.card,
.wide-card,
.filter-card,
.table-card,
.subscription-card,
.redeem-card,
.profile-card,
.modal,
.user-menu,
.pager {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.045)),
    var(--glass);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px) saturate(1.15);
}

.auth-tabs {
  overflow: hidden;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.auth-tabs button.active,
.nav-button.active,
.nav-button:hover,
.side-utility:hover {
  background: linear-gradient(90deg, rgba(46, 240, 194, 0.18), rgba(110, 167, 255, 0.13));
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(178, 235, 255, 0.14), 0 18px 46px rgba(0, 0, 0, 0.22);
}

.field-line input,
.filter-input,
.filter-select,
.line-input,
.modal input,
.modal select,
.modal textarea,
.profile-password-form input {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--line-strong);
  color: var(--ink);
}

.field-line input::placeholder {
  color: rgba(214, 232, 246, 0.48);
}

.ink-button,
.solid-button {
  border-color: rgba(196, 241, 255, 0.34);
  background: linear-gradient(135deg, var(--green), var(--blue) 54%, var(--red));
  color: #06111e;
  box-shadow: 0 18px 48px rgba(46, 240, 194, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.38);
}

.ink-button:hover,
.solid-button:hover {
  transform: translateY(-1px);
  filter: saturate(1.08) brightness(1.04);
}

.ghost-button,
.small-button,
.refresh-button,
.icon-button,
.copy-button,
.mobile-shell-bar button {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.07);
  color: var(--ink);
}

.text-button,
.field-action,
.login-status a,
.price {
  color: var(--green);
}

.sidebar {
  border-color: var(--line-strong);
  background: linear-gradient(180deg, rgba(6, 13, 27, 0.84), rgba(7, 17, 31, 0.64));
  backdrop-filter: blur(22px) saturate(1.16);
}

body.dark-mode .sidebar,
body.dark-mode .announcement-top,
body.dark-mode .mobile-shell-bar {
  background: linear-gradient(180deg, rgba(3, 8, 18, 0.9), rgba(6, 13, 27, 0.72));
}

.brand-letter {
  color: transparent;
  background: linear-gradient(135deg, var(--green), var(--blue), var(--red));
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 0 26px rgba(46, 240, 194, 0.22));
}

.side-brand small,
.badge,
.operational,
.profile-chip {
  border-color: rgba(178, 235, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: var(--green);
}

.badge.orange {
  background: rgba(255, 202, 114, 0.16);
  color: var(--orange);
}

.badge.gray {
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
}

.badge.red,
.profile-chip.bad {
  background: rgba(255, 79, 135, 0.14);
  color: var(--red);
}

.profile-chip.good,
.operational {
  background: rgba(46, 240, 194, 0.14);
  color: var(--green);
}

.workspace {
  position: relative;
  z-index: 1;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 4;
  margin: 0 calc(clamp(24px, 3vw, 62px) * -1);
  padding: 0 clamp(24px, 3vw, 62px);
  background: linear-gradient(180deg, rgba(7, 17, 31, 0.82), rgba(7, 17, 31, 0.42));
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(22px) saturate(1.16);
}

.icon-plain,
.language-chip,
.tiny-badge,
.wallet-badge,
.user-chip {
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
}

.wallet-badge,
.masked-key {
  background: rgba(46, 240, 194, 0.14);
  color: var(--green);
  border: 1px solid rgba(46, 240, 194, 0.24);
}

#user-avatar,
.profile-avatar {
  background: linear-gradient(135deg, var(--green), var(--blue) 54%, var(--red));
  color: #07111f;
}

.dashboard-hero,
.subscription-hero,
.page-intro,
.announcement-hero {
  border-color: var(--line-strong);
}

.metrics-strip {
  overflow: hidden;
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.035)),
    rgba(6, 13, 27, 0.42);
  box-shadow: var(--shadow);
}

.metric-cell {
  border-color: var(--line-strong);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012));
}

.metric-dash,
.model-bar,
.balance-line,
.progress-line span,
.quota-bar span {
  background: linear-gradient(90deg, var(--green), var(--blue), var(--red));
}

.card-header,
th,
td,
.ticket-main,
.profile-section-header,
.profile-info-list,
.profile-info-row,
.profile-binding-row,
.profile-avatar-panel,
.user-menu button,
.user-menu a {
  border-color: var(--line);
}

th {
  background: rgba(255, 255, 255, 0.055);
  color: #b7c8dd;
}

tr:hover {
  background: rgba(46, 240, 194, 0.045);
}

.ticket-dark {
  background:
    linear-gradient(145deg, rgba(46, 240, 194, 0.18), rgba(110, 167, 255, 0.08)),
    #06111f;
  color: var(--ink);
}

.ticket-actions,
.profile-support-card,
.balance-hero-card {
  background: linear-gradient(135deg, rgba(46, 240, 194, 0.15), rgba(110, 167, 255, 0.1), rgba(255, 79, 135, 0.12));
}

.balance-hero-card {
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
}

.empty-icon {
  background: rgba(255, 255, 255, 0.08);
  color: var(--green);
}

button,
a,
select,
input,
textarea {
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(46, 240, 194, 0.72);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  body::before {
    animation: none;
  }

  button,
  a,
  select,
  input,
  textarea {
    transition: none;
  }
}

@media (max-width: 1180px) {
  .app-header {
    margin: 0 -16px;
    padding: 18px 16px 12px;
  }
}

@media (max-width: 700px) {
  body {
    background-size: auto, 48px 48px, 48px 48px;
  }

  body::before {
    filter: blur(34px) saturate(1.12);
  }

  .login-top {
    background: rgba(7, 17, 31, 0.72);
  }

  .auth-panel {
    background: rgba(8, 16, 31, 0.54);
  }
}

/* 20260627 contrast readability pass */
:root {
  --paper: #050b18;
  --paper-soft: #0b1728;
  --ink: #f7fbff;
  --muted: #c8d8ea;
  --faint: #9fb5ce;
  --line: rgba(177, 219, 255, 0.18);
  --line-strong: rgba(223, 244, 255, 0.32);
  --white: rgba(11, 25, 43, 0.94);
  --glass: rgba(7, 17, 31, 0.9);
  --glass-strong: rgba(8, 20, 36, 0.97);
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.48), 0 0 0 1px rgba(226, 245, 255, 0.08);
}

body.dark-mode {
  --paper: #040817;
  --paper-soft: #091426;
  --ink: #f8fcff;
  --muted: #c9d9ec;
  --faint: #9db5d0;
  --line: rgba(177, 219, 255, 0.17);
  --line-strong: rgba(223, 244, 255, 0.3);
  --white: rgba(10, 24, 42, 0.95);
  --glass: rgba(6, 15, 29, 0.92);
  --glass-strong: rgba(7, 18, 33, 0.98);
}

body {
  background:
    linear-gradient(120deg, rgba(4, 8, 19, 0.98), rgba(5, 17, 31, 0.98) 42%, rgba(17, 8, 28, 0.97)),
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
}

body::before {
  opacity: 0.58;
}

body::after {
  opacity: 0.18;
}

.login-top,
.announcement-top,
.mobile-shell-bar,
.app-header,
.sidebar {
  background: linear-gradient(180deg, rgba(5, 12, 26, 0.94), rgba(7, 17, 31, 0.86));
  border-color: var(--line-strong);
}

.auth-panel,
.keeper-image-frame,
.register-qr-frame,
.announcement-strip,
.card,
.wide-card,
.filter-card,
.table-card,
.subscription-card,
.redeem-card,
.profile-card,
.modal,
.user-menu,
.pager,
.metrics-strip,
.ticket-actions,
.profile-support-card,
.balance-hero-card {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.035)),
    var(--glass-strong);
  color: var(--ink);
  border-color: var(--line-strong);
}

.login-editorial p,
.dashboard-hero p,
.subscription-hero p,
.announcement-hero p,
.issue,
.auth-footer,
.side-bottom,
.metric-label,
.empty-state,
.profile-info-row span,
.help-text,
.date-line,
.breadcrumb-line {
  color: var(--muted);
}

.chapter-label,
.eyebrow,
.operational,
.profile-chip.good,
.price,
.text-button,
.field-action,
.login-status a {
  color: var(--green);
}

.field-line input,
.filter-input,
.filter-select,
.line-input,
.modal input,
.modal select,
.modal textarea,
.profile-password-form input {
  background: rgba(3, 10, 22, 0.86);
  border-color: rgba(223, 244, 255, 0.3);
  color: var(--ink);
}

.field-line input::placeholder,
.filter-input::placeholder,
.line-input::placeholder,
.modal input::placeholder,
.modal textarea::placeholder {
  color: #93a9c0;
}

.ghost-button,
.small-button,
.refresh-button,
.icon-button,
.copy-button,
.mobile-shell-bar button,
.auth-tabs,
.icon-plain,
.language-chip,
.tiny-badge,
.wallet-badge,
.user-chip,
.badge,
.profile-chip,
.empty-icon {
  background: rgba(12, 29, 49, 0.9);
  color: var(--ink);
  border-color: rgba(223, 244, 255, 0.28);
}

th {
  background: rgba(13, 31, 53, 0.96);
  color: #d9eaff;
}

td {
  color: var(--ink);
}

.badge.gray,
.metric-sub,
.balance-sub,
.profile-chip.neutral {
  color: var(--muted);
}

@media (max-width: 700px) {
  .login-top,
  .auth-panel {
    background: rgba(7, 17, 31, 0.92);
  }
}

/* 20260627 relay palette tune */
:root {
  --paper: #07101c;
  --paper-soft: #0b1726;
  --ink: #f3f8fb;
  --muted: #b8c8d7;
  --faint: #86a0b6;
  --line: rgba(156, 189, 214, 0.13);
  --line-strong: rgba(196, 220, 238, 0.25);
  --red: #f16f88;
  --green: #56d6bd;
  --green-soft: rgba(86, 214, 189, 0.16);
  --blue: #75a7e8;
  --orange: #dfb66f;
  --black: #edf7f8;
  --white: rgba(9, 22, 36, 0.92);
  --glass: rgba(9, 22, 36, 0.74);
  --glass-strong: rgba(10, 24, 39, 0.94);
  --shadow: 0 24px 72px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(213, 236, 245, 0.06);
}

body.dark-mode {
  --paper: #060c17;
  --paper-soft: #0a1524;
  --ink: #f5f9fc;
  --muted: #bccbd9;
  --faint: #8da5ba;
  --line: rgba(158, 192, 218, 0.14);
  --line-strong: rgba(203, 226, 244, 0.26);
  --white: rgba(8, 20, 34, 0.94);
  --glass: rgba(8, 20, 34, 0.78);
  --glass-strong: rgba(9, 22, 36, 0.96);
}

html {
  background: var(--paper);
}

body {
  background:
    radial-gradient(circle at 16% 18%, rgba(86, 214, 189, 0.12), transparent 30%),
    radial-gradient(circle at 84% 12%, rgba(117, 167, 232, 0.12), transparent 32%),
    linear-gradient(135deg, #07101c 0%, #0a1725 54%, #111727 100%),
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: auto, auto, auto, 72px 72px, 72px 72px;
}

body::before {
  opacity: 0.34;
  filter: blur(58px) saturate(0.92);
  background:
    conic-gradient(from 220deg at 36% 42%,
      rgba(86, 214, 189, 0.2),
      rgba(117, 167, 232, 0.16) 22%,
      transparent 42%,
      rgba(223, 182, 111, 0.08) 58%,
      transparent 78%,
      rgba(86, 214, 189, 0.18));
}

body::after {
  opacity: 0.12;
  mix-blend-mode: screen;
  background:
    repeating-linear-gradient(115deg, transparent 0 28px, rgba(255, 255, 255, 0.024) 28px 29px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 42%, rgba(86, 214, 189, 0.035));
}

.paper-cross {
  opacity: 0.48;
  filter: drop-shadow(0 0 10px rgba(86, 214, 189, 0.18));
}

.paper-cross::before,
.paper-cross::after {
  background: rgba(206, 231, 244, 0.32);
}

.diamond {
  background: linear-gradient(135deg, #56d6bd, #7aa8dc);
  box-shadow: 0 0 18px rgba(86, 214, 189, 0.22);
}

.login-top,
.announcement-top,
.mobile-shell-bar,
.app-header,
.sidebar {
  background: linear-gradient(180deg, rgba(8, 20, 34, 0.94), rgba(9, 22, 36, 0.78));
  border-color: var(--line-strong);
  box-shadow: 0 1px 0 rgba(235, 248, 255, 0.05);
}

.auth-panel,
.keeper-image-frame,
.register-qr-frame,
.announcement-strip,
.card,
.wide-card,
.filter-card,
.table-card,
.subscription-card,
.redeem-card,
.profile-card,
.modal,
.user-menu,
.pager,
.metrics-strip,
.ticket-actions,
.profile-support-card,
.balance-hero-card {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025)),
    var(--glass-strong);
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}

.auth-panel {
  box-shadow: var(--shadow), inset 1px 0 0 rgba(255, 255, 255, 0.04);
}

.login-editorial h1 em,
.auth-panel h2 em,
.subscription-hero em,
.dashboard-hero em,
.announcement-hero h1 em,
.chapter-label,
.eyebrow,
.operational,
.profile-chip.good,
.price,
.text-button,
.field-action,
.login-status a {
  color: var(--green);
}

.login-editorial h1 em::after,
.metric-dash,
.model-bar,
.balance-line,
.progress-line span,
.quota-bar span {
  background: linear-gradient(90deg, #56d6bd, #75a7e8);
  box-shadow: 0 0 20px rgba(86, 214, 189, 0.18);
}

.auth-tabs,
.icon-plain,
.language-chip,
.tiny-badge,
.wallet-badge,
.user-chip,
.badge,
.profile-chip,
.empty-icon,
.ghost-button,
.small-button,
.refresh-button,
.icon-button,
.copy-button,
.mobile-shell-bar button {
  background: rgba(12, 28, 45, 0.82);
  border-color: rgba(199, 224, 240, 0.22);
  color: var(--ink);
}

.auth-tabs button.active,
.nav-button.active,
.nav-button:hover,
.side-utility:hover {
  background: linear-gradient(90deg, rgba(86, 214, 189, 0.16), rgba(117, 167, 232, 0.1));
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(199, 224, 240, 0.12), 0 16px 38px rgba(0, 0, 0, 0.2);
}

.field-line {
  border-bottom-color: rgba(204, 228, 244, 0.22);
}

.field-line > span,
.field-line > span b {
  color: #d7e7f1;
}

.field-line input,
.filter-input,
.filter-select,
.line-input,
.modal input,
.modal select,
.modal textarea,
.profile-password-form input {
  background: rgba(4, 12, 22, 0.72);
  border-color: rgba(198, 223, 238, 0.3);
  color: var(--ink);
}

.field-line input::placeholder,
.filter-input::placeholder,
.line-input::placeholder,
.modal input::placeholder,
.modal textarea::placeholder {
  color: #91a7ba;
}

.ink-button,
.solid-button {
  border-color: rgba(124, 224, 205, 0.42);
  background: linear-gradient(135deg, #56d6bd, #75a7e8);
  color: #06121d;
  box-shadow: 0 16px 42px rgba(86, 214, 189, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.36);
}

.ink-button:hover,
.solid-button:hover {
  filter: brightness(1.04);
}

.brand-letter {
  background: linear-gradient(135deg, #56d6bd, #75a7e8);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 0 18px rgba(86, 214, 189, 0.16));
}

#user-avatar,
.profile-avatar {
  background: linear-gradient(135deg, #5fd8bf, #6f99d4);
  color: #07111f;
  box-shadow: 0 10px 24px rgba(86, 214, 189, 0.16);
}

.wallet-badge,
.masked-key {
  background: rgba(86, 214, 189, 0.13);
  color: #9cebdc;
  border-color: rgba(86, 214, 189, 0.26);
}

.tiny-badge {
  color: #b9ccdc;
}

.badge,
.side-brand small,
.profile-chip {
  background: rgba(12, 28, 45, 0.82);
  border-color: rgba(199, 224, 240, 0.2);
  color: #cfe2ef;
}

.badge.orange {
  background: rgba(223, 182, 111, 0.14);
  color: #e4c282;
}

.badge.red,
.profile-chip.bad {
  background: rgba(241, 111, 136, 0.14);
  color: #ff9aae;
}

.profile-chip.good,
.operational {
  background: rgba(86, 214, 189, 0.13);
  color: #9cebdc;
}

th {
  background: rgba(11, 28, 47, 0.95);
  color: #dcecf5;
}

tr:hover {
  background: rgba(86, 214, 189, 0.045);
}

.ticket-dark,
.ticket-actions,
.profile-support-card,
.balance-hero-card {
  background:
    linear-gradient(145deg, rgba(86, 214, 189, 0.12), rgba(117, 167, 232, 0.08)),
    rgba(8, 20, 34, 0.92);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline-color: rgba(86, 214, 189, 0.68);
}

@media (max-width: 700px) {
  body {
    background:
      radial-gradient(circle at 20% 18%, rgba(86, 214, 189, 0.12), transparent 34%),
      linear-gradient(135deg, #07101c 0%, #0a1725 58%, #111727 100%);
  }

  .login-top,
  .auth-panel {
    background: rgba(9, 22, 36, 0.94);
  }
}

/* 20260627 light editorial palette */
:root,
body.dark-mode {
  color-scheme: light;
  --paper: #f2eee6;
  --paper-soft: #f8f5ee;
  --ink: #17130f;
  --muted: #887f70;
  --faint: #b5ab9b;
  --line: rgba(45, 39, 30, 0.08);
  --line-strong: rgba(45, 39, 30, 0.16);
  --red: #c33a3f;
  --green: #17b5a5;
  --green-soft: #d7f0d2;
  --blue: #397895;
  --orange: #d45a40;
  --black: #11100e;
  --white: #fffdf8;
  --glass: rgba(255, 253, 248, 0.82);
  --glass-strong: rgba(255, 253, 248, 0.94);
  --shadow: 0 20px 58px rgba(60, 50, 34, 0.12);
}

html,
body,
body.dark-mode {
  background:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px),
    radial-gradient(circle at 12% 18%, rgba(205, 188, 156, 0.16), transparent 30%),
    #f2eee6 !important;
  background-size: 56px 56px, 56px 56px, auto, auto !important;
  color: var(--ink) !important;
}

body::before,
body::after {
  opacity: 0 !important;
}

.login-top,
.announcement-top,
.mobile-shell-bar,
.app-header,
.sidebar {
  background: rgba(242, 238, 230, 0.88) !important;
  border-color: rgba(45, 39, 30, 0.14) !important;
  box-shadow: none !important;
  color: var(--ink) !important;
  backdrop-filter: blur(16px);
}

.sidebar {
  background: rgba(239, 234, 224, 0.92) !important;
}

.wordmark,
.side-brand,
.brand-title,
.page-title,
.login-editorial h1,
.auth-panel h2,
.dashboard-hero h1,
.subscription-hero h1,
.card h2,
.card h3,
.wide-card h2,
.table-card h2,
.profile-card h2,
.modal h2 {
  color: var(--ink) !important;
}

.login-editorial h1 em,
.auth-panel h2 em,
.subscription-hero em,
.dashboard-hero em,
.price,
.text-button,
.field-action,
.login-status a,
.brand-letter {
  color: var(--red) !important;
  background: none !important;
  -webkit-background-clip: initial !important;
  background-clip: initial !important;
  filter: none !important;
}

.login-editorial h1 em::after,
.metric-dash,
.model-bar,
.balance-line,
.quota-bar span {
  background: var(--red) !important;
  box-shadow: none !important;
}

.metric-dash:nth-of-type(2n),
.model-bar:nth-of-type(2n) {
  background: var(--blue) !important;
}

.nav-button,
.side-utility,
.auth-tabs button,
.ghost-button,
.small-button,
.refresh-button,
.icon-button,
.copy-button,
.mobile-shell-bar button {
  background: transparent !important;
  border-color: rgba(45, 39, 30, 0.12) !important;
  color: #514a40 !important;
  box-shadow: none !important;
}

.auth-tabs button.active,
.nav-button.active,
.nav-button:hover,
.side-utility:hover {
  background: rgba(255, 253, 248, 0.9) !important;
  color: var(--ink) !important;
  box-shadow: 0 10px 30px rgba(60, 50, 34, 0.08) !important;
}

.auth-card,
.announcement-card,
.announcement-strip,
.card,
.wide-card,
.filter-card,
.table-card,
.subscription-card,
.redeem-card,
.profile-card,
.modal,
.user-menu,
.pager,
.empty-state,
.ticket-actions,
.profile-support-card,
.balance-hero-card,
.ticket-dark {
  background: rgba(255, 253, 248, 0.9) !important;
  border-color: rgba(45, 39, 30, 0.12) !important;
  color: var(--ink) !important;
  box-shadow: 0 18px 46px rgba(60, 50, 34, 0.1) !important;
}

.field-line {
  border-bottom-color: rgba(45, 39, 30, 0.18) !important;
}

.field-line > span,
.field-line > span b,
.form-message,
.page-subtitle,
.card p,
.muted,
.tiny-badge {
  color: var(--muted) !important;
}

.field-line input,
.filter-input,
.filter-select,
.line-input,
.modal input,
.modal select,
.modal textarea,
.profile-password-form input {
  background: rgba(255, 253, 248, 0.82) !important;
  border-color: rgba(45, 39, 30, 0.18) !important;
  color: var(--ink) !important;
}

.field-line input::placeholder,
.filter-input::placeholder,
.line-input::placeholder,
.modal input::placeholder,
.modal textarea::placeholder {
  color: #a99f91 !important;
}

.ink-button,
.solid-button {
  border-color: #11100e !important;
  background: #11100e !important;
  color: #fffdf8 !important;
  box-shadow: 0 14px 34px rgba(35, 31, 25, 0.16) !important;
}

.wallet-badge,
.masked-key {
  background: #11100e !important;
  color: #fffdf8 !important;
  border-color: #11100e !important;
}

#user-avatar,
.profile-avatar {
  background: var(--green) !important;
  color: #fffdf8 !important;
  box-shadow: none !important;
}

.badge,
.side-brand small,
.profile-chip {
  background: rgba(255, 253, 248, 0.78) !important;
  border-color: rgba(45, 39, 30, 0.14) !important;
  color: #514a40 !important;
}

.badge.orange {
  background: rgba(212, 90, 64, 0.12) !important;
  color: #a9422f !important;
}

.badge.red,
.profile-chip.bad {
  background: rgba(195, 58, 63, 0.12) !important;
  color: #a72d34 !important;
}

.profile-chip.good,
.operational {
  background: rgba(23, 181, 165, 0.12) !important;
  color: #0d7e73 !important;
}

th {
  background: rgba(239, 234, 224, 0.95) !important;
  color: var(--ink) !important;
}

td,
tr {
  color: var(--ink) !important;
  border-color: rgba(45, 39, 30, 0.1) !important;
}

tr:hover {
  background: rgba(195, 58, 63, 0.045) !important;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline-color: rgba(195, 58, 63, 0.66) !important;
}

@media (max-width: 700px) {
  body,
  body.dark-mode {
    background:
      linear-gradient(var(--line) 1px, transparent 1px),
      linear-gradient(90deg, var(--line) 1px, transparent 1px),
      #f2eee6 !important;
    background-size: 48px 48px, 48px 48px, auto !important;
  }

  .login-top,
  .auth-panel {
    background: rgba(242, 238, 230, 0.94) !important;
  }

  .side-bottom #theme-toggle {
    display: none !important;
  }
}

/* 20260627 relay login detailed terms */
.auth-terms {
  margin-top: 14px;
  font-family: var(--sans);
  color: var(--muted) !important;
  font-size: 12px;
  line-height: 1.65;
}

.auth-terms p {
  margin: 0;
}

.auth-terms details {
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.7);
}

.auth-terms summary {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px;
  color: var(--ink) !important;
  cursor: pointer;
  font-weight: 850;
  list-style: none;
}

.auth-terms summary::-webkit-details-marker {
  display: none;
}

.auth-terms summary::after {
  content: "+";
  flex: 0 0 auto;
  color: var(--red);
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1;
}

.auth-terms details[open] summary {
  position: sticky;
  top: 0;
  z-index: 1;
  border-bottom: 1px solid var(--line-strong);
  background: rgba(255, 253, 248, 0.96);
}

.auth-terms details[open] summary::after {
  content: "-";
}

.auth-terms details[open] {
  max-height: min(52vh, 430px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.auth-terms ol {
  margin: 0;
  padding: 12px 14px 12px 34px;
  display: grid;
  gap: 10px;
}

.auth-terms li::marker {
  color: var(--red);
  font-weight: 850;
}

.auth-terms li strong {
  display: block;
  margin-bottom: 2px;
  color: var(--ink) !important;
  font-size: 13px;
}

.auth-terms li span {
  display: block;
  color: var(--muted) !important;
}

.auth-terms details > p {
  border-top: 1px solid var(--line);
  padding: 10px 12px 12px;
  color: #665d50 !important;
}

body.dark-mode .auth-terms details,
body.dark-mode .auth-terms details > p {
  background: rgba(255, 253, 248, 0.72) !important;
}

body.dark-mode .auth-terms details[open] summary {
  background: rgba(255, 253, 248, 0.96) !important;
}

@media (max-width: 700px) {
  .auth-terms {
    font-size: 11px;
  }

  .auth-terms details[open] {
    max-height: min(46vh, 360px);
  }
}

/* 20260627 light palette consistency pass */
:root,
body.dark-mode {
  color-scheme: light !important;
  --paper: #f2eee6;
  --paper-soft: #f8f5ee;
  --ink: #17130f;
  --muted: #887f70;
  --faint: #b5ab9b;
  --line: rgba(45, 39, 30, 0.08);
  --line-strong: rgba(45, 39, 30, 0.16);
  --red: #c33a3f;
  --green: #17b5a5;
  --green-soft: #d7f0d2;
  --blue: #397895;
  --orange: #d45a40;
  --black: #11100e;
  --white: #fffdf8;
  --glass: rgba(255, 253, 248, 0.86);
  --glass-strong: rgba(255, 253, 248, 0.96);
  --shadow: 0 18px 46px rgba(60, 50, 34, 0.1);
}

html,
body,
body.dark-mode,
.login-view,
.app-view,
.workspace {
  background:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px),
    radial-gradient(circle at 12% 18%, rgba(205, 188, 156, 0.16), transparent 30%),
    var(--paper) !important;
  background-size: 56px 56px, 56px 56px, auto, auto !important;
  color: var(--ink) !important;
}

.login-top,
.announcement-top,
.mobile-shell-bar,
.app-header,
.sidebar,
body.dark-mode .sidebar,
body.dark-mode .announcement-top,
body.dark-mode .mobile-shell-bar {
  background: rgba(239, 234, 224, 0.94) !important;
  background-image: none !important;
  border-color: var(--line-strong) !important;
  box-shadow: none !important;
  color: var(--ink) !important;
  backdrop-filter: blur(16px);
}

.auth-panel,
.keeper-image-frame,
.register-qr-frame,
.announcement-strip,
.card,
.wide-card,
.filter-card,
.table-card,
.subscription-card,
.redeem-card,
.profile-card,
.modal,
.user-menu,
.pager,
.metrics-strip,
.ticket-actions,
.profile-support-card,
.balance-hero-card,
.ticket-dark,
.empty-state {
  background: var(--glass-strong) !important;
  background-image: none !important;
  border-color: rgba(45, 39, 30, 0.12) !important;
  color: var(--ink) !important;
  box-shadow: var(--shadow) !important;
}

.wordmark,
.side-brand,
.brand-title,
.page-title,
.login-editorial h1,
.auth-panel h2,
.dashboard-hero h1,
.subscription-hero h1,
.announcement-hero h1,
.card h2,
.card h3,
.wide-card h2,
.table-card h2,
.profile-card h2,
.modal h2 {
  color: var(--ink) !important;
}

.login-editorial h1 em,
.auth-panel h2 em,
.subscription-hero em,
.dashboard-hero em,
.announcement-hero h1 em,
.price,
.text-button,
.field-action,
.login-status a,
.brand-letter {
  color: var(--red) !important;
  background: none !important;
  -webkit-background-clip: initial !important;
  background-clip: initial !important;
  filter: none !important;
}

.login-editorial h1 em::after,
.metric-dash,
.model-bar,
.balance-line,
.quota-bar span,
.progress-line span {
  background: var(--red) !important;
  box-shadow: none !important;
}

.metric-cell:nth-child(2) .metric-dash,
.metric-dash:nth-of-type(2n),
.model-bar:nth-of-type(2n) {
  background: var(--blue) !important;
}

.nav-button,
.side-utility,
.auth-tabs button,
.ghost-button,
.small-button,
.refresh-button,
.icon-button,
.copy-button,
.mobile-shell-bar button {
  background: transparent !important;
  border-color: rgba(45, 39, 30, 0.12) !important;
  color: #514a40 !important;
  box-shadow: none !important;
}

.auth-tabs button.active,
.nav-button.active,
.nav-button:hover,
.side-utility:hover {
  background: var(--white) !important;
  color: var(--ink) !important;
  box-shadow: 0 10px 30px rgba(60, 50, 34, 0.08) !important;
}

.field-line,
.card-header,
th,
td,
.ticket-main,
.profile-section-header,
.profile-info-list,
.profile-info-row,
.profile-binding-row,
.profile-avatar-panel,
.user-menu button,
.user-menu a {
  border-color: var(--line-strong) !important;
}

.field-line > span,
.field-line > span b,
.form-message,
.page-subtitle,
.card p,
.muted,
.tiny-badge,
.metric-label,
.metric-note,
.metric-sub,
.balance-sub,
.profile-chip.neutral,
.login-editorial p,
.dashboard-hero p,
.subscription-hero p,
.announcement-hero p,
.issue,
.auth-footer,
.side-bottom,
.empty-state,
.profile-info-row span,
.help-text,
.date-line,
.breadcrumb-line {
  color: var(--muted) !important;
}

.field-line input,
.filter-input,
.filter-select,
.line-input,
.modal input,
.modal select,
.modal textarea,
.profile-password-form input {
  background: rgba(255, 253, 248, 0.9) !important;
  border-color: rgba(45, 39, 30, 0.18) !important;
  color: var(--ink) !important;
}

.field-line input::placeholder,
.filter-input::placeholder,
.line-input::placeholder,
.modal input::placeholder,
.modal textarea::placeholder {
  color: #a99f91 !important;
}

.ink-button,
.solid-button,
.wallet-badge,
.masked-key {
  border-color: var(--black) !important;
  background: var(--black) !important;
  background-image: none !important;
  color: var(--white) !important;
  box-shadow: 0 14px 34px rgba(35, 31, 25, 0.16) !important;
}

#user-avatar,
.profile-avatar {
  background: var(--green) !important;
  color: var(--white) !important;
  box-shadow: none !important;
}

.badge,
.side-brand small,
.profile-chip,
.tiny-badge,
.operational {
  background: rgba(255, 253, 248, 0.78) !important;
  border-color: rgba(45, 39, 30, 0.14) !important;
  color: #514a40 !important;
}

.profile-chip.good,
.operational {
  background: rgba(23, 181, 165, 0.12) !important;
  color: #0d7e73 !important;
}

.badge.orange {
  background: rgba(212, 90, 64, 0.12) !important;
  color: #a9422f !important;
}

.badge.red,
.profile-chip.bad {
  background: rgba(195, 58, 63, 0.12) !important;
  color: #a72d34 !important;
}

th {
  background: rgba(239, 234, 224, 0.96) !important;
  color: var(--ink) !important;
}

td,
tr {
  color: var(--ink) !important;
  border-color: rgba(45, 39, 30, 0.1) !important;
}

tr:hover {
  background: rgba(195, 58, 63, 0.045) !important;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline-color: rgba(195, 58, 63, 0.66) !important;
}

@media (max-width: 700px) {
  html,
  body,
  body.dark-mode,
  .login-view,
  .app-view,
  .workspace {
    background:
      linear-gradient(var(--line) 1px, transparent 1px),
      linear-gradient(90deg, var(--line) 1px, transparent 1px),
      var(--paper) !important;
    background-size: 48px 48px, 48px 48px, auto !important;
  }

  .login-top,
  .auth-panel {
    background: rgba(242, 238, 230, 0.94) !important;
  }
}

/* 20260707 video generator full-width compose layout */
.vg-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.vg-compose {
  max-width: none;
  justify-self: stretch;
}

.vg-form {
  display: grid;
  grid-template-columns: minmax(420px, .98fr) minmax(520px, 1.02fr);
  grid-template-areas:
    "topline topline"
    "prompt controls"
    "actions actions"
    "message message";
  column-gap: 20px;
  row-gap: 14px;
  align-items: start;
}

.vg-compose-topline,
.vg-actions,
.vg-message {
  grid-column: 1 / -1;
}

.vg-compose-topline {
  grid-area: topline;
}

.vg-prompt-stack,
.vg-control-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.vg-prompt-stack {
  grid-area: prompt;
}

.vg-control-stack {
  grid-area: controls;
  display: grid;
  grid-template-columns: minmax(330px, .92fr) minmax(260px, .72fr);
  grid-template-areas:
    "choices upload"
    "watermark watermark"
    "cost cost";
  align-items: start;
  column-gap: 14px;
  row-gap: 14px;
  padding-top: 0;
}

.vg-actions {
  grid-area: actions;
  display: grid;
  grid-template-columns: minmax(120px, .24fr) minmax(0, .76fr);
}

.vg-message {
  grid-area: message;
}

.vg-choice-stack .vg-choice-row {
  grid-column: auto;
}

.vg-upload-row {
  grid-area: upload;
  align-self: stretch;
}

.vg-upload-zone {
  min-height: 112px;
}

.video-asset-list {
  grid-column: 2;
  min-height: 0;
}

.vg-watermark {
  grid-area: watermark;
}

.vg-cost-note {
  grid-area: cost;
}

.vg-output {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.vg-log-body {
  min-height: 180px;
}

@media (max-width: 1180px) {
  .vg-form,
  .vg-output {
    grid-template-columns: 1fr;
    grid-template-areas:
      "topline"
      "prompt"
      "controls"
      "actions"
      "message";
  }

  .vg-control-stack {
    display: flex;
    flex-direction: column;
    padding-top: 0;
  }

  .video-asset-list,
  .vg-choice-row {
    grid-column: auto;
  }
}
