/* ============================================================
   Custom Soul 云端 — 全站样式
   依赖 tokens.css
   ============================================================ */

/* ---------------------------------------------------------- 布局 */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--sp-6); }
.wrap-narrow { max-width: var(--maxw-narrow); margin: 0 auto; padding: 0 var(--sp-6); }

/* ---------------------------------------------------------- 顶栏 */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: rgba(255, 255, 255, .86);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border-soft);
}
.site-header .wrap {
  height: 100%; display: flex; align-items: center; gap: var(--sp-6);
}
.brand {
  display: flex; align-items: center; gap: var(--sp-3);
  font-weight: 700; font-size: 16px; color: var(--text); text-decoration: none;
}
.brand:hover { text-decoration: none; color: var(--text); }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, var(--brand-400), var(--brand-600));
  display: grid; place-items: center;
  color: #fff; font-size: 15px; font-weight: 800;
  box-shadow: 0 3px 10px rgba(124, 92, 255, .32);
}
.site-nav { display: flex; align-items: center; gap: var(--sp-5); margin-left: auto; }
.site-nav a {
  color: var(--text-muted); font-size: 14px; font-weight: 500; text-decoration: none;
  padding: 6px 2px; border-bottom: 2px solid transparent; transition: color .15s, border-color .15s;
}
.site-nav a:hover { color: var(--text); text-decoration: none; }
.site-nav a.active { color: var(--brand-600); border-bottom-color: var(--brand-500); }

/* ---------------------------------------------------------- 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px; border-radius: var(--r-md);
  border: 1px solid transparent; background: var(--brand-500); color: #fff;
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background .15s, box-shadow .15s, transform .06s, border-color .15s;
  white-space: nowrap; text-decoration: none;
}
.btn:hover { background: var(--brand-600); color: #fff; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] {
  opacity: .5; cursor: not-allowed; transform: none;
}
.btn-ghost {
  background: var(--white); color: var(--text); border-color: var(--border);
  box-shadow: var(--sh-xs);
}
.btn-ghost:hover { background: var(--bg-subtle); color: var(--text); border-color: var(--ink-300); }
.btn-danger { background: var(--err-500); }
.btn-danger:hover { background: var(--err-700); }
.btn-ok { background: var(--ok-500); }
.btn-ok:hover { background: var(--ok-700); }
.btn-sm { padding: 5px 12px; font-size: 13px; border-radius: var(--r-sm); }
.btn-block { width: 100%; }

/* ---------------------------------------------------------- 卡片 */
.card {
  background: var(--bg-surface); border: 1px solid var(--border-soft);
  border-radius: var(--r-lg); box-shadow: var(--sh-xs);
}
.card-pad { padding: var(--sp-6); }
.card-head {
  padding: var(--sp-4) var(--sp-6); border-bottom: 1px solid var(--border-soft);
  display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap;
}
.card-head h2, .card-head h3 { font-size: 15px; font-weight: 650; }
.card-head .spacer { margin-left: auto; }
.card-body { padding: var(--sp-6); }

/* ---------------------------------------------------------- 表单 */
.field { margin-bottom: var(--sp-5); }
.field label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--ink-700); margin-bottom: 6px;
}
.field .hint { font-size: 12.5px; color: var(--text-faint); margin-top: 5px; line-height: 1.5; }
.input, .select, .textarea {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--white); color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--brand-400);
  box-shadow: 0 0 0 3px var(--brand-100);
}
.textarea { min-height: 84px; resize: vertical; }
.input-mono { font-family: var(--font-mono); font-size: 13px; }
.input-group { display: flex; gap: var(--sp-2); }
.input-group .input { flex: 1; }

