/* ============== 全局样式 ============== */
:root {
  --tm-primary: #6366f1;
  --tm-primary-hover: #4f46e5;
  --tm-bg: #0f172a;
  --tm-bg-soft: #1e293b;
  --tm-card-bg: rgba(255, 255, 255, 0.05);
  --tm-card-border: rgba(255, 255, 255, 0.1);
  --tm-text: #e2e8f0;
  --tm-text-muted: #94a3b8;
  --tm-success: #10b981;
  --tm-warning: #f59e0b;
  --tm-danger: #ef4444;
  --tm-info: #06b6d4;
}

[data-theme="light"] {
  --tm-primary: #4f46e5;
  --tm-primary-hover: #4338ca;
  --tm-bg: #e6ebf5;
  --tm-bg-soft: #d8e0ee;
  --tm-card-bg: rgba(255, 255, 255, 0.94);
  --tm-card-border: rgba(15, 23, 42, 0.18);
  --tm-text: #0f172a;
  --tm-text-muted: #334155;
  --tm-success: #059669;
  --tm-warning: #d97706;
  --tm-danger: #dc2626;
  --tm-info: #0891b2;
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: var(--tm-text);
  background:
    radial-gradient(at 20% 0%, rgba(99, 102, 241, 0.25) 0px, transparent 50%),
    radial-gradient(at 80% 100%, rgba(6, 182, 212, 0.18) 0px, transparent 50%),
    var(--tm-bg);
  background-attachment: fixed;
  min-height: 100vh;
}

[data-theme="light"] body,
[data-theme="light"] #app {
  background:
    radial-gradient(at 20% 0%, rgba(99, 102, 241, 0.10) 0px, transparent 50%),
    radial-gradient(at 80% 100%, rgba(6, 182, 212, 0.08) 0px, transparent 50%),
    var(--tm-bg);
}

a {
  color: var(--tm-primary);
  text-decoration: none;
}

/* ============== 登录页 ============== */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  padding-bottom: 56px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(20px);
  border: 1px solid var(--tm-card-border);
  border-radius: 20px;
  padding: 40px 36px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.login-logo {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo h1 {
  font-size: 28px;
  margin: 8px 0 4px;
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 700;
}

.login-logo p {
  color: var(--tm-text-muted);
  font-size: 13px;
  margin: 0;
}

.login-form .el-input__wrapper {
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

.login-form .el-input__inner {
  color: var(--tm-text);
}

.login-tip {
  text-align: center;
  color: var(--tm-text-muted);
  font-size: 12px;
  margin-top: 16px;
}


.tm-secondary-btn {
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  color: #e2e8f0 !important;
}

.tm-secondary-btn:hover {
  background: rgba(99, 102, 241, 0.14) !important;
  border-color: rgba(99, 102, 241, 0.5) !important;
  color: #ffffff !important;
}

[data-theme="light"] .tm-secondary-btn {
  background: rgba(15, 23, 42, 0.04) !important;
  border: 1px solid rgba(15, 23, 42, 0.16) !important;
  color: var(--tm-text) !important;
}

[data-theme="light"] .tm-secondary-btn:hover {
  background: rgba(79, 70, 229, 0.10) !important;
  border-color: rgba(79, 70, 229, 0.45) !important;
  color: #312e81 !important;
}
/* ============== 布局 ============== */
.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 230px;
  flex-shrink: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(16px);
  border-right: 1px solid var(--tm-card-border);
  padding: 24px 0;
  display: flex;
  flex-direction: column;
}

.sidebar-logo {
  padding: 0 24px 24px;
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.sidebar .el-menu {
  background: transparent;
  border: none;
  flex: 1;
}

.sidebar .el-menu-item {
  color: var(--tm-text-muted);
  margin: 4px 12px;
  border-radius: 10px;
}

.sidebar .el-menu-item.is-active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.4), rgba(6, 182, 212, 0.3));
  color: #fff;
}

.sidebar .el-menu-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

[data-theme="light"] .sidebar {
  background: rgba(255, 255, 255, 0.90);
}

[data-theme="light"] .topbar {
  background: rgba(255, 255, 255, 0.88);
}

