/* ===== 公共样式：颜色、字体、滚动条、可访问性 ===== */
:root {
  --primary: #1677ff;
  --primary-2: #25d4ff;
  --primary-grad: linear-gradient(90deg, #1677ff 0%, #25d4ff 100%);
  --text-main: #1f2937;
  --text-sub: #5a6b80;     /* 提高对比度，从 #6b7280 改为更深 */
  --text-muted: #6b7e98;
  --border: rgba(22, 119, 255, 0.18);
  --bubble-bg: rgba(255, 255, 255, 0.72);
  --bubble-border: rgba(255, 255, 255, 0.85);
  --shadow: 0 6px 24px rgba(22, 119, 255, 0.08);
  --header-h: 72px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial,
    sans-serif;
  color: var(--text-main);
  background: #eaf3ff;
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: transparent;
}

/* 全局键盘焦点样式（无障碍） */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }
}

/* 全局背景层 */
.app-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: linear-gradient(180deg, #cfe6ff 0%, #f3f9ff 60%, #ffffff 100%);
}
.app-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("/static/images/bg.jpg");
  background-size: cover;
  background-position: center bottom;
  background-repeat: no-repeat;
  opacity: 0.55;
  mix-blend-mode: lighten;
}

/* 顶部导航 */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  z-index: 10;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.92) 0%,
    rgba(255, 255, 255, 0.78) 70%,
    rgba(255, 255, 255, 0) 100%
  );
  backdrop-filter: blur(10px) saturate(150%);
  -webkit-backdrop-filter: blur(10px) saturate(150%);
}
.app-header .brand,
.app-header .actions {
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: auto;
}
.app-header .emblem {
  width: 38px;
  height: 38px;
  object-fit: contain;
}
.app-header .title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #0a3a7a;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.6);
}
.app-header .subtitle {
  font-size: 12px;
  color: #4b6280;
  margin-top: 2px;
  letter-spacing: 1px;
}
.app-header .header-divider {
  position: absolute;
  left: 32px;
  right: 32px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(22, 119, 255, 0.25),
    transparent
  );
}

/* 顶部 AI 状态徽章 */
.ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--border);
  color: var(--primary);
  font-size: 13px;
  backdrop-filter: blur(6px);
}
.ai-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00c853;
  box-shadow: 0 0 8px #00c853;
}

/* 滚动条 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-thumb {
  background: rgba(22, 119, 255, 0.25);
  border-radius: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}

/* ===== 移动端响应式（统一断点） ===== */
@media (max-width: 768px) {
  :root {
    --header-h: 56px;
  }
  .app-header {
    padding: 0 14px;
  }
  .app-header .emblem {
    width: 30px;
    height: 30px;
  }
  .app-header .title {
    font-size: 15px;
    letter-spacing: 1px;
  }
  .app-header .subtitle {
    font-size: 10px;
    letter-spacing: 0.5px;
  }
  .app-header .header-divider {
    left: 14px;
    right: 14px;
  }
  .ai-badge {
    padding: 4px 10px;
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .app-header .subtitle { display: none; }
}
