/* ==========================================================================
   FPA 性格色彩测试工作台 · 主题
   配色主轴：浅绿色背景 + 中间白色内容区
   ========================================================================== */

:root {
  color-scheme: light;

  /* ---- 浅绿背景层：中间留白给白色卡片 ---- */
  --bg-0:  #EAF9F1;
  --bg-1:  #D8F3E5;
  --bg-2:  #C4EBD8;
  --bg-3:  #B0E4CB;
  --bg-base: #DCF4E7;

  /* ---- 内容区：白 ---- */
  --panel:   #FFFFFF;
  --panel-2: #F7FCF9;
  --panel-3: #EFF9F3;

  --line:        rgba(16, 92, 62, 0.12);
  --line-strong: rgba(16, 92, 62, 0.24);

  --text:   #0E3A29;
  --text-2: #45705D;
  --text-3: #6C9481;

  --brand:      #35C98B;
  --brand-2:    #199A65;
  --brand-ink:  #0C7A4E;
  --brand-soft: rgba(32, 168, 106, 0.13);
  --on-brand:   #05301F;

  --warn:   #B8860B;
  --danger: #C0453F;

  /* 四色：图形填色 */
  --c-red:    #E4574F;
  --c-blue:   #3B74CC;
  --c-yellow: #E0A62B;
  --c-green:  #1E9A66;

  --radius:    18px;
  --radius-sm: 11px;
  --shadow:    0 12px 30px rgba(13, 74, 52, 0.09);
  --shadow-lg: 0 24px 54px rgba(13, 74, 52, 0.14);

  --font: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; min-height: 100%; }

body {
  font-family: var(--font);
  color: var(--text);
  background-color: var(--bg-base);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

/* 背景铺在固定层：浅绿渐变 + 左右两侧绿晕，中间自然留白 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 620px at -6% -10%, rgba(126, 226, 176, 0.50), transparent 62%),
    radial-gradient(880px 600px at 106% 108%, rgba(122, 224, 172, 0.52), transparent 64%),
    radial-gradient(1100px 700px at 50% 50%, rgba(255, 255, 255, 0.55), transparent 70%),
    linear-gradient(158deg, var(--bg-0) 0%, var(--bg-1) 32%, var(--bg-2) 62%, var(--bg-3) 100%);
}

a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 900px; margin: 0 auto; padding: 30px 20px 64px; }
.wrap.narrow { max-width: 640px; }
.wrap.mid { max-width: 780px; }
.wrap.wide { max-width: 1280px; }

/* ---------------- 头部 ---------------- */
.brand { display: flex; align-items: center; gap: 13px; margin-bottom: 24px; flex-wrap: wrap; }
.brand .mark {
  width: 44px; height: 44px; border-radius: 13px; flex: none;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: grid; place-items: center;
  font-weight: 800; font-size: 17px; color: var(--on-brand); letter-spacing: -0.5px;
  box-shadow: 0 8px 20px rgba(25, 154, 101, 0.30);
}
.brand h1 { font-size: 19px; margin: 0; font-weight: 700; letter-spacing: 0.2px; }
.brand p { margin: 2px 0 0; font-size: 12.5px; color: var(--text-3); }
.brand .spacer { flex: 1; }

/* 企业标识徽章 */
.org-chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; padding: 4px 11px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand-ink);
  border: 1px solid rgba(25, 154, 101, 0.24);
  white-space: nowrap;
}

/* ---------------- 卡片（白色内容区） ---------------- */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 18px; }
.card h2 { margin: 0 0 6px; font-size: 17px; }
.card h3 { margin: 0 0 6px; font-size: 15.5px; }
.card .sub { color: var(--text-2); font-size: 13.5px; margin: 0 0 18px; }
.card.center { text-align: center; }