[data-theme="light"] .sidebar .el-menu-item.is-active {
  color: #1e1b4b;
}

[data-theme="light"] .sidebar .el-menu-item:hover {
  background: rgba(79, 70, 229, 0.08);
  color: #1e1b4b;
}

.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--tm-card-border);
  font-size: 12px;
  color: var(--tm-text-muted);
}

.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: 60px;
  padding: 0 24px;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--tm-card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar-title {
  font-size: 16px;
  font-weight: 600;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar .el-select {
  width: 200px;
}

.content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

.tm-page-footer {
  flex-shrink: 0;
  padding: 10px 16px 14px;
  text-align: center;
  font-size: 12px;
  line-height: 1.5;
  color: var(--tm-text-muted);
  border-top: 1px solid var(--tm-card-border);
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(8px);
}

.tm-page-footer .tm-footer-sep {
  margin: 0 0.55em;
  opacity: 0.45;
  user-select: none;
}

.tm-page-footer a {
  cursor: pointer;
  color: var(--tm-primary);
  text-decoration: none;
}

.tm-page-footer a:hover {
  text-decoration: underline;
}

[data-theme="light"] .tm-page-footer {
  background: rgba(255, 255, 255, 0.82);
}

.tm-auth-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  padding: 10px 16px 14px;
  text-align: center;
  font-size: 12px;
  line-height: 1.5;
  color: var(--tm-text-muted);
  border-top: 1px solid var(--tm-card-border);
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(12px);
}

.tm-auth-footer .tm-footer-sep {
  margin: 0 0.55em;
  opacity: 0.45;
  user-select: none;
}

.tm-auth-footer a {
  cursor: pointer;
  color: var(--tm-primary);
  text-decoration: none;
}

.tm-auth-footer a:hover {
  text-decoration: underline;
}

/* ============== 卡片 ============== */
.card {
  background: var(--tm-card-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--tm-card-border);
  border-radius: 14px;
  padding: 20px;
  transition: all .25s ease;
}

.card:hover {
  border-color: rgba(99, 102, 241, 0.4);
}

.card-title {
  font-size: 14px;
  color: var(--tm-text-muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--tm-card-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--tm-card-border);
  border-radius: 14px;
  padding: 20px 22px;
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  opacity: 0.18;
  filter: blur(20px);
}

.stat-card.indigo::after { background: #6366f1; }
.stat-card.cyan::after { background: #06b6d4; }
.stat-card.amber::after { background: #f59e0b; }
.stat-card.emerald::after { background: #10b981; }
.stat-card.rose::after { background: #ef4444; }
.stat-card.violet::after { background: #8b5cf6; }
.stat-card.slate::after { background: #64748b; }

.stat-card .label {
  color: var(--tm-text-muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.stat-card .value {
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}

[data-theme="light"] .stat-card .value {
  color: #0f172a;
}

.stat-card .extra {
  margin-top: 6px;
  font-size: 12px;
  color: var(--tm-text-muted);
}

.stat-card .stat-card-subvalue {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--tm-text-muted);
  opacity: 0.92;
}

.chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 1100px) {
  .chart-grid {
    grid-template-columns: 1fr;
  }
}

.chart {
  height: 360px;
  width: 100%;
}

/* ============== 表格 ============== */
.table-card {
  background: var(--tm-card-bg);
  border: 1px solid var(--tm-card-border);
  border-radius: 14px;
  padding: 20px;
}

/* 组队查询 · 图表区（随主题变量，避免浅色模式出现深色块） */
.season-team-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.season-team-chart-card {
  padding: 12px;
  background: var(--tm-card-bg);
  border: 1px solid var(--tm-card-border);
  border-radius: 14px;
}

.season-team-chart-title {
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--tm-text);
  text-align: center;
  font-size: 14px;
}

.season-team-list-header {
  font-size: 14px;
  color: var(--tm-text);
  font-weight: 600;
}

/* 职业/驻地汇总 · 成员明细弹层 */
.summary-member-popover {
  max-height: 320px;
  overflow-y: auto;
}

.summary-member-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--tm-card-border);
  font-size: 13px;
}

.summary-member-row:last-child {
  border-bottom: none;
}

.summary-member-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--tm-text);
}

.summary-member-group {
  color: var(--tm-text-muted);
  font-weight: 400;
}

.summary-member-metric {
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  color: var(--tm-warning);
  font-weight: 600;
}

/* 成员档案子 Tab：窄屏或顶栏占位时避免标签被裁切，可横向滑动查看 */
.members-archive-tabs .el-tabs__nav-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}

/* ============== 成员档案 · 展开的高级筛选（与主题卡片一致，避免浅色块 + 输入不可见）============== */
.members-row-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.members-row-actions--dropdown .el-button {
  padding: 5px 10px;
}

@media (max-width: 768px) {
  .members-archive-table .el-table .cell {
    padding-left: 6px;
    padding-right: 6px;
  }
}

/* —— 同盟管理页：紧凑概览 + 双栏 —— */
.alliance-view,
.alliance-mgmt-page {
  max-width: 1180px;
  margin: 0 auto;
}

.alliance-mgmt-summary {
  padding: 14px 18px !important;
  margin-bottom: 16px;
}

.alliance-mgmt-summary-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0;
  row-gap: 10px;
}

