/* ============================================================
   蛊真人·修行世界 — 游戏主样式
   设计主题：古卷轴风水墨风格
   ============================================================ */

/* ----------------------------------------------------------
   1. CSS 自定义属性 (设计变量)
   ---------------------------------------------------------- */
:root {
  /* 核心背景色系 — 仿古绢黄/茶色 */
  --bg-dark: #efe6d3;
  --bg-medium: #e8dcc0;
  --bg-light: #f5ecd8;
  --bg-deeper: #ddd0b0;

  /* 主题色 — 泥金（赭金） */
  --accent: #b8860b;
  --accent-light: #d4a843;
  --accent-dark: #8b6508;

  /* 文字色系 — 墨色 */
  --text: #3a3226;
  --text-muted: #5b4a3a;
  --text-bright: #1f1a12;

  /* 状态色 — 传统颜料 */
  --danger: #a8362a;
  --danger-light: #c44536;
  --danger-bright: #8b2a1f;
  --success: #4a7c45;
  --success-light: #6b8e6b;
  --success-bright: #3a6635;
  --warning: #c4956a;
  --warning-light: #d4a873;
  --info: #5b9db8;
  --info-light: #7eb8da;

  /* 稀有度色系 */
  --rarity-gold: #b8860b;
  --rarity-silver: #8b8378;
  --rarity-bronze: #a0703c;
  --rarity-gold-bg: rgba(184, 134, 11, 0.12);
  --rarity-silver-bg: rgba(139, 131, 120, 0.1);
  --rarity-bronze-bg: rgba(160, 112, 60, 0.1);

  /* 渐变背景色 — 绢黄系 */
  --gradient-card: linear-gradient(180deg, rgba(255, 252, 245, 0.8) 0%, rgba(232, 220, 192, 0.7) 100%);
  --gradient-navbar: linear-gradient(180deg, rgba(184, 134, 11, 0.9) 0%, rgba(139, 101, 8, 0.95) 50%, rgba(107, 77, 8, 0.9) 100%);
  --gradient-panel-header: linear-gradient(180deg, rgba(184, 134, 11, 0.1) 0%, rgba(212, 168, 67, 0.03) 100%);
  --gradient-accent: linear-gradient(135deg, #b8860b, #d4a843, #a0703c);
  --gradient-dark: linear-gradient(135deg, #efe6d3, #e8dcc0);
  --gradient-danger: linear-gradient(135deg, #a8362a, #c44536);
  --gradient-success: linear-gradient(135deg, #4a7c45, #6b8e6b);

  /* 卡片交互色 */
  --card-hover-glow: rgba(184, 134, 11, 0.15);
  --card-hover-border: rgba(184, 134, 11, 0.4);
  --card-active-bg: rgba(184, 134, 11, 0.08);

  /* 边框 */
  --border: #c9b896;
  --border-light: rgba(184, 134, 11, 0.2);
  --border-accent: rgba(184, 134, 11, 0.35);

  /* 发光 — 墨/金系 */
  --glow-accent: 0 0 15px rgba(184, 134, 11, 0.3);
  --glow-accent-strong: 0 0 25px rgba(184, 134, 11, 0.45);
  --glow-danger: 0 0 12px rgba(168, 54, 42, 0.3);
  --glow-success: 0 0 12px rgba(74, 124, 69, 0.3);

  /* 圆角 — 保留大圆角 */
  --border-radius: 12px;
  --border-radius-lg: 16px;
  --border-radius-xl: 20px;
  --border-radius-full: 9999px;

  /* 过渡 */
  --transition-speed: 0.25s;
  --transition-slow: 0.4s;
  --transition-fast: 0.15s;

  /* 字体 — 增加楷体系列 */
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei",
    -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: "KaiTi", "STKaiti", "楷体", "SimSun", "STSong",
    "Noto Serif CJK SC", Georgia, "Times New Roman", serif;
  --font-mono: "SF Mono", "Cascadia Code", "Fira Code", "Consolas", "Monaco",
    "Menlo", monospace;

  /* 阴影 — 柔和墨色阴影 */
  --shadow-sm: 0 2px 8px rgba(90, 70, 40, 0.1);
  --shadow-md: 0 4px 16px rgba(90, 70, 40, 0.12);
  --shadow-lg: 0 8px 32px rgba(90, 70, 40, 0.15);
  --shadow-glow: 0 0 16px rgba(184, 134, 11, 0.25);
  --shadow-inset: inset 0 1px 3px rgba(90, 70, 40, 0.06);
  --shadow-card-hover: 0 8px 30px rgba(90, 70, 40, 0.12), 0 0 20px rgba(184, 134, 11, 0.08);
}

/* ----------------------------------------------------------
   2. Reset & 全局样式
   ---------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-dark);
  color: var(--text);
  line-height: 1.7;
  letter-spacing: 0.02em;
  min-width: 1024px;
  min-height: 100vh;
  overflow-x: hidden;
  /* 水墨卷轴底纹：淡墨晕染 + 极淡纹理 */
  background-image:
    /* 顶部藤黄光晕 */
    radial-gradient(
      ellipse at 50% 0%,
      rgba(184, 134, 11, 0.06) 0%,
      transparent 55%
    ),
    /* 底部赭墨光晕 */
    radial-gradient(
      ellipse at 50% 100%,
      rgba(90, 70, 40, 0.05) 0%,
      transparent 50%
    ),
    /* 左下角茶色晕染 */
    radial-gradient(
      ellipse at 5% 85%,
      rgba(160, 112, 60, 0.04) 0%,
      transparent 45%
    ),
    /* 淡墨纹理 */
    url("data:image/svg+xml,%3Csvg width='100' height='100' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%233a3226' opacity='0.02'%3E%3Ccircle cx='20' cy='20' r='1'/%3E%3Ccircle cx='70' cy='50' r='1.2'/%3E%3Ccircle cx='40' cy='80' r='0.8'/%3E%3Ccircle cx='90' cy='15' r='1'/%3E%3Ccircle cx='10' cy='60' r='0.9'/%3E%3C/g%3E%3C/svg%3E");
  background-attachment: fixed;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-serif);
  color: var(--accent-dark);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.03em;
  position: relative;
}

h1 {
  font-size: 2rem;
  padding-bottom: 8px;
  color: var(--accent-dark);
}
h1::after {
  content: ' ♡';
  position: absolute;
  bottom: 0;
  left: 0;
  width: auto;
  height: auto;
  font-size: 0.7rem;
  background: none;
  color: var(--accent);
  border-radius: 0;
  opacity: 0.7;
}

h2 {
  font-size: 1.6rem;
  padding-bottom: 6px;
  color: var(--accent-dark);
}
h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-light), transparent);
  border-radius: 3px;
}

h3 {
  font-size: 1.3rem;
  padding-bottom: 5px;
  color: var(--accent-dark);
}
h3::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-light), transparent);
  border-radius: 2px;
}

h4 {
  font-size: 1.1rem;
  padding-bottom: 4px;
  color: var(--accent-dark);
}
h4::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 30px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-light), transparent);
  border-radius: 2px;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition-speed);
}

a:hover {
  color: var(--accent-dark);
}

img {
  max-width: 100%;
  height: auto;
}

/* 滚动条 - Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--accent-light) var(--bg-deeper);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-deeper);
  border-radius: 10px;
  margin: 2px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--accent-light), var(--accent));
  border-radius: 10px;
  border: 2px solid var(--bg-deeper);
  transition: all var(--transition-speed);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--accent), var(--accent-dark));
  border-color: var(--bg-medium);
}

::-webkit-scrollbar-corner {
  background: var(--bg-dark);
}

/* ----------------------------------------------------------
   3. 布局
   ---------------------------------------------------------- */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.main-content {
  flex: 1;
  overflow-y: auto;
  padding-top: 60px; /* 导航栏高度 */
}

.content-wrapper {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

/* 双列布局 */
.layout-two-column {
  display: flex;
  gap: 20px;
}

.layout-two-column > .column-main {
  flex: 1;
  min-width: 0;
}

.layout-two-column > .column-side {
  width: 320px;
  flex-shrink: 0;
}

/* 三列布局 */
.layout-three-column {
  display: flex;
  gap: 20px;
}

.layout-three-column > .column {
  flex: 1;
  min-width: 0;
}

/* ----------------------------------------------------------
   4. 顶部导航栏 — 粉色渐变半透明
   ---------------------------------------------------------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--gradient-navbar);
  border-bottom: 2px solid var(--accent-light);
  box-shadow: var(--shadow-md), 0 4px 20px rgba(90, 70, 40, 0.12);
  height: 60px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  backdrop-filter: blur(12px);
}
/* 导航栏底部光晕效果 */
.navbar::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  right: 0;
  height: 8px;
  background: linear-gradient(180deg, rgba(184, 134, 11, 0.25) 0%, transparent 100%);
  pointer-events: none;
}

.navbar-brand {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: #fdf6e3;
  margin-right: 30px;
  white-space: nowrap;
  letter-spacing: 3px;
  text-shadow: 0 0 15px rgba(245, 236, 216, 0.5),
               0 0 30px rgba(184, 134, 11, 0.3),
               0 2px 4px rgba(107, 77, 8, 0.4);
  transition: text-shadow var(--transition-speed);
}
.navbar-brand:hover {
  text-shadow: 0 0 20px rgba(245, 236, 216, 0.7),
               0 0 40px rgba(184, 134, 11, 0.5),
               0 2px 4px rgba(107, 77, 8, 0.5);
}

.navbar-inner {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  height: 100%;
  gap: 12px;
}

.navbar-nav {
  display: flex;
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  gap: 2px;
  height: 100%;
  align-items: center;
  scrollbar-width: none;
  -ms-overflow-style: none;
  list-style: none;
}

.navbar-nav::-webkit-scrollbar { display: none; }

.navbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* 导航标签按钮样式 */
.nav-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255,255,255,0.8);
  background: transparent;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  font-family: var(--font-sans);
  flex-shrink: 0;
}

.nav-tab:hover {
  color: #fff;
  background: rgba(255,255,255,0.15);
  transform: translateY(-1px);
}

.nav-tab.active {
  color: #fff;
  background: rgba(255,255,255,0.2);
  box-shadow: 0 2px 8px rgba(184, 134, 11,0.3);
}

/* 保留原有的 .navbar-nav li a 样式用于其他场景 */
.navbar-nav > li {
  height: 100%;
}

.navbar-nav > li > a {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 18px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  border-bottom: 3px solid transparent;
  transition: all var(--transition-speed);
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  border-radius: 0;
}

.navbar-nav > li > a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 60%;
  height: 3px;
  background: linear-gradient(90deg, #fff, var(--accent-light));
  border-radius: 3px 3px 0 0;
  transition: transform var(--transition-speed);
}

