: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;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.33, 1, 0.68, 1);
  --duration-fast: 220ms;
  --duration: 420ms;
  --duration-slow: 560ms;
}

* { 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;
  text-align: center;
}

.login-logo {
  width: 116px;
  height: 116px;
  margin: 0 auto 34px;
  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);
}

/* ---------- 顶部导航 ---------- */
.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);
}

body.is-workspace-mode .header {
  display: none;
}

.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 var(--duration-fast) var(--ease-soft),
    background var(--duration-fast) var(--ease-soft),
    transform var(--duration-fast) var(--ease-out);
}

.tab::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 3px;
  height: 2px;
  opacity: 0;
  background: transparent;
  transform: scaleX(.65);
  transition:
    opacity var(--duration-fast) var(--ease-soft),
    background var(--duration-fast) ease,
    transform var(--duration) var(--ease-out);
}

.tab:hover {
  color: var(--primary-dark);
  background: rgba(241, 239, 255, .62);
  transform: translateY(-1px);
}

.tab.active {
  color: var(--primary-dark);
  background: transparent;
  box-shadow: none;
}

.tab.active::after {
  opacity: 1;
  background: var(--primary);
  transform: scaleX(1);
}

.tab:active {
  transform: translateY(0);
}

/* ---------- 主区域 ---------- */
.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;
  opacity: 0;
  transform: translateY(18px);
}

.panel.active,
.panel.is-exiting {
  display: block;
}

.panel.active {
  animation: panelEnter var(--duration-slow) var(--ease-out) both;
}

.panel.is-exiting {
  pointer-events: none;
  animation: panelExit var(--duration-fast) var(--ease-soft) both;
}

/* 只允许当前激活的面板留在文档流里，避免切换后旧面板内容“漏”到首页下方 */
.panel:not(.active):not(.is-exiting) {
  display: none !important;
}