.alliance-mgmt-kv {
  flex: 1 1 auto;
  min-width: 140px;
  padding: 0 14px;
  border-left: 1px solid var(--tm-card-border);
}
.alliance-mgmt-kv:first-child {
  border-left: none;
  padding-left: 0;
}

.alliance-mgmt-kv .k {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--tm-text-muted);
  margin-bottom: 4px;
}

.alliance-mgmt-kv .v {
  font-size: 15px;
  font-weight: 600;
  color: var(--tm-text, #e2e8f0);
  word-break: break-word;
  line-height: 1.35;
}

[data-theme="light"] .alliance-mgmt-kv .v {
  color: #0f172a;
}

.alliance-mgmt-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 16px;
  align-items: start;
}

@media (min-width: 920px) {
  .alliance-mgmt-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.alliance-mgmt-card {
  margin-bottom: 0 !important;
}

.alliance-mgmt-card .card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--tm-text, #e2e8f0);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--tm-card-border);
}

[data-theme="light"] .alliance-mgmt-card .card-title {
  color: #0f172a;
}

.alliance-mgmt-form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--tm-card-border);
}

.alliance-mgmt-sanctions .sanctions-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.alliance-mgmt-sanctions .sanctions-head .hint {
  margin: 4px 0 0;
  max-width: 640px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--tm-text-muted);
}

@media (max-width: 640px) {
  .alliance-mgmt-kv {
    min-width: calc(50% - 8px);
    border-left: none;
    padding-left: 0;
    padding-right: 12px;
  }
}