.navbar-nav > li > a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-bottom-color: rgba(255, 255, 255, 0.5);
}

.navbar-nav > li > a:hover::after {
  transform: translateX(-50%) scaleX(0.6);
}

.navbar-nav > li > a.active {
  color: #fff;
  border-bottom-color: #fff;
  background: rgba(255, 255, 255, 0.15);
}

.navbar-nav > li > a.active::after {
  transform: translateX(-50%) scaleX(1);
  height: 3px;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.5);
}

/* 资源栏 */
.resource-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  padding: 0 10px;
}

.resource-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text);
  white-space: nowrap;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius);
  transition: all var(--transition-speed);
  backdrop-filter: blur(6px);
}
.resource-item:hover {
  border-color: var(--accent-light);
  background: rgba(255, 255, 255, 0.8);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.resource-icon {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.resource-icon.gold {
  background: linear-gradient(135deg, #d4a843, #a0703c);
  color: #fff;
}

.resource-icon.wood {
  background: linear-gradient(135deg, #6b8e6b, #6b8e6b);
  color: #fff;
}

.resource-icon.stone {
  background: linear-gradient(135deg, #8b8378, #8b8378);
  color: #fff;
}

.resource-icon.food {
  background: linear-gradient(135deg, #d4a843, #b8860b);
  color: #fff;
}

.resource-value {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
  font-size: 0.88rem;
}

/* 顶部信息栏整合容器 */
.top-info-bar {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 16px;
  background: rgba(255,255,255,0.55);
  border-bottom: 1px solid var(--border-light);
  backdrop-filter: blur(10px);
  flex-wrap: wrap;
}

#resource-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  flex: 1;
  flex-wrap: wrap;
}

#user-info-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 0 8px 16px;
  border-left: 1px solid var(--border-light);
  font-size: 0.85rem;
  flex-shrink: 0;
}

/* 主内容区 */
#main-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px 20px;
  min-height: calc(100vh - 140px);
}

/* 面板 */
.panel {
  background: rgba(255,255,255,0.7);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 14px;
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(184, 134, 11,0.08);
}

.panel h3 {
  font-size: 1.05rem;
  color: var(--accent-dark);
  margin: 0 0 12px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}

/* ----------------------------------------------------------
   5. 卡片组件 — 白色半透明毛玻璃
   ---------------------------------------------------------- */
.card {
  background: var(--gradient-card);
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 20px;
  backdrop-filter: blur(10px);
  transition: all var(--transition-speed);
}
.card:hover {
  border-color: var(--card-hover-border);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-3px);
}

.card-header {
  background: var(--gradient-panel-header);
  border-bottom: 1px solid var(--border-light);
  border-left: 4px solid var(--accent);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: var(--border-radius-xl) var(--border-radius-xl) 0 0;
}

.card-header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--accent-dark);
}

.card-body {
  padding: 20px;
}

.card-footer {
  border-top: 1px solid var(--border-light);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  background: rgba(255, 240, 245, 0.5);
  border-radius: 0 0 var(--border-radius-xl) var(--border-radius-xl);
}

/* 卡片变体 */
.card-accent {
  border-color: var(--accent-light);
}
.card-accent .card-header {
  background: linear-gradient(
    180deg,
    rgba(184, 134, 11, 0.15) 0%,
    rgba(184, 134, 11, 0.05) 100%
  );
  border-left-color: var(--accent);
}

.card-danger {
  border-color: rgba(255, 138, 128, 0.35);
}
.card-danger .card-header {
  background: linear-gradient(
    180deg,
    rgba(255, 138, 128, 0.12) 0%,
    rgba(255, 138, 128, 0.02) 100%
  );
  color: var(--danger);
  border-left-color: var(--danger);
}

/* ----------------------------------------------------------
   6. 按钮 — 粉橙渐变，大圆角
   ---------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 22px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-sans);
  border: 1px solid transparent;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all var(--transition-speed);
  white-space: nowrap;
  line-height: 1.4;
  user-select: none;
  outline: none;
  position: relative;
  overflow: hidden;
}

/* 按钮光泽效果 */
.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(245, 236, 216, 0.25) 50%,
    transparent 100%
  );
  transition: left 0.5s ease;
  pointer-events: none;
}
.btn:hover::before {
  left: 100%;
}

.btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(184, 134, 11, 0.4);
}

.btn:disabled,
.btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
  filter: grayscale(0.3);
}

.btn:active:not(:disabled) {
  transform: scale(0.95);
}

/* 主按钮 — 粉橙渐变 */
.btn-primary {
  background: var(--gradient-accent);
  color: #fff;
  border-color: var(--accent);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 15px rgba(184, 134, 11, 0.3);
  border-radius: var(--border-radius);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--accent-dark), var(--accent), var(--accent-light));
  box-shadow: 0 6px 20px rgba(184, 134, 11, 0.45);
  transform: translateY(-2px);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0) scale(0.95);
}

/* 危险按钮 */
.btn-danger {
  background: var(--gradient-danger);
  color: #fff;
  border-color: var(--danger);
  box-shadow: 0 4px 15px rgba(255, 138, 128, 0.25);
  border-radius: var(--border-radius);
}

.btn-danger:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--danger-light), var(--danger-bright), var(--danger));
  box-shadow: 0 6px 20px rgba(255, 138, 128, 0.4);
  transform: translateY(-2px);
}

.btn-danger:active:not(:disabled) {
  transform: translateY(0) scale(0.95);
}

/* 成功按钮 */
.btn-success {
  background: var(--gradient-success);
  color: #fff;
  border-color: var(--success);
  box-shadow: 0 4px 15px rgba(126, 203, 118, 0.25);
  border-radius: var(--border-radius);
}

.btn-success:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--success-light), var(--success-bright), var(--success));
  box-shadow: 0 6px 20px rgba(126, 203, 118, 0.4);
  transform: translateY(-2px);
}

.btn-success:active:not(:disabled) {
  transform: translateY(0) scale(0.95);
}

/* 信息按钮 */
.btn-info {
  background: linear-gradient(135deg, var(--info), #5bb8d4);
  color: #fff;
  border-color: var(--info);
  box-shadow: 0 4px 15px rgba(126, 200, 227, 0.25);
  border-radius: var(--border-radius);
}

.btn-info:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--info-light), var(--info));
  box-shadow: 0 6px 20px rgba(126, 200, 227, 0.4);
  transform: translateY(-2px);
}

.btn-info:active:not(:disabled) {
  transform: translateY(0) scale(0.95);
}

/* 警告按钮 */
.btn-warning {
  background: linear-gradient(135deg, var(--warning), #ff9a3c);
  color: #fff;
  border-color: var(--warning);
  box-shadow: 0 4px 15px rgba(255, 179, 71, 0.25);
  border-radius: var(--border-radius);
}

.btn-warning:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--warning-light), var(--warning));
  box-shadow: 0 6px 20px rgba(255, 179, 71, 0.4);
  transform: translateY(-2px);
}

.btn-warning:active:not(:disabled) {
  transform: translateY(0) scale(0.95);
}

/* 幽灵按钮 */
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-accent);
  border-radius: var(--border-radius);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--card-active-bg);
  border-color: var(--accent);
  color: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(184, 134, 11, 0.15);
}

.btn-ghost:active:not(:disabled) {
  transform: translateY(0) scale(0.95);
}

/* 按钮尺寸 */
.btn-small {
  padding: 5px 14px;
  font-size: 0.8rem;
  border-radius: 8px;
}

.btn-large {
  padding: 14px 30px;
  font-size: 1.05rem;
  border-radius: var(--border-radius-lg);
}

.btn-block {
  width: 100%;
}

/* 图标按钮 */
.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  font-size: 1rem;
}

.btn-icon.btn-small {
  width: 28px;
  height: 28px;
  font-size: 0.8rem;
}

/* ----------------------------------------------------------
   7. 表单
   ---------------------------------------------------------- */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.form-label .required {
  color: var(--danger);
  margin-left: 3px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  font-size: 0.9rem;
  font-family: var(--font-sans);
  color: var(--text);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  transition: all var(--transition-speed);
  outline: none;
  box-shadow: inset 0 2px 4px rgba(91, 58, 107, 0.06);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
  border-color: var(--accent-light);
  background: rgba(255, 255, 255, 0.85);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent);
  box-shadow: inset 0 2px 4px rgba(91, 58, 107, 0.06),
              0 0 0 3px rgba(184, 134, 11, 0.15),
              0 0 12px rgba(184, 134, 11, 0.1);
  background: rgba(255, 255, 255, 0.95);
}

.form-input:disabled,
.form-select:disabled,
.form-textarea:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.form-input.error,
.form-select.error,
.form-textarea.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(255, 138, 128, 0.15);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%23b8860b' fill='none' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}
.form-select:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%238b6508' fill='none' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.form-select option {
  background: #fff;
  color: var(--text);
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-error {
  font-size: 0.8rem;
  color: var(--danger);
  margin-top: 4px;
}

/* 复选框 / 单选框 */
.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.9rem;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-accent);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  position: relative;
  transition: all var(--transition-speed);
  flex-shrink: 0;
  box-shadow: inset 0 1px 2px rgba(91, 58, 107, 0.06);
}

.form-check input[type="radio"] {
  border-radius: 50%;
}

.form-check input[type="checkbox"]:hover,
.form-check input[type="radio"]:hover {
  border-color: var(--accent);
}

.form-check input[type="checkbox"]:checked {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
}

.form-check input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.form-check input[type="radio"]:checked {
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
}

.form-check input[type="radio"]:checked::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.form-check input:focus-visible {
  box-shadow: 0 0 0 3px rgba(184, 134, 11, 0.3), inset 0 1px 2px rgba(91, 58, 107, 0.06);
}

/* 输入组 */
.input-group {
  display: flex;
}

.input-group .form-input {
  border-radius: var(--border-radius) 0 0 var(--border-radius);
}

.input-group .btn {
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
  margin-left: -1px;
}

/* ----------------------------------------------------------
   8. 进度条 — 彩虹渐变
   ---------------------------------------------------------- */
.progress {
  height: 12px;
  background: rgba(240, 230, 255, 0.6);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.progress-bar {
  height: 100%;
  border-radius: 10px;
  transition: width 0.6s ease;
  position: relative;
  overflow: hidden;
}

/* 进度条动画条纹 */
.progress-bar::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 8px,
    rgba(255, 255, 255, 0.2) 8px,
    rgba(255, 255, 255, 0.2) 16px
  );
  animation: progress-stripes 1.2s linear infinite;
}

@keyframes progress-stripes {
  0% { background-position: 0 0; }
  100% { background-position: 40px 0; }
}

