/* ============================================================
   common.css — 小红书 MAPI SaaS 统一设计系统
   所有页面引用此文件，保证视觉一致性
   ============================================================ */

/* === Design Tokens === */
:root {
  /* Brand */
  --red: #ff2442;
  --red-hover: #e6203c;
  --red-light: #fff0f2;
  --red-bg: #fff5f7;

  /* Semantic */
  --green: #00c853;
  --green-light: #e8f5e9;
  --orange: #ff9800;
  --orange-light: #fff3e0;
  --blue: #1976d2;
  --blue-light: #e3f2fd;

  /* Neutral */
  --bg: #f5f6f8;
  --card: #fff;
  --border: #e8e8e8;
  --border-light: #f0f0f0;
  --text: #1a1a1a;
  --text2: #555;
  --text3: #999;

  /* Elevation */
  --shadow-sm: 0 1px 3px rgba(0,0,0,.04);
  --shadow-md: 0 2px 8px rgba(0,0,0,.06);
  --shadow-lg: 0 8px 24px rgba(0,0,0,.1);

  /* Spacing */
  --sp-xs: 4px;
  --sp-sm: 8px;
  --sp-md: 16px;
  --sp-lg: 24px;
  --sp-xl: 32px;

  /* Radius */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;

  /* Typography */
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Helvetica Neue', sans-serif;
  --mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

/* === Reset === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* === Top Bar (Brand Header) === */
.top-bar {
  background: linear-gradient(135deg, #ff2442 0%, #ff5c72 60%, #ff8fa3 100%);
  color: #fff;
  padding: 0 var(--sp-lg);
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.top-bar .brand {
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  white-space: nowrap;
}
.top-bar .brand-sub {
  font-size: 11px;
  opacity: .7;
  font-weight: 400;
}
.top-bar-right {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  font-size: 13px;
}
.top-bar-right select {
  padding: 5px 10px;
  border-radius: var(--r-sm);
  border: none;
  font-size: 13px;
  background: rgba(255,255,255,.95);
  max-width: 180px;
}
.top-btn {
  background: rgba(255,255,255,.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,.25);
  padding: 5px 14px;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 12px;
  white-space: nowrap;
  transition: background .15s;
}
.top-btn:hover { background: rgba(255,255,255,.28); }

/* === Main Nav === */
.main-nav {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 0 var(--sp-lg);
  display: flex;
  gap: 0;
  position: sticky;
  top: 52px;
  z-index: 99;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.main-nav::-webkit-scrollbar { display: none; }
.main-nav a {
  padding: 11px 18px;
  font-size: 13px;
  color: var(--text2);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: all .15s;
  flex-shrink: 0;
}
.main-nav a:hover { color: var(--text); background: #fafafa; }
.main-nav a.active {
  color: var(--red);
  font-weight: 600;
  border-bottom-color: var(--red);
}

/* === Sub Nav (page-level tabs) === */
.sub-nav {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-md);
  overflow-x: auto;
}
.sub-nav .tab {
  padding: 10px 20px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text2);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: all .15s;
}
.sub-nav .tab:hover { color: var(--text); }
.sub-nav .tab.active {
  color: var(--red);
  font-weight: 600;
  border-bottom-color: var(--red);
}

/* === Container === */
.container { max-width: 1360px; margin: 0 auto; padding: var(--sp-md) var(--sp-lg); }

/* === Card === */
.card {
  background: var(--card);
  border-radius: var(--r-lg);
  padding: var(--sp-lg);
  margin-bottom: var(--sp-md);
  box-shadow: var(--shadow-sm);
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--sp-md);
}
.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 16px;
  border: none;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all .15s;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-hover); }