/* 成员标签颜色（系统管理 / 成员档案） */
.tm-member-tag {
  border-width: 1px !important;
  border-style: solid !important;
  background-clip: padding-box;
  font-weight: 600;
}
.tm-member-tag--red {
  background-color: rgba(239, 68, 68, 0.24) !important;
  border-color: #f87171 !important;
  color: #fee2e2 !important;
}
.tm-member-tag--orange {
  background-color: rgba(249, 115, 22, 0.24) !important;
  border-color: #fb923c !important;
  color: #ffedd5 !important;
}
.tm-member-tag--yellow {
  background-color: rgba(234, 179, 8, 0.24) !important;
  border-color: #facc15 !important;
  color: #fef9c3 !important;
}
.tm-member-tag--green {
  background-color: rgba(34, 197, 94, 0.22) !important;
  border-color: #4ade80 !important;
  color: #dcfce7 !important;
}
.tm-member-tag--pink {
  background-color: rgba(236, 72, 153, 0.22) !important;
  border-color: #f472b6 !important;
  color: #fbcfe8 !important;
}
.tm-member-tag--blue {
  background-color: rgba(59, 130, 246, 0.24) !important;
  border-color: #60a5fa !important;
  color: #bfdbfe !important;
}
.tm-member-tag--purple {
  background-color: rgba(168, 85, 247, 0.24) !important;
  border-color: #c084fc !important;
  color: #f3e8ff !important;
}
.tm-member-tag--white {
  background-color: rgba(248, 250, 252, 0.18) !important;
  border-color: #e2e8f0 !important;
  color: #f8fafc !important;
}
[data-theme="light"] .tm-member-tag--red {
  background-color: #fee2e2 !important;
  border-color: #f87171 !important;
  color: #991b1b !important;
}
[data-theme="light"] .tm-member-tag--orange {
  background-color: #ffedd5 !important;
  border-color: #fb923c !important;
  color: #9a3412 !important;
}
[data-theme="light"] .tm-member-tag--yellow {
  background-color: #fef9c3 !important;
  border-color: #facc15 !important;
  color: #713f12 !important;
}
[data-theme="light"] .tm-member-tag--green {
  background-color: #dcfce7 !important;
  border-color: #4ade80 !important;
  color: #166534 !important;
}
[data-theme="light"] .tm-member-tag--pink {
  background-color: #fce7f3 !important;
  border-color: #f472b6 !important;
  color: #9d174d !important;
}
[data-theme="light"] .tm-member-tag--blue {
  background-color: #dbeafe !important;
  border-color: #60a5fa !important;
  color: #1e3a8a !important;
}
[data-theme="light"] .tm-member-tag--purple {
  background-color: #f3e8ff !important;
  border-color: #c084fc !important;
  color: #6b21a8 !important;
}
[data-theme="light"] .tm-member-tag--white {
  background-color: #f1f5f9 !important;
  border-color: #94a3b8 !important;
  color: #0f172a !important;
}
.tm-tag-swatch {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  vertical-align: middle;
  margin-right: 6px;
}
[data-theme="light"] .tm-tag-swatch {
  border-color: rgba(15, 23, 42, 0.2);
}
.tm-tag-swatch--red { background: #ef4444; }
.tm-tag-swatch--orange { background: #f97316; }
.tm-tag-swatch--yellow { background: #eab308; }
.tm-tag-swatch--green { background: #22c55e; }
.tm-tag-swatch--pink { background: #ec4899; }
.tm-tag-swatch--blue { background: #3b82f6; }
.tm-tag-swatch--purple { background: #a855f7; }
.tm-tag-swatch--white { background: #f8fafc; border-color: #94a3b8; }

.members-filter-advanced {
  margin-top: 12px;
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--tm-card-bg);
  border: 1px solid var(--tm-card-border);
  backdrop-filter: blur(12px);
}
.members-filter-advanced-hint {
  color: var(--tm-text-muted);
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 14px;
}
.members-filter-advanced-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px 12px;
  margin-bottom: 12px;
}
.members-filter-advanced-row:last-child {
  margin-bottom: 0;
}
.members-filter-advanced-label {
  flex: 0 0 100%;
  font-size: 12px;
  font-weight: 600;
  color: var(--tm-text-muted);
  padding-top: 6px;
}
@media (min-width: 768px) {
  .members-filter-advanced-label {
    flex: 0 0 104px;
    width: 104px;
    padding-top: 8px;
  }
}
.members-filter-advanced-inputs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.members-filter-advanced .el-input__wrapper {
  background: rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16) inset !important;
}
.members-filter-advanced .el-input__wrapper:hover {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.24) inset !important;
}
.members-filter-advanced .el-input__wrapper.is-focus {
  box-shadow: 0 0 0 1px var(--tm-primary) inset !important;
}
.members-filter-advanced .el-input__inner {
  color: var(--tm-text) !important;
  -webkit-text-fill-color: var(--tm-text) !important;
}
.members-filter-advanced .el-input__inner::placeholder {
  color: var(--tm-text-muted);
  opacity: 0.92;
}
[data-theme="light"] .members-filter-advanced .el-input__wrapper {
  background: rgba(15, 23, 42, 0.05) !important;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.14) inset !important;
}
[data-theme="light"] .members-filter-advanced .el-input__wrapper:hover {
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.2) inset !important;
}
[data-theme="light"] .members-filter-advanced .el-input__inner {
  color: var(--tm-text) !important;
  -webkit-text-fill-color: var(--tm-text) !important;
}
[data-theme="light"] .members-filter-advanced .el-input__inner::placeholder {
  color: var(--tm-text-muted);
  opacity: 0.95;
}

.members-filter-advanced .el-date-editor .el-input__wrapper {
  background: rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16) inset !important;
}

.members-filter-advanced .members-filter-date-range.el-date-editor--daterange {
  width: 248px !important;
  max-width: 248px;
  flex: 0 0 auto;
}

.members-filter-advanced .members-filter-date-range .el-range-input {
  font-size: 12px;
}

.members-filter-advanced .members-filter-date-range .el-range-separator {
  padding: 0 4px;
  flex: none;
}

[data-theme="light"] .members-filter-advanced .el-date-editor .el-input__wrapper {
  background: rgba(15, 23, 42, 0.05) !important;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.14) inset !important;
}