/* 进度条shimmer */
.progress-bar::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.25) 50%,
    transparent 100%
  );
  animation: progress-shimmer 1.5s infinite;
  z-index: 1;
}

@keyframes progress-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}

/* 进度条颜色变体 — 彩虹系 */
.progress-bar.accent {
  background: linear-gradient(90deg, var(--accent), #a0703c, var(--accent-light));
}

.progress-bar.success {
  background: linear-gradient(90deg, #6b8e6b, #6b8e6b, #6b8e6b);
}

.progress-bar.danger {
  background: linear-gradient(90deg, #c44536, #c44536, #c44536);
}

.progress-bar.warning {
  background: linear-gradient(90deg, #d4a843, #d4a873, #d4a843);
}

.progress-bar.info {
  background: linear-gradient(90deg, #7eb8da, #7eb8da, #7eb8da);
}

/* 带标签的进度条 */
.progress-labeled {
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-labeled .progress {
  flex: 1;
}

.progress-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  min-width: 40px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* 建造进度卡片 */
.build-progress {
  padding: 12px 0;
  border-bottom: 1px solid rgba(184, 134, 11, 0.08);
}

.build-progress:last-child {
  border-bottom: none;
}

.build-progress-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 0.85rem;
}

.build-progress-name {
  color: var(--text);
}

.build-progress-time {
  color: var(--text-muted);
}

/* ----------------------------------------------------------
   9. 表格
   ---------------------------------------------------------- */
.table-container {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

thead {
  background: rgba(184, 134, 11, 0.2);
}

thead th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 700;
  color: var(--accent-dark);
  border-bottom: 2px solid rgba(184, 134, 11, 0.25);
  white-space: nowrap;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}

tbody td {
  padding: 10px 16px;
  border-bottom: 1px solid rgba(184, 134, 11, 0.08);
  vertical-align: middle;
}

tbody tr:nth-child(even) {
  background: rgba(184, 134, 11, 0.06);
}

tbody tr:hover {
  background: rgba(184, 134, 11, 0.08);
}

/* 表格对齐变体 */
th.text-center,
td.text-center {
  text-align: center;
}

th.text-right,
td.text-right {
  text-align: right;
}

/* 紧凑表格 */
.table-compact thead th,
.table-compact tbody td {
  padding: 6px 10px;
  font-size: 0.82rem;
}

/* 斑马纹表格 */
.table-striped tbody tr:nth-child(odd) {
  background: rgba(184, 134, 11, 0.03);
}

.table-striped tbody tr:nth-child(even) {
  background: rgba(184, 134, 11, 0.08);
}

/* ----------------------------------------------------------
   10. 通知 (Toast) — 圆润可爱
   ---------------------------------------------------------- */
.notification-container {
  position: fixed;
  top: 70px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 400px;
}

.notification {
  padding: 14px 18px;
  border-radius: var(--border-radius-lg);
  font-size: 0.9rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  animation: notification-slide-in 0.3s ease;
  cursor: pointer;
  border-left: 4px solid transparent;
  max-width: 100%;
  backdrop-filter: blur(10px);
}

@keyframes notification-slide-in {
  from {
    opacity: 0;
    transform: translateX(100%) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

.notification.removing {
  animation: notification-slide-out 0.25s ease forwards;
}

@keyframes notification-slide-out {
  from {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateX(100%) scale(0.9);
  }
}

.notification-success {
  background: rgba(168, 230, 207, 0.5);
  border-left-color: var(--success);
  color: #3a7d3a;
}

.notification-error {
  background: rgba(255, 168, 165, 0.5);
  border-left-color: var(--danger);
  color: #c0392b;
}

.notification-warning {
  background: rgba(255, 199, 115, 0.5);
  border-left-color: var(--warning);
  color: #b87a20;
}

.notification-info {
  background: rgba(168, 223, 240, 0.5);
  border-left-color: var(--info);
  color: #3a7d9b;
}

.notification-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.notification-body {
  flex: 1;
  min-width: 0;
}

.notification-title {
  font-weight: 700;
  margin-bottom: 2px;
  font-size: 0.9rem;
}

.notification-message {
  color: var(--text);
  font-size: 0.85rem;
}

.notification-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
  transition: color var(--transition-speed);
}

.notification-close:hover {
  color: var(--text);
}

/* ----------------------------------------------------------
   11. 弹窗 (Modal) — 圆角粉色边框
   ---------------------------------------------------------- */
.modal-overlay {
  position: fixed !important;
  inset: 0;
  z-index: 1500;
  background: rgba(58, 50, 38, 0.35);
  display: flex !important;
  align-items: center;
  justify-content: center;
  animation: modal-fade-in 0.2s ease;
  backdrop-filter: blur(4px);
}

.modal-hidden {
  display: none !important;
}

.modal-visible {
  display: flex !important;
}

@keyframes modal-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: rgba(245, 236, 216, 0.96);
  border: 2px solid rgba(184, 134, 11, 0.4);
  border-radius: var(--border-radius-xl);
  box-shadow: var(--shadow-lg), 0 0 40px rgba(184, 134, 11, 0.15);
  max-width: 90vw;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modal-zoom-in 0.3s ease;
  min-width: 400px;
  backdrop-filter: blur(10px);
}

.modal-box {
  background: #322b1c;
  color: #f5ecd8;
  border: 1px solid #4a4030;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  animation: modal-zoom-in 0.25s ease;
  overflow: hidden; /* 关键：彻底禁止外层滚动，header/footer 钉住，只有 body 内部滚 */
}

@keyframes modal-zoom-in {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-sm { width: 400px; }
.modal-md { width: 560px; }
.modal-lg { width: 760px; }
.modal-xl { width: 960px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 24px;
  border-bottom: 1px solid rgba(184, 134, 11, 0.25);
  background: rgba(184, 134, 11, 0.08);
}

.modal-header h2 {
  margin: 0;
  font-size: 1.2rem;
  color: var(--accent-dark);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  border-radius: 50%;
  transition: all var(--transition-speed);
}

.modal-close:hover {
  color: var(--accent-dark);
  background: rgba(184, 134, 11, 0.1);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
  min-height: 0; /* 关键：允许 flex 子元素收缩并启用内部滚动 */
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(184, 134, 11, 0.2);
  display: flex;
  justify-content: center;
  gap: 10px;
}

/* ----------------------------------------------------------
   12. 地图容器
   ---------------------------------------------------------- */
.map-container {
  position: relative;
  display: flex;
  justify-content: center;
  padding: 20px 0;
}

.map-container canvas {
  border: 2px solid rgba(139, 100, 43, 0.3);
  border-radius: var(--border-radius-lg);
  box-shadow:
    0 4px 16px rgba(139, 100, 43, 0.1),
    0 0 40px rgba(139, 125, 155, 0.06);
  background: transparent;
  max-width: 100%;
}

/* 地图图例 */
.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  padding: 12px;
  margin-top: 10px;
  background: rgba(245, 240, 232, 0.7);
  border: 1px solid rgba(139, 100, 43, 0.2);
  border-radius: var(--border-radius);
  backdrop-filter: blur(6px);
}

.map-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: #5b4a3a;
  font-family: 'KaiTi', 'STKaiti', '楷体', serif;
}

.map-legend-color {
  width: 14px;
  height: 14px;
  border-radius: 2px;
  border: 1px solid rgba(61, 43, 26, 0.2);
}

/* 地图控制 */
.map-controls {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 12px;
}

.map-controls .btn {
  font-size: 0.82rem;
  padding: 6px 14px;
}

/* ----------------------------------------------------------
   13. 英雄品质颜色 — 萌系配色
   ---------------------------------------------------------- */
.quality-common {
  color: #7a6e58;
}

.quality-uncommon {
  color: #6b8e6b;
}

.quality-rare {
  color: #7eb8da;
}

.quality-epic {
  color: #c9a0dc;
}

.quality-legendary {
  color: #a0703c;
}

/* 品质背景色 */
.bg-quality-common {
  background: rgba(139, 125, 155, 0.1);
}

.bg-quality-uncommon {
  background: rgba(168, 230, 207, 0.15);
}

.bg-quality-rare {
  background: rgba(126, 200, 227, 0.15);
}

.bg-quality-epic {
  background: rgba(201, 160, 220, 0.15);
}

.bg-quality-legendary {
  background: rgba(255, 154, 118, 0.15);
}

/* 品质边框 */
.border-quality-common {
  border-color: rgba(139, 125, 155, 0.35);
}

.border-quality-uncommon {
  border-color: #6b8e6b;
}

.border-quality-rare {
  border-color: #7eb8da;
}

.border-quality-epic {
  border-color: #c9a0dc;
}

.border-quality-legendary {
  border-color: #a0703c;
}

/* 英雄卡片 */
.hero-card {
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(184, 134, 11, 0.25);
  border-radius: var(--border-radius-lg);
  padding: 16px;
  cursor: pointer;
  transition: all var(--transition-speed);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(8px);
}

.hero-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
  border-color: rgba(184, 134, 11, 0.4);
}

.hero-card.selected {
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
}

.hero-card .hero-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin: 0 auto 10px;
  display: block;
  border: 3px solid rgba(184, 134, 11, 0.5);
}

.hero-card .hero-name {
  text-align: center;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 4px;
  color: var(--accent-dark);
}

.hero-card .hero-title {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.hero-card .hero-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  font-size: 0.78rem;
}

.hero-card .hero-stat {
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
}

.hero-card .hero-stat-value {
  color: var(--text);
  font-weight: 600;
}

/* ----------------------------------------------------------
   14. 标签 (Badge / Tag) — 圆润可爱
   ---------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 20px;
  line-height: 1.5;
  white-space: nowrap;
}

.badge-accent {
  background: rgba(184, 134, 11, 0.15);
  color: var(--accent-dark);
}

.badge-success {
  background: rgba(168, 230, 207, 0.25);
  color: #4a9e4a;
}

.badge-danger {
  background: rgba(255, 168, 165, 0.25);
  color: #e06060;
}

.badge-warning {
  background: rgba(255, 199, 115, 0.25);
  color: #d4892a;
}

.badge-info {
  background: rgba(168, 223, 240, 0.25);
  color: #5b9db8;
}

/* ----------------------------------------------------------
   15. 标签页 (Tabs) — 圆润标签
   ---------------------------------------------------------- */
.tabs {
  display: flex;
  border-bottom: 1px solid rgba(184, 134, 11, 0.3);
  margin-bottom: 20px;
  gap: 4px;
}

.tab-item {
  padding: 10px 22px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-muted);
  border-bottom: 3px solid transparent;
  transition: all var(--transition-speed);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: var(--font-sans);
  white-space: nowrap;
  border-radius: 12px 12px 0 0;
}

.tab-item:hover {
  color: var(--accent-dark);
  background: rgba(184, 134, 11, 0.1);
}

.tab-item.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
  background: rgba(184, 134, 11, 0.08);
}

