:root {
  --green: #07c160;
  --green-hover: #06ad56;
  --blue: #1677ff;
  --blue-hover: #0f5fdd;
  --gray: #86909c;
  --border: #e5e6eb;
  --bg: #f4f5f7;
  --text: #1d2129;
  --sub: #86909c;
  --danger: #f53f3f;
  --warning: #ff7d00;
  --success: #00b42a;
  --radius: 10px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: none; }
img { vertical-align: middle; }

.container { max-width: 1040px; margin: 0 auto; padding: 0 16px; }

/* ---------- 顶栏 ---------- */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  height: 56px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar .container { display: flex; align-items: center; width: 100%; justify-content: space-between; }
.brand { font-size: 17px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; }
.brand .logo {
  width: 26px; height: 26px; border-radius: 7px; background: var(--green);
  display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 14px; font-weight: 700;
}
.topnav { display: flex; gap: 4px; align-items: center; }
.topnav a {
  color: var(--text); padding: 6px 14px; border-radius: 8px; font-size: 14px;
}
.topnav a:hover { background: #f2f3f5; }
.topnav a.active { background: #e8f7ee; color: var(--green); font-weight: 600; }
.topnav .badge-dot { background: var(--danger); color: #fff; border-radius: 10px; font-size: 11px; padding: 0 6px; margin-left: 4px; }

/* ---------- 卡片 ---------- */
.card {
  background: #fff; border-radius: var(--radius); padding: 22px; margin: 18px 0;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.card h2 { margin: 0 0 16px; font-size: 16px; }
.card h3 { margin: 0 0 12px; font-size: 15px; }
.muted { color: var(--sub); }
.small { font-size: 12px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px; border-radius: 8px; border: 1px solid transparent;
  font-size: 14px; cursor: pointer; transition: .15s; line-height: 1.4; text-decoration: none;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: var(--green-hover); }
.btn-blue { background: var(--blue); color: #fff; }
.btn-blue:hover { background: var(--blue-hover); }
.btn-gray { background: #f2f3f5; color: var(--text); border-color: transparent; }
.btn-gray:hover { background: #e5e6eb; }
.btn-outline { background: #fff; color: var(--text); border-color: var(--border); }
.btn-outline:hover { border-color: var(--blue); color: var(--blue); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #d9363e; }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-lg { padding: 12px 26px; font-size: 15px; }

/* ---------- 表单 ---------- */
.form-row { margin-bottom: 16px; }
.form-row label { display: block; margin-bottom: 6px; font-weight: 500; }
.form-row .hint { color: var(--gray); font-size: 12px; margin-top: 4px; }
input[type=text], input[type=password], input[type=email], input[type=url], input[type=file], textarea, select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: inherit; background: #fff; color: var(--text);
}
input:focus, textarea:focus, select:focus { border-color: var(--green); outline: none; box-shadow: 0 0 0 2px rgba(7,193,96,.12); }
textarea { resize: vertical; min-height: 90px; }

/* ---------- 提示条 ---------- */
.alert { padding: 12px 16px; border-radius: 8px; margin: 12px 0; font-size: 14px; }
.alert.success { background: #e8f7ee; color: #1f8f4d; }
.alert.error { background: #fef0f0; color: #c0392b; }
.alert.info { background: #e8f3ff; color: #1a5fbe; }
.alert.warning { background: #fff7e6; color: #b26a00; }

/* ---------- 状态横幅 ---------- */
.status-banner {
  border-radius: var(--radius); padding: 16px 20px; margin: 18px 0;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.status-banner.pending { background: #fff7e6; border: 1px solid #ffd591; color: #b26a00; }
.status-banner.rejected { background: #fef0f0; border: 1px solid #f9b8b8; color: #c0392b; }
.status-banner.approved { background: #e8f7ee; border: 1px solid #a7e2bd; color: #1f8f4d; }
.status-banner .sb-title { font-weight: 600; font-size: 15px; }
.status-banner .sb-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- 徽章 ---------- */
.badge {
  display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; line-height: 1.7;
}
.badge.gray { background: #f2f3f5; color: var(--sub); }
.badge.green { background: #e8f7ee; color: var(--success); }
.badge.blue { background: #e8f3ff; color: var(--blue); }
.badge.orange { background: #fff7e6; color: var(--warning); }
.badge.red { background: #fef0f0; color: var(--danger); }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px; }
th { color: var(--sub); font-weight: 600; background: #fafafa; white-space: nowrap; }
tr:hover td { background: #fafafa; }

/* ---------- 头像 ---------- */
.avatar { border-radius: 50%; object-fit: cover; background: #e8e8e8; }
.avatar-lg { width: 72px; height: 72px; }
.avatar-md { width: 44px; height: 44px; }
.avatar-sm { width: 32px; height: 32px; }
.avatar-xs { width: 22px; height: 22px; }

/* ---------- 网格 / 用户中心 ---------- */
.grid { display: grid; grid-template-columns: 280px 1fr; gap: 18px; }
@media (max-width: 780px) { .grid { grid-template-columns: 1fr; } }
.profile-side { background: #fff; border-radius: var(--radius); padding: 22px; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.profile-side .nick { font-size: 17px; font-weight: 600; margin-top: 10px; }
.profile-side .meta { color: var(--sub); font-size: 13px; margin-top: 2px; }
.side-menu { margin-top: 16px; text-align: left; }
.side-menu a { display: block; padding: 10px 12px; border-radius: 8px; color: var(--text); margin-bottom: 2px; }
.side-menu a:hover { background: #f2f3f5; }
.side-menu a.active { background: #e8f7ee; color: var(--green); font-weight: 600; }

/* ---------- 认证页面（居中卡片） ---------- */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { width: 400px; max-width: 100%; background: #fff; border-radius: 14px; box-shadow: 0 10px 40px rgba(0,0,0,.1); padding: 34px; }
.auth-card .brand { justify-content: center; margin-bottom: 8px; font-size: 20px; }
.auth-card .tagline { text-align: center; color: var(--sub); margin: 0 0 24px; }
.auth-footer { text-align: center; margin-top: 18px; color: var(--sub); font-size: 13px; }

/* ---------- 授权确认页 ---------- */
.consent-box { max-width: 420px; margin: 0 auto; }
.consent-app { text-align: center; margin-bottom: 8px; }
.consent-app .app-logo {
  width: 64px; height: 64px; border-radius: 16px; background: linear-gradient(135deg, #07c160, #1677ff);
  color: #fff; font-size: 30px; font-weight: 700; display: flex; align-items: center; justify-content: center; margin: 0 auto 12px;
}
.profile-list { list-style: none; margin: 14px 0; padding: 0; }
.profile-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border);
  border-radius: 10px; margin-bottom: 10px; cursor: pointer; transition: .12s;
}
.profile-item:hover { border-color: var(--green); }
.profile-item.selected { border-color: var(--green); background: #e8f7ee; }
.profile-item input[type=radio] { accent-color: var(--green); }
.profile-item .p-name { font-weight: 600; }
.profile-add {
  border: 1px dashed var(--border); border-radius: 10px; padding: 14px; text-align: center;
  color: var(--blue); cursor: pointer; display: block; width: 100%; background: none; font-size: 14px;
}
.profile-add:hover { border-color: var(--blue); background: #f7fbff; }
.consent-actions { display: flex; gap: 12px; margin-top: 20px; }
.consent-actions .btn { flex: 1; }

/* ---------- 代码块 ---------- */
pre.code {
  background: #1e1e2e; color: #dcdcdc; padding: 18px; border-radius: 10px;
  overflow: auto; font-size: 13px; line-height: 1.6; max-height: 520px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

/* ---------- 站内箱 ---------- */
.msg-item { display: flex; gap: 14px; padding: 14px 4px; border-bottom: 1px solid var(--border); }
.msg-item .m-body { flex: 1; }
.msg-item .m-title { font-weight: 600; }
.msg-item.unread .m-title::before { content: "●"; color: var(--danger); margin-right: 6px; }
.msg-item .m-time { color: var(--sub); font-size: 12px; }

/* ---------- 其它 ---------- */
.flex { display: flex; align-items: center; gap: 10px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 18px; }
.mb-2 { margin-bottom: 12px; }
.text-center { text-align: center; }
.hidden { display: none; }
.thumb { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; border: 1px solid var(--border); cursor: zoom-in; }
.pagination { display: flex; gap: 6px; margin-top: 16px; }
.pagination a, .pagination span { padding: 6px 12px; border: 1px solid var(--border); border-radius: 8px; color: var(--text); }
.pagination .cur { background: var(--green); color: #fff; border-color: var(--green); }
