:root {
  --primary: #6d5bd7;
  --primary-dark: #40298f;
  --primary-deep: #25145f;
  --primary-soft: #f1efff;
  --violet-line: #dcd6fb;
  --lavender: #8e7be8;
  --plum: #7a3f90;
  --rose-soft: #fff0f7;
  --amber: #a66f20;
  --amber-soft: #fff5e4;

  --ink: #172033;
  --ink-soft: #667085;
  --ink-muted: #8b95a5;
  --line: #e8e5f1;
  --line-strong: #d9d2ea;
  --bg: #f8f7fc;
  --surface: #ffffff;

  --shadow-sm: 0 1px 2px rgba(23, 32, 51, 0.06);
  --shadow: 0 18px 46px rgba(54, 36, 111, 0.13);
  --radius: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: auto;
  scrollbar-gutter: stable;
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% -160px, rgba(141, 123, 232, .20), transparent 360px),
    linear-gradient(180deg, rgba(255,255,255,.82), rgba(248,247,252,.94) 300px),
    var(--bg);
  min-height: 100vh;
  overflow-y: scroll;
  -webkit-font-smoothing: antialiased;
}

body.is-locked {
  overflow: hidden;
}

body.is-locked .site-shell {
  display: none;
}

body.is-authed .login-screen {
  display: none;
}

/* ---------- 登录页 ---------- */
.login-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow: hidden;
  color: #fff;
  background: #f2effb;
}

.login-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 24%, rgba(255,255,255,.86) 0 16%, rgba(255,255,255,.22) 36%, rgba(255,255,255,0) 64%),
    linear-gradient(100deg, rgba(26, 13, 74, .78) 0%, rgba(63, 37, 142, .58) 42%, rgba(255,255,255,.30) 100%),
    linear-gradient(180deg, rgba(255,255,255,.12), rgba(31, 16, 82, .28)),
    url("assets/collagen-hero.png") center / cover no-repeat;
  transform: scale(1.02);
}

.login-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(20, 9, 61, .34), rgba(255,255,255,0) 62%),
    radial-gradient(circle at 82% 76%, rgba(255,255,255,.34), rgba(255,255,255,0) 26%);
}

.login-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 64px));
  min-height: 100svh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  align-items: center;
  gap: 72px;
}

.login-copy {
  max-width: 650px;
  padding-top: 24px;
}

.login-logo {
  width: 76px;
  height: 76px;
  margin-bottom: 28px;
  color: rgba(255,255,255,.94);
}

.login-logo svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 14px 30px rgba(32, 18, 82, .30));
}

.login-kicker {
  color: rgba(255,255,255,.76);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 2.4px;
  margin-bottom: 16px;
}

.login-copy h1 {
  font-size: clamp(42px, 5vw, 72px);
  line-height: 1.08;
  letter-spacing: 0;
  text-shadow: 0 18px 44px rgba(18, 8, 56, .32);
}

.login-sub {
  margin-top: 18px;
  color: rgba(255,255,255,.84);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: .4px;
}

.login-card {
  width: 100%;
  padding: 34px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.38);
  background:
    linear-gradient(180deg, rgba(255,255,255,.86), rgba(255,255,255,.72));
  box-shadow: 0 30px 80px rgba(35, 18, 86, .30);
  color: var(--ink);
  backdrop-filter: blur(18px);
}

.login-card-head {
  margin-bottom: 28px;
}

.login-card-head span {
  display: block;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.login-card-head h2 {
  color: var(--primary-dark);
  font-size: 28px;
  line-height: 1.25;
}

.login-card-head p {
  margin-top: 8px;
  color: #687385;
  font-size: 13px;
  line-height: 1.65;
}

.login-field {
  display: block;
  margin-bottom: 16px;
}

.login-field span {
  display: block;
  color: #5e6678;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
}

.login-field input {
  width: 100%;
  height: 48px;
  border: 1px solid rgba(109, 91, 215, .18);
  border-radius: 10px;
  padding: 0 14px;
  outline: none;
  background: rgba(255,255,255,.82);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  font-weight: 650;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.login-field input:focus {
  border-color: #a798ef;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(109, 91, 215, .12);
}

.login-error {
  min-height: 20px;
  color: #b4233a;
  font-size: 13px;
  font-weight: 650;
  margin: 2px 0 14px;
}

.login-button {
  width: 100%;
  height: 50px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary), #9b72dd);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .4px;
  box-shadow: 0 16px 36px rgba(109, 91, 215, .28);
  transition: transform .15s ease, box-shadow .15s ease;
}

.login-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 42px rgba(109, 91, 215, .34);
}

