:root {
  --bg: #fff8fc;
  --bg-2: #fff2f9;
  --panel: #ffffff;
  --panel-2: #fff4fa;
  --border: #ffe1ee;
  --border-soft: #ffedf5;
  --text: #4b3f56;
  --muted: #9b8ea6;
  --muted-2: #b7aac1;
  --accent: #ff86b6;
  --accent-2: #3fcaa0;
  --warn: #ffb84d;
  --danger: #ff6b8a;
  --purple: #b49dff;
  --radius: 20px;
  --shadow: 0 14px 34px rgba(255, 150, 190, 0.18);
  --shadow-soft: 0 8px 22px rgba(255, 170, 200, 0.14);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(900px 520px at 8% -12%, #ffe3f1, transparent 60%),
    radial-gradient(820px 460px at 96% -4%, #e2f2ff, transparent 58%),
    radial-gradient(760px 520px at 50% 112%, #e6fff6, transparent 58%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: #ef6ca4; text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
.hidden { display: none !important; }

.drop-svg { vertical-align: middle; display: inline-block; }
.drop-emoji { display: inline-block; line-height: 1; vertical-align: middle; filter: drop-shadow(0 2px 3px rgba(120, 200, 255, 0.35)); }
.drop-badge { display: inline-flex; align-items: center; justify-content: center; }

/* ---------------- 登录 ---------------- */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-card {
  width: 100%;
  max-width: 430px;
  background: linear-gradient(180deg, #ffffff, #fff6fb);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 34px 30px;
  box-shadow: var(--shadow);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}
.brand .logo {
  width: 48px; height: 48px;
  border-radius: 16px;
  background: linear-gradient(135deg, #d7f0ff, #e6fff6);
  border: 1px solid #d6eeff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 -4px 10px rgba(120, 200, 255, 0.18);
}
.brand h1 { font-size: 20px; margin: 0; letter-spacing: 0.5px; color: #46384f; }
.brand p { margin: 3px 0 0; color: var(--muted); font-size: 12.5px; }
.auth-tabs {
  display: flex;
  background: var(--bg-2);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 5px;
  margin: 22px 0 18px;
}
.auth-tabs button {
  flex: 1;
  background: transparent;
  border: 0;
  color: var(--muted);
  padding: 9px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
}
.auth-tabs button.active { background: #fff; color: #e85f9a; box-shadow: var(--shadow-soft); }
.field { margin-bottom: 13px; }
.field label {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 6px;
}
.field input, .field select, .field textarea, .input {
  width: 100%;
  background: #fff8fc;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 11px 14px;
  border-radius: 14px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus, .input:focus {
  border-color: #ffb3d3;
  box-shadow: 0 0 0 3px rgba(255, 150, 190, 0.18);
  background: #fff;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: linear-gradient(135deg, #ffa2c8, #ff7cad);
  color: #fff;
  border: 0;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(255, 124, 173, 0.28);
  transition: filter 0.15s, transform 0.1s, opacity 0.15s;
}
.btn:hover { filter: brightness(1.04); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; }
.btn.block { width: 100%; padding: 12px; margin-top: 8px; }
.btn.ghost { background: #fff; border: 1px solid var(--border); color: var(--text); box-shadow: none; }
.btn.subtle { background: var(--panel-2); color: #e0659a; border: 1px solid var(--border); box-shadow: none; }
.btn.green { background: linear-gradient(135deg, #8ceccb, #43cfa4); color: #08402f; box-shadow: 0 8px 18px rgba(67, 207, 164, 0.26); }
.btn.danger { background: #fff; border: 1px solid rgba(255, 107, 138, 0.45); color: var(--danger); box-shadow: none; }
.btn.sm { padding: 6px 13px; font-size: 12.5px; }
.btn.xs { padding: 5px 11px; font-size: 12px; }
.hint-box {
  margin-top: 16px;
  background: #f2fbf7;
  border: 1px solid #d6f4e8;
  border-radius: 16px;
  padding: 12px 14px;
  font-size: 12px;
  color: #5f7d72;
  line-height: 1.8;
}
.hint-box code { color: #e0659a; background: #fff; padding: 1px 6px; border-radius: 6px; }

/* ---------------- 布局 ---------------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 236px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #ffffff, #fff7fc);
  border-right: 1px solid var(--border-soft);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar .brand { padding: 0 6px; }
.sidebar .brand .logo { width: 40px; height: 40px; border-radius: 13px; }
.sidebar .brand h1 { font-size: 16.5px; }
.nav { margin-top: 24px; display: flex; flex-direction: column; gap: 4px; flex: 1; overflow-y: auto; }
.nav .group-label {
  font-size: 11px;
  color: var(--muted-2);
  letter-spacing: 1px;
  margin: 14px 12px 6px;
}
.nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: 0;
  color: #7d7088;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 13.5px;
  text-align: left;
  font-weight: 600;
}
.nav button:hover { background: #fff1f8; color: #e0659a; }
.nav button.active {
  background: linear-gradient(90deg, #ffe4f1, #fff3f9);
  color: #e05595;
  box-shadow: inset 3px 0 0 var(--accent);
}
.nav .ico { width: 18px; text-align: center; opacity: 0.9; }
.sidebar-foot { border-top: 1px solid var(--border-soft); padding-top: 14px; margin-top: 10px; }
.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 14px; background: var(--panel-2);
}
.avatar {
  width: 34px; height: 34px; border-radius: 11px;
  background: linear-gradient(135deg, #c9b4ff, #ffa9cd);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px; color: #fff; flex-shrink: 0;
}
.user-chip .meta { flex: 1; min-width: 0; }
.user-chip .meta .nm { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .meta .rl { font-size: 11px; color: var(--muted); }
.logout-btn { background: transparent; border: 0; color: var(--muted); font-size: 12px; padding: 8px 10px; margin-top: 6px; border-radius: 10px; width: 100%; text-align: left; }
.logout-btn:hover { color: var(--danger); background: #fff0f4; }

.main { flex: 1; min-width: 0; padding: 26px 32px 60px; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 24px; flex-wrap: wrap;
}
.topbar h2 { margin: 0; font-size: 21px; color: #46384f; }
.topbar .sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.balance-chip {
  display: inline-flex; align-items: center; gap: 9px;
  background: linear-gradient(135deg, #e9fff7, #e6f4ff);
  border: 1px solid #c9f0e2;
  padding: 8px 16px 8px 12px; border-radius: 999px;
  box-shadow: var(--shadow-soft);
}
.balance-chip .drop-badge { display: flex; }
.balance-chip .lbl { font-size: 12px; color: #6f9284; }
.balance-chip .val { font-size: 17px; font-weight: 800; color: #1f9d78; }
.balance-chip .unit { font-size: 12px; color: #7aa595; }

/* ---------------- 卡片/表格 ---------------- */
.grid { display: grid; gap: 16px; }
.stats { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.stat-card {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 18px 18px;
  box-shadow: var(--shadow-soft);
}
.stat-card .k { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.stat-card .v { font-size: 25px; font-weight: 800; margin-top: 10px; color: #4a3b54; }
.stat-card .s { font-size: 12px; color: var(--muted-2); margin-top: 6px; }
.stat-card.accent .v { color: var(--accent); }
.stat-card.green .v { color: #1f9d78; }
.stat-card.warn .v { color: #e79a1f; }
.stat-card.purple .v { color: #8f74e8; }
.stat-card.danger .v { color: var(--danger); }

.panel {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-soft);
}
.panel + .panel { margin-top: 18px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.panel-head h3 { margin: 0; font-size: 15.5px; color: #46384f; }
.panel-head .desc { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.two-col { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; }
@media (max-width: 1100px) { .two-col { grid-template-columns: 1fr; } }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  text-align: left; color: #a08fa9; font-weight: 700; font-size: 12px;
  padding: 10px 12px; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td { padding: 11px 12px; border-bottom: 1px solid #fff0f7; vertical-align: middle; color: #574a61; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fff7fb; }
.tscroll { overflow-x: auto; }
.mono { font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace; font-size: 12px; }
.muted { color: var(--muted); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; border: 1px solid transparent; white-space: nowrap;
}
.badge.green { background: #e8fbf3; color: #1f9d78; border-color: #c6f0e0; }
.badge.blue { background: #e8f3ff; color: #4a86e8; border-color: #cfe4ff; }
.badge.warn { background: #fff6e3; color: #d99018; border-color: #ffe6b8; }
.badge.red { background: #ffeaf0; color: #e0557b; border-color: #ffd0dd; }
.badge.gray { background: #f4f1f6; color: #9b8ea6; border-color: #ece6f0; }
.badge.purple { background: #f1ecff; color: #8f74e8; border-color: #e2d9ff; }

/* 模型卡 */
.model-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.model-card {
  background: #fff;
  border: 1px solid var(--border-soft); border-radius: var(--radius);
  padding: 18px; display: flex; flex-direction: column; gap: 12px;
  box-shadow: var(--shadow-soft);
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.model-card:hover { border-color: #ffc7de; transform: translateY(-3px); box-shadow: var(--shadow); }
.model-card .top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.model-card .nm { font-size: 15.5px; font-weight: 800; color: #46384f; }
.model-card .id { font-size: 11.5px; color: var(--muted-2); margin-top: 3px; }
.model-card .desc { font-size: 12.5px; color: var(--muted); line-height: 1.65; min-height: 38px; }
.model-card .spec { display: flex; gap: 14px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.price-row { display: flex; gap: 10px; }
.price-box {
  flex: 1; background: linear-gradient(135deg, #eefaff, #e9fff7); border: 1px solid #d6f2ee;
  border-radius: 14px; padding: 10px 12px;
}
.price-box .k { font-size: 11px; color: #7fa79b; }
.price-box .v { font-size: 16px; font-weight: 800; color: #1f9d78; margin-top: 4px; }
.price-box .v small { font-size: 11px; color: #7fa79b; font-weight: 600; }

/* 图表 */
.chart { display: flex; align-items: flex-end; gap: 8px; height: 150px; padding-top: 10px; }
.chart .bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.chart .bar {
  width: 100%; max-width: 34px; border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, #ff9ec6, #ffd3e5);
  min-height: 3px; transition: height 0.3s;
}
.chart .bar.green { background: linear-gradient(180deg, #5fd9b4, #c9f7e7); }
.chart .bl { font-size: 10px; color: var(--muted-2); white-space: nowrap; transform: rotate(-38deg); }

/* 工具条 */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar .input { max-width: 260px; }
.toolbar .spacer { flex: 1; }
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.inline-form .field { margin-bottom: 0; min-width: 140px; }
.code-row { display: flex; gap: 8px; }
.code-row input { flex: 1; min-width: 0; }
.code-row .btn { white-space: nowrap; }

/* 空态 */
.empty { text-align: center; color: var(--muted-2); padding: 34px 12px; font-size: 13px; }

/* toast */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #fff; border: 1px solid var(--border);
  color: var(--text); padding: 12px 20px; border-radius: 16px;
  font-size: 13.5px; box-shadow: var(--shadow); opacity: 0; pointer-events: none;
  transition: opacity 0.2s, transform 0.2s; z-index: 1000; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { border-color: #ffc2d1; color: #e0557b; }
.toast.ok { border-color: #bff0df; color: #1f9d78; }

/* modal */
.modal-mask {
  position: fixed; inset: 0; background: rgba(255, 220, 236, 0.55);
  display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 900;
  backdrop-filter: blur(4px);
}
.modal {
  width: 100%; max-width: 480px; background: #fff;
  border: 1px solid var(--border); border-radius: 24px; padding: 24px; box-shadow: var(--shadow);
}
.modal h3 { margin: 0 0 6px; font-size: 17px; color: #46384f; }
.modal .sub { color: var(--muted); font-size: 12.5px; margin-bottom: 16px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.key-reveal {
  background: #fff7fb; border: 1px dashed #ffc7dd; border-radius: 14px;
  padding: 13px; font-family: monospace; font-size: 13px; word-break: break-all; color: #1f9d78;
}
.notice {
  background: #fff8e8; border: 1px solid #ffe6b8;
  border-radius: 14px; padding: 12px 14px; font-size: 12.5px; color: #a9791c; line-height: 1.7;
}
.notice.blue { background: #eef6ff; border-color: #d3e6ff; color: #4a75b8; }

@media (max-width: 780px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: relative; flex-direction: row; align-items: center; overflow-x: auto; padding: 12px; }
  .sidebar .nav { flex-direction: row; margin: 0; overflow-x: auto; }
  .nav .group-label { display: none; }
  .sidebar-foot { display: none; }
  .main { padding: 18px 16px 50px; }
}

/* ---------------- 登录弹窗 ---------------- */
.auth-card { position: relative; }
.modal.modal-plain { background: transparent; border: none; box-shadow: none; padding: 0; max-width: 460px; overflow: visible; }
.auth-close {
  position: absolute; top: 12px; right: 14px; width: 30px; height: 30px;
  border-radius: 50%; border: 1px solid var(--border); background: #fff;
  color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer;
}
.auth-close:hover { color: var(--accent); }

/* ---------------- 公开首页 ---------------- */
.landing { max-width: 1120px; margin: 0 auto; padding: 22px 24px 60px; }
.land-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 4px 2px 22px; }
.land-brand { display: flex; align-items: center; gap: 10px; }
.land-brand .logo {
  width: 46px; height: 46px; border-radius: 15px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #fff0f8, #e9f8ff); box-shadow: var(--shadow-soft);
}
.land-brand h1 { margin: 0; font-size: 19px; letter-spacing: .5px; }
.land-brand p { margin: 2px 0 0; font-size: 11px; color: var(--muted); }
.land-nav { display: flex; align-items: center; gap: 10px; }
.land-nav > a { font-size: 13px; color: var(--muted); font-weight: 600; }
.land-nav > a:hover { color: var(--accent); text-decoration: none; }
.land-hero { text-align: center; padding: 46px 14px 34px; }
.land-badge {
  display: inline-block; font-size: 12px; font-weight: 700; color: #e2608f;
  background: #fff0f7; border: 1px solid var(--border); padding: 7px 14px; border-radius: 999px;
}
.land-hero h2 { margin: 18px auto 12px; font-size: 40px; line-height: 1.15; letter-spacing: .5px; }
.land-hero h2 span { background: linear-gradient(90deg, #ff86b6, #b49dff, #3fcaa0); -webkit-background-clip: text; background-clip: text; color: transparent; }
.land-hero > p { margin: 0 auto; max-width: 560px; color: var(--muted); font-size: 15px; line-height: 1.7; }
.land-actions { display: flex; justify-content: center; gap: 14px; margin: 28px 0 20px; flex-wrap: wrap; }
.land-badges { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.land-badges span { font-size: 12px; color: var(--muted); background: #fff; border: 1px solid var(--border-soft); padding: 6px 12px; border-radius: 999px; }
.land-section { margin-top: 46px; }
.land-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.land-head h3 { margin: 0; font-size: 20px; }
.land-head p { margin: 0; color: var(--muted); font-size: 13px; }
.land-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.land-card {
  background: linear-gradient(180deg, #fff, #fff7fc); border: 1px solid var(--border);
  border-radius: 22px; padding: 20px; box-shadow: var(--shadow-soft);
  display: flex; flex-direction: column; gap: 10px;
}
.land-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.land-card-top h4 { margin: 0; font-size: 16px; }
.land-desc { margin: 0; font-size: 12.5px; color: var(--muted); min-height: 36px; line-height: 1.5; }
.land-price { display: flex; gap: 10px; }
.land-price > div { flex: 1; background: #fff3f9; border-radius: 14px; padding: 10px 12px; }
.land-price .k { display: block; font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.land-price .v { font-size: 18px; font-weight: 800; color: var(--text); }
.land-price .v small { font-size: 11px; font-weight: 600; color: var(--muted); margin-left: 3px; }
.land-card .btn { margin-top: auto; }
.land-feats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.land-feat { background: #fff; border: 1px solid var(--border-soft); border-radius: 20px; padding: 20px; box-shadow: var(--shadow-soft); }
.land-feat .n { font-size: 12px; font-weight: 800; color: var(--accent); letter-spacing: 1px; }
.land-feat h4 { margin: 8px 0 6px; font-size: 16px; }
.land-feat p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.6; }
.land-code {
  background: #2f2a38; color: #f6e9f3; border-radius: 18px; padding: 20px;
  font-size: 12.5px; line-height: 1.7; overflow-x: auto;
  font-family: ui-monospace, Consolas, monospace; margin: 0;
}
.land-foot { margin-top: 52px; text-align: center; color: var(--muted-2); font-size: 12px; }
.btn.lg { padding: 13px 26px; font-size: 15px; border-radius: 16px; }

/* 接入信息与复制按钮 */
.endpoint-box { background: #fff; border: 1px solid var(--border); border-radius: 20px; padding: 8px 18px; box-shadow: var(--shadow-soft); }
.endpoint-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border-soft); }
.endpoint-row:last-child { border-bottom: none; }
.endpoint-row-top { align-items: flex-start; }
.endpoint-k { flex: 0 0 80px; font-size: 12px; font-weight: 700; color: var(--muted); padding-top: 6px; }
.endpoint-v { flex: 1; font-size: 13.5px; color: var(--text); background: #fff5fa; border-radius: 10px; padding: 7px 12px; }
.model-chips { flex: 1; display: flex; flex-wrap: wrap; gap: 8px; }
.model-chip { display: inline-flex; align-items: center; gap: 6px; background: #fff5fa; border: 1px solid var(--border-soft); border-radius: 999px; padding: 5px 8px 5px 12px; }
.model-chip code { font-size: 12.5px; color: var(--text); }
.copy-mini {
  border: 1px solid var(--border); background: #fff; color: #ef6ca4;
  border-radius: 8px; font-size: 11px; line-height: 1; padding: 4px 7px; cursor: pointer;
}
.copy-mini:hover { background: #fff0f7; border-color: #ffc7dd; }


@media (max-width: 640px) {
  .landing { padding: 16px 16px 48px; }
  .land-hero h2 { font-size: 30px; }
  .land-nav > a { display: none; }
}
