/* font-loaded via system fonts for China accessibility */
:root {
  --cream: #faf8f5;
  --warm-white: #fdfaf6;
  --paper: #f5f1ea;
  --ink: #3a3226;
  --ink-light: #6b5e4f;
  --ink-lighter: #9b8e7f;
  --accent: #8b6f4e;
  --accent-light: #a88b6a;
  --accent-soft: #d4c4ad;
  --border: #e3dbd0;
  --border-light: #ede6dc;
  --green: #5a7a5c;
  --green-soft: #e3ece4;
  --red-soft: #c4877a;
  --red-bg: #fce8e3;
  --shadow: 0 2px 12px rgba(60, 40, 20, 0.06);
  --shadow-lg: 0 8px 32px rgba(60, 40, 20, 0.08);
}

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

body {
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--cream);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.7;
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(139, 111, 78, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(90, 122, 92, 0.03) 0%, transparent 50%);
}

.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}

.header {
  text-align: center;
  margin-bottom: 36px;
}

.header-line {
  width: 60px; height: 1px;
  background: var(--accent-soft); margin: 0 auto;
}

.header-line:first-child { margin-bottom: 24px; }
.header-line:last-child { margin-top: 20px; }

.title {
  font-family: 'Noto Serif SC', serif;
  font-size: 28px; font-weight: 700;
  color: var(--ink); letter-spacing: 4px;
}

.subtitle {
  font-size: 13px; color: var(--ink-lighter);
  letter-spacing: 3px; margin-top: 10px;
}

.progress-bar-wrap {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 32px;
}

.progress-bar {
  flex: 1; height: 6px;
  background: var(--border-light);
  border-radius: 3px; overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  border-radius: 3px;
  transition: width 0.3s ease;
  width: 0%;
}

.progress-text {
  font-size: 12px; color: var(--ink-lighter);
  white-space: nowrap; min-width: 58px; text-align: right;
}

.form-card {
  background: var(--warm-white);
  border-radius: 12px; padding: 40px 36px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
}

.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  font-size: 14px; font-weight: 500;
  color: var(--ink-light);
  margin-bottom: 10px; letter-spacing: 1px;
}

.form-group label::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  margin-right: 8px; vertical-align: middle;
  position: relative; top: -1px;
}

.form-row.two-col {
  display: flex; gap: 16px;
}

.form-row .half { flex: 1; }

input[type="text"],
input[type="number"],
select {
  width: 100%; padding: 12px 16px;
  font-size: 15px; font-family: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 8px; outline: none;
  transition: border-color 0.25s, box-shadow 0.25s;
  -webkit-appearance: none;
}

input::placeholder { color: var(--ink-lighter); font-size: 14px; }

input:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139, 111, 78, 0.08);
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239b8e7f' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

.question-section {
  margin-bottom: 36px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border-light);
}

.question-section:last-of-type { border-bottom: none; }

.section-title {
  font-family: 'Noto Serif SC', serif;
  font-size: 16px; font-weight: 600;
  color: var(--accent); letter-spacing: 2px;
  margin-bottom: 20px;
  padding: 0;
  display: flex; align-items: center; gap: 10px;
  text-align: center;
}

.section-title::before,
.section-title::after {
  content: '';
  flex: 1; height: 1px;
  background: var(--accent-soft); opacity: 0.5;
}

.question-item {
  margin-bottom: 18px;
  padding: 12px 16px;
  background: var(--cream);
  border-radius: 10px;
  border: 1px solid transparent;
  transition: border-color 0.2s;
}

.question-item:hover {
  border-color: var(--accent-soft);
}

.question-item.answered {
  border-color: var(--accent-soft);
  background: #faf6f0;
}

.question-text {
  font-size: 15px; color: var(--ink);
  margin-bottom: 10px; line-height: 1.6;
}

.question-number {
  display: inline-block;
  width: 24px; height: 24px;
  line-height: 24px; text-align: center;
  font-size: 12px; font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 50%; margin-right: 8px;
}

.score-options {
  display: flex; gap: 8px;
}

.score-option {
  flex: 1; text-align: center;
}

.score-option input { display: none; }

.score-option label {
  display: block; padding: 8px 4px;
  font-size: 13px; color: var(--ink-light);
  background: var(--warm-white);
  border: 1px solid var(--border);
  border-radius: 8px; cursor: pointer;
  transition: all 0.2s; user-select: none;
  letter-spacing: 0; margin: 0;
}

.score-option label::before { display: none; }

.score-option input:checked + label {
  background: var(--accent); color: #fff;
  border-color: var(--accent);
  font-weight: 500;
}

.score-option label:hover {
  border-color: var(--accent-soft);
}

.score-desc {
  display: none;
}

.submit-btn {
  width: 100%; padding: 16px;
  font-size: 16px;
  font-family: 'Noto Serif SC', serif;
  font-weight: 600; letter-spacing: 3px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  border: none; border-radius: 10px; cursor: pointer;
  transition: all 0.3s; margin-top: 16px;
  box-shadow: 0 4px 14px rgba(139, 111, 78, 0.2);
}