.login-button:disabled {
  cursor: wait;
  opacity: .72;
  transform: none;
  box-shadow: 0 10px 24px rgba(109, 91, 215, .18);
}

.login-footnote {
  margin-top: 14px;
  color: #7a8496;
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

/* ---------- 顶部导航 ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.90);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
  box-shadow: 0 18px 44px rgba(44, 29, 91, .06);
}

.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  height: 92px;
  padding: 0 44px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 28px;
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }

.brand-logo {
  width: 52px;
  height: 52px;
  border-radius: 0;
  background: transparent;
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
}

.brand-logo svg {
  width: 46px;
  height: 46px;
  display: block;
}

.logo-frame,
.logo-loop {
  fill: none;
  stroke: currentColor;
  stroke-width: 3.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-copy { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.brand-copy strong { color: var(--primary-dark); font-size: 16px; letter-spacing: .1px; line-height: 1; white-space: nowrap; }
.brand-copy span { color: var(--ink-muted); font-size: 11px; font-weight: 700; letter-spacing: 1.6px; }

.header-right { display: flex; align-items: center; justify-content: flex-end; }
.user { display: flex; align-items: center; gap: 9px; }

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-dark);
  border: 1px solid var(--violet-line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.user-name { font-size: 14px; font-weight: 600; }

.logout-button {
  height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0 12px;
  cursor: pointer;
  background: #fff;
  color: var(--primary-dark);
  font-family: inherit;
  font-size: 13px;
  font-weight: 750;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}

.logout-button:hover {
  border-color: #bcaef0;
  background: var(--primary-soft);
}

.logout-button:disabled {
  cursor: wait;
  color: var(--ink-muted);
  background: #f7f7fb;
}

.tabs {
  min-width: 0;
  padding: 0;
  display: flex;
  gap: 18px;
  justify-content: center;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar { display: none; }

.tab {
  position: relative;
  border: none;
  cursor: pointer;
  background: transparent;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-soft);
  width: 82px;
  height: 44px;
  padding: 0;
  margin: 0;
  border-radius: 999px;
  white-space: nowrap;
  transition: color .15s ease, background .15s ease;
}

.tab::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 3px;
  height: 2px;
  opacity: 0;
  background: transparent;
  transition: opacity .15s ease;
}

.tab:hover { color: var(--primary-dark); background: rgba(241, 239, 255, .62); }
.tab.active {
  color: var(--primary-dark);
  background: transparent;
  box-shadow: none;
}
.tab.active::after {
  opacity: 1;
  background: var(--primary);
}

/* ---------- 主区域 ---------- */
.main {
  max-width: none;
  margin: 0;
  padding: 0;
}

/* ---------- 首屏主视觉 ---------- */
.hero {
  position: relative;
  overflow: hidden;
  height: calc(100svh - 92px);
  min-height: 620px;
  border-radius: 0;
  margin-bottom: 0;
  background: #f1edfb;
  border: none;
  box-shadow: none;
}

.hero-media {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 49%, rgba(255,255,255,.62) 0 22%, rgba(255,255,255,.20) 44%, rgba(255,255,255,0) 68%),
    linear-gradient(180deg, rgba(246,244,255,.50) 0%, rgba(255,255,255,.24) 34%, rgba(52, 28, 112, .10) 100%),
    linear-gradient(90deg, rgba(255,255,255,.08) 0%, rgba(92, 51, 175, .18) 48%, rgba(85, 42, 154, .10) 100%),
    url("assets/collagen-hero.png") center 54% / cover no-repeat;
  transform: none;
}

