/* MBTI 性格测试 - 样式表 */
:root {
  --primary: #6C5CE7;
  --primary-dark: #5A4BD1;
  --success: #00B894;
  --danger: #E17055;
  --bg: #F8F9FE;
  --card: #FFFFFF;
  --text: #2D3436;
  --text-light: #636E72;
  --border: #DFE6E9;
  --shadow: 0 2px 16px rgba(108,92,231,0.08);
  --radius: 12px;
  --ei-color: #6C5CE7;
  --sn-color: #00B894;
  --tf-color: #E17055;
  --jp-color: #FDCB6E;
}

* { margin:0; padding:0; box-sizing:border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--text); line-height:1.7; }
.container { max-width:860px; margin:0 auto; padding:0 20px; }

/* Header */
.header { background: linear-gradient(135deg, var(--primary), #a29bfe); color:#fff; padding:24px 0; box-shadow:0 4px 20px rgba(108,92,231,0.2); }
.header .container { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; }
.logo { font-size:22px; font-weight:700; letter-spacing:1px; }
.header-sub { font-size:13px; opacity:0.85; }

/* Intro */
.section { padding:40px 0; }
.intro-card { background:var(--card); border-radius:var(--radius); padding:48px 40px; box-shadow:var(--shadow); text-align:center; }
.intro-card h1 { font-size:32px; margin-bottom:12px; background:linear-gradient(135deg, var(--primary), #a29bfe); -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text; }
.intro-desc { color:var(--text-light); font-size:16px; max-width:600px; margin:0 auto 32px; line-height:1.8; }
.dims-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:16px; margin-bottom:24px; }
.dim-card { background:var(--bg); border-radius:10px; padding:20px 12px; text-align:center; transition:transform .2s; }
.dim-card:hover { transform:translateY(-3px); }
.dim-icon { font-size:32px; margin-bottom:8px; }
.dim-name { font-weight:600; font-size:14px; margin-bottom:4px; }
.dim-desc { font-size:12px; color:var(--text-light); }
.dim-ei { border-bottom:3px solid var(--ei-color); }
.dim-sn { border-bottom:3px solid var(--sn-color); }
.dim-tf { border-bottom:3px solid var(--tf-color); }
.dim-jp { border-bottom:3px solid var(--jp-color); }
.intro-info { display:flex; justify-content:center; gap:24px; margin-bottom:32px; color:var(--text-light); font-size:14px; }

/* Buttons */
.btn { border:none; border-radius:8px; padding:10px 24px; font-size:15px; font-weight:600; cursor:pointer; transition:all .2s; display:inline-flex; align-items:center; gap:8px; }
.btn:hover { transform:translateY(-1px); box-shadow:0 4px 12px rgba(0,0,0,0.15); }
.btn-primary { background:var(--primary); color:#fff; }
.btn-primary:hover { background:var(--primary-dark); }
.btn-success { background:var(--success); color:#fff; }
.btn-outline { background:transparent; color:var(--primary); border:2px solid var(--primary); }
.btn-large { padding:14px 40px; font-size:17px; border-radius:10px; }

/* Progress */
.progress-bar-wrap { margin-bottom:24px; }
.progress-info { display:flex; justify-content:space-between; align-items:center; margin-bottom:8px; font-size:14px; color:var(--text-light); }
.progress-bar { height:8px; background:var(--border); border-radius:4px; overflow:hidden; }
.progress-fill { height:100%; background:linear-gradient(90deg, var(--primary), #a29bfe); border-radius:4px; transition:width .3s; }

/* Info Form */
.info-form { background:var(--card); padding:20px 24px; border-radius:var(--radius); margin-bottom:24px; box-shadow:var(--shadow); }
.form-row { display:flex; gap:16px; margin-bottom:12px; }
.form-row:last-child { margin-bottom:0; }
.form-group { flex:1; }
.form-group label { display:block; font-size:13px; font-weight:600; margin-bottom:4px; color:var(--text-light); }
.form-group input, .form-group select { width:100%; padding:8px 12px; border:1px solid var(--border); border-radius:6px; font-size:14px; transition:border-color .2s; }
.form-group input:focus, .form-group select:focus { outline:none; border-color:var(--primary); }

/* Questions */
.questions-container { margin-bottom:20px; }
.question-card { background:var(--card); border-radius:var(--radius); padding:24px; margin-bottom:16px; box-shadow:var(--shadow); }
.q-header { display:flex; align-items:center; gap:12px; margin-bottom:12px; }
.q-num { font-weight:700; color:var(--primary); font-size:16px; min-width:36px; }
.q-dim-tag { font-size:11px; padding:2px 8px; border-radius:10px; font-weight:600; }
.dim-EI { background:#EDE9FE; color:var(--ei-color); }
.dim-SN { background:#D1FAE5; color:var(--sn-color); }
.dim-TF { background:#FFE4DE; color:var(--tf-color); }
.dim-JP { background:#FEF3C7; color:#B7791F; }
.q-text { font-size:15px; margin-bottom:16px; font-weight:500; color:var(--text); }
.q-options { display:flex; gap:12px; flex-wrap:wrap; }
.q-option { flex:1; min-width:180px; padding:12px 16px; border:2px solid var(--border); border-radius:8px; cursor:pointer; transition:all .2s; font-size:14px; display:flex; align-items:center; gap:8px; }
.q-option:hover { border-color:var(--primary); background:#F8F7FF; }
.q-option.selected { border-color:var(--primary); background:#EDE9FE; font-weight:600; }
.q-option input[type=radio] { display:none; }
.q-mid { flex:0 0 auto; min-width:auto; border-style:dashed; }
.q-mid.selected { background:#FFF3E0; border-color:#FDCB6E; }
.test-nav { display:flex; justify-content:space-between; gap:16px; margin-top:8px; }

/* Result */
.result-hero { background:var(--card); border-radius:var(--radius); padding:40px; box-shadow:var(--shadow); margin-bottom:24px; text-align:center; }
.result-type-badge { margin-bottom:24px; }
.type-big { font-size:64px; font-weight:800; letter-spacing:4px; background:linear-gradient(135deg, var(--primary), #a29bfe); -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text; }
.type-name { font-size:22px; font-weight:600; margin-top:4px; }
.type-eng { font-size:14px; color:var(--text-light); }
.result-score-grid { max-width:500px; margin:0 auto; }
.score-dim { margin-bottom:16px; }
.score-bar-label { display:flex; justify-content:space-between; font-size:13px; font-weight:600; margin-bottom:4px; }
.score-bar { display:flex; height:28px; background:var(--bg); border-radius:14px; overflow:hidden; }
.score-fill-a { background:var(--primary); transition:width .6s ease; display:flex; align-items:center; justify-content:flex-end; padding-right:8px; border-radius:14px 0 0 14px; }
.score-fill-b { background:var(--border); transition:width .6s ease; border-radius:0 14px 14px 0; }
.score-percents { display:flex; justify-content:space-between; font-size:12px; color:var(--text-light); margin-top:2px; }

.result-summary { background:var(--card); padding:24px 28px; border-radius:var(--radius); box-shadow:var(--shadow); margin-bottom:20px; }
.result-summary h2, .result-card h2, .result-card h3 { margin-bottom:12px; font-size:20px; }
.result-summary p { color:var(--text-light); font-size:15px; line-height:1.9; }
.result-card { background:var(--card); padding:24px 28px; border-radius:var(--radius); box-shadow:var(--shadow); margin-bottom:16px; }
.result-card ul { list-style:none; padding:0; }
.result-card li { padding:6px 0; font-size:14px; color:var(--text-light); position:relative; padding-left:20px; }
.result-card li::before { content:"▸"; color:var(--primary); position:absolute; left:0; }
.tag-cloud { display:flex; flex-wrap:wrap; gap:8px; }
.tag { background:var(--bg); padding:6px 14px; border-radius:16px; font-size:13px; color:var(--text); }
.result-detailed { border-left:4px solid var(--primary); }
.detailed-text { font-size:14px; color:var(--text-light); line-height:2; }
.result-actions { display:flex; justify-content:center; gap:16px; margin-top:32px; padding-bottom:40px; }

/* Loading */
.loading-overlay { position:fixed; inset:0; background:rgba(255,255,255,0.95); display:flex; flex-direction:column; align-items:center; justify-content:center; z-index:100; }
.loading-spinner { width:48px; height:48px; border:4px solid var(--border); border-top-color:var(--primary); border-radius:50%; animation:spin .8s linear infinite; margin-bottom:16px; }
@keyframes spin { to { transform:rotate(360deg); } }
.loading-overlay p { font-size:16px; color:var(--text-light); }

/* Footer */
.footer { text-align:center; padding:32px 0; color:var(--text-light); font-size:13px; border-top:1px solid var(--border); margin-top:40px; }

/* Admin */
.admin-page { min-height:100vh; background:linear-gradient(135deg, #0c0c1d, #1a1a3e); display:flex; align-items:center; justify-content:center; padding:20px; }
.admin-login-box { background:rgba(255,255,255,0.95); border-radius:16px; padding:40px; width:100%; max-width:400px; box-shadow:0 20px 60px rgba(0,0,0,0.3); }
.admin-login-box h2 { text-align:center; margin-bottom:8px; font-size:24px; color:var(--text); }
.admin-login-box .sub { text-align:center; color:var(--text-light); margin-bottom:28px; font-size:14px; }
.admin-input { width:100%; padding:12px 16px; border:2px solid var(--border); border-radius:8px; font-size:15px; margin-bottom:16px; transition:border-color .2s; }
.admin-input:focus { outline:none; border-color:var(--primary); }
.admin-error { color:var(--danger); font-size:14px; margin-bottom:12px; text-align:center; display:none; }

/* Admin Dashboard */
.admin-dashboard { min-height:100vh; background:var(--bg); }
.admin-topbar { background:var(--card); padding:16px 24px; display:flex; justify-content:space-between; align-items:center; box-shadow:0 2px 8px rgba(0,0,0,0.06); }
.admin-topbar .user { font-weight:600; display:flex; align-items:center; gap:12px; }
.admin-topbar .btn { font-size:14px; }
.admin-content { padding:24px; max-width:1200px; margin:0 auto; }
.admin-tabs { display:flex; gap:8px; margin-bottom:24px; }
.admin-tab { padding:10px 20px; border:none; background:var(--card); border-radius:8px; cursor:pointer; font-size:14px; font-weight:600; transition:all .2s; }
.admin-tab.active { background:var(--primary); color:#fff; }
.admin-stats { display:grid; grid-template-columns:repeat(auto-fit,minmax(140px,1fr)); gap:12px; margin-bottom:24px; }
.admin-stat-card { background:var(--card); padding:16px; border-radius:8px; text-align:center; box-shadow:var(--shadow); }
.admin-stat-card .val { font-size:24px; font-weight:700; color:var(--primary); }
.admin-stat-card .lbl { font-size:12px; color:var(--text-light); margin-top:4px; }

.search-bar { display:flex; gap:8px; margin-bottom:16px; }
.search-bar input { flex:1; padding:8px 12px; border:1px solid var(--border); border-radius:6px; font-size:14px; }
.admin-table { width:100%; border-collapse:collapse; background:var(--card); border-radius:8px; overflow:hidden; box-shadow:var(--shadow); }
.admin-table th, .admin-table td { padding:12px 16px; text-align:left; font-size:14px; border-bottom:1px solid var(--border); }
.admin-table th { background:var(--bg); font-weight:600; }
.admin-table tr:hover { background:#F8F7FF; }
.admin-table .type-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-weight:700; font-size:13px; background:var(--primary); color:#fff; }
.pagination { display:flex; justify-content:center; gap:8px; margin-top:20px; }
.page-btn { padding:6px 14px; border:1px solid var(--border); background:var(--card); border-radius:6px; cursor:pointer; font-size:14px; }
.page-btn.active { background:var(--primary); color:#fff; border-color:var(--primary); }
.page-btn:disabled { opacity:.5; cursor:not-allowed; }

/* Detail Page */
.detail-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-bottom:20px; }
.detail-item { background:var(--bg); padding:12px 16px; border-radius:8px; }
.detail-item .lbl { font-size:12px; color:var(--text-light); }
.detail-item .val { font-size:16px; font-weight:600; margin-top:2px; }
.answers-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(320px,1fr)); gap:12px; }
.answer-item { background:var(--bg); padding:12px 16px; border-radius:8px; font-size:13px; }
.answer-item .qn { font-weight:600; color:var(--primary); margin-bottom:4px; }

/* Settings */
.settings-card { background:var(--card); padding:32px; border-radius:var(--radius); box-shadow:var(--shadow); max-width:480px; margin:0 auto; }
.settings-card h3 { margin-bottom:20px; }
.settings-card .form-group { margin-bottom:16px; }
.alert { padding:12px 16px; border-radius:8px; font-size:14px; margin-bottom:16px; display:none; }
.alert-success { background:#D1FAE5; color:var(--success); display:block; }
.alert-error { background:#FFE4DE; color:var(--danger); display:block; }

/* ============================================
   Result Page V2 - Beautiful Design
   ============================================ */

/* Type-specific color variables */
.result-section { --type-color: var(--primary); --type-gradient: linear-gradient(135deg, var(--primary), #a29bfe); }

/* Hero Section */
.result-hero-v2 {
  position: relative;
  border-radius: 20px;
  padding: 60px 40px 48px;
  overflow: hidden;
  color: #fff;
  text-align: center;
  margin-bottom: 24px;
  background: var(--type-gradient);
}

.hero-decor {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.hero-decor::before,
.hero-decor::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
}

.hero-decor::before {
  width: 300px; height: 300px;
  top: -80px; right: -60px;
}

.hero-decor::after {
  width: 200px; height: 200px;
  bottom: -40px; left: -40px;
}

.hero-circle {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
}

.hero-circle.c1 { width: 120px; height: 120px; top: 30px; left: 15%; }
.hero-circle.c2 { width: 80px; height: 80px; top: 60%; right: 10%; }
.hero-circle.c3 { width: 60px; height: 60px; bottom: 20%; left: 25%; }

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-emoji {
  font-size: 80px;
  margin-bottom: 16px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.15));
  animation: heroFloat 3s ease-in-out infinite;
}

@keyframes heroFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.hero-type-code {
  font-size: 72px;
  font-weight: 900;
  letter-spacing: 8px;
  text-shadow: 0 2px 20px rgba(0,0,0,0.15);
  line-height: 1;
  margin-bottom: 8px;
}

.hero-type-name {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 4px;
}

.hero-type-eng {
  font-size: 15px;
  opacity: 0.85;
  font-weight: 300;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.hero-tagline {
  font-size: 16px;
  opacity: 0.9;
  margin-top: 16px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

/* Dimension Scores */
.result-scores-v2 {
  background: var(--card);
  border-radius: 16px;
  padding: 32px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.result-scores-v2 h3 {
  font-size: 18px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}

.score-item-v2 {
  margin-bottom: 20px;
}

.score-item-v2:last-child {
  margin-bottom: 0;
}

.score-labels-v2 {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}

.score-label-left, .score-label-right {
  font-size: 14px;
  font-weight: 600;
}

.score-bar-v2 {
  height: 32px;
  border-radius: 16px;
  display: flex;
  overflow: hidden;
  background: #f0f0f0;
  position: relative;
}

.score-fill-left {
  border-radius: 16px 0 0 16px;
  transition: width 1s ease;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 10px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  min-width: 0;
}

.score-fill-right {
  border-radius: 0 16px 16px 0;
  transition: width 1s ease;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-left: 10px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  min-width: 0;
}

/* Summary Card */
.result-summary-v2 {
  background: var(--card);
  border-radius: 16px;
  padding: 28px 32px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.result-summary-v2::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px; height: 100%;
  background: var(--type-color);
}

.result-summary-v2 h3 {
  font-size: 18px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}

.result-summary-v2 p {
  font-size: 15px;
  line-height: 1.9;
  color: var(--text-light);
}

/* Pros vs Cons */
.result-pros-cons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.pros-card, .cons-card {
  background: var(--card);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.pros-card {
  border-top: 4px solid #00B894;
}

.cons-card {
  border-top: 4px solid #E17055;
}

.pros-card h3, .cons-card h3 {
  font-size: 17px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pros-card ul, .cons-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.pros-card li, .cons-card li {
  padding: 6px 0 6px 24px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-light);
  position: relative;
}

.pros-card li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #00B894;
  font-weight: 700;
}

.cons-card li::before {
  content: "⚠";
  position: absolute;
  left: 0;
  color: #E17055;
  font-weight: 700;
}

/* Section Cards */
.result-section-v2 {
  background: var(--card);
  border-radius: 16px;
  padding: 28px 32px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.result-section-v2 h3 {
  font-size: 18px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}

.result-section-v2 h3 .section-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  background: linear-gradient(135deg, var(--type-color), rgba(108,92,231,0.3));
}

.result-section-v2 ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.result-section-v2 li {
  padding: 8px 0 8px 24px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-light);
  position: relative;
}

.result-section-v2 li::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 14px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--type-color);
}

/* Tags */
.result-tags-v2 {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.result-tag-v2 {
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  background: linear-gradient(135deg, #f8f9fe, #ede9fe);
  color: var(--text);
  transition: all .2s;
  border: 1px solid transparent;
}

.result-tag-v2:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  border-color: var(--type-color);
}

/* Match Cards */
.result-match-grid {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.match-card {
  flex: 1;
  min-width: 100px;
  max-width: 140px;
  background: linear-gradient(135deg, #f8f9fe, #ede9fe);
  border-radius: 12px;
  padding: 16px 12px;
  text-align: center;
  transition: all .2s;
  border: 2px solid transparent;
}

.match-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
  border-color: var(--type-color);
}

.match-type {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 4px;
  color: var(--type-color);
}

.match-name {
  font-size: 12px;
  color: var(--text-light);
}

/* Cognitive Functions */
.cognitive-fn-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.cognitive-fn-item {
  padding: 10px 20px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f8f9fe, #ede9fe);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.cognitive-fn-item .fn-label {
  font-size: 12px;
  color: var(--text-light);
  font-weight: 400;
}

/* Three Column Grid */
.result-three-col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.result-col-card {
  background: var(--card);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.result-col-card h4 {
  font-size: 15px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.result-col-card p {
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-light);
}

/* Detailed Analysis */
.result-detailed-v2 {
  background: var(--card);
  border-radius: 16px;
  padding: 28px 32px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.result-detailed-v2 h3 {
  font-size: 18px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.result-detailed-v2 .detailed-text {
  font-size: 14px;
  line-height: 2;
  color: var(--text-light);
}

.result-detailed-v2 .detailed-text strong {
  color: var(--text);
  font-weight: 600;
}

/* Actions */
.result-actions-v2 {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 32px;
  padding-bottom: 40px;
  flex-wrap: wrap;
}

.result-actions-v2 .btn {
  padding: 12px 32px;
  font-size: 15px;
}

/* Print styles */
@media print {
  .header, .footer, .result-actions-v2 { display: none !important; }
  .result-hero-v2 { border-radius: 0; margin: 0; }
  .result-section-v2, .result-scores-v2, .result-summary-v2 { box-shadow: none; border: 1px solid #eee; }
}

/* Responsive */
@media (max-width:768px) {
  .dims-grid { grid-template-columns:repeat(2,1fr); }
  .form-row { flex-direction:column; }
  .q-options { flex-direction:column; }
  .detail-grid { grid-template-columns:1fr; }
  .answers-grid { grid-template-columns:1fr; }
  .result-hero { padding:24px 16px; }
  .type-big { font-size:48px; }
  .admin-stats { grid-template-columns:repeat(2,1fr); }
  .result-pros-cons { grid-template-columns:1fr; }
  .result-three-col { grid-template-columns:1fr; }
  .hero-type-code { font-size:48px; }
  .hero-emoji { font-size:60px; }
  .result-hero-v2 { padding:40px 20px 32px; }
}