.el-table {
  --el-table-bg-color: transparent;
  --el-table-tr-bg-color: transparent;
  --el-table-header-bg-color: rgba(255, 255, 255, 0.04);
  --el-table-border-color: rgba(255, 255, 255, 0.08);
  --el-table-text-color: #e2e8f0;
  --el-table-header-text-color: #cbd5e1;
}

[data-theme="light"] .el-table {
  --el-table-header-bg-color: rgba(15, 23, 42, 0.04);
  --el-table-border-color: rgba(15, 23, 42, 0.14);
  --el-table-text-color: #0f172a;
  --el-table-header-text-color: #1e293b;
}

.el-table__inner-wrapper::before {
  height: 0 !important;
}

.el-table th, .el-table tr, .el-table td {
  background: transparent !important;
}

.el-table--striped .el-table__body tr.el-table__row--striped td {
  background: rgba(255, 255, 255, 0.025) !important;
}

[data-theme="light"] .el-table--striped .el-table__body tr.el-table__row--striped td {
  background: rgba(15, 23, 42, 0.04) !important;
}

.el-table__empty-block {
  background: transparent !important;
}

.el-table tbody tr:hover td {
  background: rgba(99, 102, 241, 0.12) !important;
}

[data-theme="light"] .el-table tbody tr:hover td {
  background: rgba(79, 70, 229, 0.12) !important;
}

.el-table tbody tr.is-self-row td {
  background: rgba(245, 158, 11, 0.10) !important;
}

/* ============== 表单 / 弹窗 ============== */
.el-dialog {
  background: rgba(15, 23, 42, 0.95) !important;
  backdrop-filter: blur(20px);
  border: 1px solid var(--tm-card-border);
  border-radius: 16px !important;
}

[data-theme="light"] .el-dialog {
  background: rgba(255, 255, 255, 0.96) !important;
}

/* 浅色主题：成员详情等弹窗内文字提高清晰度 */
[data-theme="light"] .el-dialog,
[data-theme="light"] .el-dialog__title,
[data-theme="light"] .el-dialog__body {
  color: #0f172a !important;
}

[data-theme="light"] .el-dialog .card-title,
[data-theme="light"] .el-dialog .detail-info-label,
[data-theme="light"] .el-dialog .detail-stat-label,
[data-theme="light"] .el-dialog .el-timeline-item__timestamp {
  color: #1e293b !important;
}

[data-theme="light"] .el-dialog .card-title {
  color: #0f172a !important;
  font-weight: 700;
}

[data-theme="light"] .el-dialog .detail-info-value,
[data-theme="light"] .el-dialog .detail-stat-value {
  color: #0f172a !important;
}

[data-theme="light"] .el-dialog .el-table {
  --el-table-header-bg-color: rgba(15, 23, 42, 0.08);
  --el-table-border-color: rgba(15, 23, 42, 0.20);
  --el-table-text-color: #0f172a;
  --el-table-header-text-color: #1e293b;
}

[data-theme="light"] .el-dialog .el-table th .cell {
  font-weight: 600;
}

[data-theme="light"] .el-dialog .el-table td .cell {
  color: #0f172a !important;
  font-weight: 500;
}

