:root {
  --bg-ink: #0f5f67;
  --bg-deep: #073a41;
  --bg-paper: rgba(247, 244, 234, 0.92);
  --bg-card: rgba(255, 255, 255, 0.9);
  --line-soft: rgba(7, 58, 65, 0.12);
  --line-strong: rgba(7, 58, 65, 0.2);
  --text-main: #12373c;
  --text-subtle: #56757a;
  --teal: #0d737d;
  --teal-soft: #d6efee;
  --gold: #d9a53f;
  --gold-soft: #fff3d7;
  --rose: #c96c74;
  --rose-soft: #fde6e8;
  --danger: #b94f57;
  --shadow-lg: 0 24px 60px rgba(6, 44, 49, 0.22);
  --shadow-md: 0 14px 32px rgba(6, 44, 49, 0.12);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--text-main);
  font-family: "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255, 226, 167, 0.45), transparent 26%),
    radial-gradient(circle at bottom right, rgba(255, 255, 255, 0.14), transparent 24%),
    linear-gradient(160deg, #0a6771 0%, #0a5962 36%, #08373e 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, transparent 0, transparent 46%, rgba(255, 255, 255, 0.06) 47%, transparent 52%),
    repeating-linear-gradient(
      180deg,
      transparent 0,
      transparent 34px,
      rgba(255, 255, 255, 0.03) 35px,
      transparent 36px
    );
}

button,
input,
textarea {
  font: inherit;
}

img {
  display: block;
  max-width: 100%;
}

button {
  cursor: pointer;
}

input,
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.85);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: rgba(13, 115, 125, 0.55);
  box-shadow: 0 0 0 4px rgba(13, 115, 125, 0.12);
  transform: translateY(-1px);
}

textarea {
  resize: vertical;
  min-height: 88px;
}

code {
  word-break: break-all;
  font-family: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 24px;
  min-height: 100vh;
  padding: 24px;
}

.sidebar {
  position: sticky;
  top: 24px;
  height: calc(100vh - 48px);
  padding: 28px;
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(248, 244, 234, 0.94), rgba(248, 244, 234, 0.82));
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.brand-block {
  position: relative;
  padding-bottom: 22px;
}

.brand-block::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(217, 165, 63, 0), rgba(217, 165, 63, 0.85), rgba(13, 115, 125, 0));
}

.brand-kicker,
.section-kicker,
.hero-kicker {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-subtle);
}

.brand-block h1,
.hero-copy h2,
.section-heading h3,
.auth-card h3,
.panel-title-row h4 {
  margin: 0;
  font-family: "STZhongsong", "Songti SC", "Noto Serif SC", serif;
}

.brand-block h1 {
  font-size: 32px;
  line-height: 1.15;
}

.brand-copy,
.hero-text,
.auth-card__demo,
.form-tip,
.sidebar-note p,
.auth-card__meta span {
  margin: 0;
  color: var(--text-subtle);
  line-height: 1.7;
}

.nav-list {
  display: grid;
  gap: 10px;
}

.nav-item {
  position: relative;
  padding: 14px 18px;
  border: 1px solid transparent;
  border-radius: 18px;
  background: rgba(13, 115, 125, 0.08);
  color: var(--text-main);
  text-align: left;
  font-weight: 700;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.nav-item:hover,
.nav-item.is-active {
  transform: translateX(4px);
  border-color: rgba(13, 115, 125, 0.16);
  box-shadow: var(--shadow-md);
}

.nav-item.is-active {
  background: linear-gradient(135deg, rgba(13, 115, 125, 0.18), rgba(217, 165, 63, 0.18));
}

.sidebar-note {
  margin-top: auto;
  padding: 18px;
  border-radius: 18px;
  background: rgba(13, 115, 125, 0.08);
}

.main-shell {
  display: grid;
  gap: 20px;
}

.topbar,
.hero-panel,
.section-card {
  border-radius: var(--radius-xl);
  background: var(--bg-paper);
  box-shadow: var(--shadow-lg);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
}

.status-group,
.topbar-actions,
.section-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(13, 115, 125, 0.12);
  color: var(--teal);
  font-weight: 700;
}