.submit-btn:hover {
  box-shadow: 0 6px 20px rgba(139, 111, 78, 0.3);
  transform: translateY(-1px);
}

.submit-btn:active { transform: translateY(0); }

.result-card {
  background: var(--warm-white);
  border-radius: 12px; padding: 40px 36px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
  margin-top: 32px;
}

.result-header {
  text-align: center; margin-bottom: 28px;
}

.result-header h2 {
  font-family: 'Noto Serif SC', serif;
  font-size: 22px; font-weight: 700;
  color: var(--ink); letter-spacing: 3px;
}

.result-note {
  font-size: 13px; color: var(--ink-lighter);
  margin-top: 8px; opacity: 0.8;
}

.result-section {
  margin-bottom: 20px;
  padding: 20px;
  background: var(--paper);
  border-radius: 10px;
  border-left: 3px solid var(--accent-soft);
}

.result-section h3 {
  font-family: 'Noto Serif SC', serif;
  font-size: 16px; font-weight: 600;
  color: var(--accent); margin-bottom: 12px; letter-spacing: 2px;
}

.result-section h4 {
  font-size: 14px; font-weight: 600;
  color: var(--ink-light); margin: 14px 0 8px; letter-spacing: 1px;
}

.result-section p {
  font-size: 14px; color: var(--ink-light);
  line-height: 1.8; margin-bottom: 6px;
}

.result-section ul {
  list-style: none; padding: 0;
}

.result-section ul li {
  font-size: 14px; color: var(--ink-light);
  line-height: 1.8; padding-left: 20px; position: relative;
}

.result-section ul li::before {
  content: '·'; position: absolute; left: 6px;
  color: var(--accent); font-weight: bold;
}

.primary-result {
  border-left-color: var(--accent);
  background: #faf6f0;
}

.type-badge {
  display: inline-block;
  padding: 6px 16px;
  margin: 4px 8px 4px 0;
  font-size: 13px; border-radius: 20px;
  font-weight: 500;
}

.type-badge.primary {
  background: var(--accent); color: #fff;
  letter-spacing: 1px;
}

.type-badge.tendency {
  background: var(--accent-soft); color: var(--ink);
}

.type-badge.balanced {
  background: var(--green-soft); color: var(--green);
}

.score-bar-wrap {
  margin: 6px 0;
  display: flex; align-items: center; gap: 10px;
}

.score-bar-label {
  font-size: 13px; color: var(--ink-light);
  min-width: 70px; text-align: right;
}

.score-bar {
  flex: 1; height: 8px;
  background: var(--border-light);
  border-radius: 4px; overflow: hidden;
}

.score-bar-fill {
  height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, var(--accent-soft), var(--accent));
  transition: width 0.6s ease;
}

.score-bar-val {
  font-size: 12px; color: var(--ink-lighter);
  min-width: 36px;
}

.standard-table table {
  width: 100%; border-collapse: collapse;
  font-size: 13px; margin: 12px 0;
}

.standard-table thead th {
  background: var(--accent-soft); color: var(--ink);
  padding: 10px 12px; text-align: center;
  font-weight: 600; font-size: 12px; letter-spacing: 1px;
}

.standard-table tbody td {
  padding: 8px 12px; border-bottom: 1px solid var(--border-light);
  color: var(--ink-light); text-align: center; line-height: 1.6;
}

.standard-table tbody td:first-child {
  font-weight: 500; color: var(--ink);
}

.standard-table tbody tr:last-child td {
  border-bottom: none;
}

.formula-note {
  font-size: 12px !important; color: var(--ink-lighter) !important;
  text-align: center; margin-top: 12px !important;
  font-style: italic;
}

.result-footer {
  text-align: center; margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
}

.result-footer p {
  font-size: 13px; color: var(--ink-lighter);
  margin-bottom: 16px; line-height: 1.7;
}

.reset-btn {
  padding: 10px 32px;
  font-size: 14px; font-family: inherit; letter-spacing: 2px;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--accent);
  border-radius: 8px; cursor: pointer;
  transition: all 0.25s;
}

.reset-btn:hover { background: var(--accent); color: #fff; }

.footer {
  text-align: center; padding: 40px 20px 60px;
  color: var(--ink-lighter); font-size: 13px; letter-spacing: 2px;
}

.footer-note {
  font-size: 11px; margin-top: 6px; opacity: 0.6;
}

@media (max-width: 520px) {
  .container { padding: 24px 12px 40px; }
  .form-card, .result-card { padding: 24px 12px; }
  .title { font-size: 22px; letter-spacing: 3px; }
  .form-row.two-col { flex-direction: column; gap: 0; }
  .section-title { font-size: 15px; }

  .question-text { font-size: 16px; }
  .question-item { padding: 14px 10px; }

  .score-options { gap: 4px; }
  .score-option { flex: 1 1 0; min-width: 0; }
  .score-option label { font-size: 14px; padding: 10px 2px; color: var(--ink); }
}

.scores-toggle {
  text-align: center; margin-bottom: 12px;
}

.scores-toggle a {
  font-size: 13px; color: var(--accent); cursor: pointer;
  text-decoration: none; letter-spacing: 1px;
}

.scores-toggle a:hover { text-decoration: underline; }
