/* ============================================================
   明日方舟·卫戍协议 样式体系 (Dark Tech / Tactical Theme)
   ============================================================ */

:root {
  --bg-darker: #0d0f14;
  --bg-dark: #12161f;
  --bg-card: #181d28;
  --bg-card-hover: #1f2533;
  --bg-elevated: #242c3d;
  
  --primary: #f5a623;        /* 舟味警戒黄 */
  --primary-hover: #ffb833;
  --primary-subtle: rgba(245, 166, 35, 0.15);
  --cyan: #00e5ff;           /* 战术青 */
  --cyan-subtle: rgba(0, 229, 255, 0.12);
  --danger: #ff3b30;         /* Ban 位警示红 */
  --danger-hover: #ff5247;
  --danger-subtle: rgba(255, 59, 48, 0.15);
  --success: #34c759;        /* 完好绿 */
  
  --text-main: #f0f4f8;
  --text-muted: #8b9bb4;
  --text-dim: #5c6b82;
  
  --border-light: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --border-accent: rgba(245, 166, 35, 0.4);
  
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 15px rgba(245, 166, 35, 0.25);
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

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

body {
  background-color: var(--bg-darker);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

/* 顶部导航 */
.app-header {
  background: rgba(18, 22, 31, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
}

.rhodes-logo {
  display: flex;
  align-items: center;
  background: var(--primary);
  color: #000;
  font-weight: 900;
  font-size: 0.85rem;
  letter-spacing: 1px;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  box-shadow: 0 0 12px rgba(245, 166, 35, 0.4);
}

.brand-text .app-title {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--text-main);
  line-height: 1.2;
}

.brand-text .app-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.badge-version {
  background: var(--cyan-subtle);
  color: var(--cyan);
  border: 1px solid rgba(0, 229, 255, 0.3);
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

/* 导航标签切换 */
.nav-tabs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-dark);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}

.nav-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
  color: #000;
  background: var(--primary);
  box-shadow: 0 2px 8px rgba(245, 166, 35, 0.3);
}

.tab-badge {
  background: rgba(0, 0, 0, 0.25);
  color: inherit;
  font-size: 0.75rem;
  padding: 0.1rem 0.45rem;
  border-radius: 99px;
  font-family: var(--font-mono);
}

.nav-tab.active .tab-badge {
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
}

/* 通用按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.btn-primary {
  background: var(--primary);
  color: #000;
}
.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: var(--shadow-glow);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border-light);
}
.btn-ghost:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-strong);
}

.btn-danger {
  background: var(--danger-subtle);
  color: var(--danger);
  border-color: rgba(255, 59, 48, 0.3);
}
.btn-danger:hover {
  background: var(--danger);
  color: #fff;
}

.btn-sm {
  font-size: 0.75rem;
  padding: 0.3rem 0.65rem;
}

.icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
}
.icon-sm {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* 主体容器 */
.main-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 1.25rem;
}

.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
}

/* ============================================================
   TAB 1: BAN 位托盘
   ============================================================ */
.ban-tray-wrapper {
  margin-bottom: 1.25rem;
}

.ban-tray {
  background: linear-gradient(180deg, #1d1717 0%, var(--bg-card) 100%);
  border: 1px solid rgba(255, 59, 48, 0.35);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.1rem;
  box-shadow: 0 4px 16px rgba(255, 59, 48, 0.08);
}

.ban-tray-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.ban-count.secondary {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-muted);
}

.ban-covenants-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.ban-cov-pill {
  background: rgba(255, 59, 48, 0.22);
  border: 1px solid var(--danger);
  color: #fff;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(255, 59, 48, 0.2);
  transition: all 0.2s ease;
}

.ban-cov-pill:hover {
  background: var(--danger);
  transform: translateY(-1px);
}

.ban-cov-pill .cov-pill-img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.ban-cov-pill .cov-pill-del {
  font-size: 1.1rem;
  line-height: 1;
  color: #ffb4af;
  margin-left: 0.2rem;
}

.covenant-item.is-banned {
  border-color: rgba(255, 59, 48, 0.75);
  background: rgba(50, 15, 15, 0.7);
  box-shadow: inset 0 0 12px rgba(255, 59, 48, 0.15);
}

.covenant-item.is-banned .covenant-name {
  color: #ff7d75;
  text-decoration: line-through;
}