.status-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.status-pill--ghost {
  color: var(--gold);
  background: rgba(217, 165, 63, 0.14);
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 420px);
  gap: 24px;
  padding: 28px;
  overflow: hidden;
}

.hero-copy {
  position: relative;
  padding: 18px 6px 18px 8px;
}

.hero-copy::after {
  content: "";
  position: absolute;
  right: -64px;
  bottom: -48px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(217, 165, 63, 0.28), rgba(217, 165, 63, 0) 68%);
}

.hero-copy h2 {
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.25;
  max-width: 16ch;
}

.auth-card {
  position: relative;
  z-index: 1;
  padding: 24px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(13, 115, 125, 0.12);
}

.auth-card__header,
.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.stack-form {
  display: grid;
  gap: 14px;
}

.stack-form label {
  display: grid;
  gap: 8px;
  color: var(--text-main);
  font-weight: 600;
}

.checkbox-row {
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 10px;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.auth-card__meta {
  margin-top: 16px;
  display: grid;
  gap: 8px;
}

.payment-panel {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid rgba(13, 115, 125, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.66);
}

.payment-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.payment-panel__header span {
  font-weight: 700;
}

.payment-panel__message {
  margin: 12px 0 0;
  color: var(--text-subtle);
  line-height: 1.7;
}

.payment-panel__meta {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.payment-panel__meta li {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-top: 10px;
  border-top: 1px solid rgba(7, 58, 65, 0.08);
}

.payment-panel__meta li:first-child {
  padding-top: 0;
  border-top: 0;
}

.payment-panel__meta span {
  color: var(--text-subtle);
}

.payment-panel__meta strong {
  max-width: 70%;
  text-align: right;
  word-break: break-word;
}

.payment-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.payment-pill--ready {
  color: #1d6455;
  background: #dff6ee;
}

.payment-pill--warn {
  color: #8a5a13;
  background: #fff0d0;
}

.payment-pill--muted {
  color: #56757a;
  background: rgba(13, 115, 125, 0.12);
}

.auth-card__demo,
.form-tip {
  margin-top: 14px;
}

.primary-button,
.ghost-button,
.danger-button,
.text-button {
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 700;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.primary-button:hover,
.ghost-button:hover,
.danger-button:hover,
.text-button:hover {
  transform: translateY(-1px);
}

.primary-button {
  color: #fff;
  background: linear-gradient(135deg, #0d737d, #138a95);
  box-shadow: 0 12px 24px rgba(13, 115, 125, 0.22);
}

.ghost-button {
  color: var(--text-main);
  background: rgba(13, 115, 125, 0.08);
}

.danger-button {
  color: #fff;
  background: linear-gradient(135deg, #bf5e65, #a53c4e);
  box-shadow: 0 12px 24px rgba(165, 60, 78, 0.2);
}

.text-button {
  padding: 0;
  background: transparent;
  color: var(--teal);
}

.flash {
  padding: 14px 18px;
  border-radius: 18px;
  font-weight: 700;
  box-shadow: var(--shadow-md);
}

.flash--success {
  color: #1d6455;
  background: #dff6ee;
}

.flash--error {
  color: #8a3340;
  background: #fde6ea;
}

.flash--info {
  color: #285764;
  background: #e3f3f7;
}

.section-card {
  padding: 24px;
}

.section-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 22px;
}

.section-layout--narrow {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.list-panel,
.form-panel {
  padding: 20px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
}

.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-count {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(217, 165, 63, 0.16);
  color: #89611d;
  font-weight: 700;
}

.metric-grid,
.shortcut-grid {
  display: grid;
  gap: 16px;
}

.metric-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 18px;
}

.shortcut-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.metric-card,
.shortcut-card,
.entity-card,
.detail-card {
  border-radius: 20px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.9);
  padding: 18px;
}

.metric-card {
  background:
    linear-gradient(160deg, rgba(13, 115, 125, 0.08), rgba(255, 255, 255, 0.98)),
    rgba(255, 255, 255, 0.9);
}

.metric-card h4,
.shortcut-card h4,
.entity-card h4,
.detail-card h4 {
  margin: 0 0 8px;
  font-size: 18px;
}

.metric-value {
  margin: 0 0 10px;
  font-size: 30px;
  font-weight: 800;
  color: var(--teal);
}

.metric-helper,
.shortcut-card p,
.entity-meta,
.detail-card p,
.empty-state {
  margin: 0;
  color: var(--text-subtle);
  line-height: 1.65;
}

.entity-list,
.detail-stack {
  display: grid;
  gap: 14px;
}

.entity-card__header,
.entity-card__actions,
.entity-pill-row,
.detail-grid,
.search-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.entity-card__header {
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.entity-card__hero,
.detail-card__hero {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1;
}

.entity-card__copy,
.detail-card__copy {
  min-width: 0;
}

.entity-pill,
.theme-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.entity-pill {
  color: var(--teal);
  background: var(--teal-soft);
}

.theme-pill {
  color: #8f6210;
  background: var(--gold-soft);
}

.entity-meta {
  display: grid;
  gap: 6px;
}

.entity-avatar,
.ranking-avatar,
.actor-avatar-preview__fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, #0d737d, #d9a53f);
  color: #ffffff;
  font-weight: 800;
  flex-shrink: 0;
}

.entity-avatar {
  width: 56px;
  height: 56px;
  font-size: 22px;
}

.ranking-avatar {
  width: 48px;
  height: 48px;
  font-size: 18px;
}

.entity-avatar__image,
.ranking-avatar__image,
.actor-avatar-preview__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.entity-card__actions {
  margin-top: 14px;
}

.mini-button {
  border: none;
  border-radius: 999px;
  padding: 9px 12px;
  font-weight: 700;
  color: var(--text-main);
  background: rgba(13, 115, 125, 0.08);
}

.mini-button--danger {
  color: #8e3443;
  background: rgba(201, 108, 116, 0.16);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.detail-grid--summary .detail-card {
  background:
    linear-gradient(160deg, rgba(217, 165, 63, 0.12), rgba(255, 255, 255, 0.96)),
    rgba(255, 255, 255, 0.9);
}

.detail-card strong,
.entity-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--text-subtle);
}

.search-row {
  margin-bottom: 18px;
}

.detail-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.detail-card--ranking {
  background:
    linear-gradient(160deg, rgba(13, 115, 125, 0.08), rgba(255, 255, 255, 0.96)),
    rgba(255, 255, 255, 0.9);
}

.detail-card__copy p {
  margin: 0;
}

.actor-avatar-upload {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 18px;
  background: rgba(13, 115, 125, 0.04);
}

.actor-avatar-upload__header,
.actor-avatar-upload__body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.actor-avatar-upload__header strong {
  margin-bottom: 4px;
}

.actor-avatar-upload__header p {
  margin: 0;
  color: var(--text-subtle);
  line-height: 1.6;
}

.actor-avatar-preview {
  width: 88px;
  height: 88px;
}

.actor-avatar-preview__fallback {
  width: 88px;
  height: 88px;
  font-size: 30px;
}

.ghost-button--inline {
  white-space: nowrap;
}

.search-row input {
  flex: 1 1 280px;
}

.search-row .primary-button {
  min-width: 124px;
}

.shortcut-card {
  position: relative;
  overflow: hidden;
}

.shortcut-card::after {
  content: "";
  position: absolute;
  right: -20px;
  bottom: -20px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(13, 115, 125, 0.16), rgba(13, 115, 125, 0));
}

.shortcut-card code {
  display: inline-block;
  margin-top: 8px;
  color: var(--teal);
}

.empty-state {
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.55);
}

[hidden] {
  display: none !important;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .hero-panel,
  .section-layout,
  .section-layout--narrow {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 14px;
  }

  .sidebar,
  .topbar,
  .hero-panel,
  .section-card {
    border-radius: 22px;
  }

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

  .status-group,
  .topbar-actions {
    justify-content: space-between;
  }

  .section-heading,
  .auth-card__header,
  .panel-title-row {
    flex-direction: column;
    align-items: stretch;
  }
}
