:root {
  --primary: #2C7BE5;
  --success: #34C759;
  --warning: #FF9F0A;
  --danger: #FF4D4F;
  --sidebar: #1E293B;
  --sidebar-text: #B0B7C3;
  --bg: #F5F7FA;
  --card: #FFFFFF;
  --ink: #1A1A1A;
  --muted: #8E8E93;
  --line: #F2F2F7;
  --table-alt: #FAFBFC;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
a {
  color: inherit;
  text-decoration: none;
}
[hidden] {
  display: none !important;
}

.splash-page {
  min-height: 100vh;
  overflow: hidden;
  background: #061525;
}
.whale-splash {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100vh;
  isolation: isolate;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(8, 24, 46, 0.24), rgba(6, 21, 37, 0.84)),
    radial-gradient(circle at 50% 18%, rgba(114, 200, 255, 0.42), transparent 26%),
    linear-gradient(135deg, #061525 0%, #0b3762 48%, #2c7be5 100%);
}
.splash-sky {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.splash-star {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.6);
  animation: starPulse 2.2s ease-in-out infinite;
}
.star-a { left: 23%; top: 19%; }
.star-b { right: 26%; top: 16%; animation-delay: 0.5s; }
.star-c { left: 58%; top: 30%; animation-delay: 1s; }
.whale-stage {
  position: absolute;
  left: 50%;
  bottom: 21vh;
  width: 320px;
  height: 320px;
  transform: translateX(-50%);
}
.splash-whale {
  position: absolute;
  left: 104px;
  bottom: 68px;
  z-index: 4;
  width: 112px;
  height: 112px;
  border-radius: 24px;
  object-fit: cover;
  filter: drop-shadow(0 28px 32px rgba(0, 20, 40, 0.34));
  animation: whaleLeap 4.8s cubic-bezier(0.2, 0.72, 0.22, 1) forwards;
}
.water-ring {
  position: absolute;
  left: 50%;
  bottom: 74px;
  width: 88px;
  height: 22px;
  border: 2px solid rgba(179, 232, 255, 0.7);
  border-radius: 50%;
  transform: translateX(-50%) scale(0.28);
  opacity: 0;
}
.ring-a { animation: splashRing 4.8s ease-out forwards; }
.ring-b { animation: splashRing 4.8s ease-out 2.7s forwards; }
.water-drop {
  position: absolute;
  z-index: 3;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(192, 238, 255, 0.92);
  opacity: 0;
  animation: waterDrop 4.8s ease-out forwards;
}
.drop-a { left: 86px; bottom: 112px; }
.drop-b { left: 196px; bottom: 126px; animation-delay: 0.08s; }
.drop-c { left: 158px; bottom: 94px; animation-delay: 2.6s; }
.wave-layer {
  position: absolute;
  left: -8%;
  right: -8%;
  bottom: -2px;
  height: 26vh;
  background:
    radial-gradient(70% 85% at 50% -16%, rgba(255, 255, 255, 0.72), transparent 38%),
    linear-gradient(180deg, rgba(53, 170, 221, 0.82), rgba(8, 55, 92, 0.96));
  clip-path: polygon(0 36%, 8% 30%, 17% 39%, 26% 27%, 36% 36%, 46% 26%, 56% 34%, 68% 24%, 80% 35%, 91% 25%, 100% 34%, 100% 100%, 0 100%);
  animation: waveMove 4.8s ease-in-out forwards;
}
.wave-back {
  bottom: 5vh;
  opacity: 0.48;
  filter: blur(1px);
  transform: translateX(-3%);
}
.wave-front {
  z-index: 2;
  height: 21vh;
  opacity: 0.92;
}
.splash-copy {
  position: relative;
  z-index: 5;
  display: grid;
  justify-items: center;
  margin-top: -16vh;
  text-align: center;
  animation: copyRise 4.8s ease forwards;
}
.splash-copy p {
  margin: 0 0 10px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-weight: 800;
}
.splash-copy h1 {
  margin: 0;
  font-size: 56px;
  line-height: 1.05;
}
.splash-copy span {
  margin-top: 14px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 16px;
}
.splash-copy a {
  margin-top: 28px;
  padding: 10px 18px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-weight: 800;
}
.splash-copy .splash-legal-links {
  display: flex;
  gap: 18px;
  margin-top: 16px;
}
.splash-copy .splash-legal-links a,
.splash-copy .icp-record {
  margin-top: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
  font-weight: 600;
}
.splash-copy .splash-legal-links a:hover,
.splash-copy .splash-legal-links a:focus-visible,
.splash-copy .icp-record:hover,
.splash-copy .icp-record:focus-visible {
  color: #fff;
  text-decoration: underline;
}
.splash-copy small {
  margin-top: 18px;
  color: rgba(255, 255, 255, 0.48);
  font-size: 12px;
}
@keyframes whaleLeap {
  0% { transform: translate3d(0, 132px, 0) rotate(-8deg) scale(0.86); opacity: 0; }
  10% { opacity: 1; }
  34% { transform: translate3d(-38px, -116px, 0) rotate(-21deg) scale(1.16); }
  55% { transform: translate3d(34px, -152px, 0) rotate(18deg) scale(1.22); }
  78% { transform: translate3d(56px, 42px, 0) rotate(28deg) scale(0.94); opacity: 1; }
  100% { transform: translate3d(64px, 106px, 0) rotate(18deg) scale(0.76); opacity: 0; }
}
@keyframes splashRing {
  0%, 16% { opacity: 0; transform: translateX(-50%) scale(0.22); }
  24%, 70% { opacity: 0.72; }
  100% { opacity: 0; transform: translateX(-50%) scale(3.2); }
}
@keyframes waterDrop {
  0%, 12% { opacity: 0; transform: translate3d(0, 0, 0) scale(0.5); }
  28% { opacity: 1; transform: translate3d(-44px, -72px, 0) scale(1); }
  48%, 100% { opacity: 0; transform: translate3d(18px, 40px, 0) scale(0.2); }
}
@keyframes waveMove {
  0% { transform: translateX(-3%) translateY(20px); }
  45% { transform: translateX(2%) translateY(0); }
  100% { transform: translateX(-1%) translateY(12px); }
}
@keyframes starPulse {
  0%, 100% { opacity: 0.28; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.35); }
}
@keyframes copyRise {
  0% { opacity: 0; transform: translateY(18px); }
  18%, 100% { opacity: 1; transform: translateY(0); }
}

