:root {
  --bg-1: #020204;
  --bg-2: #06060a;
  --bg-3: #0d0b18;
  --bg-4: #17112b;
  --card: rgba(255, 255, 255, 0.04);
  --card-border: rgba(255, 255, 255, 0.1);
  --text-main: #ecf3ff;
  --text-muted: #9aa7c2;
  --accent: #5fa8ff;
  --accent-2: #9b6bff;
  --danger: #ff6b6b;
  --shadow: 0 12px 34px rgba(0, 0, 0, 0.62);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Microsoft YaHei", "微软雅黑", sans-serif;
  color: var(--text-main);
  background: radial-gradient(circle at 10% 10%, rgba(95, 168, 255, 0.24) 0%, transparent 32%),
    radial-gradient(circle at 88% 12%, rgba(155, 107, 255, 0.2) 0%, transparent 36%),
    linear-gradient(130deg, var(--bg-1) 0%, var(--bg-2) 50%, var(--bg-3) 100%);
  min-height: 100%;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.14;
  pointer-events: none;
  z-index: -2;
}

.page-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 20px 60px;
}

header.site-header {
  position: sticky;
  top: 0;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  background: rgba(3, 3, 3, 0.86);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 20;
}

.header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-main);
}

.brand img {
  width: 160px;
  height: auto;
}

.top-nav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.top-nav a {
  color: var(--text-muted);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 999px;
  border: none;
  transition: all 0.25s ease;
}

.top-nav a:hover,
.top-nav a.active {
  border: none;
  color: #fff;
  background: rgba(95, 168, 255, 0.2);
  text-shadow: 0 0 10px rgba(155, 107, 255, 0.42);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.header-user-status {
  position: relative;
}

.user-menu-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--text-main);
  font-size: 14px;
  box-shadow: none;
}

.user-menu-button:hover {
  background: rgba(255, 255, 255, 0.08);
}

.header-user-status.guest-mode .user-menu-button {
  border: none;
  background: transparent;
  box-shadow: none;
  color: var(--text-main);
}

.header-user-status.guest-mode .user-menu-button:hover {
  background: rgba(255, 255, 255, 0.08);
}

.header-actions #lang-switch.btn.secondary {
  border: none;
  background: transparent;
  box-shadow: none;
  padding: 8px 10px;
}

.header-actions #lang-switch.btn.secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: none;
}

.header-actions .user-menu-button:focus-visible,
.header-actions #lang-switch.btn.secondary:focus-visible {
  outline: 1px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}

.header-user-status.guest-mode .user-avatar {
  display: none;
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #08162f;
  background: linear-gradient(145deg, #8dc3ff, #9b6bff);
}

.user-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 180px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(5, 8, 15, 0.97);
  box-shadow: var(--shadow);
  padding: 8px;
  display: none;
  z-index: 30;
}

.header-user-status.open .user-menu-panel {
  display: block;
}

.user-menu-item {
  width: 100%;
  border-radius: 8px;
  border: 1px solid transparent;
  color: var(--text-main);
  padding: 8px 10px;
  font-size: 13px;
  text-align: left;
  text-decoration: none;
  background: transparent;
  box-shadow: none;
  display: block;
}

.user-menu-item:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(95, 168, 255, 0.18);
  transform: none;
}

button,
.btn {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 600;
  background: linear-gradient(145deg, var(--accent), #0ea5a4);
  color: #052221;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 8px 24px rgba(20, 184, 166, 0.25);
}

button:hover,
.btn:hover {
  transform: translateY(-2px);
}

.btn.secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  box-shadow: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

main {
  margin-top: 24px;
}

.hero {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid var(--card-border);
  min-height: 420px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 20px;
  padding: 28px;
  background: linear-gradient(145deg, rgba(95, 168, 255, 0.2), rgba(10, 7, 24, 0.94));
  box-shadow: var(--shadow);
}

#hero-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-content,
.hero-panel {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1.05;
  margin: 10px 0;
}

.hero p {
  color: var(--text-muted);
  font-size: 18px;
  max-width: 650px;
}

.glow-pill {
  display: inline-flex;
  padding: 6px 12px;
  border-radius: 999px;
  background: linear-gradient(145deg, rgba(245, 158, 11, 0.33), rgba(20, 184, 166, 0.25));
  border: 1px solid rgba(255, 255, 255, 0.28);
  font-size: 12px;
  letter-spacing: 1px;
}

.hero-panel {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.23);
  background: rgba(7, 10, 18, 0.9);
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.stat-card {
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px;
}

.stat-card h3 {
  margin: 0;
  color: #fff;
  font-size: 20px;
}

.stat-card p {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

.section-card {
  margin-top: 22px;
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--card-border);
  padding: 22px;
  box-shadow: var(--shadow);
}

.section-title {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 30px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.mt-16 {
  margin-top: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.service-card,
.paper-card,
.identity-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 16px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.table-wrap.mt-12 {
  margin-top: 12px;
}

.admin-bulk-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

th {
  background: rgba(95, 168, 255, 0.18);
  color: #dffefa;
}

td {
  background: rgba(7, 10, 18, 0.82);
}

.service-card h3,
.paper-card h3,
.identity-card h3 {
  margin-top: 0;
}

.paper-card a {
  color: #5eead4;
}

label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-muted);
  font-size: 14px;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  padding: 10px;
  background: rgba(7, 10, 18, 0.9);
  color: #eafffb;
  margin-bottom: 14px;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

form.inline-auth {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.auth-actions {
  display: flex;
  align-items: end;
  gap: 10px;
}

.auth-register-hint {
  color: var(--text-muted);
  font-size: 14px;
  margin: 10px 0 0;
}

.auth-register-hint a {
  color: #5eead4;
}

.auth-box {
  background: rgba(8, 8, 8, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 16px;
  margin-top: 20px;
}

.auth-status {
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 14px;
}

.notice {
  margin-top: 10px;
  font-size: 14px;
}

.notice.error {
  color: var(--danger);
}

.notice.ok {
  color: #6ee7b7;
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: all 0.45s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

footer {
  margin-top: 32px;
  padding: 18px 0;
  color: var(--text-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

@media (max-width: 960px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .grid-3 {
    grid-template-columns: 1fr;
  }

  .grid-2,
  form.inline-auth {
    grid-template-columns: 1fr;
  }

  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}