/* 文献工作区仅能在文献 Tab 激活时出现 */
.main:not(:has(#library.active)) #library {
  display: none !important;
}

.main:not(:has(#library.active)) #literatureNativeContainer,
.main:not(:has(#library.active)) #literatureLibraryContainer {
  display: none !important;
}

.panel.active .panel-head,
.panel.active .module-grid,
.panel.active .tool-grid,
.panel.active .card-grid,
.panel.active .row-list,
.panel.active .table-wrap,
.panel.active .filters,
.panel.active .module-note,
.panel.active .hero {
  animation: contentRise var(--duration-slow) var(--ease-out) both;
}

.panel.active .panel-head { animation-delay: 40ms; }
.panel.active .filters { animation-delay: 90ms; }
.panel.active .module-grid,
.panel.active .tool-grid,
.panel.active .card-grid,
.panel.active .row-list,
.panel.active .table-wrap,
.panel.active .module-note { animation-delay: 120ms; }
.panel.active .hero { animation-delay: 0ms; }

@keyframes panelEnter {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes panelExit {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

@keyframes contentRise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.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; }

/* ---------- 模块入口 ---------- */
.module-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.module-card {
  position: relative;
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  gap: 18px;
  min-height: 210px;
  padding: 28px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.96), rgba(248,247,252,.92));
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition:
    border-color var(--duration-fast) var(--ease-soft),
    box-shadow var(--duration) var(--ease-out),
    transform var(--duration) var(--ease-out);
}

.module-card::before {
  content: "进入 →";
  position: absolute;
  right: 24px;
  top: 24px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: rgba(241, 239, 255, .0);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .2px;
  opacity: 0;
  transform: translateX(-6px);
  transition:
    opacity var(--duration-fast) var(--ease-soft),
    transform var(--duration-fast) var(--ease-out),
    background var(--duration-fast) ease,
    border-color var(--duration-fast) ease;
}

.module-card::after {
  content: "";
  position: absolute;
  right: -56px;
  bottom: -74px;
  width: 180px;
  height: 180px;
  border: 1px solid rgba(109, 91, 215, .16);
  border-radius: 50%;
  transition: transform var(--duration) var(--ease-out), opacity var(--duration) ease;
}

.module-card:hover {
  transform: translateY(-4px) scale(1.01);
  border-color: #c9bff5;
  box-shadow: 0 22px 50px rgba(54, 36, 111, 0.16);
}

.module-card:hover::before {
  opacity: 1;
  transform: translateX(0);
  background: var(--primary-soft);
  border-color: var(--violet-line);
}

.module-card:hover::after {
  transform: scale(1.08);
  opacity: .85;
}

.module-card:active {
  transform: translateY(-1px) scale(.995);
}

.module-card.is-launching {
  animation: cardLaunch var(--duration-fast) var(--ease-out) both;
  pointer-events: none;
}

@keyframes cardLaunch {
  0% {
    transform: translateY(-4px) scale(1.01);
  }
  55% {
    transform: translateY(-8px) scale(1.025);
  }
  100% {
    transform: translateY(-2px) scale(1.01);
    opacity: .88;
  }
}

.module-card-primary {
  grid-column: auto;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  min-height: 168px;
  height: 168px;
  padding: 22px 28px;
  background:
    linear-gradient(90deg, rgba(42, 24, 104, .97) 0%, rgba(64, 41, 143, .92) 44%, rgba(91, 91, 201, .62) 78%, rgba(29, 42, 116, .34) 100%),
    url("assets/literature-reading-hero.png") 42% center / cover no-repeat;
  color: #fff;
  border-color: rgba(255,255,255,.22);
}

.module-card-primary::before {
  color: #fff;
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.18);
}

.module-card-primary:hover::before {
  background: rgba(255,255,255,.16);
  border-color: rgba(255,255,255,.34);
}

.module-card-primary::after {
  right: auto;
  left: 28px;
  bottom: -78px;
  width: 210px;
  height: 210px;
  border-color: rgba(255,255,255,.18);
  background: radial-gradient(circle, rgba(255,255,255,.11), rgba(255,255,255,0) 62%);
}

.module-card-primary .module-body {
  align-self: center;
}

.module-card-primary .module-kicker {
  margin-bottom: 6px;
  color: rgba(255,255,255,.78);
  font-size: 11px;
  letter-spacing: 2.2px;
}

.module-card-primary .module-body h2 {
  font-size: 26px;
  line-height: 1.2;
  color: #fff;
  text-shadow: 0 8px 28px rgba(20, 18, 76, .22);
}

.module-card-primary .module-body p {
  max-width: 360px;
  margin-top: 8px;
  color: rgba(255,255,255,.88);
  font-size: 13px;
  line-height: 1.55;
}

.module-card-primary .module-status {
  right: 20px;
  bottom: 18px;
  height: 30px;
  padding: 0 14px;
  background: rgba(255,255,255,.16);
  border-color: rgba(255,255,255,.34);
  color: rgba(255,255,255,.92);
  font-size: 12px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18);
}

.module-card-wechat {
  background:
    radial-gradient(circle at 86% 18%, rgba(255,255,255,.26), transparent 24%),
    linear-gradient(118deg, rgba(18, 91, 92, .98) 0%, rgba(20, 139, 128, .94) 48%, rgba(74, 181, 156, .72) 100%);
  border-color: rgba(255,255,255,.28);
}

.module-card-wechat::after {
  left: auto;
  right: -48px;
  bottom: -92px;
  width: 230px;
  height: 230px;
  border-color: rgba(219, 255, 244, .22);
  background: radial-gradient(circle, rgba(203,255,238,.18), rgba(255,255,255,0) 64%);
}

.wechat-card-art {
  position: absolute;
  top: 34px;
  right: 34px;
  width: 112px;
  height: 78px;
  z-index: 1;
  opacity: .72;
  transform: rotate(-4deg);
  transition: transform var(--duration) var(--ease-out), opacity var(--duration-fast) ease;
}

.module-card-wechat:hover .wechat-card-art {
  opacity: .92;
  transform: translateY(-3px) rotate(-2deg) scale(1.04);
}

.wechat-bubble {
  position: absolute;
  display: block;
  border: 1px solid rgba(255,255,255,.58);
  background: rgba(255,255,255,.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2);
}

.wechat-bubble::after {
  content: "";
  position: absolute;
  bottom: -8px;
  width: 14px;
  height: 14px;
  background: inherit;
  border-right: 1px solid rgba(255,255,255,.5);
  border-bottom: 1px solid rgba(255,255,255,.5);
  transform: rotate(45deg);
}

.wechat-bubble i {
  position: absolute;
  top: 50%;
  width: 7px;
  height: 7px;
  margin-top: -4px;
  border-radius: 50%;
  background: rgba(255,255,255,.86);
}

.wechat-bubble i:first-child { left: 28%; }
.wechat-bubble i:last-child { right: 28%; }

.wechat-bubble-main {
  left: 0;
  top: 0;
  width: 76px;
  height: 54px;
  border-radius: 50%;
}

.wechat-bubble-main::after { left: 14px; }

.wechat-bubble-small {
  right: 0;
  bottom: 0;
  width: 60px;
  height: 44px;
  border-radius: 50%;
  background: rgba(225,255,246,.2);
}

.wechat-bubble-small::after { right: 10px; }

.module-icon {
  width: 66px;
  height: 66px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.30);
  color: #fff;
  font-size: 26px;
  font-weight: 850;
}