.hero::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 39%;
  height: 27%;
  z-index: 1;
  border: none;
  background:
    linear-gradient(90deg, rgba(255,255,255,.30), rgba(255,255,255,.72) 28%, rgba(255,255,255,.72) 72%, rgba(255,255,255,.30));
  backdrop-filter: blur(3px);
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 110px;
  background:
    linear-gradient(180deg, rgba(248,247,252,0), rgba(248,247,252,.80)),
    linear-gradient(90deg, rgba(109,91,215,.18), rgba(255,255,255,0), rgba(109,91,215,.14));
}

.hero-content {
  position: relative;
  z-index: 2;
  width: min(1040px, 100%);
  margin: 0 auto;
  padding: min(23vh, 210px) 48px 0;
  color: var(--primary-dark);
  text-align: center;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.4px;
  color: var(--primary-dark);
  padding: 0 15px;
  border-radius: 999px;
  border: 1px solid rgba(109, 91, 215, .28);
  background: rgba(255,255,255,.70);
  box-shadow: 0 10px 28px rgba(64, 41, 143, .08);
  backdrop-filter: blur(12px);
  margin-bottom: 22px;
}

.hero-title {
  font-size: clamp(46px, 5.2vw, 72px);
  font-weight: 800;
  color: var(--primary-dark);
  letter-spacing: 0;
  line-height: 1.18;
  text-shadow: 0 14px 36px rgba(255,255,255,.86);
}

.hero-sub {
  max-width: 720px;
  font-size: 22px;
  color: #5c3aa7;
  margin-top: 15px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.75;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 30px;
}

.hero-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 13px;
  border: 1px solid rgba(109, 91, 215, .18);
  border-radius: 999px;
  background: rgba(255,255,255,.72);
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 22px rgba(64, 41, 143, .07);
}

.panel:not(.home-panel) {
  max-width: 1180px;
  margin: 0 auto;
  padding: 56px 28px 70px;
}

.home-panel {
  max-width: none;
  margin: 0;
  padding: 0;
}

.panel { display: none; }
.panel.active { display: block; }

.panel-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.panel-head h1 { font-size: 25px; font-weight: 800; letter-spacing: 0; }
.panel-head p { color: var(--ink-soft); margin-top: 8px; font-size: 14px; }

.search {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 14px;
  box-shadow: var(--shadow-sm);
  transition: border-color .18s ease, box-shadow .18s ease;
}

.search:focus-within { border-color: #bcaef0; box-shadow: 0 0 0 3px rgba(109, 91, 215, .12); }
.search-ico { color: var(--ink-muted); font-size: 16px; }
.search input { border: none; outline: none; font-size: 14px; width: 240px; background: transparent; color: var(--ink); }
.search input::placeholder { color: var(--ink-muted); }

/* 筛选 chip */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }

.chip {
  border: 1px solid var(--line);
  cursor: pointer;
  background: var(--surface);
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 15px;
  border-radius: 999px;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}

