/* ========================================
   WOTI — 坦克世界玩家人格测试 样式
   军事主题：深橄榄绿 + 卡其 + 钢铁灰
   ======================================== */

/* --- 基础重置 & 变量 --- */
:root {
  --bg: #FAF8F3;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F5F2EC;
  --text: #2D3A2E;
  --text-dim: #6B7C6E;
  --accent: #5B8C3E;
  --accent-dark: #4A7432;
  --accent-glow: rgba(91, 140, 62, 0.12);
  --danger: #C0392B;
  --khaki: #8B7D5E;
  --steel: #7F8C8D;
  --border: #E0DDD5;
  --radius: 12px;
  --max-w: 480px;
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

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

/* --- 页面切换 --- */
.page {
  display: none;
  min-height: 100vh;
  animation: fadeIn 0.3s ease;
}
.page.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 24px 20px;
}

/* --- 按钮 --- */
.btn-primary {
  display: block;
  width: 100%;
  padding: 16px;
  background: var(--accent);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius);
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 1px;
}
.btn-primary:hover { background: var(--accent-dark); }
.btn-primary:active { transform: scale(0.97); }

.btn-secondary {
  display: block;
  width: 100%;
  padding: 14px;
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 10px;
}
.btn-secondary:hover { background: var(--accent-glow); }

.btn-back {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 24px;
  cursor: pointer;
  padding: 4px 8px;
  transition: color 0.2s;
}
.btn-back:hover { color: var(--accent); }

/* =========================
   首页
   ========================= */
#page-home { text-align: center; padding-top: 10vh; }

.home-badge {
  display: inline-block;
  font-size: 48px;
  font-weight: 900;
  letter-spacing: 8px;
  color: var(--accent);
  border: 4px solid var(--accent);
  padding: 12px 28px;
  margin-bottom: 16px;
  position: relative;
}
.home-badge::before,
.home-badge::after {
  content: '';
  position: absolute;
  width: 12px; height: 12px;
  border: 2px solid var(--accent);
}
.home-badge::before { top: -6px; left: -6px; border-right: none; border-bottom: none; }
.home-badge::after { bottom: -6px; right: -6px; border-left: none; border-top: none; }

.home-title {
  font-size: 22px;
  font-weight: 700;
  margin: 16px 0 4px;
}
.home-subtitle {
  font-size: 13px;
  color: var(--text-dim);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 24px;
}
.home-desc {
  color: var(--text-dim);
  font-size: 15px;
  margin-bottom: 28px;
  line-height: 1.8;
}
.home-dims {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 36px;
}
.dim-tag {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  color: var(--text-dim);
}
.dim-letter {
  color: var(--accent);
  font-weight: 700;
}
.home-disclaimer {
  color: var(--text-dim);
  font-size: 12px;
  margin-top: 20px;
  opacity: 0.6;
}

/* =========================
   答题页
   ========================= */
.quiz-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}
.progress-bar {
  flex: 1;
  height: 6px;
  background: #E8E5DC;
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.3s ease;
  width: 5%;
}
.quiz-count {
  font-size: 13px;
  color: var(--text-dim);
  min-width: 40px;
  text-align: right;
}
.quiz-chapter {
  font-size: 12px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 8px;
  font-weight: 600;
}
.quiz-question {
  font-size: 19px;
  font-weight: 600;
  line-height: 1.6;
  margin-bottom: 28px;
  min-height: 60px;
}

.quiz-options { display: flex; flex-direction: column; gap: 12px; }

.quiz-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 18px 20px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.quiz-option:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
}
.quiz-option:active {
  transform: scale(0.98);
}
.quiz-option.selected {
  border-color: var(--accent);
  background: var(--accent-glow);
}

/* =========================
   加载页
   ========================= */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  text-align: center;
}

.loading-icon { margin-bottom: 24px; }

.tank-silhouette {
  width: 80px;
  height: 40px;
  background: var(--accent);
  border-radius: 4px 4px 0 0;
  position: relative;
  animation: tankBounce 1.2s ease-in-out infinite;
}
.tank-silhouette::before {
  content: '';
  position: absolute;
  top: -12px; left: 50%;
  transform: translateX(-30%);
  width: 36px; height: 12px;
  background: var(--accent);
  border-radius: 3px;
}
.tank-silhouette::after {
  content: '';
  position: absolute;
  top: -16px; right: -16px;
  width: 28px; height: 6px;
  background: var(--accent);
  border-radius: 3px;
  transform: rotate(-5deg);
}

@keyframes tankBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.loading-text {
  font-size: 17px;
  color: var(--text-dim);
  margin-bottom: 16px;
}

.loading-dots span {
  display: inline-block;
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  margin: 0 4px;
  animation: dotPulse 1.4s ease-in-out infinite;
}
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotPulse {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* =========================
   结果页
   ========================= */
.result-badge {
  display: inline-block;
  font-size: 42px;
  font-weight: 900;
  letter-spacing: 6px;
  color: var(--accent);
  border: 3px solid var(--accent);
  padding: 10px 24px;
  margin: 0 auto 16px;
  text-align: center;
}
#page-result .container { text-align: center; }

.result-title {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 8px;
}
.result-oneliner {
  font-size: 15px;
  color: var(--text-dim);
  margin-bottom: 20px;
  font-style: italic;
}
.result-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 24px;
}
.result-tag {
  background: var(--accent-glow);
  color: var(--accent);
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 600;
}
.result-desc {
  text-align: left;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-dim);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.result-desc p { margin-bottom: 12px; }
.result-desc p:last-child { margin-bottom: 0; }