[data-theme="light"] .el-dialog .el-table--striped .el-table__body tr.el-table__row--striped td {
  background: rgba(15, 23, 42, 0.055) !important;
}

[data-theme="light"] .el-dialog .el-table tbody tr:hover td {
  background: rgba(79, 70, 229, 0.16) !important;
}

/* 浅色主题下弹窗内弱提示文字提亮对比，避免“发灰看不清” */
[data-theme="light"] .el-dialog [style*="color: #94a3b8"],
[data-theme="light"] .el-dialog [style*="color:#94a3b8"] {
  color: #475569 !important;
}

[data-theme="light"] .el-dialog [style*="color: #e2e8f0"],
[data-theme="light"] .el-dialog [style*="color:#e2e8f0"] {
  color: #0f172a !important;
}

[data-theme="light"] .card,
[data-theme="light"] .table-card,
[data-theme="light"] .stat-card {
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.06);
}

[data-theme="light"] .section-toolbar .section-title,
[data-theme="light"] .card-title {
  color: #0f172a;
  font-weight: 600;
}

[data-theme="light"] .detail-info-value,
[data-theme="light"] .detail-stat-value {
  color: #0f172a;
}

.el-dialog__title, .el-dialog__body, .el-form-item__label {
  color: var(--tm-text) !important;
}

.el-input__wrapper, .el-textarea__inner, .el-select .el-input__wrapper {
  background: rgba(255, 255, 255, 0.06) !important;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12) inset !important;
}

[data-theme="light"] .el-input__wrapper,
[data-theme="light"] .el-textarea__inner,
[data-theme="light"] .el-select .el-input__wrapper {
  background: rgba(15, 23, 42, 0.03) !important;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.12) inset !important;
}

.el-input__inner, .el-textarea__inner {
  color: var(--tm-text) !important;
}

/* ============== Tag ============== */
.role-tag {
  padding: 2px 10px;
  border-radius: 8px;
  font-size: 12px;
}

.role-superadmin { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }
.role-admin { background: rgba(99, 102, 241, 0.2); color: #a5b4fc; }
.role-viewer { background: rgba(148, 163, 184, 0.2); color: #cbd5e1; }

/* ============== 上传区 ============== */
.upload-dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  padding: 36px;
  text-align: center;
  cursor: pointer;
  transition: all .2s ease;
  background: rgba(255, 255, 255, 0.03);
}

.upload-dropzone:hover {
  border-color: var(--tm-primary);
  background: rgba(99, 102, 241, 0.08);
}

.upload-dropzone .icon {
  font-size: 48px;
  color: var(--tm-primary);
}

.upload-dropzone .hint {
  margin-top: 12px;
  color: var(--tm-text);
  font-size: 14px;
}

.upload-dropzone .desc {
  margin-top: 6px;
  color: var(--tm-text-muted);
  font-size: 12px;
}

/* ============== 滚动条 ============== */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* Element Plus 微调 */
.el-button--primary {
  background: linear-gradient(135deg, var(--tm-primary), var(--tm-primary-hover)) !important;
  border: none !important;
}

/* ============== 分页器（深色主题适配） ============== */
.el-pagination {
  --el-pagination-bg-color: transparent;
  --el-pagination-button-bg-color: transparent;
  --el-pagination-text-color: var(--tm-text);
  --el-pagination-button-color: var(--tm-text);
  --el-pagination-hover-color: var(--tm-primary);
  color: var(--tm-text) !important;
  flex-wrap: wrap;
  row-gap: 6px;
}

/* "共 N 条 / Go to / 1 / 2 ..." 这些文本提示 */
.el-pagination .el-pagination__total,
.el-pagination .el-pagination__jump,
.el-pagination .el-pagination__goto,
.el-pagination .el-pagination__classifier,
.el-pagination .el-pagination__sizes .el-input__inner,
.el-pagination .el-pagination__editor.el-input .el-input__inner {
  color: var(--tm-text) !important;
}

/* page-size 下拉与跳页输入：与卡片同风格 */
.el-pagination .el-pagination__sizes .el-input .el-input__wrapper,
.el-pagination .el-pagination__editor.el-input .el-input__wrapper {
  background: rgba(255, 255, 255, 0.06) !important;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15) inset !important;
}