/* ----------------------------------------------------------
   16. 加载状态
   ---------------------------------------------------------- */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--text-muted);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(184, 134, 11, 0.3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 12px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner-sm {
  width: 16px;
  height: 16px;
  border-width: 2px;
}

.spinner-lg {
  width: 48px;
  height: 48px;
  border-width: 4px;
}

/* 骨架屏 */
.skeleton {
  background: linear-gradient(
    90deg,
    rgba(184, 134, 11, 0.08) 0%,
    rgba(184, 134, 11, 0.2) 20%,
    rgba(184, 134, 11, 0.08) 40%
  );
  background-size: 800px 100%;
  animation: skeleton-loading 1.6s ease-in-out infinite;
  border-radius: 8px;
}

@keyframes skeleton-loading {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
}

.skeleton-text:last-child {
  width: 70%;
}

.skeleton-title {
  height: 22px;
  width: 60%;
  margin-bottom: 14px;
  border-radius: 10px;
}

.skeleton-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.skeleton-card {
  padding: 20px;
  border-radius: var(--border-radius-lg);
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid var(--border-light);
}

.skeleton-card .skeleton-title {
  margin-bottom: 16px;
}

.skeleton-card .skeleton-text {
  margin-bottom: 10px;
}

.skeleton-card .skeleton-text:last-child {
  width: 50%;
}

/* ----------------------------------------------------------
   17. 空状态
   ---------------------------------------------------------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state-title {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.empty-state-description {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  max-width: 400px;
}

/* ----------------------------------------------------------
   18. 分割线
   ---------------------------------------------------------- */
.divider {
  border: none;
  border-top: 1px solid rgba(184, 134, 11, 0.2);
  margin: 20px 0;
}

.divider-accent {
  border-top-color: rgba(184, 134, 11, 0.35);
}

.divider-dashed {
  border-top-style: dashed;
}

/* ----------------------------------------------------------
   19. 工具提示 (Tooltip)
   ---------------------------------------------------------- */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--text);
  font-size: 0.78rem;
  border-radius: 10px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  border: 1px solid rgba(184, 134, 11, 0.4);
  box-shadow: var(--shadow-md);
  z-index: 100;
  margin-bottom: 6px;
}

[data-tooltip]:hover::after {
  opacity: 1;
}

/* ----------------------------------------------------------
   20. 分页
   ---------------------------------------------------------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 16px 0;
}

.pagination-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(184, 134, 11, 0.2);
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all var(--transition-speed);
  user-select: none;
}

.pagination-item:hover {
  color: var(--accent-dark);
  border-color: rgba(184, 134, 11, 0.4);
  background: rgba(184, 134, 11, 0.15);
  transform: translateY(-1px);
}

.pagination-item.active {
  background: var(--gradient-accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 700;
  box-shadow: var(--shadow-glow);
}

.pagination-item.disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

/* ----------------------------------------------------------
   21. 下拉菜单
   ---------------------------------------------------------- */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 500;
  min-width: 180px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(184, 134, 11, 0.35);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  padding: 6px 0;
  margin-top: 4px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-5px);
  transition: all 0.15s ease;
  backdrop-filter: blur(12px);
}

.dropdown.active .dropdown-menu,
.dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: block;
  width: 100%;
  padding: 8px 16px;
  font-size: 0.85rem;
  color: var(--text);
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: background var(--transition-speed);
  font-family: var(--font-sans);
}

.dropdown-item:hover {
  background: rgba(184, 134, 11, 0.12);
  color: var(--accent-dark);
}

.dropdown-divider {
  height: 1px;
  background: rgba(184, 134, 11, 0.2);
  margin: 4px 0;
}

/* ----------------------------------------------------------
   22. 军队/战斗相关
   ---------------------------------------------------------- */
.troop-icon {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
}