.module-icon-soft {
  background: var(--primary-soft);
  border-color: var(--violet-line);
  color: var(--primary-dark);
}

.module-body {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.module-kicker {
  display: block;
  margin-bottom: 12px;
  color: rgba(255,255,255,.74);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}

.module-card:not(.module-card-primary) .module-kicker {
  color: var(--lavender);
}

.module-body h2 {
  font-size: 26px;
  line-height: 1.25;
  letter-spacing: 0;
}

.module-body p {
  max-width: 420px;
  margin-top: 12px;
  color: rgba(255,255,255,.80);
  font-size: 14px;
  line-height: 1.75;
}

.module-card:not(.module-card-primary) .module-body p {
  color: var(--ink-soft);
}

.module-status {
  position: absolute;
  right: 24px;
  bottom: 22px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.16);
  color: rgba(255,255,255,.82);
  border: 1px solid rgba(255,255,255,.24);
  font-size: 12px;
  font-weight: 750;
}

.module-card:not(.module-card-primary) .module-status {
  background: var(--primary-soft);
  color: var(--primary-dark);
  border-color: var(--violet-line);
}

.module-note {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
  padding: 16px 18px;
  border: 1px dashed #d5cef2;
  border-radius: var(--radius);
  background: rgba(255,255,255,.64);
}

.module-note span {
  flex-shrink: 0;
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 800;
}

.module-note p {
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.6;
}

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

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

.tool-card::after {
  content: "→";
  position: absolute;
  right: 18px;
  top: 50%;
  color: var(--primary-dark);
  font-size: 16px;
  font-weight: 700;
  opacity: 0;
  transform: translate(6px, -50%);
  transition:
    opacity var(--duration-fast) var(--ease-soft),
    transform var(--duration-fast) var(--ease-out);
}

.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(54, 36, 111, 0.14);
  border-color: #c9bff5;
}

.tool-card:hover::after {
  opacity: 1;
  transform: translate(0, -50%);
}

.tool-card:active {
  transform: translateY(-1px);
}

.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: 12px;
  padding: 17px 20px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition:
    border-color var(--duration-fast) var(--ease-soft),
    box-shadow var(--duration) var(--ease-out),
    transform var(--duration) var(--ease-out),
    background var(--duration-fast) ease;
}

.row-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 36px rgba(54, 36, 111, 0.12);
  border-color: #c9bff5;
  background: #fcfbff;
}

.row-item:hover .row-action {
  transform: translateX(4px);
  color: var(--primary);
}

.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;
  transition: transform var(--duration-fast) var(--ease-out), color var(--duration-fast) ease;
}

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

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

.info-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(54, 36, 111, 0.14);
  border-color: #c9bff5;
}