.admin-body {
  min-height: 100vh;
  min-width: 1280px;
  background: var(--bg);
}

.login-view {
  display: grid;
  grid-template-columns: minmax(520px, 0.94fr) minmax(430px, 0.7fr);
  min-height: 100vh;
  background: #fff;
}
.login-brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 72px;
  background:
    linear-gradient(135deg, rgba(30, 41, 59, 0.96), rgba(44, 123, 229, 0.82)),
    radial-gradient(circle at 70% 20%, rgba(255, 255, 255, 0.24), transparent 32%);
  color: #fff;
}
.login-logo {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
}
.login-kicker {
  margin: 28px 0 12px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}
.login-brand h1 {
  margin: 0;
  max-width: 620px;
  font-size: 44px;
  line-height: 1.16;
}
.login-brand p:last-child {
  max-width: 560px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 16px;
  line-height: 1.8;
}
.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 64px;
  background: #fff;
}
.login-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 24px;
}
.login-tab {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: #4b5563;
  font-weight: 700;
}
.login-tab.active {
  border-color: var(--primary);
  background: rgba(44, 123, 229, 0.08);
  color: var(--primary);
}
.login-form {
  display: grid;
  gap: 18px;
}
.login-form label {
  display: grid;
  gap: 8px;
  color: #374151;
  font-size: 14px;
  font-weight: 700;
}
.login-form input,
.login-form select,
.filter-row input,
.filter-row select,
.topbar-actions select,
.pagination-row select {
  height: 40px;
  border: 1px solid #E5E7EB;
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
  outline: none;
}
.login-form input:focus,
.login-form select:focus,
.filter-row input:focus,
.filter-row select:focus,
.topbar-actions select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(44, 123, 229, 0.12);
}
.inline-control {
  display: grid;
  grid-template-columns: 1fr 116px;
  gap: 8px;
}
.login-error {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-size: 13px;
}
.login-hint {
  min-height: 20px;
  margin: -6px 0 0;
  color: #0f766e;
  font-size: 13px;
}
.login-secondary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #64748b;
  font-size: 13px;
}
.login-secondary button {
  border: 0;
  background: transparent;
  color: var(--primary);
  font-weight: 800;
}