.troop-count {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* 战斗结果 */
.battle-report {
  padding: 16px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(184, 134, 11, 0.2);
  border-radius: var(--border-radius);
  backdrop-filter: blur(8px);
}

.battle-result-victory {
  border-left: 4px solid var(--success);
}

.battle-result-defeat {
  border-left: 4px solid var(--danger);
}

.battle-result-draw {
  border-left: 4px solid var(--warning);
}

/* ----------------------------------------------------------
   23. 科技树
   ---------------------------------------------------------- */
.tech-tree {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.tech-tier {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.tech-node {
  width: 100px;
  padding: 12px;
  text-align: center;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(184, 134, 11, 0.25);
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all var(--transition-speed);
  backdrop-filter: blur(6px);
}

.tech-node:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
  transform: translateY(-3px);
}

.tech-node.researched {
  border-color: var(--success);
  background: rgba(168, 230, 207, 0.15);
}

.tech-node.researching {
  border-color: var(--warning);
  animation: pulse-border 1.5s infinite;
}

@keyframes pulse-border {
  0%, 100% { border-color: var(--warning); }
  50% { border-color: rgba(255, 179, 71, 0.3); }
}

.tech-node.locked {
  opacity: 0.4;
  cursor: not-allowed;
}

.tech-node-icon {
  font-size: 1.5rem;
  margin-bottom: 6px;
}

.tech-node-name {
  font-size: 0.78rem;
  color: var(--text);
}

/* ----------------------------------------------------------
   24. 排行榜
   ---------------------------------------------------------- */
.leaderboard-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.85rem;
}

.leaderboard-rank.rank-1 {
  background: linear-gradient(135deg, #d4a843, #a0703c);
  color: #fff;
}

.leaderboard-rank.rank-2 {
  background: linear-gradient(135deg, #8b8378, #8b8378);
  color: #fff;
}

.leaderboard-rank.rank-3 {
  background: linear-gradient(135deg, #a0703c, #8b6b4a);
  color: #fff;
}

/* ----------------------------------------------------------
   25. 聊天面板
   ---------------------------------------------------------- */
.chat-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 300px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.chat-message {
  margin-bottom: 10px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: var(--border-radius);
  font-size: 0.85rem;
}

.chat-message .chat-sender {
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 2px;
}

.chat-message .chat-time {
  font-size: 0.72rem;
  color: var(--text-muted);
  float: right;
}

.chat-message.system {
  text-align: center;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-style: italic;
}

.chat-input-area {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid rgba(184, 134, 11, 0.2);
}

.chat-input-area .form-input {
  flex: 1;
}

/* ----------------------------------------------------------
   26. 响应式
   桌面优先 (Desktop First)
   断点：≤768px 手机, 768-1024px 平板, >1024px 桌面
   ---------------------------------------------------------- */

/* ---------- 平板 (768px - 1024px) ---------- */
@media (max-width: 1024px) {
  body {
    min-width: 0;
  }

  .content-wrapper {
    padding: 12px;
  }

  /* 布局：双列/三列改为堆叠 */
  .layout-two-column {
    flex-direction: column;
  }
  .layout-two-column > .column-side {
    width: 100%;
  }
  .layout-three-column {
    flex-direction: column;
  }

  /* 资源栏 */
  .resource-bar {
    gap: 8px;
    flex-wrap: wrap;
  }
  .resource-item {
    font-size: 0.78rem;
  }

  /* 网格：4列变3列, 3列变2列 */
  .grid-4 { grid-template-columns: repeat(3, 1fr) !important; }
  .grid-3 { grid-template-columns: repeat(2, 1fr) !important; }

  /* 统计卡片 */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* 弹窗 */
  .modal-sm, .modal-md { width: 90vw; }
  .modal-lg { width: 95vw; }
  .modal-xl { width: 95vw; }

  /* 表单行 */
  .form-row {
    grid-template-columns: 1fr;
  }
  .form-row-label {
    text-align: left;
    padding-top: 0;
  }

  /* 导航栏 */
  .navbar-inner { gap: 6px; }
  .navbar-brand { font-size: 1.1rem; margin-right: 8px; }
  .nav-tab { padding: 0 8px; font-size: 0.78rem; height: 32px; }

  /* 顶部信息栏 */
  .top-info-bar { flex-direction: column; padding: 8px 12px; }
  #user-info-bar { border-left: none; border-top: 1px solid var(--border-light); width: 100%; padding: 6px 0 0; }

  /* 主内容 */
  #main-content { padding: 10px 12px; }
  .panel { padding: 12px; margin-bottom: 10px; }

  /* 网格 */
  .building-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
  .unit-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
}

/* ---------- 平板横向 (768px - 1024px) 导航栏调整 ---------- */
@media (max-width: 1024px) and (min-width: 769px) {
  .navbar-inner {
    gap: 6px;
  }
  .navbar-brand {
    font-size: 1.1rem;
    margin-right: 8px;
    letter-spacing: 0;
  }
  .navbar-nav {
    gap: 0;
  }
  .nav-tab {
    padding: 0 8px;
    font-size: 0.78rem;
  }
}

/* ---------- 手机 (≤768px) ---------- */
@media (max-width: 768px) {
  html { font-size: 13px; }
  body { min-width: 0; }

  .content-wrapper { padding: 8px; }

  /* ===== 导航栏：汉堡菜单 ===== */
  .navbar {
    height: auto;
    min-height: 50px;
    flex-wrap: wrap;
    padding: 6px 10px;
  }
  .navbar-inner {
    flex-wrap: wrap;
    width: 100%;
  }
  .navbar-brand {
    font-size: 1rem;
    letter-spacing: 0;
    margin-right: 0;
    flex-shrink: 0;
  }

  /* 汉堡菜单按钮 */
  .hamburger-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: none;
    border: 1px solid rgba(184, 134, 11, 0.4);
    border-radius: var(--border-radius);
    color: var(--accent);
    font-size: 1.4rem;
    cursor: pointer;
    flex-shrink: 0;
    z-index: 1010;
    order: -1;
    margin-right: 8px;
  }
  .hamburger-btn:active {
    background: rgba(184, 134, 11, 0.15);
  }

  /* 主导航默认隐藏 */
  .navbar-nav {
    position: fixed;
    top: 52px;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1005;
    background: rgba(255, 240, 245, 0.98);
    flex-direction: column;
    overflow-y: auto;
    padding: 8px 0 80px;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    display: flex;
    backdrop-filter: blur(10px);
  }
  .navbar-nav.open {
    transform: translateX(0);
  }

  .navbar-nav .nav-tab {
    display: block;
    width: 100%;
    text-align: left;
    padding: 14px 20px;
    font-size: 1rem;
    border-bottom: 1px solid rgba(184, 134, 11, 0.12);
    border-radius: 0;
    background: none;
    color: var(--text);
    cursor: pointer;
    font-family: var(--font-sans);
    border-top: none;
    border-left: none;
    border-right: none;
  }
  .navbar-nav .nav-tab.active {
    color: var(--accent);
    background: rgba(184, 134, 11, 0.12);
    border-left: 3px solid var(--accent);
  }
  .navbar-nav .nav-tab:hover {
    background: rgba(184, 134, 11, 0.08);
  }

  /* 导航遮罩 */
  .nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    top: 52px;
    z-index: 1000;
    background: rgba(91, 58, 107, 0.3);
  }
  .nav-overlay.show { display: block; }

  /* 顶部右侧按钮 */
  .navbar-right {
    margin-left: auto;
    flex-shrink: 0;
  }
  #btn-logout {
    min-width: 44px;
    min-height: 44px;
    font-size: 1.2rem;
  }

  /* ===== 资源栏：垂直排列 ===== */
  #resource-bar {
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 12px;
  }
  #resource-bar .resource-item {
    flex: 1 1 calc(50% - 6px);
    min-width: 0;
    justify-content: center;
    padding: 6px 4px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    font-size: 0.8rem;
  }
  .res-icon { font-size: 0.8rem; }
  .res-value { font-size: 0.82rem; }

  /* ===== 用户信息栏 ===== */
  #user-info-bar {
    flex-wrap: wrap;
    padding: 6px 12px;
    font-size: 0.82rem;
    gap: 6px;
  }

  /* ===== 主内容区 ===== */
  #main-content { padding: 8px 0; }

  /* ===== 布局：全部堆叠 ===== */
  .layout-two-column {
    flex-direction: column;
    gap: 12px;
  }
  .layout-two-column > .column-side { width: 100%; }
  .layout-three-column { flex-direction: column; gap: 12px; }

  /* ===== 网格：全部单列 ===== */
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  /* ===== 建筑卡片网格 ===== */
  .building-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .building-card { padding: 10px; }
  .building-card-header { flex-wrap: wrap; }

  /* ===== 兵种卡片网格 ===== */
  .unit-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  /* ===== 宝物网格 ===== */
  .items-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  /* ===== 统计卡片 ===== */
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .stat-card { padding: 14px; }

  /* ===== 卡片组件 ===== */
  .card { margin-bottom: 12px; }
  .card-header { padding: 10px 14px; }
  .card-body { padding: 14px; }
  .card-footer { padding: 10px 14px; flex-wrap: wrap; }

  /* ===== 按钮：触控友好 (≥44x44px) ===== */
  .btn {
    padding: 12px 18px;
    font-size: 0.92rem;
    min-height: 44px;
  }
  .btn-small {
    padding: 8px 14px;
    font-size: 0.82rem;
    min-height: 40px;
  }
  .btn-large {
    padding: 14px 24px;
    font-size: 1rem;
    min-height: 48px;
  }
  .btn-icon {
    width: 44px;
    height: 44px;
  }
  .btn-icon.btn-small {
    width: 36px;
    height: 36px;
  }

  /* 表单控件触控优化 */
  .form-input,
  .form-select {
    padding: 12px 14px;
    font-size: 1rem;
    min-height: 44px;
  }
  .form-check input[type="checkbox"],
  .form-check input[type="radio"] {
    width: 22px;
    height: 22px;
  }
  .form-check { font-size: 0.95rem; }

  /* ===== 弹窗：全屏 ===== */
  .modal-overlay {
    align-items: stretch;
  }
  .modal {
    min-width: 0;
    width: 100vw;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
    margin: 0;
  }
  .modal-sm, .modal-md, .modal-lg, .modal-xl {
    width: 100vw;
  }
  .modal-header {
    padding: 14px 16px;
  }
  .modal-body {
    padding: 16px;
  }
  .modal-footer {
    padding: 14px 16px;
    flex-wrap: wrap;
  }
  .modal-close {
    width: 44px;
    height: 44px;
    font-size: 1.5rem;
  }

  /* ===== 地图 Canvas ===== */
  .map-container {
    padding: 8px 0;
    overflow-x: auto;
  }
  .map-container canvas {
    width: 100% !important;
    height: auto !important;
    max-width: 100%;
  }
  .map-controls {
    flex-wrap: wrap;
    gap: 6px;
  }
  .map-controls .btn {
    font-size: 0.85rem;
    padding: 10px 12px;
    min-height: 44px;
  }
  .map-legend {
    gap: 8px;
    padding: 8px;
  }
  .map-legend-item { font-size: 0.75rem; }

  /* ===== 表格：水平滚动 ===== */
  .table-container,
  .admin-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  table { font-size: 0.8rem; }
  thead th { padding: 8px 10px; }
  tbody td { padding: 8px 10px; }

  /* ===== 标签页 ===== */
  .tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 0;
  }
  .tab-item {
    padding: 10px 14px;
    font-size: 0.85rem;
    white-space: nowrap;
  }

  /* ===== 通知 ===== */
  .notification-container {
    top: 56px;
    right: 8px;
    left: 8px;
    max-width: none;
  }
  .notification {
    font-size: 0.85rem;
    padding: 12px 14px;
  }

  /* ===== 下拉菜单 ===== */
  .dropdown-menu {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
    max-height: 50vh;
    overflow-y: auto;
    z-index: 1600;
  }

  /* ===== 底部 ===== */
  #bottom-bar {
    padding: 8px 12px;
    font-size: 0.78rem;
  }

  /* ===== 聊天面板 ===== */
  .chat-panel { min-height: 250px; }
  .chat-input-area { flex-wrap: wrap; }
  .chat-input-area .form-input { flex: 1 1 100%; }
  .chat-input-area .btn { flex-shrink: 0; }

  /* ===== 联盟 ===== */
  .alliance-stats { flex-wrap: wrap; gap: 12px; }
  .alliance-header { flex-wrap: wrap; }
  .alliance-actions { flex-wrap: wrap; }

  /* ===== 邮件 ===== */
  .mail-actions { flex-wrap: wrap; }
  .mail-item-header { flex-wrap: wrap; gap: 6px; }

  /* ===== 战报 ===== */
  .report-filters { flex-direction: column; }
  .combat-overview { flex-direction: column; gap: 8px; }
  .combat-resources { flex-direction: column; gap: 8px; }

  /* ===== 科技树 ===== */
  .tech-tier { gap: 8px; }
  .tech-node { width: 80px; padding: 8px; }
  .tech-node-icon { font-size: 1.2rem; }
  .tech-node-name { font-size: 0.7rem; }

  /* ===== 贸易 ===== */
  .trade-row { flex-wrap: wrap; gap: 8px; }
  .trade-create { flex-wrap: wrap; }

  /* ===== 表单行 ===== */
  .form-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .form-row-label {
    text-align: left;
    padding-top: 0;
  }

  /* ===== 百科 ===== */
  .wiki-tabs { overflow-x: auto; flex-wrap: nowrap; }

  /* ===== 面板头部 ===== */
  .panel-header { flex-direction: column; align-items: flex-start; }

  /* ===== 排行榜 ===== */
  .leaderboard-tabs { flex-wrap: wrap; }
  .my-rank-card { flex-wrap: wrap; gap: 8px; }

  /* ===== 分页 ===== */
  .pagination { flex-wrap: wrap; }
  .admin-pagination {
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
    text-align: center;
  }

  /* ===== 英雄卡片 ===== */
  .hero-card { padding: 12px; }

  /* ===== 工具类覆盖 ===== */
  .flex-between-sm-stack {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  .w-half { width: 100% !important; }

  /* ===== 搜索框全宽 ===== */
  .search-input { width: 100%; }

  /* ===== 详细信息面板 ===== */
  .detail-grid { grid-template-columns: 1fr; }

  /* ===== 导航栏移动端优化 ===== */
  .navbar { height: auto; min-height: 50px; flex-wrap: wrap; padding: 6px 10px; }
  .navbar-inner { flex-wrap: wrap; }
  .navbar-nav { order: 3; width: 100%; overflow-x: auto; padding: 4px 0; }
  .nav-tab { font-size: 0.75rem; padding: 0 8px; height: 30px; border-radius: 8px; }

  /* ===== 网格 ===== */
  .building-grid { grid-template-columns: 1fr; }
  .unit-grid { grid-template-columns: 1fr; }

  /* ===== 主内容 ===== */
  #main-content { padding: 8px; }
}

/* ----------------------------------------------------------
   27. 动画工具类
   ---------------------------------------------------------- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.94);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.03); }
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(184, 134, 11, 0.4);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(184, 134, 11, 0);
  }
}

@keyframes number-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); color: var(--accent); }
  100% { transform: scale(1); }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes breathe {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

/* ---- 萌系新增动画 ---- */

/* 浮动动画 */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* 弹跳动画 */
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  25% { transform: translateY(-10px); }
  50% { transform: translateY(0); }
  75% { transform: translateY(-4px); }
}

/* 星形闪烁动画 */
@keyframes sparkle {
  0%, 100% { opacity: 0.4; transform: scale(0.8) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.2) rotate(180deg); }
}

/* 心跳动画 */
@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  15% { transform: scale(1.15); }
  30% { transform: scale(1); }
  45% { transform: scale(1.1); }
  60% { transform: scale(1); }
}

/* 摇摆动画 */
@keyframes wiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-3deg); }
  75% { transform: rotate(3deg); }
}