/* ---------------- 表单 ---------------- */
label.field { display: block; margin-bottom: 15px; }
label.field > span { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
label.field > span .req { color: var(--danger); margin-left: 3px; font-weight: 700; }

input[type="text"], input[type="password"], input[type="tel"], input[type="number"], select, textarea {
  width: 100%; padding: 12px 14px; font-size: 15px; font-family: inherit;
  color: var(--text); background: var(--panel-2);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  outline: none; transition: border-color .16s, box-shadow .16s, background .16s;
}
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  background: #fff; border-color: var(--brand-2); box-shadow: 0 0 0 3px var(--brand-soft);
}
input::placeholder, textarea::placeholder { color: #9BB8A9; }
input:disabled, select:disabled { opacity: .55; cursor: not-allowed; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 24px; font-size: 15px; font-weight: 600; font-family: inherit;
  color: var(--on-brand); background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border: none; border-radius: 999px; cursor: pointer;
  box-shadow: 0 10px 24px rgba(25, 154, 101, 0.26);
  transition: transform .12s, box-shadow .16s, opacity .16s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 14px 30px rgba(25, 154, 101, 0.34); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.block { width: 100%; }
.btn.ghost {
  background: #fff; color: var(--text); border: 1px solid var(--line-strong);
  box-shadow: none; font-weight: 500;
}
.btn.ghost:hover { background: var(--panel-3); box-shadow: none; }
.btn.sm { padding: 8px 15px; font-size: 13px; }
.btn.danger { background: #fff; color: var(--danger); border: 1px solid rgba(192,69,63,.36); box-shadow: none; }
.btn.danger:hover { background: rgba(192,69,63,.07); }

.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1 1 180px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 620px) { .grid2 { grid-template-columns: 1fr; } }

.hint { font-size: 12.5px; color: var(--text-3); }
.err { color: var(--danger); font-size: 13.5px; min-height: 20px; margin-top: 10px; }

/* ---------------- 首页装饰 ---------------- */
.hero-dots { display: flex; gap: 8px; margin-bottom: 18px; }
.hero-dots i { width: 10px; height: 10px; border-radius: 50%; display: block; }
.hero-dots i:nth-child(1) { background: var(--c-red); }
.hero-dots i:nth-child(2) { background: var(--c-blue); }
.hero-dots i:nth-child(3) { background: var(--c-yellow); }
.hero-dots i:nth-child(4) { background: var(--c-green); }
.lead { font-size: 15px; color: var(--text-2); line-height: 1.85; }

.pill-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }
.pill {
  font-size: 12.5px; padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--line-strong); color: var(--text-2); background: var(--panel-3);
}

/* ---------------- 答题页 ---------------- */
.q-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.q-count { font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.q-count b { color: var(--brand-ink); font-size: 20px; font-weight: 700; }
.bar { height: 7px; border-radius: 999px; background: rgba(16, 92, 62, 0.10); overflow: hidden; margin-bottom: 24px; }
.bar > i { display: block; height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--brand-2), var(--brand)); transition: width .3s ease; }

.q-title { font-size: 20px; font-weight: 700; line-height: 1.5; margin: 0 0 20px; }
.q-title .no { color: var(--brand-ink); margin-right: 8px; font-variant-numeric: tabular-nums; }