/* 上下页按钮 + 数字按钮（is-background 模式） */
.el-pagination.is-background .btn-prev,
.el-pagination.is-background .btn-next,
.el-pagination.is-background .el-pager li {
  background: rgba(255, 255, 255, 0.06) !important;
  color: var(--tm-text) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
}

.el-pagination.is-background .btn-prev:hover:not(:disabled),
.el-pagination.is-background .btn-next:hover:not(:disabled),
.el-pagination.is-background .el-pager li:hover:not(.is-active):not(.is-disabled) {
  color: #fff !important;
  border-color: var(--tm-primary) !important;
  background: rgba(99, 102, 241, 0.18) !important;
}

.el-pagination.is-background .btn-prev:disabled,
.el-pagination.is-background .btn-next:disabled,
.el-pagination.is-background .el-pager li.is-disabled {
  color: rgba(226, 232, 240, 0.35) !important;
  background: rgba(255, 255, 255, 0.03) !important;
  border-color: rgba(255, 255, 255, 0.06) !important;
}

/* 当前页 */
.el-pagination.is-background .el-pager li.is-active {
  background: linear-gradient(135deg, var(--tm-primary), var(--tm-primary-hover)) !important;
  color: #fff !important;
  border-color: transparent !important;
  font-weight: 600;
}

/* 省略号 "..." 也调亮一点 */
.el-pagination.is-background .el-pager li.more {
  color: var(--tm-text-muted) !important;
}

/* ============== 攻城模拟布局 ============== */
.siege-sim-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  align-items: start;
}

.siege-sim-chart-card {
  grid-column: 1 / -1;
}

@media (max-width: 1024px) {
  .siege-sim-grid {
    grid-template-columns: 1fr;
  }
}

/* ============== 成员详情弹窗（v0.4.0） ============== */
.detail-info-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

@media (max-width: 768px) {
  .detail-info-grid { grid-template-columns: repeat(2, 1fr); }
}

.detail-info-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px 14px;
}

.detail-admin-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.detail-info-label {
  font-size: 11px;
  color: var(--tm-text-muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.detail-info-value {
  font-size: 14px;
  font-weight: 600;
  color: #e2e8f0;
}

.detail-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

@media (max-width: 768px) {
  .detail-stats-grid { grid-template-columns: repeat(2, 1fr); }
}

.detail-stat-card {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(6, 182, 212, 0.08));
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.detail-stat-card::after {
  content: '';
  position: absolute;
  top: -20px;
  right: -20px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.15);
  filter: blur(15px);
}

.detail-stat-value {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}

.detail-stat-label {
  font-size: 12px;
  color: var(--tm-text-muted);
  margin-top: 4px;
}

.detail-stat-gain {
  font-size: 12px;
  color: #34d399;
  margin-top: 4px;
  font-weight: 600;
}

/* Timeline 暗色适配 */
.el-timeline-item__timestamp {
  color: var(--tm-text-muted) !important;
}

.el-timeline-item__content {
  color: var(--tm-text) !important;
}

/* ============== 登录页验证码 ============== */
.captcha-img {
  flex: 0 0 120px;
  width: 120px;
  height: 40px;
  border-radius: 4px;
  overflow: hidden;
  background: #f1f5f9;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.captcha-img img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.captcha-loading {
  color: #64748b;
  font-size: 12px;
}

/* ============== 通用响应式工具类 ============== */

/* 卡片头部：标题 + 工具按钮组。窄屏自动换行 */
.section-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-toolbar .section-title {
  font-size: 15px;
  font-weight: 600;
  color: #e2e8f0;
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  word-break: break-word;
}

/* 按钮组：自动换行 + 间距 */
.action-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* 日期切换器：左中右紧凑 */
.date-switcher {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.date-switcher .date-label {
  font-weight: 600;
  color: #e2e8f0;
  font-size: 14px;
  white-space: nowrap;
  padding: 0 4px;
}

/* ============== 响应式适配 ============== */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: -230px;
    top: 0;
    bottom: 0;
    z-index: 2000;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
  }

  .sidebar.is-open {
    left: 0;
  }

  .sidebar-mask {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1999;
    display: none;
  }

  .sidebar-mask.is-open {
    display: block;
  }

  .topbar {
    padding: 0 16px;
  }

  .content {
    padding: 16px;
  }

  .hamburger {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    cursor: pointer;
  }

  .topbar-actions .el-select {
    width: 140px !important;
  }

  .topbar-title {
    display: none; /* 移动端隐藏标题，由 Logo 代替或通过菜单查看 */
  }

  .stat-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .stat-card {
    padding: 14px 16px;
  }

  .stat-card .value {
    font-size: 20px;
  }

  .chart-grid {
    grid-template-columns: 1fr !important;
  }

  .chart {
    height: 280px;
  }

  .login-card {
    padding: 30px 24px;
    margin: 16px;
  }

  .detail-info-grid, .detail-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .topbar-actions .el-select {
    width: 110px !important;
  }

  .section-toolbar .section-title {
    flex-basis: 100%;
    font-size: 14px;
  }

  .section-toolbar .action-group {
    flex-basis: 100%;
    justify-content: flex-start;
  }

  .date-switcher .date-label {
    font-size: 13px;
    padding: 0 2px;
  }
}