/* 弹出动画 */
@keyframes pop-in {
  0% { transform: scale(0); opacity: 0; }
  70% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

/* 柔和发光呼吸 */
@keyframes glow-breathe {
  0%, 100% { box-shadow: 0 0 8px rgba(184, 134, 11, 0.3); }
  50% { box-shadow: 0 0 20px rgba(184, 134, 11, 0.5); }
}

.animate-fade-in {
  animation: fadeIn 0.35s ease;
}

.animate-fade-in-up {
  animation: fadeInUp 0.4s ease;
}

.animate-fade-in-scale {
  animation: fadeInScale 0.3s ease;
}

.animate-pulse {
  animation: pulse 2s infinite;
}

.animate-pulse-glow {
  animation: pulse-glow 2s infinite;
}

.animate-number-pop {
  animation: number-pop 0.4s ease;
}

.animate-slide-left {
  animation: slideInLeft 0.35s ease;
}

.animate-slide-right {
  animation: slideInRight 0.35s ease;
}

.animate-breathe {
  animation: breathe 3s ease-in-out infinite;
}

/* 萌系动画工具类 */
.animate-float {
  animation: float 3s ease-in-out infinite;
}

.animate-bounce {
  animation: bounce 0.8s ease;
}

.animate-sparkle {
  animation: sparkle 2s ease-in-out infinite;
}

.animate-heartbeat {
  animation: heartbeat 1.5s ease-in-out infinite;
}

.animate-wiggle {
  animation: wiggle 0.6s ease-in-out;
}

.animate-pop-in {
  animation: pop-in 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.animate-glow-breathe {
  animation: glow-breathe 2.5s ease-in-out infinite;
}

/* ===== 邮件 Badge 闪烁 ===== */
.nav-badge {
  display: inline-block;
  background: #c44536;
  color: #fff;
  border-radius: 50%;
  min-width: 18px;
  height: 18px;
  line-height: 18px;
  text-align: center;
  font-size: 11px;
  font-weight: bold;
  margin-left: 4px;
  vertical-align: middle;
  transition: transform 0.15s ease;
}

.nav-badge.new-mail {
  animation: mail-blink 0.45s ease 3;
}

@keyframes mail-blink {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: 0.5; }
}

/* 页面切换动画 */
.page-enter {
  animation: fadeInScale 0.3s ease;
}
.page-exit {
  animation: fadeIn 0.2s ease reverse;
}

/* 交错动画延迟 */
.animate-stagger > * {
  opacity: 0;
  animation: fadeInUp 0.4s ease forwards;
}
.animate-stagger > *:nth-child(1) { animation-delay: 0s; }
.animate-stagger > *:nth-child(2) { animation-delay: 0.06s; }
.animate-stagger > *:nth-child(3) { animation-delay: 0.12s; }
.animate-stagger > *:nth-child(4) { animation-delay: 0.18s; }
.animate-stagger > *:nth-child(5) { animation-delay: 0.24s; }
.animate-stagger > *:nth-child(6) { animation-delay: 0.3s; }
.animate-stagger > *:nth-child(7) { animation-delay: 0.36s; }
.animate-stagger > *:nth-child(8) { animation-delay: 0.42s; }
.animate-stagger > *:nth-child(9) { animation-delay: 0.48s; }
.animate-stagger > *:nth-child(10) { animation-delay: 0.54s; }

/* ----------------------------------------------------------
   28. 游戏特有组件
   ---------------------------------------------------------- */

/* 城堡预览 */
.castle-preview {
  text-align: center;
  padding: 20px;
}

.castle-level {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  font-family: var(--font-serif);
}

/* 资源生产速率 */
.production-rate {
  font-size: 0.8rem;
  color: var(--success);
}

.production-rate.negative {
  color: var(--danger);
}

/* 队列项目 */
.queue-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(184, 134, 11, 0.1);
}

.queue-item:last-child {
  border-bottom: none;
}

.queue-item-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--border-radius);
  background: rgba(184, 134, 11, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.queue-item-info {
  flex: 1;
  min-width: 0;
}

.queue-item-name {
  font-size: 0.85rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-item-time {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* 联盟旗帜 */
.alliance-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(184, 134, 11, 0.2);
  border-radius: var(--border-radius);
  backdrop-filter: blur(8px);
}

.alliance-banner-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--border-radius);
  background: rgba(184, 134, 11, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.alliance-banner-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--accent-dark);
}

.alliance-banner-tag {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* 事件面板 */
.event-item {
  padding: 10px 0;
  border-bottom: 1px solid rgba(184, 134, 11, 0.1);
  font-size: 0.85rem;
}

.event-item:last-child {
  border-bottom: none;
}

.event-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.event-type {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 600;
  margin-right: 6px;
}

.event-type.combat {
  background: rgba(255, 168, 165, 0.2);
  color: #e06060;
}

.event-type.diplomacy {
  background: rgba(168, 223, 240, 0.25);
  color: #5b9db8;
}

.event-type.economy {
  background: rgba(168, 230, 207, 0.25);
  color: #4a9e4a;
}

/* 技能图标 */
.skill-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--border-radius);
  border: 2px solid rgba(184, 134, 11, 0.3);
  background: rgba(255, 255, 255, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all var(--transition-speed);
}

.skill-icon:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
  transform: scale(1.1);
}

/* ----------------------------------------------------------
   28.5 用户信息栏
   ---------------------------------------------------------- */
#user-info-bar {
  /* Layout handled by .top-info-bar integration above.
     Keep only child element styling here. */
}

#user-info-bar .user-name {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 600;
}

/* 头像占位圆 */
#user-info-bar .user-name::before {
  content: '';
  display: inline-block;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  border: 2px solid var(--accent-light);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

#user-info-bar .user-prestige {
  color: #a0703c;
  font-weight: 700;
  text-shadow: 0 0 8px rgba(255, 154, 118, 0.3);
  font-family: var(--font-mono);
  letter-spacing: 0.03em;
  font-size: 0.95rem;
}

/* ----------------------------------------------------------
   29. 贸易样式
   ---------------------------------------------------------- */
.trade-form { display: flex; flex-direction: column; gap: 8px; }
.trade-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px; background: rgba(255, 255, 255, 0.5); border-radius: 10px;
  border: 1px solid rgba(184, 134, 11, 0.15);
}
.trade-res-name { font-weight: bold; color: var(--accent-dark); min-width: 50px; text-transform: capitalize; }
.trade-res-amount { color: var(--text); min-width: 150px; }
.trade-price { color: var(--text-muted); min-width: 120px; }
.trade-create { display: flex; gap: 8px; align-items: center; margin-top: 12px; }

/* 宝物样式 */
.items-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.item-card {
  background: rgba(255, 255, 255, 0.65); border: 1px solid var(--border);
  border-radius: 14px; padding: 12px; text-align: center;
  backdrop-filter: blur(6px);
  transition: all var(--transition-speed);
}
.item-card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: var(--shadow-card-hover); }
.item-name { font-weight: bold; color: var(--accent-dark); margin-bottom: 6px; }
.item-stat { display: inline-block; margin: 2px 4px; padding: 2px 8px; background: rgba(184, 134, 11, 0.1); border-radius: 10px; font-size: 0.85rem; }
.item-actions { margin-top: 8px; display: flex; gap: 6px; justify-content: center; }

.hero-items { margin-bottom: 12px; }
.hero-items h4 { color: var(--accent-dark); margin: 0 0 6px; }
.equipped-item {
  display: inline-block; margin: 4px; padding: 4px 10px;
  background: rgba(255, 255, 255, 0.6); border-radius: 8px; font-size: 0.9rem;
  border: 1px solid rgba(184, 134, 11, 0.2);
}

.btn-xs { padding: 1px 6px; font-size: 0.7rem; }

.skill-icon.on-cooldown {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ----------------------------------------------------------
   29. 打印样式
   ---------------------------------------------------------- */
@media print {
  body {
    background: #fff;
    color: #000;
  }

  .navbar,
  .notification-container,
  .modal-overlay {
    display: none !important;
  }

  .main-content {
    padding-top: 0;
  }
}

/* ----------------------------------------------------------
   30. 工具类 (Utilities)
   ---------------------------------------------------------- */

/* 文字颜色 */
.text-muted {
  color: var(--text-muted) !important;
}

.text-accent {
  color: var(--accent) !important;
}

.text-danger {
  color: var(--danger) !important;
}

.text-success {
  color: var(--success) !important;
}

.text-warning {
  color: var(--warning) !important;
}

.text-info {
  color: var(--info) !important;
}

.text-white {
  color: #ffffff !important;
}

/* 文字对齐 */
.text-left { text-align: left !important; }
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }

/* 文字大小 */
.text-sm { font-size: 0.82rem !important; }
.text-xs { font-size: 0.72rem !important; }
.text-lg { font-size: 1.1rem !important; }
.text-xl { font-size: 1.3rem !important; }

/* 文字粗细 */
.font-normal { font-weight: 400 !important; }
.font-medium { font-weight: 500 !important; }
.font-semibold { font-weight: 600 !important; }
.font-bold { font-weight: 700 !important; }

/* 外边距 */
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px !important; }
.mt-2 { margin-top: 16px !important; }
.mt-3 { margin-top: 24px !important; }
.mt-4 { margin-top: 32px !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 8px !important; }
.mb-2 { margin-bottom: 16px !important; }
.mb-3 { margin-bottom: 24px !important; }
.mb-4 { margin-bottom: 32px !important; }

.ml-0 { margin-left: 0 !important; }
.ml-1 { margin-left: 8px !important; }
.ml-2 { margin-left: 16px !important; }
.ml-auto { margin-left: auto !important; }

.mr-0 { margin-right: 0 !important; }
.mr-1 { margin-right: 8px !important; }
.mr-2 { margin-right: 16px !important; }

.mx-auto { margin-left: auto !important; margin-right: auto !important; }

/* 内边距 */
.p-0 { padding: 0 !important; }
.p-1 { padding: 8px !important; }
.p-2 { padding: 16px !important; }
.p-3 { padding: 24px !important; }
.p-4 { padding: 32px !important; }

.px-1 { padding-left: 8px !important; padding-right: 8px !important; }
.px-2 { padding-left: 16px !important; padding-right: 16px !important; }
.px-3 { padding-left: 24px !important; padding-right: 24px !important; }

.py-1 { padding-top: 8px !important; padding-bottom: 8px !important; }
.py-2 { padding-top: 16px !important; padding-bottom: 16px !important; }
.py-3 { padding-top: 24px !important; padding-bottom: 24px !important; }

/* Flexbox */
.flex {
  display: flex !important;
}

.flex-column {
  flex-direction: column !important;
}

.flex-wrap {
  flex-wrap: wrap !important;
}

.flex-1 {
  flex: 1 !important;
}

.flex-between {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}

.flex-center {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.flex-align-center {
  display: flex !important;
  align-items: center !important;
}

.items-start { align-items: flex-start !important; }
.items-end { align-items: flex-end !important; }
.items-center { align-items: center !important; }

.justify-start { justify-content: flex-start !important; }
.justify-end { justify-content: flex-end !important; }
.justify-center { justify-content: center !important; }
.justify-between { justify-content: space-between !important; }

.gap-0 { gap: 0 !important; }
.gap-1 { gap: 8px !important; }
.gap-2 { gap: 16px !important; }
.gap-3 { gap: 24px !important; }

/* 网格 */
.grid {
  display: grid !important;
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr) !important;
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr) !important;
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr) !important;
}

/* 显示/隐藏 */
.hidden {
  display: none !important;
}

.visible {
  visibility: visible !important;
}

.invisible {
  visibility: hidden !important;
}

/* 溢出 */
.overflow-hidden { overflow: hidden !important; }
.overflow-auto { overflow: auto !important; }

/* 宽度 */
.w-full { width: 100% !important; }
.w-auto { width: auto !important; }
.w-half { width: 50% !important; }