.opts { display: grid; gap: 11px; }
.opt {
  display: flex; align-items: flex-start; gap: 13px; width: 100%; text-align: left;
  padding: 15px 17px; cursor: pointer; font-size: 15px; font-family: inherit;
  color: var(--text); background: var(--panel-2);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  transition: border-color .14s, background .14s, transform .1s;
}
.opt:hover { border-color: var(--line-strong); background: var(--panel-3); }
.opt:active { transform: scale(.994); }
.opt .k {
  flex: none; width: 26px; height: 26px; border-radius: 8px; margin-top: 1px;
  display: grid; place-items: center; font-size: 13px; font-weight: 700;
  border: 1px solid var(--line-strong); color: var(--text-2); background: #fff;
  transition: all .14s;
}
.opt.on { border-color: var(--brand-2); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand-2) inset; }
.opt.on .k { background: var(--brand-2); color: #fff; border-color: var(--brand-2); }

.q-nav { display: flex; gap: 12px; margin-top: 24px; align-items: center; }
.q-nav .btn { flex: none; }
.q-nav .spacer { flex: 1; }

.qmap { display: none; flex-wrap: wrap; gap: 6px; margin-top: 26px; }
.qmap i {
  width: 26px; height: 26px; border-radius: 7px; font-size: 11px; font-style: normal;
  display: grid; place-items: center; color: var(--text-3);
  border: 1px solid var(--line); background: var(--panel-3);
  cursor: pointer; transition: all .14s;
}
.qmap i.done { color: #fff; background: var(--brand-2); border-color: var(--brand-2); font-weight: 700; }
.qmap i.cur { outline: 2px solid var(--brand-2); outline-offset: 1px; }
@media (min-width: 760px) { .qmap { display: flex; } }

/* ---------------- 结果页 ---------------- */
.result-hero {
  border-radius: var(--radius); padding: 30px 26px; position: relative; overflow: hidden;
  border: 1px solid var(--line); background: var(--panel); box-shadow: var(--shadow);
}
.result-hero::after {
  content: ''; position: absolute; inset: 0; opacity: .16; pointer-events: none;
  background: radial-gradient(560px 240px at 88% 0%, var(--hero), transparent 70%);
}
.result-hero > * { position: relative; z-index: 1; }
.result-hero .badge {
  display: inline-flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-2);
  border: 1px solid var(--line-strong); border-radius: 999px; padding: 5px 13px; margin-bottom: 16px;
  background: rgba(255,255,255,.72);
}
.result-hero .badge b { color: var(--text); }
.result-hero h2 { font-size: 33px; margin: 0 0 6px; letter-spacing: -0.5px; }
.result-hero .tag { font-size: 15px; color: var(--text-2); }
.result-hero .slogan { margin-top: 14px; font-size: 14.5px; color: var(--text-3); font-style: italic; }
.hero-emoji { position: absolute; right: 24px; top: 22px; font-size: 44px; opacity: .92; }

.donut-wrap { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; }
.donut { flex: none; }
.donut circle { transition: stroke-dasharray .8s cubic-bezier(.3,.9,.3,1); }
.legend { flex: 1 1 240px; display: grid; gap: 10px; }
.legend .li { display: grid; grid-template-columns: 12px 1fr auto auto; gap: 10px; align-items: center; font-size: 14px; }
.legend .dot { width: 12px; height: 12px; border-radius: 4px; }
.legend .sc { font-variant-numeric: tabular-nums; font-weight: 700; }
.legend .pc { color: var(--text-3); font-size: 12.5px; font-variant-numeric: tabular-nums; width: 48px; text-align: right; }
.legend .li.top .nm { font-weight: 700; }

.bars { display: grid; gap: 10px; margin-top: 4px; }
.bars .b { display: grid; grid-template-columns: 50px 1fr 96px; gap: 12px; align-items: center; font-size: 13.5px; white-space: nowrap; }
.bars .track { height: 9px; border-radius: 999px; background: rgba(16, 92, 62, 0.10); overflow: hidden; }
.bars .track > i { display: block; height: 100%; border-radius: 999px; transition: width .8s cubic-bezier(.3,.9,.3,1); }

/* 雷达图 */
.radar-wrap { display: flex; gap: 26px; align-items: center; flex-wrap: wrap; justify-content: center; }
.radar { flex: none; }
.radar svg { overflow: visible; }

.kv { display: grid; gap: 12px; }
.kv .item { border-left: 3px solid var(--line-strong); padding: 2px 0 2px 14px; }
.kv .item h4 { margin: 0 0 4px; font-size: 13px; color: var(--text-3); font-weight: 600; letter-spacing: .4px; }
.kv .item p { margin: 0; font-size: 14.5px; color: var(--text); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-size: 13px; padding: 5px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); }
.chip.good { color: #106B45; border-color: rgba(30,154,102,.34); background: rgba(30,154,102,.09); }
.chip.bad  { color: #B03C36; border-color: rgba(192,69,63,.30); background: rgba(192,69,63,.08); }

.note {
  border-radius: var(--radius-sm); padding: 14px 16px; font-size: 13.5px; line-height: 1.75;
  border: 1px solid var(--line); background: var(--panel-3); color: var(--text-2);
}
.note.warn { border-color: rgba(184,134,11,.34); background: #FDF8EA; color: #7E5F0C; }
.note.ok   { border-color: rgba(25,154,101,.30); background: #EDFBF3; color: #0C6B46; }
.note b { color: var(--text); }

.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th, .tbl td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--line); }
.tbl th { color: var(--text-3); font-weight: 600; font-size: 12.5px; }

.steps { counter-reset: s; display: grid; gap: 10px; margin: 0; padding: 0; }
.steps li { list-style: none; position: relative; padding-left: 30px; font-size: 14px; color: var(--text-2); }
.steps li::before {
  counter-increment: s; content: counter(s); position: absolute; left: 0; top: 1px;
  width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  font-size: 11.5px; font-weight: 700; color: #fff; background: var(--brand-2);
}
ul.plain { margin: 0; padding-left: 18px; color: var(--text-2); font-size: 14px; }
ul.plain li { margin-bottom: 5px; }

.footer {
  margin: 30px auto 0; width: fit-content; max-width: 100%;
  padding: 7px 15px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 6px 18px rgba(13, 74, 52, 0.08);
  font-size: 12.5px; color: var(--text-2); text-align: center; line-height: 1.5;
}
.footer a { color: var(--text-2); }

/* ---------------- 账号页（登录 / 注册） ---------------- */
.auth-head { text-align: center; padding: 26px 0 10px; }
.auth-head .logo {
  width: 62px; height: 62px; margin: 0 auto 16px; border-radius: 19px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: grid; place-items: center; font-weight: 800; font-size: 23px;
  color: var(--on-brand); box-shadow: 0 14px 30px rgba(25, 154, 101, 0.32);
}
.auth-head h1 { font-size: 24px; margin: 0 0 8px; letter-spacing: -0.3px; }
.auth-head p { margin: 0; color: var(--text-2); font-size: 14px; }

.tabs { display: flex; gap: 6px; background: var(--panel-3); border-radius: 999px; padding: 5px; margin-bottom: 22px; }
.tabs button {
  flex: 1; padding: 9px 14px; border: none; background: none; cursor: pointer;
  font-family: inherit; font-size: 14px; font-weight: 600; color: var(--text-3);
  border-radius: 999px; transition: all .16s;
}
.tabs button.on { background: #fff; color: var(--brand-ink); box-shadow: 0 3px 10px rgba(13,74,52,.10); }

/* ---------------- 后台 ---------------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 13px; margin-bottom: 18px; }
.stat { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 15px 17px; background: var(--panel-3); }
.stat .k { font-size: 12.5px; color: var(--text-3); }
.stat .v { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 3px; }
.stat .v small { font-size: 13px; color: var(--text-3); font-weight: 400; margin-left: 4px; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar input, .toolbar select { width: auto; flex: 1 1 160px; padding: 9px 12px; font-size: 14px; }
.toolbar .btn { padding: 9px 16px; font-size: 14px; }

.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; white-space: nowrap; }
table.data th, table.data td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line); }
table.data th { background: var(--panel-3); color: var(--text-3); font-size: 12.5px; font-weight: 600; position: sticky; top: 0; }
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: var(--panel-3); }
table.data td.num { font-variant-numeric: tabular-nums; font-weight: 600; }
.cbadge {
  display: inline-block; padding: 2px 9px; border-radius: 6px; font-size: 12.5px; font-weight: 700;
  border: 1px solid currentColor;
}
.cbadge.red    { color: #BF3A34; background: rgba(228,87,79,.11); }
.cbadge.blue   { color: #2C5CA8; background: rgba(59,116,204,.11); }
.cbadge.yellow { color: #8F6608; background: rgba(224,166,43,.14); }
.cbadge.green  { color: #106B45; background: rgba(30,154,102,.11); }

.empty { padding: 46px 20px; text-align: center; color: var(--text-3); font-size: 14px; }

/* ---------------- 弹层 ---------------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(8, 52, 36, 0.38); backdrop-filter: blur(4px);
  display: none; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow: auto; z-index: 50;
}
.modal-mask.on { display: flex; }
.modal {
  width: 100%; max-width: 720px; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 24px;
}
.modal .mhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.modal .mhead h3 { margin: 0; font-size: 18px; }
.x { background: none; border: none; color: var(--text-3); font-size: 22px; cursor: pointer; line-height: 1; padding: 0 4px; }
.x:hover { color: var(--text); }

.qr-box { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.qr-box canvas, .qr-box img { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px; }

.copy-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.copy-row input { font-size: 13px; padding: 8px 11px; }

.link-box {
  display: flex; gap: 8px; align-items: center;
  background: var(--panel-3); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 10px 12px;
}
.link-box code {
  flex: 1; font-size: 12.5px; word-break: break-all; color: var(--brand-ink);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
}

.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translate(-50%, 20px);
  background: #0E3A29; color: #EAFBF2; border: 1px solid rgba(255,255,255,0.14);
  padding: 11px 20px; border-radius: 999px; font-size: 14px; opacity: 0;
  transition: opacity .2s, transform .2s; z-index: 90; box-shadow: var(--shadow-lg);
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 620px) {
  .wrap { padding: 20px 15px 50px; }
  .card { padding: 20px 17px; }
  .q-title { font-size: 17.5px; }
  .result-hero h2 { font-size: 26px; }
  .hero-emoji { font-size: 32px; right: 16px; top: 16px; }
  .legend .li { font-size: 13px; }
  .brand h1 { font-size: 17px; }
}