.admin-shell {
  display: grid;
  grid-template-columns: 220px minmax(1200px, 1fr);
  min-height: 100vh;
}
.admin-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: var(--sidebar);
  color: var(--sidebar-text);
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 60px;
  padding: 0 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
}
.sidebar-brand img {
  width: 32px;
  height: 32px;
  border-radius: 6px;
}
.sidebar-brand strong {
  font-size: 16px;
}
.sidebar-menu {
  display: grid;
  gap: 4px;
  padding: 14px 10px;
}
.sidebar-menu a {
  display: flex;
  align-items: center;
  height: 44px;
  padding: 0 14px;
  border-radius: 4px;
  color: var(--sidebar-text);
  font-size: 14px;
  font-weight: 700;
}
.sidebar-menu a::before {
  content: "";
  width: 8px;
  height: 8px;
  margin-right: 10px;
  border-radius: 2px;
  background: currentColor;
  opacity: 0.72;
}
.sidebar-menu a.active,
.sidebar-menu a:hover {
  background: var(--primary);
  color: #fff;
}
.sidebar-user {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 10px;
  align-items: center;
  margin-top: auto;
  padding: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(44, 123, 229, 0.25);
  color: #fff;
  font-weight: 800;
}
.sidebar-user strong,
.sidebar-user small {
  display: block;
}
.sidebar-user strong {
  color: #fff;
  font-size: 14px;
}
.sidebar-user small {
  margin-top: 4px;
  overflow: hidden;
  color: #8E98A8;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-main {
  min-width: 1200px;
  background: var(--bg);
}
.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 8px 24px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.breadcrumb {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
}
.admin-topbar h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.admin-content {
  padding: 24px;
}

.primary-btn,
.ghost-btn,
.link-btn {
  border-radius: 4px;
  font-weight: 700;
}
.primary-btn {
  height: 40px;
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #fff;
  padding: 0 16px;
}
.primary-btn.wide {
  width: 100%;
}
.ghost-btn {
  height: 40px;
  border: 1px solid #D9DEE8;
  background: #fff;
  color: #334155;
  padding: 0 14px;
}
.ghost-btn.danger {
  color: var(--danger);
}
.link-btn {
  border: 0;
  background: transparent;
  color: var(--primary);
  padding: 0;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
}
.metric-card {
  min-height: 118px;
  padding: 18px;
  border-radius: 6px;
  background: #1A5276;
  color: #fff;
}
.metric-card span,
.metric-card small {
  display: block;
}
.metric-card span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
}
.metric-card strong {
  display: block;
  margin: 14px 0 8px;
  font-size: 28px;
  line-height: 1;
}
.metric-card small {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
}
.metric-card .up { color: #B7F5C4; }
.metric-card .warn { color: #FFE0A6; }
.metric-card .danger { color: #FFC5C7; }

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
  gap: 16px;
  margin-top: 16px;
}
.chart-card,
.table-card,
.placeholder-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}
.chart-card {
  min-height: 320px;
  padding: 18px;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.card-head h3,
.placeholder-card h3 {
  margin: 0;
  font-size: 16px;
}
.card-head span {
  color: var(--muted);
  font-size: 12px;
}
.trend-chart {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  align-items: end;
  gap: 10px;
  height: 210px;
  padding: 16px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, transparent 24%, var(--line) 25%, transparent 25%),
    linear-gradient(180deg, transparent 49%, var(--line) 50%, transparent 50%),
    linear-gradient(180deg, transparent 74%, var(--line) 75%, transparent 75%);
}
.trend-chart span {
  display: block;
  height: var(--h);
  min-height: 24px;
  border-radius: 4px 4px 0 0;
  background: var(--c);
}
.chart-legend {
  display: flex;
  gap: 18px;
  margin-top: 14px;
  color: #4B5563;
  font-size: 12px;
}
.chart-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  border-radius: 2px;
}
.blue { background: var(--primary); }
.green { background: var(--success); }
.gray { background: #8E8E93; }
.rank-list {
  display: grid;
  gap: 14px;
}
.rank-list div {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
  align-items: center;
}
.rank-list b {
  font-size: 13px;
}
.rank-list span {
  position: relative;
  display: block;
  height: 28px;
  padding-left: 10px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 28px;
  overflow: hidden;
}
.rank-list span::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  z-index: 0;
  width: var(--w);
  border-radius: 4px;
  background: linear-gradient(90deg, #2C7BE5, #7EB3F7);
}
.rank-list span {
  z-index: 1;
}
.rank-list span::after {
  content: attr(style);
  display: none;
}

.table-card {
  margin-top: 16px;
  padding: 16px;
}
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}
.filter-row input {
  width: 240px;
}
.filter-row select {
  width: 160px;
}
.batch-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  margin-bottom: 12px;
  padding: 0 12px;
  border: 1px solid rgba(44, 123, 229, 0.22);
  border-radius: 4px;
  background: rgba(44, 123, 229, 0.08);
}
.batch-toolbar div,
.batch-toolbar span + button {
  margin-left: auto;
}
.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 4px;
}
.admin-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 14px;
}
.admin-table thead {
  background: var(--table-alt);
}
.admin-table th {
  height: 48px;
  color: var(--ink);
  font-weight: 800;
  text-align: left;
}
.admin-table th,
.admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.admin-table tbody tr:nth-child(even) {
  background: var(--table-alt);
}
.admin-table tbody tr:hover {
  background: #F0F4FF;
}
.admin-table th:first-child,
.admin-table td:first-child {
  width: 52px;
}
.fixed-right {
  position: sticky;
  right: 0;
  width: 108px;
  background: inherit;
}
.ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.status-tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 800;
}
.status-tag.warning {
  background: rgba(255, 159, 10, 0.14);
  color: #A96500;
}
.status-tag.danger {
  background: rgba(255, 77, 79, 0.12);
  color: #B91C1C;
}
.status-tag.success {
  background: rgba(52, 199, 89, 0.12);
  color: #137333;
}
.pagination-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 12px;
  color: #4B5563;
  font-size: 13px;
}

