:root {
  --bg: #0b1220;
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.7);
  --line: rgba(255, 255, 255, 0.12);
  --panel: rgba(255, 255, 255, 0.06);
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
  --primary: #6ee7ff;
  --primary2: #a78bfa;
  --ok: #7cf29a;
  --warn: #ffd166;
  --danger: #ff6b6b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  background: #102a5e;
  min-height: 100vh;
}

/* 顶部导航 */
.topnav {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(15, 45, 120, 0.55);
  backdrop-filter: blur(10px);
}

.topnav__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand__logo {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary2));
  color: #07101c;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  box-shadow: 0 0 0 6px rgba(110, 231, 255, 0.12);
}

.brand__name {
  font-weight: 900;
  letter-spacing: 0.2px;
}

.menu {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.menu__item {
  border: 1px solid transparent;
  background: transparent;
  color: rgba(255, 255, 255, 0.86);
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 16px !important;
  font-weight: 500;
}

.menu__item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.menu__item.is-active {
  background: rgba(110, 231, 255, 0.14);
  border-color: rgba(110, 231, 255, 0.18);
}

.linkbtn {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.88);
  padding: 10px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 16px !important;
}

.linkbtn:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Hero 区域 */
.hero {
  min-height: calc(100vh - 60px);
  display: flex;
  align-items: center;
  background: #102a5e;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.hero__inner {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 16px 40px 40px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.hero__left {
  text-align: left;
  max-width: 600px;
  margin-left: 60px;
}

.hero__title {
  margin: 0 0 10px 0;
  font-size: 64px;
  font-weight: 900;
  line-height: 1.1;
}

/* 原左侧标语隐藏 */
.hero__left .hero__tagline {
  display: none;
}

/* 右侧人物形象框 - 标语置于底部 */
.hero__right {
  flex-shrink: 0;
  max-width: 40%;
  background-color: #17295d;
  border-radius: 28px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-bottom: 16px;
}

.hero-image {
  max-width: 100%;
  height: auto;
  display: block;
  border: none;
  outline: none;
  background-color: #17295D;
  box-shadow: none;
  /* filter: drop-shadow(0 0 2px #17295D); */  /* 已移除 */
  transition: transform 0.2s ease;
  
}

.hero-image:hover {
  transform: scale(1.01);
}

.hero__tagline--moved {
    margin-top: -70px;      /* 向上移动70px，进入图片内部 */
    margin-bottom: 8px;
    font-size: 22px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.95);
    letter-spacing: 0.1em;
    text-align: center;
    /* 添加半透明背景，提升文字可读性 */
    background: rgba(0, 0, 0, 0.55);
    padding: 6px 16px;
    border-radius: 40px;
    display: inline-block;
    backdrop-filter: blur(4px); /* 可选：毛玻璃效果 */
}

/* 响应式 */
@media (max-width: 768px) {
  .hero__inner {
    flex-direction: column;
    text-align: center;
  }
  .hero__left {
    text-align: center;
  }
  .hero__title {
    font-size: 42px;
  }
  .hero__right {
    max-width: 70%;
    margin-top: 24px;
    padding-bottom: 12px;
  }
  .hero__tagline--moved {
    font-size: 18px;
    margin: 8px 0 4px;
  }
  .menu__item {
    font-size: 14px !important;
    padding: 8px 10px;
  }
  .linkbtn {
    font-size: 14px !important;
  }
  .brand__name {
    font-size: 18px !important;
  }
}

/* 通用按钮 */
.btn {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.92);
  padding: 11px 14px;
  border-radius: 14px;
  cursor: pointer;
  font-size: 13px;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn--primary {
  border-color: rgba(110, 231, 255, 0.22);
  background: rgba(110, 231, 255, 0.14);
}

.btn--ghost {
  background: transparent;
}

.btn--small {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 6px;
}

/* Workbench 面板区域 */
.workbench__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 26px 16px 40px;
}

.panel {
  display: none;
  border: 1px solid rgba(110, 231, 255, 0.16);
  background: linear-gradient(180deg, rgba(110, 231, 255, 0.06), rgba(167, 139, 250, 0.035));
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel.is-show {
  display: block;
}

.panel__head {
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(110, 231, 255, 0.04);
}

.panel__head h2 {
  margin: 0 0 6px 0;
  font-size: 16px;
}

.panel__head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.cards {
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 980px) {
  .cards {
    grid-template-columns: 1fr;
  }
}

.card {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.18);
  border-radius: 16px;
  padding: 14px;
}

.card__title {
  font-weight: 900;
  margin-bottom: 6px;
}

.card__desc {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  margin-bottom: 10px;
}

.story {
  margin: 0 14px 14px;
}

.story__head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
}

.story__title {
  font-weight: 900;
}