.btn-secondary { background: #f0f0f0; color: var(--text); }
.btn-secondary:hover { background: #e4e4e4; }
.btn-success { background: var(--green); color: #fff; }
.btn-warning { background: var(--orange); color: #fff; }
.btn-danger { background: #f44336; color: #fff; }
.btn-ghost { background: transparent; color: var(--text2); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--red); color: var(--red); }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* === Badge === */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
}
.badge-ok { background: var(--green-light); color: #2e7d32; }
.badge-warn { background: var(--orange-light); color: #e65100; }
.badge-err { background: #ffebee; color: #c62828; }
.badge-info { background: var(--blue-light); color: #1565c0; }

/* === Table === */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left;
  padding: 10px 12px;
  background: #fafbfc;
  font-weight: 600;
  color: var(--text2);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  font-size: 12px;
}
td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}
tr:hover td { background: #fafbfc; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.scroll-table { max-height: 400px; overflow-y: auto; overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* === Toolbar === */
.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: var(--sp-md);
}
.toolbar select, .toolbar input[type="date"], .toolbar input[type="text"], .toolbar input[type="number"] {
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 13px;
  outline: none;
  transition: border-color .15s;
}
.toolbar select:focus, .toolbar input:focus { border-color: var(--red); }

/* === Form === */
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--text2);
}
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 13px;
  outline: none;
  transition: border-color .15s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--red);
}
.form-group textarea { resize: vertical; min-height: 60px; }

/* === Modal === */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 200;
  justify-content: center;
  align-items: flex-start;
  padding-top: 60px;
}
.modal-overlay.show { display: flex; }
.modal {
  background: var(--card);
  border-radius: var(--r-xl);
  width: 90%;
  max-width: 640px;
  max-height: 80vh;
  overflow-y: auto;
  padding: var(--sp-lg);
  box-shadow: var(--shadow-lg);
}
.modal h3 { font-size: 18px; margin-bottom: var(--sp-md); }

/* === Toast === */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 20px;
  border-radius: var(--r-md);
  color: #fff;
  font-size: 13px;
  z-index: 999;
  opacity: 0;
  transition: opacity .3s;
  pointer-events: none;
}
.toast.show { opacity: 1; }
.toast-ok { background: var(--green); }
.toast-err { background: #f44336; }

/* === Login Overlay === */
.login-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 300;
  display: flex;
  justify-content: center;
  align-items: center;
}
.login-box {
  background: var(--card);
  border-radius: var(--r-xl);
  padding: var(--sp-xl);
  width: 380px;
  max-width: 90vw;
  box-shadow: var(--shadow-lg);
}
.login-box h2 {
  text-align: center;
  margin-bottom: var(--sp-lg);
  color: var(--red);
  font-size: 20px;
}
.login-box input {
  width: 100%;
  padding: 10px 14px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 14px;
  outline: none;
}
.login-box input:focus { border-color: var(--red); }
.login-box button {
  width: 100%;
  padding: 11px;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}
.login-box button:hover { background: var(--red-hover); }

/* === Empty State === */
.empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--text3);
}
.empty-icon { font-size: 48px; margin-bottom: 12px; opacity: .6; }
.empty p { margin-top: 6px; }

/* === Metric Grid === */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: var(--sp-md);
}
.metric-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px;
  text-align: center;
  transition: box-shadow .15s;
}
.metric-card:hover { box-shadow: var(--shadow-md); }
.metric-card .val { font-size: 22px; font-weight: 700; }
.metric-card .lbl { font-size: 12px; color: var(--text3); margin-top: 2px; }

/* === KPI Row === */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: var(--sp-md);
}
.kpi {
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.kpi::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--red);
}
.kpi .label { font-size: 12px; color: var(--text3); margin-bottom: 6px; }
.kpi .value { font-size: 24px; font-weight: 700; }
.kpi .change { font-size: 12px; margin-top: 4px; }
.change-up { color: var(--red); }
.change-down { color: var(--green); }

/* === Utility === */
.text-red { color: var(--red); }
.text-green { color: var(--green); }
.text-muted { color: var(--text3); }
.text-sm { font-size: 12px; }
.text-mono { font-family: var(--mono); font-size: 12px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-sm { gap: var(--sp-sm); }
.gap-md { gap: var(--sp-md); }
.mt-sm { margin-top: var(--sp-sm); }
.mt-md { margin-top: var(--sp-md); }
.mb-md { margin-bottom: var(--sp-md); }

/* === Loading / Skeleton === */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--text3);
  font-size: 13px;
  gap: 8px;
}
.loading::before {
  content: '';
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--r-sm);
}
.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-card { height: 80px; border-radius: var(--r-md); margin-bottom: 12px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* === Form Row (inline) === */
.form-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.form-row label {
  font-size: 13px;
  color: var(--text2);
  min-width: 60px;
}
.form-row input, .form-row select {
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 13px;
  outline: none;
}
.form-row input:focus, .form-row select:focus { border-color: var(--red); }

/* === Tag === */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}
.tag-ok { background: var(--green-light); color: #2e7d32; }
.tag-warn { background: var(--orange-light); color: #e65100; }
.tag-err { background: #ffebee; color: #c62828; }
.tag-info { background: var(--blue-light); color: #1565c0; }

/* === Grid Layouts === */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-md); }
.grid-3 { display: grid; grid-template-columns: 2fr 1fr; gap: var(--sp-md); }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--sp-md); }