.info-card:active {
  transform: translateY(-1px);
}
.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: 88px;
    height: 88px;
    margin: 0 auto 22px;
  }
  .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, .module-grid { grid-template-columns: 1fr; }
  .module-card {
    grid-template-columns: 58px minmax(0, 1fr);
    min-height: 190px;
    padding: 22px;
  }
  .module-card-primary {
    grid-template-columns: 1fr;
    min-height: 156px;
    height: 156px;
    padding: 20px 22px;
    background:
      linear-gradient(180deg, rgba(42, 24, 104, .96) 0%, rgba(64, 41, 143, .88) 52%, rgba(29, 42, 116, .42) 100%),
      url("assets/literature-reading-hero.png") center / cover no-repeat;
  }
  .module-card-wechat {
    background:
      radial-gradient(circle at 86% 18%, rgba(255,255,255,.24), transparent 26%),
      linear-gradient(150deg, rgba(18, 91, 92, .98) 0%, rgba(20, 139, 128, .94) 58%, rgba(74, 181, 156, .7) 100%);
  }
  .wechat-card-art {
    right: 24px;
    top: 34px;
    transform: scale(.88) rotate(-4deg);
  }
  .module-card-library {
    background:
      linear-gradient(180deg, rgba(42, 24, 104, .96) 0%, rgba(64, 41, 143, .88) 52%, rgba(29, 42, 116, .42) 100%),
      url("assets/literature-library-hero.png") 68% center / cover no-repeat;
  }
  .module-icon {
    width: 58px;
    height: 58px;
    font-size: 23px;
  }
  .module-card-primary .module-icon {
    width: 72px;
    height: 72px;
    border-radius: 12px;
    font-size: 30px;
  }
  .module-body h2 {
    font-size: 22px;
  }
  .module-card-primary .module-kicker {
    font-size: 12px;
    letter-spacing: 1.8px;
  }
  .module-card-primary .module-body h2 {
    font-size: 28px;
  }
  .module-card-primary .module-body p {
    max-width: none;
    margin-top: 12px;
    font-size: 14px;
  }
  .module-status {
    right: 18px;
    bottom: 18px;
  }
  .module-card-primary .module-status {
    right: 18px;
    bottom: 18px;
    height: 34px;
    padding: 0 16px;
    font-size: 13px;
  }
  .module-note {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
  .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; }
}


/* ---------- 文献翻译模块原生容器 ---------- */
.literature-native-container {
  margin-top: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.literature-native-container[hidden],
.literature-library-container[hidden] {
  display: none !important;
}

#library:not(.active) .literature-native-container,
#library:not(.active) .literature-library-container,
#library:not(.library-native-active) .literature-native-container,
#library:not(.library-native-active) .literature-library-container {
  display: none !important;
}

.literature-native-container,
.literature-library-container {
  margin-top: 16px;
  opacity: 0;
  transform: translateY(18px) scale(.985);
}

.literature-native-container.is-entering,
.literature-library-container.is-entering {
  display: block;
  animation: workspaceEnter var(--duration-slow) var(--ease-out) both;
}

.literature-native-container.is-visible,
.literature-library-container.is-visible {
  display: block;
  opacity: 1;
  transform: none;
}

.literature-native-container.is-exiting,
.literature-library-container.is-exiting {
  display: block;
  pointer-events: none;
  animation: workspaceExit var(--duration-fast) var(--ease-soft) both;
}

@keyframes workspaceEnter {
  from {
    opacity: 0;
    transform: translateY(24px) scale(.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes workspaceExit {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(12px) scale(.99);
  }
}

.module-grid.is-leaving,
.module-note.is-leaving {
  animation: gatewayLeave var(--duration-fast) var(--ease-soft) both;
  pointer-events: none;
}

.module-grid.is-returning,
.module-note.is-returning {
  animation: gatewayReturn var(--duration) var(--ease-out) both;
}

@keyframes gatewayLeave {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-12px) scale(.98);
  }
}

@keyframes gatewayReturn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.library-tool-actions {
  display: none;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  opacity: 0;
  transform: translateY(-6px);
}

.library-native-active .library-tool-actions {
  display: flex;
  animation: contentRise var(--duration) var(--ease-out) 80ms both;
}

#library.library-native-active {
  max-width: none;
  min-height: 100svh;
  padding: 78px clamp(14px, 2.4vw, 34px) 34px;
  transition: padding var(--duration) var(--ease-out);
}

#library.library-native-active .panel-head {
  position: fixed;
  top: 12px;
  left: clamp(14px, 2.4vw, 34px);
  right: clamp(14px, 2.4vw, 34px);
  z-index: 60;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(220, 214, 251, .84);
  border-radius: 12px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(16px);
  box-shadow: 0 12px 32px rgba(44, 29, 91, .10);
}

#library.library-native-active .panel-head > div:first-child {
  display: none;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  transition:
    background var(--duration-fast) ease,
    border-color var(--duration-fast) ease,
    color var(--duration-fast) ease,
    transform var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) ease;
}