.btn-cov-ban {
  background: rgba(255, 59, 48, 0.12);
  border: 1px solid rgba(255, 59, 48, 0.35);
  color: #ff7d75;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.btn-cov-ban:hover {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

.covenant-item.is-banned .btn-cov-ban {
  background: var(--danger);
  color: #fff;
  box-shadow: 0 0 8px rgba(255, 59, 48, 0.6);
}

.sub-cov-badge.is-banned {
  border-color: rgba(255, 59, 48, 0.6);
  background: rgba(45, 15, 15, 0.75);
  color: #ff857f;
}

.sub-cov-ban-toggle {
  background: none;
  border: none;
  color: #ff5247;
  font-size: 0.85rem;
  font-weight: bold;
  padding: 0 0.2rem;
  cursor: pointer;
  line-height: 1;
}

.ban-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 8px var(--danger);
  animation: pulse-danger 2s infinite ease-in-out;
}

@keyframes pulse-danger {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.ban-count {
  background: var(--danger);
  color: #fff;
  font-size: 0.75rem;
  padding: 0.1rem 0.5rem;
  border-radius: 99px;
  font-family: var(--font-mono);
}

.ban-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  min-height: 48px;
  align-items: center;
}

.ban-placeholder {
  color: var(--text-dim);
  font-size: 0.82rem;
  font-style: italic;
  padding: 0.5rem 0;
}

.ban-chip {
  background: rgba(255, 59, 48, 0.15);
  border: 1px solid rgba(255, 59, 48, 0.4);
  color: var(--text-main);
  padding: 0.25rem 0.5rem 0.25rem 0.3rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ban-chip:hover {
  background: rgba(255, 59, 48, 0.3);
  border-color: var(--danger);
  transform: translateY(-1px);
}

.ban-chip-avatar {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.ban-chip-del {
  color: #ff736a;
  font-size: 1.1rem;
  font-weight: bold;
  line-height: 1;
  padding-left: 0.2rem;
}

/* ============================================================
   双栏布局：盟约态势 + 干员网格
   ============================================================ */
.simulation-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 1.25rem;
  align-items: start;
}

/* 左侧栏 */
.covenant-sidebar {
  position: sticky;
  top: 75px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sidebar-block {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-light);
}

.block-title {
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--primary);
}

.block-hint {
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* 核心盟约态势列表 */
.covenant-card-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.covenant-item {
  background: var(--bg-dark);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.covenant-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
}

.covenant-item.active {
  border-color: var(--primary);
  background: var(--primary-subtle);
}

.covenant-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.covenant-item-name-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.covenant-icon {
  width: 22px;
  height: 22px;
  border-radius: 3px;
  object-fit: contain;
}

.covenant-name {
  font-size: 0.9rem;
  font-weight: 700;
}

.covenant-status-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.1rem 0.45rem;
  border-radius: 3px;
  font-family: var(--font-mono);
}

.status-intact {
  background: rgba(52, 199, 89, 0.15);
  color: var(--success);
  border: 1px solid rgba(52, 199, 89, 0.3);
}

.status-warn {
  background: rgba(245, 166, 35, 0.15);
  color: var(--primary);
  border: 1px solid rgba(245, 166, 35, 0.3);
}

.status-damaged {
  background: rgba(255, 59, 48, 0.15);
  color: var(--danger);
  border: 1px solid rgba(255, 59, 48, 0.3);
}

/* 进度条与人数提示 */
.covenant-progress-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 0.35rem;
}

.covenant-progress-fill {
  height: 100%;
  background: var(--primary);
  transition: width 0.3s ease, background-color 0.3s ease;
}

.covenant-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* 附加盟约网格 */
.covenant-badge-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.45rem;
  max-height: 260px;
  overflow-y: auto;
}

.sub-cov-badge {
  background: var(--bg-dark);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sub-cov-badge:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
}

.sub-cov-badge.active {
  border-color: var(--cyan);
  background: var(--cyan-subtle);
  color: var(--cyan);
}

.sub-cov-info {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.sub-cov-name {
  font-weight: 600;
}

.sub-cov-count {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--text-dim);
}

/* ============================================================
   当局可用阵容实时速览栏 (Live Matched Lineups Bar)
   ============================================================ */
.live-matched-lineups-panel {
  background: linear-gradient(180deg, rgba(20, 35, 25, 0.7) 0%, var(--bg-card) 100%);
  border: 1px solid rgba(52, 199, 89, 0.4);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  margin-bottom: 1.1rem;
  box-shadow: 0 4px 16px rgba(52, 199, 89, 0.08);
}

.live-lineups-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.live-lineups-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: #72ec8f;
}

.pulse-green-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
  animation: pulse-green 2s infinite ease-in-out;
}