.module-placeholder {
  display: grid;
  min-height: calc(100vh - 96px);
}
.module-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}
.module-head h3 {
  margin: 0;
  font-size: 20px;
}
.module-head p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
}
.placeholder-card {
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 420px;
  padding: 48px;
  text-align: center;
}
.module-stage {
  display: inline-flex;
  align-items: center;
  height: 28px;
  margin: 0 0 14px;
  padding: 0 10px;
  border-radius: 4px;
  background: rgba(44, 123, 229, 0.12);
  color: var(--primary);
  font-weight: 800;
}
.placeholder-card p:last-child {
  max-width: 520px;
  color: var(--muted);
  line-height: 1.8;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.42);
}
.modal {
  width: 480px;
  border-radius: 6px;
  background: #fff;
  padding: 24px;
  box-shadow: 0 24px 88px rgba(15, 23, 42, 0.28);
}
.modal h3 {
  margin: 0;
  font-size: 18px;
}
.modal p {
  margin: 14px 0 24px;
  color: #4B5563;
  line-height: 1.7;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 45;
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: 720px;
  max-width: calc(100vw - 220px);
  height: 100vh;
  border-left: 1px solid var(--line);
  background: #fff;
  box-shadow: -22px 0 70px rgba(15, 23, 42, 0.18);
}
.drawer header,
.drawer footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}
.drawer footer {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}
.drawer h3 {
  margin: 0;
  font-size: 18px;
}
.drawer-body {
  overflow: auto;
  padding: 22px;
}
.drawer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.drawer-grid label {
  display: grid;
  gap: 8px;
  color: #374151;
  font-size: 13px;
  font-weight: 700;
}
.drawer-grid input {
  height: 38px;
  border: 1px solid #E5E7EB;
  border-radius: 4px;
  padding: 0 10px;
}
.drawer-section {
  margin-top: 22px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--table-alt);
}
.drawer-section h4 {
  margin: 0 0 10px;
}
.drawer-section li {
  margin: 8px 0;
  color: #4B5563;
}

.plain-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-width: 320px;
  padding: 28px;
  background: var(--bg);
}
.plain-card,
.legal-card {
  width: min(760px, 100%);
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.08);
}
.plain-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.plain-brand img {
  width: 42px;
  height: 42px;
  border-radius: 8px;
}
.plain-brand strong,
.plain-brand small {
  display: block;
}
.plain-brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}
.eyebrow {
  margin: 26px 0 10px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
}
.plain-card h1,
.legal-card h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.2;
}
.plain-card p,
.legal-card p,
.legal-card li {
  color: #4B5563;
  line-height: 1.8;
}
.primary-link {
  display: inline-flex;
  margin-top: 14px;
  color: var(--primary);
  font-weight: 800;
}
.legal-card {
  display: grid;
  gap: 18px;
}
.legal-card section {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
.legal-card ul {
  margin: 10px 0 0;
  padding-left: 20px;
}