.btn-back:hover {
  background: var(--primary-soft, #f0eeff);
  border-color: var(--primary, #7c5cff);
  color: var(--primary-dark, #5a3fd4);
  transform: translateX(-2px);
  box-shadow: 0 8px 20px rgba(109, 91, 215, .12);
}

.library-back-btn {
  flex: none;
  min-height: 38px;
  padding: 0 14px;
  border-color: var(--violet-line);
  color: var(--primary-dark);
  background: #fff;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.library-workspace-meta {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
  padding-left: 2px;
}

.library-workspace-meta span {
  color: var(--primary);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.library-workspace-meta strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 16px;
  font-weight: 850;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}


.library-native-active .module-grid,
.library-native-active .module-note {
  display: none;
}

#library.library-native-active .literature-native-container,
#library.library-native-active .literature-library-container {
  margin-top: 0;
}

#library.library-native-active .literature-library-container {
  border: none;
  box-shadow: none;
  background: transparent;
  overflow: hidden;
}

#library.library-native-active .literature-native-container {
  border-radius: 12px;
}

#library.library-native-active .lit-content {
  padding: clamp(14px, 2vw, 22px);
}

/* ---------- 文献库 Demo ---------- */
.library-demo {
  display: grid;
  gap: 16px;
}

.library-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255,255,255,.96), rgba(247,246,255,.92)),
    radial-gradient(circle at 92% 18%, rgba(141, 123, 232, .18), transparent 230px);
  box-shadow: var(--shadow-sm);
}

.library-eyebrow {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--lavender);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 2px;
}

.library-hero h2 {
  color: var(--ink);
  font-size: 30px;
  font-weight: 900;
}

.library-hero p {
  max-width: 680px;
  margin-top: 10px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.75;
}

.library-stats {
  flex: none;
  display: grid;
  grid-template-columns: repeat(3, 86px);
  gap: 10px;
}

.library-stats div {
  min-height: 74px;
  display: grid;
  place-items: center;
  padding: 10px;
  border: 1px solid var(--violet-line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.82);
}

.library-stats strong {
  color: var(--primary-dark);
  font-size: 22px;
  font-weight: 900;
}

.library-stats span {
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: 700;
}

.library-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.library-search {
  flex: 1;
  min-width: 280px;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfbff;
  color: var(--ink-muted);
}

.library-search input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: var(--ink);
  font: inherit;
}

.library-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.library-filter,
.library-ghost-btn,
.library-question-box button {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease, background .15s ease, transform .15s ease;
}

.library-filter {
  height: 34px;
  padding: 0 12px;
}

.library-filter.active,
.library-filter:hover,
.library-ghost-btn:hover {
  color: var(--primary-dark);
  border-color: var(--violet-line);
  background: var(--primary-soft);
}

.library-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, .65fr);
  gap: 16px;
  align-items: start;
}

.library-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.library-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.library-panel-head h3 {
  color: var(--ink);
  font-size: 16px;
  font-weight: 850;
}

.library-panel-head p {
  margin-top: 4px;
  color: var(--ink-muted);
  font-size: 12px;
}

.library-ghost-btn {
  flex: none;
  height: 36px;
  padding: 0 14px;
}

.library-list {
  display: grid;
  gap: 0;
}

.library-paper {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  transition: background .15s ease;
}

.library-paper:last-child {
  border-bottom: none;
}

.library-paper:hover {
  background: #fbfaff;
}

.library-paper[hidden] {
  display: none;
}

.paper-type {
  display: inline-flex;
  margin-bottom: 8px;
  padding: 3px 9px;
  border-radius: 999px;
  color: var(--primary-dark);
  background: var(--primary-soft);
  font-size: 11px;
  font-weight: 850;
}

.library-paper h4 {
  color: var(--ink);
  font-size: 15px;
  font-weight: 850;
  line-height: 1.45;
}

.library-paper p {
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.65;
}

.library-paper div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.library-paper div span {
  color: var(--ink-muted);
  background: #f7f6fb;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 700;
}

.library-chat-panel {
  position: sticky;
  top: 96px;
}

.library-demo-badge {
  flex: none;
  color: var(--primary-dark);
  background: var(--primary-soft);
  border: 1px solid var(--violet-line);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 850;
}

.library-answer {
  padding: 18px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.7;
}

.library-answer strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 850;
}

.library-answer ul {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding-left: 18px;
}

.library-question-box {
  display: grid;
  gap: 10px;
  padding: 18px;
  border-top: 1px solid var(--line);
  background: #fbfbff;
}