.story__meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.story__body {
  margin: 12px 0 0 0;
  padding: 12px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  white-space: pre-wrap;
  line-height: 1.7;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.88);
}

.grid {
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 980px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

.form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.label {
  font-size: 12px;
  color: var(--muted);
}

.input,
.textarea,
select {
  width: 100%;
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid rgba(110, 231, 255, 0.24);
  background: linear-gradient(180deg, rgba(110, 231, 255, 0.08), rgba(0, 0, 0, 0.22));
  color: rgba(255, 255, 255, 0.92);
  outline: none;
}

.input::placeholder,
.textarea::placeholder {
  color: rgba(255, 255, 255, 0.55);
}

.textarea {
  min-height: 120px;
  resize: vertical;
}

.input:focus,
.textarea:focus,
select:focus {
  border-color: rgba(110, 231, 255, 0.78);
  box-shadow: 0 0 0 4px rgba(110, 231, 255, 0.18);
}

select option {
  background: #0b1220;
  color: rgba(255, 255, 255, 0.92);
}

.row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.risk {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 88px;
  padding: 8px 10px;
  border-radius: 999px;
  font-weight: 900;
  margin: 10px 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.risk--low {
  background: rgba(124, 242, 154, 0.1);
  border-color: rgba(124, 242, 154, 0.18);
  color: var(--ok);
}

.risk--mid {
  background: rgba(255, 209, 102, 0.12);
  border-color: rgba(255, 209, 102, 0.22);
  color: var(--warn);
}

.risk--high {
  background: rgba(255, 107, 107, 0.12);
  border-color: rgba(255, 107, 107, 0.22);
  color: var(--danger);
}

.list {
  margin: 0;
  padding-left: 18px;
  color: rgba(255, 255, 255, 0.86);
  line-height: 1.8;
  font-size: 13px;
}

.advice {
  margin-top: 8px;
  padding: 12px;
  border-radius: 14px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.8;
  font-size: 13px;
}

.log {
  margin-top: 10px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.25);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.84);
  white-space: pre-wrap;
}

.is-hidden {
  display: none;
}

.kb {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.kb__item {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: all 0.2s ease;
}

.kb__item:hover {
  background: rgba(110, 231, 255, 0.12);
  transform: translateX(4px);
  border-color: rgba(110, 231, 255, 0.4);
}

.kb__q {
  font-weight: 900;
  margin-bottom: 6px;
}

.kb__a {
  color: rgba(255, 255, 255, 0.84);
  line-height: 1.8;
  font-size: 13px;
}

.footer {
  max-width: 1200px;
  margin: 10px auto 80px;
  padding: 0 16px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
}

/* AI 浮动按钮 */
.ai-fab {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 999px;
  border: 1px solid rgba(110, 231, 255, 0.28);
  background: rgba(35, 90, 255, 0.35);
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
  color: rgba(255, 255, 255, 0.92);
  cursor: pointer;
}

.ai-fab:hover {
  background: rgba(35, 90, 255, 0.48);
}

.ai-fab__icon {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), var(--primary2));
  color: #07101c;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
}

/* AI 抽屉 */
.ai-drawer {
  position: fixed;
  top: 70px;
  right: 0;
  height: calc(100vh - 70px);
  width: min(420px, 92vw);
  z-index: 60;
  transform: translateX(105%);
  transition: transform 0.22s ease;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(10, 16, 35, 0.88);
  backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
}

.ai-drawer.is-open {
  transform: translateX(0);
}

.ai-drawer__head {
  padding: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: flex-start;
}

.ai-drawer__title {
  font-weight: 900;
}

.ai-drawer__sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.ai-drawer__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-msg {
  display: flex;
  gap: 8px;
  max-width: 88%;
}

.chat-msg--ai {
  align-self: flex-start;
}

.chat-msg--user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-msg__avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), var(--primary2));
  color: #07101c;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 10px;
  flex-shrink: 0;
  align-self: flex-end;
}

.chat-msg--user .chat-msg__avatar {
  background: rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.92);
}

.chat-msg__bubble {
  padding: 10px 13px;
  border-radius: 18px;
  font-size: 13px;
  line-height: 1.7;
  word-break: break-word;
}

.chat-msg--ai .chat-msg__bubble {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom-left-radius: 4px;
}

.chat-msg--user .chat-msg__bubble {
  background: rgba(110, 231, 255, 0.18);
  border: 1px solid rgba(110, 231, 255, 0.26);
  border-bottom-right-radius: 4px;
  color: rgba(255, 255, 255, 0.95);
}

