/* ============================================================
   SRM 子域名平台 — 全局样式
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #f4f6fa;
  --card: #ffffff;
  --primary: #0071e3;
  --primary-dark: #005bb8;
  --text: #1a1a2e;
  --muted: #7a8296;
  --border: #e3e8f0;
  --green: #16a34a;
  --red: #dc2626;
  --amber: #d97706;
  --radius: 14px;
}
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(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- 顶栏 ---------- */
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; color: var(--text); text-decoration: none; }
.brand .logo {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), #38bdf8);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 900;
}
.brand small { color: var(--muted); font-weight: 400; }
.topbar .right { display: flex; align-items: center; gap: 12px; }
.user-chip { color: var(--text); font-size: 13px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px; border-radius: 10px; border: 1px solid transparent;
  font-size: 14px; font-weight: 600; cursor: pointer; transition: all .15s;
  background: var(--primary); color: #fff; text-decoration: none;
}
.btn:hover { background: var(--primary-dark); text-decoration: none; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn.ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn.green { background: var(--green); }
.btn.red { background: var(--red); }
.btn.amber { background: var(--amber); }
.btn.sm { padding: 5px 12px; font-size: 12.5px; border-radius: 8px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- 卡片与布局 ---------- */
.container { max-width: 1080px; margin: 0 auto; padding: 28px 20px 60px; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; margin-bottom: 20px;
}
.card h2 { font-size: 17px; margin-bottom: 14px; }
.card h3 { font-size: 15px; margin-bottom: 10px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 780px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---------- 表单 ---------- */
label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 5px; color: var(--text); }
input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  font-size: 14px; background: #fff; color: var(--text); outline: none; transition: border .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.form-row { display: flex; gap: 10px; align-items: flex-end; }
.form-row > * { flex: 1; }
.form-row .fixed { flex: 0 0 auto; }

/* ---------- 表格 ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 12.5px; white-space: nowrap; }
tr:hover td { background: #f8fafc; }
.mono { font-family: 'SF Mono', Consolas, monospace; font-size: 12.5px; }

/* ---------- 徽章 ---------- */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 700;
}
.badge.pending { background: #fef3c7; color: var(--amber); }
.badge.approved { background: #dcfce7; color: var(--green); }
.badge.rejected { background: #fee2e2; color: var(--red); }
.badge.admin { background: #ede9fe; color: #6d28d9; }

/* ---------- 提示 ---------- */
.msg { padding: 10px 14px; border-radius: 10px; font-size: 13px; margin: 10px 0; display: none; }
.msg.show { display: block; }
.msg.err { background: #fee2e2; color: var(--red); }
.msg.ok { background: #dcfce7; color: var(--green); }
.msg.info { background: #dbeafe; color: var(--primary-dark); }

/* ---------- Toast ---------- */
#toast-box { position: fixed; top: 74px; right: 20px; z-index: 999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--text); color: #fff; padding: 11px 16px; border-radius: 10px;
  font-size: 13px; opacity: 0; transform: translateX(20px); transition: all .25s;
  max-width: 340px; box-shadow: 0 8px 24px rgba(0,0,0,.15);
}
.toast.show { opacity: 1; transform: translateX(0); }
.toast.err { background: var(--red); }
.toast.ok { background: var(--green); }

/* ---------- 空状态 ---------- */
.empty { text-align: center; color: var(--muted); padding: 36px 0; }
.empty .big { font-size: 38px; margin-bottom: 8px; }

/* ---------- 首页 Hero ---------- */
.hero { text-align: center; padding: 48px 20px 30px; }
.hero h1 { font-size: 34px; font-weight: 900; letter-spacing: -.5px; }
.hero .sub { color: var(--muted); margin-top: 10px; font-size: 15px; }
.hero .cta { margin-top: 24px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 30px; }
@media (max-width: 780px) { .steps { grid-template-columns: 1fr; } }
.step { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; text-align: center; }
.step .num {
  width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800; margin: 0 auto 10px;
}
.step h3 { font-size: 14.5px; margin-bottom: 6px; }
.step p { font-size: 12.5px; color: var(--muted); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 8px; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
.tab {
  padding: 9px 18px; border-radius: 10px 10px 0 0; cursor: pointer; font-weight: 600;
  color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-size: 14px;
}
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ---------- 记录行 ---------- */
.rec-line { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--border); flex-wrap: wrap; }
.rec-line:last-child { border-bottom: none; }
.rec-line .type-chip {
  font-weight: 700; font-size: 11px; padding: 2px 8px; border-radius: 6px; background: #eef2ff; color: #4338ca;
}
.rec-line .val { flex: 1; min-width: 160px; }
.rec-line .proxy-chip { font-size: 11px; color: var(--muted); background: #f1f5f9; padding: 2px 8px; border-radius: 6px; }

.modal-mask {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .45); display: none;
  align-items: center; justify-content: center; z-index: 100;
}
.modal-mask.show { display: flex; }
.modal { background: #fff; border-radius: var(--radius); padding: 24px; width: 440px; max-width: 92vw; }
.modal h3 { margin-bottom: 6px; }

/* ---------- OAuth 登录按钮 ---------- */
.oauth-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 11px 14px; border-radius: 10px; border: 1px solid var(--border);
  background: #fff; color: var(--text); font-size: 14px; font-weight: 600; cursor: pointer;
  transition: all .15s; text-decoration: none; margin-bottom: 10px;
}
.oauth-btn:hover { border-color: var(--primary); background: #f8faff; text-decoration: none; }
.oauth-btn .ico { width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; font-size: 16px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; margin: 18px 0 4px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