/* === Rank Badge === */
.rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
}
.rank-1 { background: #ffd700; color: #fff; }
.rank-2 { background: #c0c0c0; color: #fff; }
.rank-3 { background: #cd7f32; color: #fff; }

/* === Responsive === */

/* Table scroll wrapper — add .table-wrap around tables for mobile scroll */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

@media (max-width: 768px) {
  .top-bar { padding: 0 var(--sp-md); height: 48px; }
  .top-bar .brand { font-size: 14px; }
  .top-bar-right { gap: 4px; }
  .top-bar-right select { max-width: 120px; font-size: 12px; }
  .top-btn { padding: 4px 10px; font-size: 11px; }
  .main-nav { padding: 0 var(--sp-sm); top: 48px; gap: 0; }
  .main-nav a { padding: 10px 10px; font-size: 11px; }
  .container { padding: var(--sp-sm) var(--sp-md); }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .kpi { padding: 12px 14px; }
  .kpi .value { font-size: 18px; }
  .kpi .label { font-size: 11px; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .grid-auto { grid-template-columns: 1fr; }
  .toolbar { flex-direction: column; align-items: stretch; gap: 6px; }
  .toolbar select, .toolbar input { width: 100%; }
  .form-row { flex-direction: column; align-items: stretch; }
  .card { padding: var(--sp-md); margin-bottom: var(--sp-sm); }
  table { font-size: 12px; }
  th, td { padding: 7px 8px; }
  .modal { width: 95%; padding: var(--sp-md); max-height: 85vh; }
  .modal-overlay { padding-top: 30px; }
  /* Sub nav scroll */
  .sub-nav { gap: 0; }
  .sub-nav .tab { padding: 8px 14px; font-size: 12px; }
  /* Balance strip */
  .balance-strip { flex-direction: column; }
  .bal-card { min-width: unset; }
  /* Summary grid */
  .summary-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  /* BI grid */
  .bi-grid { grid-template-columns: 1fr; }
  .kpi-strip { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .bi-header { flex-direction: column; align-items: flex-start; }
  .bal-forecast { flex-direction: column; gap: 8px; padding: 12px; }
  /* Overview grid */
  .overview-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .ov-card { padding: 10px; }
  /* Note cards */
  .note-card { padding: 12px; }
  .note-metrics { flex-wrap: wrap; gap: 8px; }
  /* Rule cards */
  .rule-card { padding: 12px; }
  .rule-conditions { gap: 4px; }
  .condition-tag, .action-tag { font-size: 11px; padding: 2px 8px; }
  /* Cond/action rows in modal */
  .cond-row, .action-row { flex-wrap: wrap; gap: 6px; }
  .cond-row select, .cond-row input, .action-row select, .action-row input { min-width: unset; flex: 1; }
  /* Stats row */
  .stats-row { gap: 8px; }
  .stat-mini { min-width: 90px; padding: 10px 12px; }
  /* Cost tabs */
  .cost-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; }
  .cost-tabs button { white-space: nowrap; font-size: 11px; padding: 8px 12px; }
  /* Manage tabs */
  .manage-tabs { overflow-x: auto; }
  /* Touch targets */
  .btn { min-height: 36px; }
  .btn-sm { min-height: 30px; }
  select, input[type="date"], input[type="text"], input[type="number"] { min-height: 36px; }
  /* Login box */
  .login-box { padding: var(--sp-lg); width: 90vw; }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .kpi .value { font-size: 16px; }
  .metric-grid { grid-template-columns: 1fr; }
  .top-bar .brand-sub { display: none; }
  .top-bar-right > *:not(button):not(select) { display: none; }
  .main-nav a { padding: 8px 8px; font-size: 10px; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .kpi-strip { grid-template-columns: 1fr 1fr; }
  .overview-grid { grid-template-columns: 1fr 1fr; }
  .health-ring { width: 60px; height: 60px; }
  .health-inner { width: 44px; height: 44px; }
  .health-inner .score { font-size: 16px; }
  .card-title { font-size: 13px; }
  h2, h3 { font-size: 16px; }
  .container { padding: var(--sp-xs) var(--sp-sm); }
}

/* ============================================================
   Landing Page & Invite 共享样式（增量补充）
   ============================================================ */

/* === 品牌标识 === */
.brand-mark {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--red) 0%, #ff6b81 50%, #ff8fa3 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(255, 36, 66, .25);
}
.brand-mark::before {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  background: rgba(255, 255, 255, .9);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.brand-mark::after {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  background: var(--red);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.brand-mark--sm {
  width: 44px;
  height: 44px;
  border-radius: 12px;
}
.brand-mark--sm::before { width: 18px; height: 18px; }
.brand-mark--sm::after { width: 8px; height: 8px; }

/* === Invite 页面样式 === */

/* 授权卡片 */
.invite-card {
  background: var(--card);
  border-radius: var(--r-xl);
  padding: 40px 32px;
  max-width: 460px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}
.invite-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--red), #ff6b81, #ff8fa3);
}

/* 品牌头部 */
.invite-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: var(--sp-lg);
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.invite-brand h1 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.invite-brand p {
  font-size: 12px;
  color: var(--text3);
  margin-top: 2px;
}

/* 倒计时 */
.invite-timer {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text3);
  margin-bottom: 20px;
}
.invite-timer svg { flex-shrink: 0; }
.invite-timer--urgent { color: var(--orange); font-weight: 600; }

/* 服务标签 */
.invite-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--red-light);
  color: var(--red);
  padding: 8px 16px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: var(--sp-md);
}

/* 描述文字 */
.invite-desc {
  font-size: 14px;
  color: var(--text2);
  line-height: 1.8;
  margin-bottom: 20px;
}

/* 权限网格 */
.scope-section { margin-bottom: var(--sp-lg); }
.scope-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.scope-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.scope-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #fafbfc;
  border-radius: var(--r-md);
  font-size: 12px;
  color: var(--text2);
}
.scope-check { color: var(--green); font-weight: 700; }

