/* TetraAI 后台管理样式 —— 深色金融科技风 */
:root {
  --bg: #0a0f1e;
  --bg-2: #0e1628;
  --card: #131d36;
  --border: #22304f;
  --text: #e8edf7;
  --muted: #93a1bf;
  --gold: #f0b90b;
  --cyan: #2fd4c7;
  --green: #16c784;
  --red: #ea3943;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; }

/* 登录 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-box {
  width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; padding: 40px 34px; text-align: center;
}
.login-logo {
  width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 14px;
  background: linear-gradient(135deg, var(--gold), #d99a06); color: #0a0f1e;
  font-size: 28px; font-weight: 800; display: flex; align-items: center; justify-content: center;
}
.login-box h1 { font-size: 22px; margin-bottom: 6px; }
.login-box p { color: var(--muted); font-size: 13px; margin-bottom: 22px; }
.login-box input {
  width: 100%; padding: 13px 16px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg-2); color: var(--text); font-size: 15px; margin-bottom: 14px;
}
.login-box input:focus { outline: none; border-color: var(--gold); }
.login-tip { font-size: 12px; color: var(--muted); margin-top: 16px; }

/* 按钮 */
.btn {
  display: inline-block; padding: 12px 26px; border-radius: 10px; border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--gold), #d99a06); color: #0a0f1e;
  font-size: 15px; font-weight: 600; font-family: inherit;
}
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-danger { background: rgba(234, 57, 67, .15); color: var(--red); border: 1px solid rgba(234, 57, 67, .4); }

/* 头部 */
.admin-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px; background: var(--bg-2); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.admin-logo { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 700; }
.al-mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--gold), #d99a06); color: #0a0f1e;
  font-weight: 800; display: flex; align-items: center; justify-content: center;
}
.admin-user { display: flex; align-items: center; gap: 16px; font-size: 13px; color: var(--muted); }
.admin-user a { color: var(--cyan); text-decoration: none; }
.admin-user a:hover { text-decoration: underline; }

/* 主体 */
.admin-body { display: flex; min-height: calc(100vh - 63px); }
.admin-side {
  width: 200px; flex-shrink: 0; background: var(--bg-2);
  border-right: 1px solid var(--border); padding: 16px 10px;
  display: flex; flex-direction: column; gap: 6px;
}
.side-item {
  text-align: left; padding: 12px 16px; border-radius: 10px; border: none; cursor: pointer;
  background: transparent; color: var(--muted); font-size: 14px; font-family: inherit;
  transition: .25s;
}
.side-item:hover { color: var(--text); background: var(--card); }
.side-item.active { background: var(--card); color: var(--gold); font-weight: 600; }

.admin-main { flex: 1; padding: 26px; overflow-x: auto; }
.admin-main h2 { font-size: 20px; margin-bottom: 6px; }
.view-desc { color: var(--muted); font-size: 13px; margin-bottom: 18px; }

/* 统计卡 */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 22px; text-align: center;
}
.stat-card b { display: block; font-size: 32px; color: var(--gold); margin-bottom: 4px; }
.stat-card span { font-size: 13px; color: var(--muted); }

/* 面板 */
.panel {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 22px; margin-bottom: 22px;
}
.panel h3 { font-size: 16px; margin-bottom: 16px; }
.panel label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.panel input, .panel textarea {
  display: block; width: 100%; margin-top: 6px; padding: 11px 14px;
  border-radius: 10px; border: 1px solid var(--border); background: var(--bg-2);
  color: var(--text); font-size: 14px; font-family: inherit;
}
.panel input:focus, .panel textarea:focus { outline: none; border-color: var(--gold); }
.panel .tip { font-size: 12px; color: var(--muted); margin-top: 10px; }

/* 工具栏 */
.toolbar { display: flex; gap: 10px; margin-bottom: 16px; }

/* 表格 */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; background: var(--bg-2); white-space: nowrap; }
td { color: var(--text); }
tr:hover td { background: rgba(240, 185, 11, .04); }
.tag-badge {
  display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 11px;
  background: rgba(47, 212, 199, .12); color: var(--cyan); border: 1px solid rgba(47, 212, 199, .35);
}
.row-actions button {
  margin-right: 6px; padding: 4px 10px; border-radius: 7px; border: 1px solid var(--border);
  background: transparent; color: var(--muted); cursor: pointer; font-size: 12px;
}
.row-actions button:hover { color: var(--gold); border-color: var(--gold); }
.row-actions button.del:hover { color: var(--red); border-color: var(--red); }
.empty-tip { text-align: center; color: var(--muted); padding: 30px 0; }

/* 表单按钮 */
.form-btns { display: flex; gap: 10px; }

@media (max-width: 860px) {
  .admin-body { flex-direction: column; }
  .admin-side { width: 100%; flex-direction: row; overflow-x: auto; border-right: none; border-bottom: 1px solid var(--border); }
  .side-item { white-space: nowrap; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
