/* ==========================================================================
   AI SaaS Base — 自带样式（不依赖 npm / vite / CDN，解压即用）
   ========================================================================== */

:root {
  --bg:            #f6f7f9;
  --surface:       #ffffff;
  --border:        #e4e7ec;
  --text:          #101828;
  --text-muted:    #667085;
  --brand:         #4f46e5;
  --brand-dark:    #4338ca;
  --brand-soft:    #eef2ff;
  --danger:        #d92d20;
  --danger-soft:   #fef3f2;
  --success:       #067647;
  --success-soft:  #ecfdf3;
  --warning:       #b54708;
  --warning-soft:  #fffaeb;
  --radius:        10px;
  --radius-sm:     7px;
  --shadow-sm:     0 1px 2px rgba(16,24,40,.05);
  --shadow:        0 4px 12px rgba(16,24,40,.08);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.3; font-weight: 650; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p  { margin: 0 0 1em; }

/* ---------------- 布局 ---------------- */

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 30;
}
.topbar-inner {
  max-width: 1120px; margin: 0 auto; padding: 0 20px;
  height: 60px; display: flex; align-items: center; gap: 20px;
}
.brand {
  font-weight: 700; font-size: 1.05rem; color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.brand-mark {
  width: 26px; height: 26px; border-radius: 7px;
  background: linear-gradient(135deg, var(--brand), #7c3aed);
  display: inline-grid; place-items: center;
  color: #fff; font-size: 14px; font-weight: 700;
}
.topnav { display: flex; gap: 6px; margin-left: auto; align-items: center; }
.topnav a.navlink {
  color: var(--text-muted); padding: 7px 11px; border-radius: var(--radius-sm);
  font-size: .92rem;
}
.topnav a.navlink:hover { background: var(--bg); color: var(--text); text-decoration: none; }
.topnav a.navlink.active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }

.container { max-width: 1120px; margin: 0 auto; padding: 28px 20px 64px; }
.container-narrow { max-width: 460px; margin: 0 auto; padding: 56px 20px; }

/* ---------------- 卡片 ---------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 22px;
}
.card + .card { margin-top: 18px; }
.card-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
}
.card-head h2, .card-head h3 { margin: 0; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
@media (max-width: 820px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ---------------- 表单 ---------------- */

.field { margin-bottom: 16px; }
.field label {
  display: block; font-size: .88rem; font-weight: 600;
  color: var(--text); margin-bottom: 6px;
}
.field .hint { font-size: .8rem; color: var(--text-muted); margin-top: 5px; }

input[type=text], input[type=email], input[type=password], input[type=number],
input[type=url], select, textarea {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  font-family: inherit; font-size: .95rem;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}
input[aria-invalid=true] { border-color: var(--danger); }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--brand); }

.checkline { display: flex; align-items: flex-start; gap: 9px; font-size: .88rem; }
.checkline label { margin: 0; font-weight: 400; color: var(--text-muted); }

/* ---------------- 按钮 ---------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 16px; border-radius: var(--radius-sm);
  border: 1px solid transparent; cursor: pointer;
  font-family: inherit; font-size: .93rem; font-weight: 600;
  transition: background .15s, border-color .15s, transform .05s;
  text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); text-decoration: none; color: #fff; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg); text-decoration: none; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b42318; text-decoration: none; color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 11px; font-size: .85rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------------- 提示 ---------------- */

.alert {
  border-radius: var(--radius-sm); padding: 11px 14px;
  font-size: .9rem; margin-bottom: 16px; border: 1px solid transparent;
}
.alert ul { margin: 0; padding-left: 18px; }
.alert li + li { margin-top: 4px; }
.alert-error   { background: var(--danger-soft);  border-color: #fecdca; color: #912018; }
.alert-success { background: var(--success-soft); border-color: #abefc6; color: var(--success); }
.alert-info    { background: var(--brand-soft);   border-color: #c7d2fe; color: var(--brand-dark); }
.alert-warning { background: var(--warning-soft); border-color: #fedf89; color: var(--warning); }

/* ---------------- 徽标 / 表格 ---------------- */

.badge {
  display: inline-block; padding: 2px 9px; border-radius: 100px;
  font-size: .76rem; font-weight: 600; line-height: 1.6;
}
.badge-ok      { background: var(--success-soft); color: var(--success); }
.badge-warn    { background: var(--warning-soft); color: var(--warning); }
.badge-bad     { background: var(--danger-soft);  color: var(--danger); }
.badge-muted   { background: var(--bg); color: var(--text-muted); }
.badge-brand   { background: var(--brand-soft); color: var(--brand-dark); }

table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); font-weight: 600; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fcfcfd; }

/* ---------------- 统计块 ---------------- */

.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.stat .label { font-size: .8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; }
.stat .value { font-size: 1.7rem; font-weight: 700; margin-top: 4px; line-height: 1.2; }
.stat .sub   { font-size: .82rem; color: var(--text-muted); margin-top: 2px; }

/* ---------------- 套餐卡 ---------------- */

.plan {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  display: flex; flex-direction: column; gap: 10px;
}
.plan.featured { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79,70,229,.08); }
.plan .plan-name { font-weight: 650; font-size: 1rem; }
.plan .plan-price { font-size: 1.9rem; font-weight: 750; line-height: 1; }
.plan .plan-price small { font-size: .8rem; font-weight: 500; color: var(--text-muted); }
.plan ul { margin: 0; padding-left: 18px; font-size: .88rem; color: var(--text-muted); }
.plan ul li + li { margin-top: 5px; }

/* ---------------- 杂项 ---------------- */

.muted { color: var(--text-muted); }
.small { font-size: .85rem; }
.tiny  { font-size: .78rem; }
.mono  { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.right { text-align: right; }
.center { text-align: center; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; } .mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: 16px; }
.flex { display: flex; gap: 10px; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }
.divider { height: 1px; background: var(--border); margin: 18px 0; border: 0; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; }
.auth-title { text-align: center; margin-bottom: 6px; }
.auth-sub { text-align: center; color: var(--text-muted); font-size: .9rem; margin-bottom: 22px; }
.auth-foot { text-align: center; font-size: .88rem; color: var(--text-muted); margin-top: 20px; }

footer.site-foot {
  max-width: 1120px; margin: 0 auto; padding: 24px 20px 40px;
  color: var(--text-muted); font-size: .82rem; text-align: center;
}
