/* 一抹青 · 渠道伙伴独立站 · 样式 */
:root {
  --brand: #16B8A6;
  --brand-dark: #0F9E8E;
  --brand-light: #E0F7F4;
  --bg: #F5F7FA;
  --bg-card: #FFFFFF;
  --text: #1A2332;
  --text-sub: #6B7785;
  --text-faint: #9CA8B5;
  --border: #E4E9EF;
  --success: #16B8A6;
  --warning: #F59E0B;
  --danger: #EF4444;
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
  --radius: 8px;
  --radius-lg: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}
a { color: var(--brand); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ====== 登录页 ====== */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #16B8A6 0%, #0F9E8E 100%);
  padding: 20px;
}
.login-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  width: 100%; max-width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.login-logo {
  width: 56px; height: 56px;
  background: var(--brand);
  border-radius: 14px;
  margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 24px; font-weight: 700;
}
.login-title { font-size: 22px; font-weight: 700; text-align: center; margin-bottom: 4px; }
.login-sub { font-size: 13px; color: var(--text-sub); text-align: center; margin-bottom: 28px; }
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; color: var(--text-sub); margin-bottom: 6px; }
.form-input {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px; background: white;
  transition: border-color 0.2s;
}
.form-input:focus { outline: none; border-color: var(--brand); }
.btn-primary {
  width: 100%; padding: 13px;
  background: var(--brand); color: white;
  border: none; border-radius: var(--radius);
  font-size: 15px; font-weight: 600;
  transition: background 0.2s;
}
.btn-primary:hover { background: var(--brand-dark); }
.btn-primary:disabled { background: #B5C4D0; cursor: not-allowed; }
.tip { text-align: center; margin-top: 16px; font-size: 12px; color: var(--text-faint); }
.error-msg { color: var(--danger); font-size: 13px; margin-top: 8px; text-align: center; min-height: 18px; }

/* ====== 通用布局 ====== */
.layout { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.brand-icon {
  width: 32px; height: 32px;
  background: var(--brand);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700;
}
.brand-name { font-weight: 700; font-size: 16px; }
.brand-sub { font-size: 12px; color: var(--text-sub); }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.user-info { font-size: 13px; color: var(--text-sub); }
.btn-logout {
  background: transparent; color: var(--text-sub);
  border: 1px solid var(--border);
  padding: 6px 14px; border-radius: 6px;
  font-size: 13px;
}
.btn-logout:hover { background: var(--bg); }

.main { flex: 1; padding: 24px; max-width: 1200px; margin: 0 auto; width: 100%; }

/* ====== 卡片 ====== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.card-title {
  font-size: 15px; font-weight: 600;
  margin-bottom: 16px; color: var(--text);
  display: flex; align-items: center; justify-content: space-between;
}
.card-title-text { display: flex; align-items: center; gap: 8px; }
.card-title-bar {
  width: 3px; height: 14px;
  background: var(--brand);
  border-radius: 2px;
}

/* ====== 统计卡片网格 ====== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0;
  width: 4px; height: 100%; background: var(--brand);
}
.stat-label { font-size: 13px; color: var(--text-sub); margin-bottom: 8px; }
.stat-value { font-size: 26px; font-weight: 700; color: var(--text); }
.stat-value .unit { font-size: 13px; color: var(--text-sub); margin-left: 4px; font-weight: 400; }
.stat-extra { font-size: 12px; color: var(--text-faint); margin-top: 6px; }

/* ====== 推广码 ====== */
.invite-box {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: white;
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 16px;
}
.invite-text { font-size: 14px; opacity: 0.9; }
.invite-code {
  background: rgba(255,255,255,0.15);
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 22px; font-weight: 700;
  letter-spacing: 1.5px;
  font-family: "SF Mono", Consolas, monospace;
}
.invite-copy {
  background: white;
  color: var(--brand);
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 13px; font-weight: 600;
}
.invite-copy:hover { background: var(--brand-light); }

/* ====== 表格 ====== */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td {
  padding: 12px 14px; text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.tbl th { background: var(--bg); color: var(--text-sub); font-weight: 500; font-size: 12px; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: #FAFBFC; }
.tbl .num { font-family: "SF Mono", Consolas, monospace; }

.status-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}
.status-tag.s0 { background: #FFF7E6; color: #D97706; }
.status-tag.s1 { background: #E0F7F4; color: #0F9E8E; }
.status-tag.s2 { background: #FEE2E2; color: #DC2626; }

.empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-faint);
  font-size: 13px;
}

/* ====== 分页 ====== */
.pager {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; margin-top: 16px;
}
.pager button {
  padding: 6px 12px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
}
.pager button:disabled { color: var(--text-faint); cursor: not-allowed; }
.pager .pg-info { font-size: 12px; color: var(--text-sub); padding: 0 8px; }

/* ====== 个人中心 ====== */
.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 640px) {
  .profile-grid { grid-template-columns: 1fr; }
  .invite-box { flex-direction: column; align-items: stretch; text-align: center; }
}
.profile-item {
  display: flex; padding: 10px 0;
  border-bottom: 1px dashed var(--border);
}
.profile-item:last-child { border-bottom: none; }
.profile-label { color: var(--text-sub); width: 100px; flex-shrink: 0; }
.profile-value { color: var(--text); flex: 1; word-break: break-all; }

/* ====== 响应式 ====== */
@media (max-width: 640px) {
  .topbar { padding: 12px 16px; }
  .main { padding: 16px; }
  .stat-value { font-size: 22px; }
  .tbl th, .tbl td { padding: 8px 10px; }
}