/* 截断文本 */
.truncate {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* 不透明度 */
.opacity-50 { opacity: 0.5 !important; }
.opacity-75 { opacity: 0.75 !important; }

/* 圆角 */
.rounded { border-radius: var(--border-radius) !important; }
.rounded-lg { border-radius: var(--border-radius-lg) !important; }
.rounded-full { border-radius: 9999px !important; }

/* 光标 */
.cursor-pointer { cursor: pointer !important; }
.cursor-not-allowed { cursor: not-allowed !important; }

/* 用户选择 */
.select-none { user-select: none !important; }
.select-all { user-select: all !important; }

/* 换行 */
.break-all { word-break: break-all !important; }
.whitespace-nowrap { white-space: nowrap !important; }

/* ============================================================
   战报卡片样式
   ============================================================ */
.report-filters { display: flex; gap: 8px; }
.report-filters select {
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.85rem;
}

.report-timeline { display: flex; flex-direction: column; gap: 8px; }

.report-card {
  background: rgba(255, 255, 255, 0.65);
  border-radius: 14px;
  border: 1px solid var(--border);
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
  backdrop-filter: blur(8px);
}
.report-card.victory { border-left: 4px solid var(--success); }
.report-card.defeat { border-left: 4px solid var(--danger); }
.report-card.neutral { border-left: 4px solid var(--text-muted); }
.report-card:hover { border-color: var(--accent); transform: translateY(-2px); }

.report-card-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; cursor: pointer; user-select: none;
}
.report-card-header:hover { background: rgba(184, 134, 11, 0.06); }
.report-card-left { display: flex; align-items: center; gap: 12px; }
.report-icon { font-size: 1.5rem; }
.report-card-info { display: flex; flex-direction: column; }
.report-card-type { font-weight: bold; color: var(--text); }
.report-card-target { font-size: 0.85rem; color: var(--text-muted); max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.report-card-right { display: flex; align-items: center; gap: 12px; }
.report-card-result { font-weight: bold; font-size: 0.9rem; }
.report-card-result.victory { color: var(--success); }
.report-card-result.defeat { color: var(--danger); }
.report-card-result.neutral { color: var(--text-muted); }
.report-card-time { font-size: 0.8rem; color: var(--text-muted); }

.report-card-detail {
  border-top: 1px solid var(--border);
  padding: 16px;
  background: rgba(255, 240, 245, 0.4);
}

.report-detail-inner { }
.report-detail-time { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 12px; }

/* 战斗概览 */
.combat-overview {
  display: flex; align-items: stretch; gap: 16px;
  margin-bottom: 16px; padding: 12px;
  background: rgba(255, 240, 245, 0.5); border-radius: 12px;
}
.combat-side { flex: 1; }
.combat-side h5 { margin: 0 0 8px; color: var(--accent-dark); }
.combat-vs {
  display: flex; align-items: center;
  font-size: 1.2rem; font-weight: bold; color: var(--accent);
  padding: 0 8px;
}

/* 伤亡进度条 */
.casualty-bar { margin-top: 8px; }
.bar-segments { display: flex; height: 20px; border-radius: 10px; overflow: hidden; }
.bar-dead { background: linear-gradient(90deg, #c44536, #c44536); }
.bar-wounded { background: linear-gradient(90deg, #d4a843, #d4a873); }
.bar-survive { background: linear-gradient(90deg, #6b8e6b, #6b8e6b); }
.bar-labels { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }

/* 战利品 */
.combat-resources { display: flex; gap: 16px; margin-bottom: 12px; }
.loot-section, .loss-section { flex: 1; }
.loot-section h5, .loss-section h5 { margin: 0 0 8px; }
.resource-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.res-badge {
  display: inline-block; padding: 2px 10px;
  background: rgba(255, 255, 255, 0.6); border-radius: 8px;
  font-size: 0.85rem; color: var(--text);
}
.res-badge.loss { color: var(--danger); }
.hero-exp { color: var(--accent); font-weight: bold; }
.equip-recover { color: var(--info); }

/* 侦察详情 */
.scout-detail {
  background: rgba(168, 223, 240, 0.2); padding: 12px;
  border-radius: 10px; border: 1px solid rgba(126, 200, 227, 0.35);
}
.scout-detail h5 { color: var(--info); margin: 0 0 8px; }

/* ============================================================
   联盟样式增强
   ============================================================ */
.alliance-detail-panel { }
.alliance-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.alliance-header h3 { margin: 0; }
.badge-level {
  background: var(--gradient-accent); color: #fff;
  padding: 2px 10px; border-radius: 12px; font-weight: bold; font-size: 0.85rem;
}
.alliance-stats { display: flex; gap: 24px; margin-bottom: 16px; }
.stat-item { display: flex; flex-direction: column; }
.stat-label { font-size: 0.8rem; color: var(--text-muted); }
.stat-value { font-size: 1.1rem; font-weight: bold; color: var(--text); }
.alliance-members { margin-bottom: 16px; }
.alliance-members h4 { color: var(--accent-dark); margin: 0 0 8px; }
.alliance-actions { display: flex; gap: 8px; }

.alliance-create-form { }
.form-group { margin-bottom: 12px; }
.form-group label { display: block; margin-bottom: 4px; color: var(--text-muted); font-size: 0.9rem; }
.resource-cost { display: flex; gap: 12px; flex-wrap: wrap; }
.cost-item { font-size: 0.9rem; color: var(--text); }
.res-icon { }

.alliance-list { display: flex; flex-direction: column; gap: 6px; }
.alliance-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; background: rgba(255, 255, 255, 0.6);
  border-radius: 12px; border: 1px solid var(--border);
  backdrop-filter: blur(6px);
  transition: all var(--transition-speed);
}
.alliance-item:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.alliance-item-info { display: flex; gap: 16px; align-items: center; }
.alliance-item-name { font-weight: bold; color: var(--accent-dark); }
.alliance-item-leader { font-size: 0.85rem; color: var(--text-muted); }
.alliance-item-count { font-size: 0.85rem; color: var(--text); }

tr.highlight { background: rgba(184, 134, 11, 0.15) !important; }

/* ============================================================
   排行榜样式
   ============================================================ */
.leaderboard-tabs { display: flex; gap: 8px; }

.my-rank-card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; margin-bottom: 16px;
  background: linear-gradient(135deg, rgba(184, 134, 11, 0.25), rgba(184, 134, 11, 0.08));
  border: 2px solid var(--accent-light); border-radius: 14px;
  backdrop-filter: blur(8px);
}
.my-rank-badge {
  background: var(--gradient-accent); color: #fff;
  padding: 4px 14px; border-radius: 10px;
  font-weight: bold; font-size: 1.1rem;
}

.leaderboard-table { width: 100%; }
.leaderboard-table th { text-align: left; }
.rank-cell { font-weight: bold; font-size: 1.1rem; width: 80px; }

/* ============================================================
   邮件样式
   ============================================================ */
.mail-actions { display: flex; gap: 8px; }

.mail-list { display: flex; flex-direction: column; gap: 4px; }

.mail-item {
  padding: 12px 16px; background: rgba(255, 255, 255, 0.6);
  border-radius: 12px; border: 1px solid var(--border);
  cursor: pointer; transition: border-color 0.2s, transform 0.2s;
  backdrop-filter: blur(6px);
}
.mail-item:hover { border-color: var(--accent); transform: translateY(-1px); }
.mail-item.unread {
  background: rgba(184, 134, 11, 0.12);
  border-color: rgba(184, 134, 11, 0.35);
}

.mail-item-header {
  display: flex; align-items: center; gap: 10px;
}
.mail-icon { font-size: 1.2rem; }
.mail-title { flex: 1; color: var(--text); }
.mail-title.unread-text { font-weight: bold; color: var(--accent-dark); }
.mail-time { font-size: 0.8rem; color: var(--text-muted); }
.mail-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
}

.mail-detail {
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid var(--border);
}
.mail-content {
  color: var(--text); line-height: 1.6;
  white-space: pre-wrap; word-break: break-word;
}
.mail-detail-actions { margin-top: 10px; display: flex; gap: 8px; }

/* ============================================================
   战斗卡片样式（增强）
   ============================================================ */
/* (combat-overview, casualty-bar 等已在上面定义) */

/* ============================================================
   空状态
   ============================================================ */
.empty-state {
  text-align: center; padding: 40px 20px;
}
.empty-state p { margin: 8px 0; }

/* ============================================================
   面板头部
   ============================================================ */
.panel-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px; flex-wrap: wrap; gap: 8px;
}
.panel-header h3 { margin: 0; }

/* ============================================================
   百科/图鉴样式
   ============================================================ */
.wiki-tabs {
  display: flex; gap: 6px; flex-wrap: wrap;
  margin-bottom: 16px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.wiki-dao-filter {
  display: flex; gap: 4px; flex-wrap: wrap; align-items: center;
  margin-bottom: 16px; padding: 10px 12px;
  background: rgba(255, 255, 255, 0.5); border-radius: 10px;
  border: 1px solid var(--border);
}

.wiki-section { margin-bottom: 24px; }
.wiki-section h3 { color: var(--accent-dark); margin: 0 0 4px; }
.wiki-section .text-muted { margin-bottom: 12px; }

.wiki-table { width: 100%; font-size: 0.85rem; }
.wiki-table th {
  background: rgba(184, 134, 11, 0.15); color: var(--accent-dark);
  padding: 8px 10px; text-align: left; white-space: nowrap;
  border-radius: 8px 8px 0 0;
}
.wiki-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.wiki-table tr:hover td { background: rgba(184, 134, 11, 0.06); }
.wiki-table td:first-child { white-space: nowrap; }

.guide-block {
  margin-bottom: 20px; padding: 16px;
  background: rgba(255, 255, 255, 0.6); border-radius: 14px;
  border: 1px solid var(--border);
  backdrop-filter: blur(6px);
}
.guide-block h4 { color: var(--accent-dark); margin: 0 0 10px; font-size: 1.05rem; }
.guide-block ol, .guide-block ul { padding-left: 20px; }
.guide-block li { margin-bottom: 6px; line-height: 1.6; }

/* 建筑卡片网格（用于 renderBuildings） */
.building-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}
.building-card {
  background: rgba(255, 255, 255, 0.65); border: 1px solid var(--border);
  border-radius: 14px; padding: 12px;
  transition: all 0.25s ease;
  backdrop-filter: blur(8px);
  position: relative; overflow: hidden;
}
.building-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
}
.building-card.built { border-left: 4px solid var(--success); }
.building-card.locked { opacity: 0.6; }
.building-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-light), transparent);
  opacity: 0.5;
}
.building-card.built::before {
  background: linear-gradient(90deg, var(--success), var(--accent), var(--accent-light));
  opacity: 0.8;
}
.building-card-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.building-name {
  font-weight: bold; color: var(--text);
  display: flex; align-items: center; gap: 6px;
  font-size: 1.05rem;
}
.building-name .emoji { font-size: 1.2rem; }
.building-level { font-size: 0.85rem; color: var(--text-muted); }
.building-effects {
  display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px;
}
.effect-item {
  display: inline-block; padding: 2px 8px;
  background: rgba(184, 134, 11, 0.15); border-radius: 10px;
  font-size: 0.78rem; color: var(--accent-dark);
}
.building-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.build-cost { font-size: 0.8rem; color: var(--text-muted); }