.chip:hover { color: var(--primary-dark); border-color: #c9bff5; }
.chip.active { background: var(--primary-soft); color: var(--primary-dark); border-color: #c9bff5; }

/* ---------- 工具网格 ---------- */
.tool-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

.tool-card {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 110px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.tool-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #c9bff5; }

.tool-ico {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  border: 1px solid var(--violet-line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
}

.tool-ico.i3,
.tool-ico.i4 { background: #f3eefb; color: var(--plum); border-color: #e5d6f0; }
.tool-ico.i5,
.tool-ico.i6 { background: var(--amber-soft); color: var(--amber); border-color: #f1d9aa; }

.tool-body h3 { font-size: 16px; font-weight: 750; }
.tool-body p { font-size: 13px; color: var(--ink-soft); margin-top: 5px; line-height: 1.55; }

/* ---------- 行列表 ---------- */
.row-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }

.row-item {
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 17px 20px;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.row-item:hover { transform: translateY(-1px); box-shadow: var(--shadow); border-color: #c9bff5; }

.row-tag {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  min-width: 76px;
  text-align: center;
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.row-tag.t4 { background: var(--amber-soft); color: var(--amber); }
.row-tag.t5 { background: #f3eefb; color: var(--plum); }
.row-main { flex: 1; min-width: 180px; }
.row-main h3 { font-size: 15px; font-weight: 650; line-height: 1.5; }
.row-meta { font-size: 13px; color: var(--ink-soft); margin-top: 4px; }
.row-action { flex-shrink: 0; color: var(--primary-dark); font-size: 13px; font-weight: 700; }

/* ---------- 信息卡 ---------- */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

.info-card {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-height: 190px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.info-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #c9bff5; }
.info-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }

.badge {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.badge.b2 { background: var(--amber-soft); color: var(--amber); }
.badge.b3 { background: #f3eefb; color: var(--plum); }
.badge.b4 { background: #f0f2f7; color: #465168; }
.info-no { font-size: 12px; color: var(--ink-muted); font-weight: 600; white-space: nowrap; }
.info-card h3 { font-size: 16px; font-weight: 750; line-height: 1.5; }
.info-card > p { font-size: 13px; color: var(--ink-soft); flex: 1; line-height: 1.65; }
.info-foot { display: flex; justify-content: space-between; gap: 14px; font-size: 12px; color: var(--ink-muted); padding-top: 11px; border-top: 1px solid var(--line); }

/* ---------- 表格 ---------- */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; font-size: 13px; font-weight: 750; color: #596579; padding: 15px 20px; background: #f9fafc; border-bottom: 1px solid var(--line); }
.data-table td { font-size: 14px; padding: 15px 20px; border-bottom: 1px solid var(--line); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background .12s ease; }
.data-table tbody tr:hover { background: #fbf9ff; }

.status { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.status.ok { background: #e7f6ee; color: #1f7d55; }
.status.warn { background: var(--amber-soft); color: var(--amber); }

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
  .login-screen {
    overflow-y: auto;
  }
  .login-shell {
    width: min(100% - 32px, 480px);
    min-height: 100svh;
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 44px 0;
  }
  .login-copy {
    padding-top: 0;
  }
  .login-logo {
    width: 58px;
    height: 58px;
    margin-bottom: 18px;
  }
  .login-copy h1 {
    font-size: 38px;
  }
  .login-sub {
    font-size: 16px;
  }
  .login-card {
    padding: 26px;
    border-radius: 14px;
  }
  .login-card-head h2 {
    font-size: 24px;
  }
  .header-inner {
    display: flex;
    min-height: auto;
    height: auto;
    padding: 14px 16px 10px;
    flex-wrap: wrap;
    gap: 12px;
  }
  .brand-logo { width: 44px; height: 44px; font-size: 22px; border-radius: 10px; }
  .brand-logo svg { width: 38px; height: 38px; }
  .logo-frame,
  .logo-loop { stroke-width: 3.3; }
  .brand-copy strong { font-size: 17px; }
  .brand-copy span { font-size: 10px; letter-spacing: 1px; }
  .header-right { display: none; }
  .tabs { order: 3; flex-basis: 100%; justify-content: flex-start; padding-bottom: 2px; }
  .tab { width: 76px; height: 40px; font-size: 14px; padding: 0; }
  .main { padding: 0 0 48px; }
  .hero {
    height: calc(100svh - 120px);
    min-height: 540px;
    margin-bottom: 0;
  }
  .hero-media {
    background:
      linear-gradient(180deg, rgba(255,255,255,.22) 0%, rgba(255,255,255,.62) 42%, rgba(255,255,255,.22) 100%),
      url("assets/collagen-hero.png") center / cover no-repeat;
  }
  .hero::before { top: 34%; height: 34%; }
  .hero-content { padding: 136px 22px 0; }
  .hero-title { font-size: 38px; line-height: 1.22; }
  .hero-sub { font-size: 16px; }
  .hero-meta { margin-top: 22px; }
  .panel:not(.home-panel) { padding: 38px 16px 48px; }
  .tool-grid, .card-grid { grid-template-columns: 1fr; }
  .search { width: 100%; }
  .search input { width: 100%; }
  .panel-head { align-items: stretch; }
  .row-item { flex-wrap: wrap; }
  .table-wrap { overflow-x: auto; }
  .data-table { min-width: 720px; }
}