.library-question-box textarea {
  width: 100%;
  resize: vertical;
  min-height: 104px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  outline: none;
  color: var(--ink);
  font: inherit;
  line-height: 1.6;
}

.library-question-box textarea:focus {
  border-color: var(--violet-line);
  box-shadow: 0 0 0 3px rgba(109, 91, 215, .10);
}

.library-question-box button {
  height: 40px;
  color: #fff;
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.library-question-box button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.hidden {
  display: none !important;
}

.lit-workbench {
  --lit-gray-0: #ffffff;
  --lit-gray-50: #fafbfc;
  --lit-gray-100: #f4f5f7;
  --lit-gray-150: #eceef1;
  --lit-gray-200: #e3e6ea;
  --lit-gray-300: #d3d7dd;
  --lit-gray-400: #a8aeb8;
  --lit-gray-500: #727885;
  --lit-gray-600: #4a505c;
  --lit-gray-700: #2f343d;
  --lit-gray-800: #1c2028;
  --lit-gray-900: #11141a;
  --lit-brand: #3370ff;
  --lit-brand-600: #245bdb;
  --lit-brand-50: #eef3ff;
  --lit-brand-100: #dde7ff;
  --lit-green: #2bb673;
  --lit-green-50: #e7f7ef;
  --lit-radius: 8px;
  --lit-shadow: 0 1px 2px rgba(17,20,26,.04), 0 1px 3px rgba(17,20,26,.06);
  color: var(--lit-gray-800);
  background: var(--lit-gray-100);
}

.lit-kbd-hint {
  flex: none;
  font-size: 12px;
  color: var(--lit-gray-500);
  background: var(--lit-gray-100);
  border: 1px solid var(--lit-gray-200);
  padding: 5px 11px;
  border-radius: 999px;
}

.lit-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  padding: 16px 24px 30px;
  align-items: stretch;
}

.lit-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--lit-gray-0);
  border: 1px solid var(--lit-gray-200);
  border-radius: var(--lit-radius);
  box-shadow: var(--lit-shadow);
  overflow: hidden;
}

.lit-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--lit-gray-150);
}

.lit-card-head h3 {
  color: var(--lit-gray-900);
  font-size: 16px;
  font-weight: 800;
}

.lit-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  color: var(--lit-brand);
  background: var(--lit-brand-50);
  padding: 3px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
}

.lit-chip.muted {
  color: var(--lit-gray-500);
  background: var(--lit-gray-100);
}

.lit-workbench .dropzone {
  flex: 1;
  display: grid;
  align-content: center;
  margin: 16px;
  padding: 34px 20px;
  border: 1.5px dashed var(--lit-brand);
  border-radius: var(--lit-radius);
  text-align: center;
  cursor: pointer;
  background: var(--lit-brand-50);
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.lit-workbench .dropzone:hover,
.lit-workbench .dropzone.drag {
  background: #e7eeff;
  transform: translateY(-1px);
}

.lit-workbench .dz-art {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: var(--lit-brand);
  background: var(--lit-brand-100);
}

.lit-workbench .dz-title {
  color: var(--lit-gray-800);
  font-size: 16px;
  font-weight: 650;
}

.lit-workbench .dz-hint {
  margin-top: 6px;
  color: var(--lit-gray-400);
  font-size: 13px;
}

.lit-link {
  border: none;
  background: none;
  color: var(--lit-brand);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.lit-link:hover {
  text-decoration: underline;
}

.lit-workbench .file-meta {
  margin: 0 18px 18px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--lit-brand-50);
  border: 1px solid var(--lit-brand-100);
  border-radius: var(--lit-radius);
  color: var(--lit-gray-600);
  font-size: 13px;
}

.lit-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  border: none;
  border-radius: var(--lit-radius);
  padding: 8px 16px;
  background: var(--lit-brand);
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease, box-shadow .15s ease;
}

.lit-btn-primary:hover:not(:disabled) {
  background: var(--lit-brand-600);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(51,112,255,.28);
}

.lit-btn-primary:disabled {
  background: var(--lit-gray-300);
  cursor: not-allowed;
  box-shadow: none;
}

.lit-workbench .pipeline {
  list-style: none;
}

.lit-workbench .pipeline li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--lit-gray-100);
  transition: background .15s ease;
}

.lit-workbench .pipeline li:last-child {
  border-bottom: none;
}