@keyframes pulse-green {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.badge-intact {
  background: var(--success);
  color: #000;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.1rem 0.5rem;
  border-radius: 99px;
  font-family: var(--font-mono);
}

.intact-lineups-preview {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.intact-preview-card {
  flex: 0 0 auto;
  min-width: 260px;
  background: var(--bg-dark);
  border: 1px solid rgba(52, 199, 89, 0.35);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.intact-preview-card:hover {
  border-color: var(--success);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(52, 199, 89, 0.2);
}

.intact-preview-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.intact-preview-ops {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.intact-preview-op-img {
  width: 28px;
  height: 28px;
  border-radius: 3px;
  object-fit: cover;
  border: 1px solid var(--border-light);
}

.intact-empty-tip {
  color: var(--text-dim);
  font-size: 0.82rem;
  padding: 0.4rem 0;
  font-style: italic;
}

.lineup-status-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--font-mono);
}
.lineup-status-intact {
  background: rgba(52, 199, 89, 0.15);
  color: var(--success);
  border: 1px solid rgba(52, 199, 89, 0.4);
}
.lineup-status-warn {
  background: rgba(245, 166, 35, 0.15);
  color: var(--primary);
  border: 1px solid rgba(245, 166, 35, 0.4);
}
.lineup-status-banned {
  background: rgba(255, 59, 48, 0.18);
  color: var(--danger);
  border: 1px solid rgba(255, 59, 48, 0.4);
}

.filter-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  margin-bottom: 1.1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-light);
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 240px;
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  fill: var(--text-dim);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  background: var(--bg-dark);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.85rem;
  padding: 0.5rem 2rem 0.5rem 2.2rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary-subtle);
}

.clear-search-btn {
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.segmented-control {
  display: inline-flex;
  background: var(--bg-dark);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.seg-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.seg-btn:hover {
  color: var(--text-main);
}

.seg-btn.active {
  background: var(--bg-elevated);
  color: var(--text-main);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.active-covenant-pill {
  background: var(--primary-subtle);
  border: 1px solid var(--border-accent);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 99px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.active-covenant-pill button {
  background: none;
  border: none;
  color: inherit;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

/* 干员网格 */
.operators-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(138px, 1fr));
  gap: 0.75rem;
}

/* 干员卡片 */
.operator-card {
  position: relative;
  background: var(--bg-dark);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  display: flex;
  flex-direction: column;
}

.operator-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.operator-avatar-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #000;
  overflow: hidden;
}

.operator-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease, filter 0.3s ease;
}

.operator-card:hover .operator-avatar {
  transform: scale(1.05);
}

/* Ban 状态覆层 */
.operator-card.banned {
  border-color: rgba(255, 59, 48, 0.6);
  background: rgba(40, 15, 15, 0.8);
}

.operator-card.banned .operator-avatar {
  filter: grayscale(85%) contrast(1.1) brightness(0.6);
}

.ban-badge-overlay {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(255, 59, 48, 0.3);
}

.operator-card.banned .ban-badge-overlay {
  display: flex;
}

.ban-stamp {
  border: 2px solid var(--danger);
  color: #fff;
  background: rgba(255, 59, 48, 0.85);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 1.5px;
  padding: 0.2rem 0.5rem;
  transform: rotate(-12deg);
  border-radius: 2px;
  box-shadow: 0 0 10px rgba(255, 59, 48, 0.6);
}

/* 卡片信息 */
.operator-info {
  padding: 0.45rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.operator-name {
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.operator-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.tag-cov {
  font-size: 0.68rem;
  padding: 0.05rem 0.3rem;
  border-radius: 2px;
  font-weight: 600;
  white-space: nowrap;
}

.tag-core {
  background: var(--primary-subtle);
  color: var(--primary);
  border: 1px solid rgba(245, 166, 35, 0.3);
}

.tag-sub {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border: 1px solid var(--border-light);
}

/* ============================================================
   TAB 2: 社区阵容库
   ============================================================ */
.lineups-header-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  background: var(--bg-card);
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}

.lineups-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.custom-select {
  background: var(--bg-dark);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  outline: none;
}

.custom-select:focus {
  border-color: var(--primary);
}

.lineups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 1.1rem;
}

.lineup-card.is-fatal-banned {
  border-color: rgba(255, 59, 48, 0.6);
  background: linear-gradient(180deg, rgba(45, 15, 15, 0.75) 0%, var(--bg-card) 100%);
}

.tag-cov.tag-banned {
  background: rgba(255, 59, 48, 0.25) !important;
  color: #ff7d75 !important;
  border-color: var(--danger) !important;
  text-decoration: line-through;
}

.lineup-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.lineup-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.lineup-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}

.lineup-author {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.2rem;
}

