:root {
  --rose: #ff5a8a;
  --rose-d: #e84a78;
  --rose-l: #ffe6ee;
  --ink: #2b2330;
  --muted: #8a8290;
  --line: #efe7ec;
  --bg: #faf7f9;
  --ok: #2bb673;
  --warn: #f5a623;
  --danger: #e7503a;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(180, 120, 150, 0.12);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
a { color: var(--rose-d); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ---------- 通用 ---------- */
.hidden { display: none !important; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.grid { display: grid; gap: 16px; }
.muted { color: var(--muted); }
.phone-peek {
  border: none; background: none; padding: 0; color: var(--rose-d);
  cursor: pointer; font: inherit; text-decoration: underline dotted;
}
.phone-peek.on { color: var(--ink); text-decoration: none; }
.tag { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; background: var(--rose-l); color: var(--rose-d); }
.tag.gray { background: #eee; color: #777; }
.tag.ok { background: #e2f7ec; color: var(--ok); }
.tag.warn { background: #fdf0d8; color: #c8841a; }
.tag.danger { background: #fde6e2; color: var(--danger); }

.btn {
  border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; font-weight: 600;
  background: var(--rose); color: #fff; transition: .15s; box-shadow: 0 4px 12px rgba(255,90,138,.25);
}
.btn:hover { background: var(--rose-d); }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.btn.ghost:hover { border-color: var(--rose); color: var(--rose-d); }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.btn.danger { background: var(--danger); box-shadow: none; }
.btn.block { width: 100%; }

input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 14px; background: #fff; color: var(--ink); outline: none; transition: .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--rose); box-shadow: 0 0 0 3px var(--rose-l); }
label { font-size: 13px; color: var(--muted); display: block; margin: 12px 0 5px; }

.card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
tbody tr:hover { background: #fcf6f9; }

/* ---------- 启动选择页 ---------- */
#landing {
  min-height: 100vh; display: flex; flex-direction: column;
  background: radial-gradient(1200px 600px at 50% -10%, #ffd9e6 0%, var(--bg) 55%);
  padding: 24px;
}
.landing-main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; }
#landing h1 { font-size: 30px; margin: 0 0 6px; }
#landing p { color: var(--muted); margin: 0 0 36px; }
.portals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; max-width: 820px; width: 100%; }
.portal {
  background: #fff; border-radius: 18px; padding: 28px 22px; text-align: center; box-shadow: var(--shadow);
  cursor: pointer; transition: .2s; border: 2px solid transparent;
}
.portal:hover { transform: translateY(-4px); border-color: var(--rose); }
.portal .ic { font-size: 40px; }
.portal h3 { margin: 12px 0 4px; }
.portal small { color: var(--muted); }
@media (max-width: 760px) { .portals { grid-template-columns: 1fr; } }

#landing .icp-footer { margin-top: 20px; flex-shrink: 0; }

/* ---------- 登录弹层 ---------- */
.auth-page { min-height: 100vh; display: flex; flex-direction: column; }
.auth-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; }
.auth-wrap .card { padding: 28px; width: 100%; max-width: 380px; }
.brand { text-align: center; margin-bottom: 18px; }
.brand .ic { font-size: 34px; }
.brand h2 { margin: 8px 0 0; }

/* ---------- 应用框架 ---------- */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  background: #fff; border-bottom: 1px solid var(--line); padding: 0 20px; height: 60px;
  display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 20;
}
.topbar .logo { font-weight: 800; color: var(--rose-d); display: flex; align-items: center; gap: 8px; }
.topbar .me { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: var(--rose-l); border: 1px solid var(--line); }

.body { flex: 1; display: flex; }
.side { width: 210px; background: #fff; border-right: 1px solid var(--line); padding: 14px 10px; }
.side a {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 10px; color: var(--ink);
  font-size: 14px; margin-bottom: 3px; font-weight: 500;
}
.side a:hover { background: var(--bg); }
.side a.active { background: var(--rose-l); color: var(--rose-d); font-weight: 700; }
.main { flex: 1; padding: 22px; overflow: auto; }
.page-title { font-size: 20px; font-weight: 700; margin: 0 0 18px; }

/* C 端底部 tab（移动优先） */
.tabbar { display: none; }
@media (max-width: 720px) {
  .side { display: none; }
  .main { padding: 16px 14px 80px; }
  .tabbar {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--line);
    z-index: 30;
  }
  .tabbar a { flex: 1; text-align: center; padding: 9px 0; font-size: 11px; color: var(--muted); }
  .tabbar a.active { color: var(--rose-d); }
  .tabbar a .ic { display: block; font-size: 20px; }
}

/* 卡片列表 */
.list-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.proj-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.proj-card .cover { height: 96px; background: linear-gradient(135deg, #ffd9e6, #ffeef4); display: flex; align-items: center; justify-content: center; font-size: 34px; }
.proj-card .pc-body { padding: 14px; }
.proj-card h4 { margin: 0 0 4px; }
.proj-card p { margin: 0 0 10px; font-size: 13px; color: var(--muted); min-height: 36px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.stat { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.stat .n { font-size: 26px; font-weight: 800; color: var(--rose-d); }
.stat .l { color: var(--muted); font-size: 13px; }

/* 模态框 */
.modal-mask { position: fixed; inset: 0; background: rgba(40,30,40,.45); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 460px; max-height: 88vh; overflow: auto; padding: 24px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal h3 { margin: 0 0 14px; }
.modal-lg { max-width: 640px; }

/* toast */
#toast { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 99; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: #2b2330; color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 14px; box-shadow: var(--shadow); animation: pop .2s; }
.toast.ok { background: var(--ok); }
.toast.err { background: var(--danger); }
@keyframes pop { from { opacity: 0; transform: translateY(-8px); } }

.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.privacy-box { font-size: 13px; color: #555; max-height: 240px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 14px; background: var(--bg); }
.face-compare { display: flex; gap: 16px; justify-content: center; align-items: center; margin: 12px 0; }
.face-compare .fc { text-align: center; }
.face-compare img, .face-compare .ph { width: 120px; height: 120px; border-radius: 12px; object-fit: cover; background: var(--rose-l); display: flex; align-items: center; justify-content: center; font-size: 40px; }
.kvs { display: grid; grid-template-columns: 120px 1fr; gap: 8px 10px; font-size: 14px; }
.kvs .k { color: var(--muted); }

/* 图形验证码 */
.captcha-row { gap: 10px; }
.captcha-svg { width: 130px; height: 48px; border-radius: 8px; border: 1px solid var(--line); cursor: pointer; object-fit: contain; background: #f5f5f5; }
.captcha-loading { width: 130px; height: 48px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; color: var(--muted); background: #f5f5f5; border-radius: 8px; }

/* ICP备案 */
.icp-footer { margin-top: 16px; padding: 12px 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.icp-footer a { font-size: 12px; color: #b5b0ba; text-decoration: none; }
.icp-footer a:hover { color: var(--muted); }
.police-badge { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; }