.queue-item {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px; background: rgba(255, 255, 255, 0.5);
  border-radius: 10px; margin-bottom: 4px;
}

/* ============================================================
   兵种卡片样式增强
   ============================================================ */
.unit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.unit-card {
  background: rgba(255, 255, 255, 0.65); border: 1px solid var(--border);
  border-radius: 16px; padding: 14px;
  transition: all 0.25s ease; position: relative;
  overflow: hidden;
  backdrop-filter: blur(8px);
}
.unit-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
}
.unit-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  opacity: 0.6;
  border-radius: 16px 16px 0 0;
}
.unit-name {
  font-size: 1.1rem; font-weight: bold;
  color: var(--text); margin-bottom: 6px;
  display: flex; align-items: center; gap: 6px;
}
.unit-name .emoji { font-size: 1.3rem; }
.unit-count {
  font-size: 0.9rem; color: var(--accent);
  font-weight: bold; margin-bottom: 8px;
}
.unit-stats {
  display: flex; gap: 10px; flex-wrap: wrap;
  font-size: 0.8rem; color: var(--text-muted);
  margin-bottom: 8px; padding: 6px;
  background: rgba(255, 240, 245, 0.5); border-radius: 10px;
}
.unit-stat-item {
  display: flex; align-items: center; gap: 3px;
}
.unit-stat-label { color: var(--text-muted); }
.unit-stat-value { color: var(--accent-dark); font-weight: bold; }
.unit-meta {
  font-size: 0.78rem; color: var(--text-muted);
  margin-bottom: 6px;
}
.unit-equipment, .unit-reqs, .unit-cost, .unit-eqcost, .unit-time {
  font-size: 0.78rem; margin-bottom: 4px;
}
.unit-equipment { color: var(--info); }
.unit-reqs { color: var(--warning); }
.unit-cost { color: var(--text-muted); }
.unit-eqcost { color: var(--text-muted); }
.unit-time { color: var(--accent); }

/* 兵种分类标题 */
.unit-category-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 1.2rem; color: var(--accent-dark);
  margin-bottom: 12px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.unit-category-icon { font-size: 1.4rem; }

/* 资源栏增强 — layout handled by .top-info-bar integration above */
#resource-bar {
  /* Keep only child element overrides here. Layout is in the .top-info-bar section. */
  gap: 14px;
}
.res-item {
  display: flex; align-items: center; gap: 7px;
  font-size: 0.9rem;
  padding: 5px 12px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius);
  transition: all var(--transition-speed);
  backdrop-filter: blur(6px);
}
.res-item:hover {
  border-color: var(--accent-light);
  background: rgba(255, 255, 255, 0.75);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.res-item .emoji { font-size: 1.2rem; }
.res-item .res-name { color: var(--text-muted); font-size: 0.82rem; }
.res-item .res-value {
  color: var(--accent-dark);
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
  transition: color 0.3s;
}
.res-item .res-rate {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-family: var(--font-mono);
}

/* ============================================================
   新手引导系统样式
   ============================================================ */

/* 引导激活时禁止页面滚动和交互 */
body.guide-active {
  overflow: hidden;
}

/* 引导遮罩层容器 */
.guide-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  pointer-events: none;
}

/* 4 个遮罩片段 */
.guide-overlay-part {
  position: fixed;
  background: rgba(91, 58, 107, 0.45);
  pointer-events: all;
  transition: all 0.3s ease;
}

/* 高亮边框 */
.guide-highlight-box {
  position: fixed;
  z-index: 10000;
  pointer-events: none;
  border: 2px solid var(--accent);
  border-radius: 14px;
  box-shadow: 0 0 0 4px rgba(184, 134, 11, 0.3),
              0 0 20px rgba(184, 134, 11, 0.5);
  animation: guide-pulse 2s ease-in-out infinite;
  transition: all 0.3s ease;
}

@keyframes guide-pulse {
  0%, 100% {
    box-shadow: 0 0 0 4px rgba(184, 134, 11, 0.3),
                0 0 20px rgba(184, 134, 11, 0.5);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(184, 134, 11, 0.5),
                0 0 30px rgba(184, 134, 11, 0.7);
  }
}

/* 高亮目标元素 */
.guide-highlight-target {
  position: relative;
  z-index: 10002 !important;
  box-shadow: 0 0 0 3px rgba(184, 134, 11, 0.6) !important;
}

/* 提示气泡 */
.guide-tooltip {
  position: fixed;
  z-index: 10001;
  width: 320px;
  max-width: 90vw;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 240, 245, 0.95) 100%);
  border: 2px solid var(--accent-light);
  border-radius: var(--border-radius-xl);
  box-shadow: var(--shadow-lg), 0 0 30px rgba(184, 134, 11, 0.25);
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.6;
  animation: guide-tooltip-in 0.3s ease;
  transition: all 0.3s ease;
  backdrop-filter: blur(12px);
}

@keyframes guide-tooltip-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* 气泡箭头 */
.guide-tooltip::after {
  content: '';
  position: absolute;
  width: 0;
  height: 0;
  border: 10px solid transparent;
}

.guide-tooltip-arrow-top::after {
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-bottom-color: var(--accent-light);
}

.guide-tooltip-arrow-bottom::after {
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-top-color: var(--accent-light);
}

.guide-tooltip-arrow-left::after {
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  border-right-color: var(--accent-light);
}

.guide-tooltip-arrow-right::after {
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  border-left-color: var(--accent-light);
}

/* 气泡头部 */
.guide-tooltip-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 0;
}

.guide-step-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 24px;
  padding: 0 10px;
  background: var(--gradient-accent);
  color: #fff;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: bold;
  flex-shrink: 0;
}

.guide-tooltip-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: bold;
  color: var(--accent-dark);
}

/* 气泡正文 */
.guide-tooltip-body {
  padding: 10px 16px;
}

.guide-tooltip-body p {
  margin: 0;
  color: var(--text);
}

/* 气泡底部按钮 */
.guide-tooltip-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 16px 14px;
  border-top: 1px solid var(--border);
}

.guide-btn {
  padding: 6px 18px;
  border: 1px solid transparent;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 0.85rem;
  font-family: var(--font-sans);
  transition: all var(--transition-speed);
}

.guide-btn-skip {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}

.guide-btn-skip:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.guide-btn-next {
  background: var(--gradient-accent);
  color: #fff;
  font-weight: bold;
}

.guide-btn-next:hover {
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}

/* 新手指南按钮样式 */
.guide-replay-section {
  margin-top: 12px;
}

.btn-guide-replay {
  background: var(--gradient-accent);
  color: #fff;
  font-weight: bold;
  border: none;
  padding: 8px 20px;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all var(--transition-speed);
}

.btn-guide-replay:hover {
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

/* ==========================================================
   战斗回合明细样式
   ========================================================== */
.combat-rounds {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(184, 134, 11, 0.25);
}

.rounds-title {
  font-size: 1rem;
  color: var(--accent-dark);
  margin-bottom: 16px;
  text-align: center;
  letter-spacing: 0.05em;
}

.rounds-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.round-card {
  position: relative;
}

.round-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: rgba(184, 134, 11, 0.12);
  border-radius: 10px 10px 0 0;
  border: 1px solid rgba(184, 134, 11, 0.2);
  border-bottom: none;
}

.round-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 24px;
  background: var(--gradient-accent);
  color: #fff;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.round-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.round-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: rgba(184, 134, 11, 0.15);
  border: 1px solid rgba(184, 134, 11, 0.2);
  border-top: none;
  border-radius: 0 0 10px 10px;
  overflow: hidden;
}

.round-side {
  padding: 12px;
  background: rgba(255, 255, 255, 0.6);
}

.round-side.attacker {
  border-right: 1px solid rgba(184, 134, 11, 0.15);
}

.round-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.round-troops {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.troop-count {
  font-size: 0.85rem;
  color: var(--text);
}

.troop-loss {
  font-size: 0.78rem;
  color: #e74c3c;
  font-weight: 600;
}

.round-damage {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.round-events {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.round-event-tag {
  display: inline-block;
  font-size: 0.7rem;
  padding: 2px 10px;
  border-radius: 10px;
  line-height: 1.5;
}

.round-divider {
  text-align: center;
  padding: 2px 0;
  color: rgba(184, 134, 11, 0.4);
  font-size: 0.7rem;
}

@media (max-width: 768px) {
  .round-body {
    grid-template-columns: 1fr;
  }
  .round-side.attacker {
    border-right: none;
    border-bottom: 1px solid rgba(184, 134, 11, 0.15);
  }
}

/* ============================================================
   蛊虫图鉴 (Gu Worm Encyclopedia) 样式
   ============================================================ */

/* 蛊虫卡片 */
.gu-card {
  transition: all 0.2s ease;
  cursor: default;
}
.gu-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.gu-card.owned {
  border-color: #4caf50 !important;
}
.gu-card.locked {
  filter: grayscale(0.5);
}

/* 流派筛选按钮 */
.dao-filter-btn,
.realm-filter-btn {
  transition: all 0.15s ease;
}
.dao-filter-btn:hover,
.realm-filter-btn:hover {
  border-color: #e0c068 !important;
  color: #e0c068 !important;
}
.dao-filter-btn.active,
.realm-filter-btn.active {
  background: #e0c068 !important;
  color: #000 !important;
  border-color: #e0c068 !important;
  font-weight: bold;
}

/* 蛊虫网格 */
.gu-worm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}

/* 流派面板 */
.dao-group-panel {
  margin-bottom: 15px;
}

/* 转数标题 */
.realm-header {
  font-size: 14px;
  font-weight: bold;
  color: #e0c068;
  border-bottom: 1px solid #333;
  padding-bottom: 4px;
  margin: 10px 0 6px;
}

/* 概览面板 */
.gu-overview {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .gu-worm-grid {
    grid-template-columns: 1fr;
  }
  .dao-filter-bar,
  .realm-filter-bar {
    gap: 4px;
  }
  .dao-filter-btn,
  .realm-filter-btn {
    font-size: 11px;
    padding: 3px 7px !important;
  }
}