.btn-like {
  background: var(--bg-dark);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 0.35rem 0.75rem;
  border-radius: 99px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-like:hover {
  color: #ff3b30;
  border-color: rgba(255, 59, 48, 0.4);
}

.btn-like.liked {
  color: #ff3b30;
  background: rgba(255, 59, 48, 0.12);
  border-color: rgba(255, 59, 48, 0.3);
}

.lineup-covenants-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}

/* 阵容干员卡片联动 Ban 状态 */
.lineup-operators-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
  background: var(--bg-dark);
  padding: 0.5rem;
  border-radius: var(--radius-sm);
}

.lineup-op-thumb {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #000;
  border: 1px solid var(--border-light);
}

.lineup-op-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lineup-op-thumb.is-banned {
  border-color: var(--danger);
}
.lineup-op-thumb.is-banned img {
  filter: grayscale(90%) contrast(1.2) brightness(0.5);
}
.lineup-op-thumb.is-banned::after {
  content: "✕";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--danger);
  font-weight: bold;
  font-size: 1.1rem;
  background: rgba(255, 59, 48, 0.35);
}

.lineup-ban-warning {
  background: rgba(255, 59, 48, 0.15);
  border: 1px solid rgba(255, 59, 48, 0.3);
  color: #ff857f;
  font-size: 0.75rem;
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.lineup-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.lineup-tips-box {
  background: rgba(245, 166, 35, 0.08);
  border-left: 2px solid var(--primary);
  padding: 0.4rem 0.65rem;
  font-size: 0.78rem;
  color: #e6c888;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ============================================================
   TAB 3: 开局策略
   ============================================================ */
.strategies-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  background: var(--bg-card);
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}

.hint-text {
  font-size: 0.82rem;
  color: var(--text-dim);
}

.strategies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1rem;
}

.strategy-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.strategy-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.strategy-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
}

.strategy-issuer {
  font-size: 0.75rem;
  color: var(--cyan);
  background: var(--cyan-subtle);
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0, 229, 255, 0.2);
}

.strategy-meta {
  display: flex;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.strategy-effect {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  background: var(--bg-dark);
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
}

/* ============================================================
   模态弹窗：上传阵容表单
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.open {
  display: flex;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-md);
  animation: modal-pop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-pop {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid var(--border-light);
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary);
}

.modal-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.modal-form {
  padding: 1.25rem 1.4rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-row {
  display: flex;
  gap: 1rem;
}
.flex-1 { flex: 1; }
.flex-2 { flex: 2; }

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}
.form-label.required::after {
  content: " *";
  color: var(--danger);
}

.form-input, .form-textarea {
  background: var(--bg-dark);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 0.55rem 0.75rem;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s ease;
  font-family: inherit;
}

.form-input:focus, .form-textarea:focus {
  border-color: var(--primary);
}

.form-input-sm {
  background: var(--bg-dark);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 0.35rem 0.6rem;
  font-size: 0.78rem;
  outline: none;
  width: 100%;
  margin-bottom: 0.4rem;
}

.selected-ops-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  background: var(--bg-dark);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  min-height: 48px;
  align-items: center;
}

.empty-hint {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.picker-scroll-box {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  max-height: 140px;
  overflow-y: auto;
  background: var(--bg-dark);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.45rem;
}

.picker-op-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  font-size: 0.75rem;
  cursor: pointer;
}
.picker-op-btn:hover {
  background: var(--primary);
  color: #000;
}
.picker-op-btn.selected {
  background: var(--cyan);
  color: #000;
  border-color: var(--cyan);
}

.tag-selector-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  max-height: 110px;
  overflow-y: auto;
  background: var(--bg-dark);
  padding: 0.4rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}

.selector-tag {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  font-size: 0.72rem;
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
  cursor: pointer;
  user-select: none;
}

.selector-tag.active {
  background: var(--primary-subtle);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: bold;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

/* 轻量 Toast 提示 */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(50px);
  background: var(--bg-elevated);
  border: 1px solid var(--border-accent);
  color: var(--text-main);
  padding: 0.6rem 1.4rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  font-size: 0.88rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 2000;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ============================================================
   响应式断点适配 (Mobile / Tablet)
   ============================================================ */
@media (max-width: 960px) {
  .header-container {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  
  .nav-tabs {
    justify-content: space-around;
  }
  
  .header-actions {
    display: flex;
    justify-content: flex-end;
  }

  .simulation-layout {
    grid-template-columns: 1fr;
  }

  .covenant-sidebar {
    position: static;
  }

  .covenant-card-list {
    max-height: 280px;
  }

  .operators-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  }

  .form-row {
    flex-direction: column;
  }
}