.chat-input-bar {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-attach-btn {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: transparent;
  color: rgba(255, 255, 255, 0.65);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.chat-textarea {
  flex: 1;
  padding: 8px 12px;
  border-radius: 14px;
  border: 1px solid rgba(110, 231, 255, 0.22);
  background: rgba(110, 231, 255, 0.06);
  color: rgba(255, 255, 255, 0.92);
  outline: none;
  resize: none;           /* 去除右下角调整手柄 */
  font-size: 13px;
  line-height: 1.6;
  min-height: 36px;
  max-height: none;       /* 无最大高度限制 */
  overflow-y: hidden;     /* 不显示滚动条 */
}

.chat-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(110, 231, 255, 0.26);
  background: rgba(110, 231, 255, 0.16);
  color: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 900;
}

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.backdrop.is-show {
  opacity: 1;
  pointer-events: auto;
}

/* 知识模态框 */
.knowledge-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.knowledge-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.knowledge-modal__content {
  background: #1e2c48;
  border-radius: 32px;
  max-width: 700px;
  width: 90%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(110, 231, 255, 0.25);
  animation: modalFadeIn 0.2s ease;
}

@keyframes modalFadeIn {
  from {
    transform: scale(0.96);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.knowledge-modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.knowledge-modal__header h3 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #fff, #a5f0ff);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}

.knowledge-modal__close {
  background: none;
  border: none;
  font-size: 32px;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.7);
  transition: 0.2s;
  line-height: 1;
}

.knowledge-modal__close:hover {
  color: #ff6b6b;
  transform: scale(1.1);
}

.knowledge-modal__body {
  padding: 24px;
  overflow-y: auto;
  font-size: 15px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.92);
  white-space: pre-wrap;
  word-break: break-word;
}

/* 闯关模块样式 */
.game-mode-selector {
  display: flex;
  gap: 24px;
  justify-content: center;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.game-mode-btn {
  background: linear-gradient(135deg, #2a3f5e, #1a2a44);
  border: 1px solid rgba(110, 231, 255, 0.4);
  border-radius: 60px;
  padding: 12px 28px;
  font-size: 1.1rem;
  font-weight: bold;
  color: white;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.game-mode-btn:hover {
  transform: translateY(-2px);
  background: #2e4a72;
  border-color: #6ee7ff;
}

.types-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.type-card {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(110, 231, 255, 0.25);
  border-radius: 20px;
  padding: 18px 12px;
  text-align: center;
  cursor: pointer;
  transition: 0.2s;
}

.type-card:hover {
  background: rgba(110, 231, 255, 0.12);
  transform: translateY(-3px);
  border-color: #6ee7ff;
}

.type-card__name {
  font-size: 1.2rem;
  font-weight: bold;
  margin-bottom: 8px;
}

.type-card__progress {
  font-size: 0.85rem;
  color: #a0c0e0;
  background: rgba(0, 0, 0, 0.4);
  display: inline-block;
  padding: 4px 12px;
  border-radius: 40px;
}

.quiz-area {
  background: rgba(0, 0, 0, 0.35);
  border-radius: 28px;
  padding: 24px;
  margin-top: 20px;
  border: 1px solid rgba(110, 231, 255, 0.2);
}

.question-text {
  font-size: 1.2rem;
  line-height: 1.5;
  background: rgba(0, 0, 0, 0.4);
  padding: 20px;
  border-radius: 20px;
  margin-bottom: 24px;
}

.options {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

.opt-btn {
  background: #0f2a3e;
  border: 1px solid rgba(110, 231, 255, 0.6);
  border-radius: 60px;
  padding: 12px 28px;
  font-size: 1rem;
  cursor: pointer;
  transition: 0.1s linear;
  min-width: 200px;
  color: white;
}

.opt-btn:hover {
  background: #1e4a6e;
  transform: scale(1.02);
}

.score-board {
  background: rgba(0, 0, 0, 0.4);
  border-radius: 32px;
  padding: 8px 18px;
  display: inline-block;
  font-weight: bold;
}

.back-to-list {
  margin-top: 20px;
  text-align: center;
}

.back-to-list button {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 8px 20px;
  border-radius: 40px;
  cursor: pointer;
  color: #ccc;
}

.back-to-list button:hover {
  background: rgba(255, 255, 255, 0.1);
}

.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.current-type-badge {
  background: #6ee7ff20;
  border-radius: 40px;
  padding: 6px 18px;
  font-size: 0.9rem;
}

.counter-badge {
  background: rgba(0, 0, 0, 0.4);
  border-radius: 40px;
  padding: 4px 14px;
  font-size: 0.8rem;
}

.fail-law {
  background: #330000aa;
  border-left: 6px solid #ff6b6b;
  padding: 16px;
  border-radius: 16px;
  margin-top: 20px;
  font-size: 0.9rem;
}

/* 辅助类 */
.scene-chat-row input {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  padding: 10px 12px;
  font-size: 15px;
  outline: none;
}

.scene-chat-row button {
  white-space: nowrap;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
}