.result-vehicle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
}
.vehicle-label {
  font-size: 13px;
  color: var(--text-dim);
}
.vehicle-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
}

.result-quote {
  background: #F5F0E8;
  border-left: 4px solid var(--accent);
  padding: 16px 20px;
  margin-bottom: 24px;
  font-size: 15px;
  font-style: italic;
  color: var(--khaki);
  text-align: left;
}

/* 维度条 */
.result-dimensions {
  margin-bottom: 28px;
  text-align: left;
}
.dim-bar-row {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  font-size: 13px;
}
.dim-bar-label {
  width: 42px;
  font-weight: 700;
  color: var(--accent);
  text-align: center;
}
.dim-bar-track {
  flex: 1;
  height: 8px;
  background: #E8E5DC;
  border-radius: 4px;
  margin: 0 8px;
  position: relative;
  overflow: hidden;
}
.dim-bar-fill {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.6s ease;
}
.dim-bar-label-right {
  width: 42px;
  text-align: center;
  color: var(--text-dim);
}

.result-actions { margin-top: 8px; }

/* =========================
   分享弹窗
   ========================= */
.modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal.hidden { display: none; }

.modal-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.4);
}
.modal-content {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 400px;
  width: 90%;
  text-align: center;
}
.modal-close {
  position: absolute;
  top: 12px; right: 16px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 28px;
  cursor: pointer;
}
#share-canvas {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 12px;
}
.share-tip {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 16px;
}

/* =========================
   留言墙
   ========================= */
.wall-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.wall-title {
  font-size: 20px;
  font-weight: 700;
}

.wall-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.wall-input,
.wall-select,
.wall-textarea {
  display: block;
  width: 100%;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  font-family: var(--font);
  margin-bottom: 10px;
  outline: none;
  transition: border-color 0.2s;
}
.wall-input:focus,
.wall-textarea:focus {
  border-color: var(--accent);
}
.wall-select { appearance: auto; }
.wall-textarea { resize: vertical; }
.wall-form .btn-primary { margin-top: 4px; }

.wall-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.filter-btn {
  padding: 6px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}
.filter-btn.active {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

.wall-messages { display: flex; flex-direction: column; gap: 12px; }

.wall-msg {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  animation: fadeIn 0.3s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.wall-msg-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.wall-msg-nick {
  font-weight: 700;
  font-size: 15px;
}
.wall-msg-type {
  font-size: 11px;
  background: var(--accent-glow);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}
.wall-msg-time {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-dim);
}
.wall-msg-body {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.6;
}
.wall-msg-delete {
  background: none;
  border: none;
  color: var(--danger);
  font-size: 12px;
  cursor: pointer;
  margin-top: 8px;
  opacity: 0.6;
}
.wall-msg-delete:hover { opacity: 1; }

.wall-empty {
  text-align: center;
  color: var(--text-dim);
  padding: 40px 0;
  font-size: 14px;
}

/* =========================
   管理面板
   ========================= */
.home-admin-link {
  display: block;
  text-align: center;
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-dim);
  opacity: 0.5;
  text-decoration: none;
  transition: opacity 0.2s;
}
.home-admin-link:hover { opacity: 1; }

.admin-login-box {
  text-align: center;
  padding: 40px 0;
}
.admin-login-hint {
  font-size: 15px;
  color: var(--text-dim);
  margin-bottom: 16px;
}
.admin-login-box .wall-input {
  max-width: 260px;
  margin: 0 auto 12px;
  text-align: center;
}
.admin-login-box .btn-primary {
  max-width: 260px;
  margin: 0 auto;
}

.admin-toolbar {
  margin-bottom: 20px;
}
.admin-toolbar .btn-secondary {
  width: auto;
  display: inline-block;
  padding: 8px 20px;
  font-size: 13px;
}

.admin-section {
  margin-bottom: 28px;
}
.admin-section-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
}
.admin-io-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.admin-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.admin-card-header {
  padding: 14px 16px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.15s;
}
.admin-card-header:hover {
  background: var(--bg-card-hover);
}
.admin-card-body {
  padding: 0 16px 16px;
}
.admin-card-body label {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 8px;
  font-weight: 600;
}
.admin-card-body .wall-input,
.admin-card-body .wall-textarea,
.admin-card-body .wall-select {
  margin-top: 4px;
}

.admin-hint {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 12px;
  line-height: 1.6;
}

/* 逻辑概览 */
.logic-tree { margin-bottom: 16px; }
.logic-dims-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.logic-dim-chip {
  background: var(--accent-glow);
  border: 1px solid var(--accent);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12px;
  color: var(--accent-dark);
}
.logic-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.logic-table th {
  background: var(--bg-card-hover);
  padding: 8px 6px;
  text-align: center;
  font-weight: 700;
  color: var(--text-dim);
  border-bottom: 2px solid var(--border);
}
.logic-table td {
  padding: 6px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.logic-cell {
  display: inline-block;
  width: 26px;
  height: 26px;
  line-height: 26px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 12px;
}
.logic-cell-a {
  background: var(--accent);
  color: #fff;
}
.logic-cell-b {
  background: #E8E5DC;
  color: var(--text);
}
.logic-hidden-row td { opacity: 0.5; }

/* 维度编辑 */
.admin-dim-pair {
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
}
.admin-dim-half { flex: 1; }
.admin-dim-pole-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}

/* =========================
   响应式微调
   ========================= */
@media (min-width: 600px) {
  .container { padding: 32px 24px; }
  .home-badge { font-size: 56px; }
  .quiz-question { font-size: 21px; }
}