.hamburger {
  display: none;
  font-size: 18px;
}

/* ============== 关于页 ============== */
.about-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: 52px;
}

.about-hero {
  padding: 48px 24px 36px;
  text-align: center;
  border-bottom: 1px solid var(--tm-card-border);
  background: rgba(15, 23, 42, 0.35);
}

.about-hero-inner {
  max-width: 720px;
  margin: 0 auto;
}

.about-hero h1 {
  margin: 0 0 6px;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.about-subtitle {
  margin: 0 0 16px;
  font-size: 14px;
  color: var(--tm-text-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.about-tagline {
  margin: 0 0 24px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--tm-text-muted);
}

.about-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.about-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.15s, border-color 0.15s;
}

.about-btn-primary {
  background: var(--tm-primary);
  color: #fff !important;
  border: 1px solid transparent;
}

.about-btn-primary:hover {
  background: var(--tm-primary-hover);
}

.about-btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--tm-card-border);
  color: var(--tm-text) !important;
}

.about-btn-ghost:hover {
  border-color: var(--tm-primary);
  color: var(--tm-primary) !important;
}

.about-main {
  flex: 1;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  padding: 32px 24px 48px;
}

.about-section {
  margin-bottom: 40px;
}

.about-section-title {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 700;
}

.about-section-hint {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--tm-text-muted);
}

.about-feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.about-feature-card {
  padding: 18px;
  border-radius: 12px;
  background: var(--tm-card-bg);
  border: 1px solid var(--tm-card-border);
  backdrop-filter: blur(10px);
}

.about-feature-card h3 {
  margin: 8px 0 8px;
  font-size: 16px;
  font-weight: 700;
}

.about-feature-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--tm-text-muted);
}

.about-feature-icon {
  font-size: 28px;
  line-height: 1;
}

.about-table-wrap {
  overflow-x: auto;
  border-radius: 12px;
}

.about-cell-multiline {
  white-space: pre-line;
  line-height: 1.5;
}

.about-notes-list {
  margin: 16px 0 0;
  padding-left: 1.2em;
  font-size: 13px;
  color: var(--tm-text-muted);
  line-height: 1.65;
}

.about-notes-list li {
  margin-bottom: 8px;
}

.about-contact p {
  margin: 0 0 10px;
  color: var(--tm-text-muted);
  line-height: 1.7;
}

.about-email {
  font-size: 18px;
  font-weight: 700;
}

.about-email a {
  color: var(--tm-primary);
}

[data-theme="light"] .about-hero {
  background: rgba(255, 255, 255, 0.65);
}

@media (max-width: 640px) {
  .about-hero {
    padding: 32px 16px 24px;
  }

  .about-hero h1 {
    font-size: 26px;
  }

  .about-main {
    padding: 24px 16px 40px;
  }
}