/* 步骤进度 */
.invite-steps { margin-bottom: var(--sp-lg); }
.invite-step {
  display: flex;
  gap: 14px;
  position: relative;
  padding-bottom: var(--sp-md);
}
.invite-step:last-child { padding-bottom: 0; }
.invite-step::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 32px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}
.invite-step:last-child::before { display: none; }
.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  z-index: 1;
  transition: all .3s;
}
.step-wait { background: #f0f0f0; color: var(--text3); }
.step-active { background: var(--red); color: #fff; box-shadow: 0 2px 8px rgba(255, 36, 66, .3); }
.step-done { background: var(--green); color: #fff; }
.step-fail { background: #c62828; color: #fff; }
.step-title { font-size: 14px; font-weight: 600; color: var(--text); }
.step-desc { font-size: 12px; color: var(--text3); margin-top: 2px; line-height: 1.5; }
.step-desc a { color: var(--blue); }

/* 状态面板 */
.panel {
  padding: 20px;
  border-radius: var(--r-lg);
  margin-bottom: var(--sp-md);
  line-height: 1.7;
}
.panel-success { background: var(--green-light); color: #2e7d32; }
.panel-error { background: #fce4ec; color: #c62828; }
.panel-expired { background: var(--orange-light); color: #e65100; }
.panel-info { background: var(--blue-light); color: #1565c0; }
.panel h3 {
  font-size: 16px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.panel p { font-size: 13px; }

/* 隐私说明 */
.invite-privacy {
  margin-top: 20px;
  padding: var(--sp-md);
  background: #fafbfc;
  border-radius: var(--r-lg);
  font-size: 11px;
  color: var(--text3);
  line-height: 1.7;
}
.invite-privacy strong {
  font-size: 12px;
  color: var(--text2);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 6px;
}

/* 联系方式 */
.invite-contact {
  margin-top: var(--sp-md);
  padding: 14px;
  background: #fafbfc;
  border-radius: var(--r-md);
  font-size: 12px;
  color: var(--text2);
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 同步列表 */
.sync-list {
  list-style: none;
  padding: 0;
  margin-top: 12px;
}
.sync-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  font-size: 13px;
  border-bottom: 1px solid rgba(0, 0, 0, .05);
}
.sync-list li:last-child { border: none; }
.sync-check { color: var(--green); font-weight: 700; }

/* 错误详情 */
.err-detail {
  margin-top: 12px;
  padding: 14px;
  background: #f5f5f5;
  border-radius: var(--r-md);
  font-size: 12px;
  color: var(--text2);
  line-height: 1.7;
}
.err-detail code {
  font-family: var(--mono);
  color: #c62828;
  background: rgba(198, 40, 40, .08);
  padding: 1px 4px;
  border-radius: 3px;
}
.err-reasons {
  list-style: none;
  padding: 0;
  margin-top: 8px;
}
.err-reasons li {
  padding: 4px 0;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
.err-reasons li::before {
  content: '\2022';
  color: var(--text3);
  flex-shrink: 0;
}

/* 帮助展开 */
.help-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--blue);
  font-size: 12px;
  cursor: pointer;
  margin-top: 12px;
  padding: 4px 0;
}
.help-toggle:hover { text-decoration: underline; }
.help-content { display: none; margin-top: 12px; }
.help-content.show { display: block; }

/* Invite 全屏按钮 */
.btn-block {
  display: block;
  width: 100%;
  text-align: center;
  padding: 15px;
  border-radius: var(--r-lg);
  font-size: 16px;
  font-weight: 600;
}
.btn-gradient {
  background: linear-gradient(135deg, var(--red), #ff6b81);
  color: #fff;
  border: none;
  cursor: pointer;
  transition: all .2s;
}
.btn-gradient:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255, 36, 66, .3);
}
.btn-gradient:active { transform: translateY(0); }
.btn-loading-state {
  background: #e0e0e0;
  color: var(--text3);
  cursor: wait;
  pointer-events: none;
}
.btn-retry-style {
  background: #f5f5f5;
  color: var(--text);
  border: none;
  cursor: pointer;
  margin-top: 10px;
}
.btn-retry-style:hover { background: #eee; }

/* Invite 页 footer */
.invite-footer {
  margin-top: var(--sp-lg);
  text-align: center;
  font-size: 11px;
  color: #ccc;
}
.invite-footer a { color: var(--text3); }

/* Invite 响应式 */
@media (max-width: 480px) {
  .invite-card { padding: 28px 20px; border-radius: 16px; }
  .scope-grid { grid-template-columns: 1fr; }
  .brand-mark { width: 40px; height: 40px; border-radius: 10px; }
  .brand-mark::before { width: 16px; height: 16px; }
  .brand-mark::after { width: 7px; height: 7px; }
}

/* ============================================================
   全局加载系统
   ============================================================ */
/* 顶部进度条 */
#global-loading-bar {
  position: fixed; top: 0; left: 0; width: 0; height: 4px;
  background: linear-gradient(90deg, #ff2d55 0%, #ff6b81 40%, #ff2d55 80%);
  background-size: 200% 100%;
  z-index: 99999; transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 12px rgba(255,45,85,0.6), 0 0 4px rgba(255,45,85,0.3);
}
#global-loading-bar.active {
  animation: loading-shimmer 1.2s linear infinite, loading-glow 2s ease-in-out infinite;
}
@keyframes loading-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@keyframes loading-glow {
  0%, 100% { box-shadow: 0 0 12px rgba(255,45,85,0.6), 0 0 4px rgba(255,45,85,0.3); }
  50% { box-shadow: 0 0 20px rgba(255,45,85,0.8), 0 0 8px rgba(255,45,85,0.5); }
}
/* 全屏遮罩 + 提示 */
#global-loading-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.08); z-index: 99998;
  display: none; align-items: center; justify-content: center;
  backdrop-filter: blur(1px); transition: opacity 0.2s;
}
#global-loading-overlay.active { display: flex; }
#global-loading-overlay .loading-hint {
  background: var(--bg1); padding: 16px 28px; border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.12);
  display: flex; align-items: center; gap: 12px;
  font-size: 14px; color: var(--text1);
}
#global-loading-overlay .loading-spinner {
  width: 22px; height: 22px; border: 3px solid var(--border);
  border-top-color: var(--red); border-radius: 50%;
  animation: btn-spin 0.7s linear infinite;
}
/* 按钮 loading 状态 */
.btn-loading { pointer-events: none; opacity: 0.7; }
.btn-loading::after {
  content: ''; display: inline-block; width: 14px; height: 14px;
  border: 2px solid transparent; border-top-color: currentColor;
  border-radius: 50%; animation: btn-spin 0.6s linear infinite;
  margin-left: 6px; vertical-align: middle;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }

/* ============================================================
   投放管理增强样式
   ============================================================ */
.cell-sub { font-size: 12px; color: var(--text3); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-id { font-size: 11px; color: var(--text3); font-family: monospace; }
.cell-actions { white-space: nowrap; }
.bid-value { cursor: pointer; padding: 2px 6px; border-radius: 4px; transition: background 0.2s; }
.bid-value:hover { background: var(--red-light, #fff0f0); }
.inline-bid-input:focus { outline: none; box-shadow: 0 0 0 2px rgba(255,45,85,0.2); }
.search-box input:focus { border-color: var(--red) !important; outline: none; box-shadow: 0 0 0 2px rgba(255,45,85,0.1); }