/* ---------------------------------------------------------- 提示条 */
.alert {
  padding: 11px 14px; border-radius: var(--r-md); font-size: 13.5px;
  border: 1px solid transparent; margin-bottom: var(--sp-4); line-height: 1.6;
}
.alert-ok   { background: var(--ok-50);   color: var(--ok-700);   border-color: #b9e6cd; }
.alert-warn { background: var(--warn-50); color: var(--warn-700); border-color: #f2dcae; }
.alert-err  { background: var(--err-50);  color: var(--err-700);  border-color: #f5c6c6; }
.alert-info { background: var(--info-50); color: var(--info-700); border-color: #c3daf7; }
.alert strong { font-weight: 650; }

/* ---------------------------------------------------------- 徽标 */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: var(--r-full);
  font-size: 12px; font-weight: 600; line-height: 1.7; white-space: nowrap;
}
.badge-ok    { background: var(--ok-50);   color: var(--ok-700); }
.badge-warn  { background: var(--warn-50); color: var(--warn-700); }
.badge-err   { background: var(--err-50);  color: var(--err-700); }
.badge-info  { background: var(--info-50); color: var(--info-700); }
.badge-brand { background: var(--brand-50); color: var(--brand-700); }
.badge-mute  { background: var(--ink-100);  color: var(--ink-600); }

/* ---------------------------------------------------------- 表格 */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th {
  text-align: left; font-weight: 600; font-size: 12.5px;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em;
  padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.data td {
  padding: 12px 14px; border-bottom: 1px solid var(--border-soft); vertical-align: middle;
}
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: var(--bg-subtle); }
.mono { font-family: var(--font-mono); font-size: 12.5px; }
.ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------------------------------------------------- 空状态 */
.empty {
  text-align: center; padding: var(--sp-12) var(--sp-6); color: var(--text-muted);
}
.empty-icon { font-size: 34px; opacity: .4; margin-bottom: var(--sp-3); }
.empty h3 { font-size: 15px; color: var(--text); margin-bottom: 6px; }
.empty p { font-size: 13.5px; margin-bottom: var(--sp-5); }

/* ---------------------------------------------------------- 代码块 */
pre.code {
  background: var(--bg-code); border: 1px solid var(--border-soft);
  border-radius: var(--r-md); padding: 14px 16px;
  font-size: 12.5px; line-height: 1.7; overflow-x: auto; margin: 0;
  color: var(--ink-800);
}
code.inline {
  background: var(--bg-code); border: 1px solid var(--border-soft);
  border-radius: var(--r-xs); padding: 1px 6px; font-size: 12.5px;
  color: var(--brand-700);
}

/* ---------------------------------------------------------- 页脚 */
.site-footer {
  margin-top: var(--sp-16); padding: var(--sp-8) 0;
  border-top: 1px solid var(--border-soft);
  color: var(--text-faint); font-size: 13px;
}
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: var(--sp-4); align-items: center; }
.site-footer .spacer { margin-left: auto; }
.site-footer a { color: var(--text-muted); }

/* ---------------------------------------------------------- 工具类 */
.mt-0 { margin-top: 0; }  .mt-2 { margin-top: var(--sp-2); }
.mt-4 { margin-top: var(--sp-4); } .mt-6 { margin-top: var(--sp-6); }
.mt-8 { margin-top: var(--sp-8); }
.mb-2 { margin-bottom: var(--sp-2); } .mb-4 { margin-bottom: var(--sp-4); }
.mb-6 { margin-bottom: var(--sp-6); }
.row { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; }
.spacer { margin-left: auto; }
.text-muted { color: var(--text-muted); }
.text-faint { color: var(--text-faint); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.text-center { text-align: center; }
.hidden { display: none !important; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--sp-5); }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--sp-5); }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--sp-4); }

/* ---------------------------------------------------------- 响应式 */
@media (max-width: 720px) {
  .wrap, .wrap-narrow { padding: 0 var(--sp-4); }
  .site-nav { gap: var(--sp-4); }
  .site-nav a { font-size: 13px; }
  .card-pad, .card-body { padding: var(--sp-5); }
  .card-head { padding: var(--sp-3) var(--sp-5); }
  body { font-size: 14.5px; }
}
@media (max-width: 520px) {
  .site-nav .hide-sm { display: none; }
  .brand span.brand-text { display: none; }
}
