/* ============================================================
   TatoLease — 子域名解析租赁分发系统
   品牌色：蓝紫渐变（#4f7cff → #6c5ce7）+ 橙色租约强调（#f59e0b）
   ============================================================ */
:root {
  --brand: #4f7cff;
  --brand-2: #6c5ce7;
  --brand-grad: linear-gradient(120deg, #4f7cff, #6c5ce7);
  --gold: #f59e0b;
  --gold-grad: linear-gradient(120deg, #f59e0b, #f97316);
  --fg: #1f2329;
  --fg-2: #4e5969;
  --fg-3: #86909c;
  --line: #e5e6eb;
  --line-soft: #f2f3f5;
  --bg: #f7f8fb;
  --card: #ffffff;
  --ok: #00b42a;
  --warn: #ff7d00;
  --danger: #f53f3f;
  --r: 14px;
  --shadow: 0 10px 30px -12px rgba(31, 45, 80, .18);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--bg); scrollbar-width: thin; }
body {
  margin: 0; font-family: var(--font); color: var(--fg); font-size: 14px; line-height: 1.65;
  background:
    radial-gradient(900px 460px at 8% -6%, rgba(79, 124, 255, .10), transparent 60%),
    radial-gradient(820px 420px at 94% 4%, rgba(108, 92, 231, .08), transparent 60%),
    var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
code { font-family: Consolas, 'SFMono-Regular', monospace; font-size: 12.5px; background: var(--line-soft); border-radius: 5px; padding: 1px 6px; color: #c7254e; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 100; backdrop-filter: blur(14px);
  background: rgba(255, 255, 255, .78); border-bottom: 1px solid var(--line);
}
.tb-inner { max-width: 1200px; margin: 0 auto; padding: 0 22px; height: 62px; display: flex; align-items: center; gap: 26px; }
.tb-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; color: var(--fg); text-decoration: none; letter-spacing: .2px; }
.tb-brand img { width: 32px; height: 32px; }
.tb-brand b { color: var(--gold); font-weight: 800; }
.tb-nav { display: flex; gap: 4px; flex: 1; }
.tb-nav a { padding: 8px 14px; border-radius: 9px; color: var(--fg-2); font-weight: 500; text-decoration: none; }
.tb-nav a:hover { background: rgba(79, 124, 255, .08); color: var(--brand); text-decoration: none; }
.tb-nav a.on { color: var(--brand); background: rgba(79, 124, 255, .10); font-weight: 600; }
.tb-acts { display: flex; align-items: center; gap: 10px; }

/* ---------- 通用 ---------- */
.wrap { max-width: 1200px; margin: 0 auto; padding: 26px 22px 60px; }
.mono-num { font-variant-numeric: tabular-nums; }
h1, h2, h3 { margin: 0; font-weight: 700; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h2 { font-size: 22px; }
.muted { color: var(--fg-3); }
.small { font-size: 12.5px; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.mb8 { margin-bottom: 8px; } .mb16 { margin-bottom: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; padding: 0 18px; border-radius: 10px; border: 1px solid transparent;
  background: var(--brand-grad); color: #fff; font: inherit; font-weight: 600; font-size: 14px;
  cursor: pointer; transition: transform .12s ease, filter .12s ease, box-shadow .12s ease;
  box-shadow: 0 6px 16px -6px rgba(79, 124, 255, .5);
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.04); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn.lg { height: 46px; padding: 0 24px; font-size: 15px; }
.btn.gold { background: var(--gold-grad); box-shadow: 0 6px 16px -6px rgba(245, 158, 11, .5); }
.btn.plain { background: #fff; color: var(--fg); border-color: var(--line); box-shadow: none; }
.btn.plain:hover { color: var(--brand); border-color: #c9d6f5; }
.btn.ghost { background: rgba(255, 255, 255, .6); color: var(--fg-2); border-color: var(--line); box-shadow: none; }
.btn.ghost:hover { color: var(--brand); border-color: #c9d6f5; background: #fff; }
.btn.danger-line { background: #fff; color: var(--danger); border-color: #ffd2d2; box-shadow: none; }
.btn.danger-line:hover { background: #fff3f3; }
.btn.block { width: 100%; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow); padding: 22px;
}
.card.tight { padding: 16px 18px; }
.card + .card { margin-top: 16px; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-title h3 { font-size: 16px; }

/* ---------- 表单 ---------- */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; font-weight: 600; color: var(--fg-2); margin-bottom: 6px; }
.input, select.input, textarea.input {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--fg); font: inherit; font-size: 14px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; padding: 10px 12px; resize: vertical; }
.input:focus, select.input:focus, textarea.input:focus {
  border-color: #a9c0ff; box-shadow: 0 0 0 3px rgba(79, 124, 255, .14);
}
.inline-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; align-items: end; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th, .tbl td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.tbl th { background: #fafbfc; font-weight: 600; color: var(--fg-2); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: #fafcff; }
.tbl .wrap-cell { white-space: normal; max-width: 320px; }

/* ---------- 状态徽标 ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { color: #0f8a3c; background: #e8f8ee; }
.pill.warn { color: #b25e00; background: #fff4e5; }
.pill.err { color: #c22b2b; background: #ffefef; }
.pill.dim { color: var(--fg-3); background: var(--line-soft); }
.pill.gold { color: #a15c00; background: #fff7e8; }

/* ---------- 商城 ---------- */
.hero { padding: 34px 0 8px; }
.hero h1 { font-size: 30px; line-height: 1.3; margin-bottom: 10px; }
.hero h1 em { font-style: normal; background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { margin: 0; color: var(--fg-2); font-size: 15px; max-width: 720px; }
.store-search { display: flex; gap: 10px; margin: 22px 0; max-width: 560px; }
.store-search .input { flex: 1; }
.store-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.store-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; transition: transform .15s, box-shadow .15s; }
.store-card:hover { transform: translateY(-2px); box-shadow: 0 16px 36px -16px rgba(31, 45, 80, .26); }
.store-card .dom { font-size: 17px; font-weight: 700; word-break: break-all; }
.store-card .dom code { font-size: 15px; background: transparent; color: var(--fg); padding: 0; }
.store-card .prices { display: flex; gap: 8px; flex-wrap: wrap; }
.price-chip { flex: 1; min-width: 84px; border: 1px solid var(--line-soft); border-radius: 10px; padding: 8px 10px; text-align: center; background: #fcfdff; }
.price-chip b { display: block; font-size: 16px; color: var(--brand); }
.price-chip span { font-size: 12px; color: var(--fg-3); }
.price-chip.sel { border-color: #a9c0ff; background: #eef3ff; }
.store-card .types { display: flex; gap: 6px; flex-wrap: wrap; }
.type-tag { font-size: 11.5px; color: var(--fg-2); background: var(--line-soft); border-radius: 6px; padding: 2px 8px; }

/* ---------- 弹窗 ---------- */
.mask { position: fixed; inset: 0; background: rgba(15, 17, 23, .45); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; z-index: 300; padding: 20px; }
.modal { width: 100%; max-width: 460px; background: #fff; border-radius: 16px; box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .4); padding: 24px; max-height: 88vh; overflow: auto; }
.modal h3 { font-size: 18px; margin-bottom: 4px; }
.modal .sub { color: var(--fg-3); font-size: 13px; margin-bottom: 16px; }
.modal-acts { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

/* ---------- 提示 ---------- */
.toast { position: fixed; top: 76px; left: 50%; transform: translateX(-50%); z-index: 400;
  background: #1f2329; color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 13.5px; box-shadow: 0 12px 30px -10px rgba(0,0,0,.4);
  animation: toastIn .18s ease; }
.toast.err { background: #c22b2b; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, -6px); } to { opacity: 1; transform: translate(-50%, 0); } }

.alert { padding: 12px 16px; border-radius: 10px; font-size: 13.5px; margin-bottom: 16px; }
.alert.info { background: #eef3ff; border: 1px solid #d6e2ff; color: #2b4acb; }
.alert.warn { background: #fff7e8; border: 1px solid #ffe2b3; color: #a15c00; }
.alert.err { background: #ffefef; border: 1px solid #ffd2d2; color: #c22b2b; }

/* ---------- 空状态 ---------- */
.empty { text-align: center; padding: 56px 20px; color: var(--fg-3); }
.empty b { display: block; font-size: 16px; color: var(--fg-2); margin-bottom: 6px; }

/* ---------- 登录页 ---------- */
.auth-wrap { min-height: calc(100vh - 62px); display: flex; align-items: center; justify-content: center; padding: 30px 20px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; font-size: 20px; font-weight: 800; }
.auth-logo img { width: 40px; height: 40px; }
.auth-logo b { color: var(--gold); }

/* ---------- 管理后台 ---------- */
.admin-layout { display: grid; grid-template-columns: 210px 1fr; gap: 20px; align-items: start; }
.admin-side { position: sticky; top: 82px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; box-shadow: var(--shadow); }
.admin-side a { display: block; padding: 10px 14px; border-radius: 10px; color: var(--fg-2); text-decoration: none; font-weight: 500; margin-bottom: 2px; }
.admin-side a:hover { background: rgba(79, 124, 255, .08); color: var(--brand); text-decoration: none; }
.admin-side a.on { background: var(--brand-grad); color: #fff; font-weight: 600; box-shadow: 0 6px 14px -6px rgba(79, 124, 255, .5); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.stat b { display: block; font-size: 24px; font-weight: 700; }
.stat span { color: var(--fg-3); font-size: 12.5px; }
.stat.gold b { color: var(--gold); }

/* ---------- 页脚 ---------- */
.footer { border-top: 1px solid var(--line); padding: 22px; text-align: center; color: var(--fg-3); font-size: 12.5px; }

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-side { position: static; display: flex; gap: 6px; overflow-x: auto; }
  .admin-side a { white-space: nowrap; }
  .tb-nav { display: none; }
}