.lit-workbench .pl-idx {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--lit-gray-100);
  color: var(--lit-gray-500);
  font-size: 14px;
  font-weight: 800;
}

.lit-workbench .pl-body {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.lit-workbench .pl-name {
  color: var(--lit-gray-900);
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
}

.lit-workbench .pl-desc {
  color: var(--lit-gray-400);
  font-size: 13px;
  text-align: right;
}

.lit-workbench .state {
  flex: none;
  color: var(--lit-gray-400);
  background: var(--lit-gray-100);
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.lit-workbench .pipeline li.active {
  background: var(--lit-brand-50);
}

.lit-workbench .pipeline li.active .pl-idx {
  color: #fff;
  background: var(--lit-brand);
}

.lit-workbench .pipeline li.active .state {
  color: var(--lit-brand);
  background: var(--lit-brand-100);
}

.lit-workbench .pipeline li.done .pl-idx,
.lit-workbench .pipeline li.done .state {
  color: var(--lit-green);
  background: var(--lit-green-50);
}

.lit-workbench .empty {
  min-height: 236px;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 34px 20px;
  text-align: center;
  color: var(--lit-gray-400);
}

.lit-workbench .empty-art {
  width: 58px;
  height: 58px;
  margin-bottom: 12px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--lit-brand-50);
  color: var(--lit-brand);
  font-size: 28px;
  font-weight: 900;
}

.lit-workbench .empty p {
  color: var(--lit-gray-700);
  font-size: 16px;
  font-weight: 800;
}

.lit-workbench .empty span {
  display: block;
  margin-top: 6px;
  color: var(--lit-gray-400);
  font-size: 13px;
}

.lit-workbench .result {
  padding: 16px;
}

.lit-workbench .fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.lit-workbench .field {
  background: var(--lit-gray-50);
  border: 1px solid var(--lit-gray-150);
  border-radius: var(--lit-radius);
  padding: 12px 14px;
}

.lit-workbench .field.full {
  grid-column: 1 / -1;
}

.lit-workbench .field .k {
  margin-bottom: 5px;
  color: var(--lit-gray-400);
  font-size: 11px;
  font-weight: 800;
}

.lit-workbench .field .v {
  color: var(--lit-gray-800);
  font-size: 13.5px;
}

.lit-workbench .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.lit-workbench .tag {
  color: var(--lit-brand);
  background: var(--lit-brand-50);
  border: 1px solid var(--lit-brand-100);
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.lit-workbench .raw {
  margin-top: 14px;
}

.lit-workbench .raw summary {
  cursor: pointer;
  color: var(--lit-gray-500);
  font-size: 13px;
  font-weight: 650;
  list-style: none;
}

.lit-workbench .raw pre,
.lit-workbench .log,
.lit-workbench .ai-output {
  margin-top: 10px;
  max-height: 220px;
  overflow: auto;
  white-space: pre-wrap;
  background: var(--lit-gray-900);
  color: #c8d0db;
  border-radius: var(--lit-radius);
  padding: 14px;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 12px;
  line-height: 1.7;
}

.lit-workbench .ai-output {
  max-height: 360px;
  background: #ffffff;
  color: var(--lit-gray-800);
  border: 1px solid var(--lit-gray-150);
  font-family: inherit;
  font-size: 13px;
}

.lit-workbench .download-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
}

.lit-workbench .download-box h3 {
  color: var(--lit-gray-900);
  font-size: 16px;
  font-weight: 800;
}

.lit-workbench .download-box p {
  max-width: 520px;
  margin-top: 8px;
  color: var(--lit-gray-500);
  font-size: 14px;
  line-height: 1.7;
}

.lit-workbench .download-actions {
  flex: none;
  display: flex;
  gap: 10px;
  align-items: center;
}

.lit-workbench .download-btn {
  height: 38px;
  border: 1px solid var(--lit-gray-200);
  border-radius: var(--lit-radius);
  padding: 0 14px;
  background: var(--lit-gray-0);
  color: var(--lit-gray-700);
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}

.lit-workbench .download-btn.primary {
  color: #fff;
  background: var(--lit-brand);
  border-color: var(--lit-brand);
}

.lit-workbench .download-btn:disabled {
  color: var(--lit-gray-300);
  background: var(--lit-gray-100);
  cursor: not-allowed;
}

.lit-workbench .advanced-panel {
  grid-column: 1 / -1;
}

.lit-workbench .advanced-settings {
  background: var(--lit-gray-0);
  border: 1px solid var(--lit-gray-200);
  border-radius: var(--lit-radius);
  box-shadow: var(--lit-shadow);
  overflow: hidden;
}

.lit-workbench .advanced-settings summary {
  min-height: 58px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  list-style: none;
}

.lit-workbench .advanced-settings summary::-webkit-details-marker {
  display: none;
}

.lit-workbench .advanced-settings summary::after {
  content: "展开";
  color: var(--lit-brand);
  background: var(--lit-brand-50);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.lit-workbench .advanced-settings[open] summary::after {
  content: "收起";
}

.lit-workbench .advanced-settings summary > span {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.lit-workbench .advanced-settings b {
  color: var(--lit-gray-900);
  font-size: 16px;
}

.lit-workbench .advanced-settings small {
  color: var(--lit-gray-400);
  font-size: 13px;
}

.lit-workbench .advanced-body {
  display: grid;
  grid-template-columns: minmax(260px, .9fr) minmax(320px, 1.1fr);
  gap: 16px;
  padding: 18px;
  border-top: 1px solid var(--lit-gray-150);
  background: var(--lit-gray-50);
}

.lit-workbench .skill-card,
.lit-workbench .advanced-form,
.lit-workbench .log-section {
  min-width: 0;
  border: 1px solid var(--lit-gray-200);
  border-radius: var(--lit-radius);
  background: var(--lit-gray-0);
  padding: 16px;
}

.lit-workbench .skill-card {
  grid-row: span 2;
}

.lit-workbench .skill-title,
.lit-workbench .log-head h3 {
  color: var(--lit-gray-900);
  font-size: 15px;
  font-weight: 800;
}

.lit-workbench .skill-card p,
.lit-workbench .note {
  margin-top: 8px;
  color: var(--lit-gray-500);
  font-size: 13px;
  line-height: 1.7;
}

.lit-workbench .skill-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.lit-workbench .skill-list div {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--lit-brand-100);
  border-radius: var(--lit-radius);
  background: var(--lit-gray-50);
}

.lit-workbench .skill-list dt {
  color: var(--lit-gray-500);
  font-size: 12px;
  font-weight: 800;
}

.lit-workbench .skill-list dd {
  min-width: 0;
  color: var(--lit-gray-800);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.lit-workbench .config-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.lit-workbench .config-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--lit-gray-500);
  font-size: 12px;
  font-weight: 700;
}

.lit-workbench .config-grid input {
  min-width: 0;
  border: 1px solid var(--lit-gray-200);
  border-radius: var(--lit-radius);
  padding: 8px 11px;
  font: inherit;
  color: var(--lit-gray-800);
}

.lit-workbench .log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

@media (max-width: 1080px) {
  .lit-content {
    grid-template-columns: 1fr;
  }

  .lit-workbench .advanced-body {
    grid-template-columns: 1fr;
  }

  .lit-workbench .skill-card {
    grid-row: auto;
  }

  .library-hero,
  .library-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .library-stats,
  .library-layout {
    grid-template-columns: 1fr;
  }

  .library-chat-panel {
    position: static;
  }
}

@media (max-width: 760px) {
  .library-tool-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    min-width: 0;
  }

  #library .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  #library.library-native-active .panel-head {
    top: 10px;
    left: 10px;
    right: 10px;
    align-items: center;
    flex-direction: row;
    flex-wrap: nowrap;
  }

  #library.library-native-active .library-tool-actions {
    width: auto;
    flex-wrap: nowrap;
  }

  #library.library-native-active {
    padding: 74px 10px 26px;
  }

  .lit-content {
    padding: 14px;
  }

  .lit-workbench .pl-body,
  .lit-workbench .download-box,
  .lit-workbench .advanced-settings summary > span {
    align-items: flex-start;
    flex-direction: column;
  }

  .lit-workbench .download-actions,
  .lit-workbench .download-btn {
    width: 100%;
  }

  .lit-workbench .download-actions,
  .lit-workbench .config-grid {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

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

  .library-search {
    min-width: 0;
  }

  .library-panel-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .panel,
  .panel.active,
  .panel.is-exiting,
  .literature-native-container,
  .literature-library-container,
  .module-grid,
  .module-note {
    opacity: 1;
    transform: none;
  }
}
