:root {
  --brand: #16a34a;
  --brand-deep: #15803d;
  --brand-soft: #dcfce7;
  --accent: #4f46e5;
  --t1: #14211a;
  --t2: #4b5f53;
  --t3: #84958a;
  --line: rgba(20, 45, 30, .08);
  --card: rgba(255, 255, 255, .82);
  --card-solid: #ffffff;
  --bg: #f2f7f3;
  --danger: #dc2626;
  --warn: #d97706;
  --shadow: 0 10px 34px rgba(22, 84, 48, .10);
  --radius: 16px;
}

* { box-sizing: border-box; }

html, body, #root { min-height: 100%; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  color: var(--t1);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(900px 520px at 8% -6%, rgba(34, 197, 94, .18), transparent 60%),
    radial-gradient(720px 480px at 100% 0%, rgba(79, 70, 229, .13), transparent 58%),
    linear-gradient(180deg, #f7fbf8 0%, var(--bg) 100%);
  background-attachment: fixed;
}

a { color: var(--brand-deep); }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  letter-spacing: .4px;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  background: linear-gradient(135deg, #22c55e 0%, #15803d 60%, #4f46e5 130%);
  box-shadow: 0 6px 16px rgba(22, 163, 74, .32);
}

.brand-text {
  background: linear-gradient(100deg, #14532d, #16a34a 55%, #4f46e5);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(14px);
  background: rgba(255, 255, 255, .78);
  border-bottom: 1px solid var(--line);
}

.app-header__inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.page-wrap {
  max-width: 1320px;
  margin: 0 auto;
  padding: 22px 20px 60px;
}

.muted { color: var(--t3); }
.mono { font-variant-numeric: tabular-nums; }

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
}

.auth-card {
  width: 100%;
  max-width: 430px;
  border-radius: 22px !important;
  box-shadow: var(--shadow) !important;
  border: 1px solid rgba(255, 255, 255, .9) !important;
  background: rgba(255, 255, 255, .88) !important;
  backdrop-filter: blur(18px);
}

.auth-hero {
  text-align: center;
  padding: 6px 0 18px;
}

.auth-hero .sub { color: var(--t3); font-size: 13px; margin-top: 6px; }

.stat-card {
  border-radius: var(--radius) !important;
  border: 1px solid var(--line) !important;
  background: var(--card) !important;
  box-shadow: 0 8px 24px rgba(22, 84, 48, .06) !important;
  height: 100%;
}

.group-card {
  border-radius: var(--radius) !important;
  border: 1px solid var(--line) !important;
  background: var(--card) !important;
  box-shadow: 0 8px 24px rgba(22, 84, 48, .06) !important;
  height: 100%;
  transition: transform .18s ease, box-shadow .18s ease;
}

.group-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(22, 84, 48, .13) !important;
}

.group-card.expired {
  opacity: .68;
  filter: grayscale(.35);
}

.group-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.group-card__title {
  font-size: 16px;
  font-weight: 700;
}

.kv {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  padding: 3px 0;
}

.kv > span:first-child { color: var(--t3); }
.kv > span:last-child { text-align: right; word-break: break-all; }

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 1px 9px;
  font-size: 12px;
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.pill.gray { background: #f1f5f2; color: var(--t2); }
.pill.red { background: #fee2e2; color: var(--danger); }
.pill.amber { background: #fef3c7; color: var(--warn); }

.log-pre {
  margin: 0;
  padding: 14px 16px;
  border-radius: 12px;
  background: #0f1f16;
  color: #d1fae5;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12.5px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 62vh;
  overflow: auto;
}

.dash-card-title { font-size: 13px; color: var(--t3); }
.dash-card-value { font-size: 26px; font-weight: 800; margin-top: 2px; }

.section-title {
  font-size: 17px;
  font-weight: 700;
  margin: 4px 0 14px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.table-card {
  border-radius: var(--radius) !important;
  border: 1px solid var(--line) !important;
  background: rgba(255, 255, 255, .86) !important;
}

.code-box {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  background: #0f1f16;
  color: #bbf7d0;
  border-radius: 12px;
  padding: 14px;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 240px;
  overflow: auto;
}

.price-card {
  border-radius: var(--radius) !important;
  border: 1px solid var(--line) !important;
  background: var(--card) !important;
}

.price-card .price {
  font-size: 24px;
  font-weight: 800;
  color: var(--brand-deep);
}

/* ── 手机适配 ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .app-header__inner {
    padding: 10px 12px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .app-header__inner > .ant-space { flex-wrap: wrap; }

  .page-wrap { padding: 14px 12px 48px; }
  .brand-text { font-size: 15px; }
  .dash-card-value { font-size: 20px; }
  .price-card .price { font-size: 20px; }

  /* 工具栏横向排不下就换行，控件不撑破屏幕 */
  .toolbar { gap: 8px; }
  .toolbar > * { max-width: 100%; }

  /* 表格：窄屏统一横向滚动，单元格不折行。
   表格本身改成 auto 布局按内容撑宽，否则固定布局下 nowrap 的文字会溢出到下一列（和类型/时间重叠）。 */
  .ant-table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .ant-table { min-width: 720px; }
  .ant-table table {
    table-layout: auto !important;
    width: auto !important;
    min-width: 720px;
  }
  .ant-table-tbody > tr > td,
  .ant-table-thead > tr > th { white-space: nowrap; }
  .ant-pagination { flex-wrap: wrap; row-gap: 6px; }

  /* 弹窗：宽度不超过屏幕 */
  .ant-modal {
    max-width: calc(100vw - 16px) !important;
    margin: 8px auto !important;
    padding-bottom: 8px;
  }
  .ant-modal-content { border-radius: 14px !important; }
  .ant-modal-header { border-radius: 14px 14px 0 0 !important; }
  .ant-modal-body { padding: 16px 14px !important; }

  .ant-drawer-content-wrapper { max-width: 100vw !important; }
  .ant-drawer-body { padding: 14px !important; }

  /* iOS 输入框字号 <16px 会自动放大页面 */
  .ant-input,
  .ant-input-affix-wrapper,
  .ant-input-number-input,
  .ant-select-selection-search-input {
    font-size: 16px !important;
  }

  .log-pre { padding: 12px; font-size: 12px; }
  .code-box { padding: 12px; font-size: 12px; }

  .group-card__head { flex-wrap: wrap; }
  .kv { font-size: 12.5px; }
}

@media (max-width: 640px) {
  .ant-card-body { padding: 16px 14px !important; }
  .ant-tabs-tab { padding: 8px 0 !important; margin-right: 16px !important; }
}
/* 登录页快捷入口：卡片内、弱化成文字链 */
.login-quick-links {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  text-align: center;
  font-size: 12px;
  line-height: 1.8;
  color: var(--t3);
}
.login-quick-links__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}
.login-quick-links__title {
  font-size: 11px;
  letter-spacing: .12em;
  color: var(--t3);
}
.login-quick-links__agent {
  font-size: 12px;
  color: var(--brand-deep);
  text-decoration: none;
  margin: 0 !important;
}
.login-quick-links__agent:hover { text-decoration: underline; }
.login-quick-links a {
  color: var(--t2);
  text-decoration: none;
  margin: 0 8px;
  transition: color .15s;
}
.login-quick-links a:hover { color: var(--brand-deep); text-decoration: underline; }

/* 极验在带 backdrop-filter 的祖先下会把边框画错（多一圈/对不齐）。
   弹窗里包含验证码时关掉滤镜，和 CzrBotWeb 的处理保持一致。 */
.ant-modal-content:has(.gt-box) {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
