/* ========== 基础重置 ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB',
    'Microsoft YaHei', 'Helvetica Neue', sans-serif;
  background: #f5f5f5;
  color: #333;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: #fff;
  position: relative;
  overflow: hidden;
}

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

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

/* ========== 首页 ========== */
.home-container {
  padding: 20px 24px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
}

.home-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0 8px;
}
.home-label {
  font-size: 13px;
  color: #999;
}
.home-date {
  font-size: 13px;
  color: #999;
}

.home-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 0;
}

.home-icon {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 32px;
  overflow: hidden;
}
.home-cat-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-title {
  font-size: 28px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 12px;
  text-align: center;
}

.home-subtitle {
  font-size: 15px;
  color: #888;
  text-align: center;
  line-height: 1.6;
}

.home-tip {
  font-size: 13px;
  color: #bbb;
  margin-top: 16px;
}

/* ========== 通用按钮 ========== */
.btn-primary {
  width: 100%;
  max-width: 320px;
  height: 52px;
  border: none;
  border-radius: 26px;
  background: #1a1a1a;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 1px;
}
.btn-primary:active {
  transform: scale(0.97);
  opacity: 0.9;
}

.btn-secondary {
  width: 100%;
  max-width: 320px;
  height: 52px;
  border: 1.5px solid #e0e0e0;
  border-radius: 26px;
  background: #fff;
  color: #333;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 12px;
}
.btn-secondary:active {
  transform: scale(0.97);
  background: #f5f5f5;
}

/* ========== 答题页 ========== */
.quiz-container {
  padding: 20px 24px 40px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0 12px;
}
.quiz-label {
  font-size: 13px;
  color: #999;
}
.quiz-progress {
  font-size: 13px;
  color: #999;
}

.progress-bar {
  width: 100%;
  height: 4px;
  background: #f0f0f0;
  border-radius: 2px;
  margin-bottom: 36px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: #1a1a1a;
  border-radius: 2px;
  transition: width 0.4s ease;
  width: 0%;
}

.quiz-question {
  font-size: 20px;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.5;
  margin-bottom: 32px;
}

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

.quiz-option {
  width: 100%;
  padding: 16px 20px;
  border: 1.5px solid #e8e8e8;
  border-radius: 14px;
  background: #fff;
  font-size: 15px;
  color: #333;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
  line-height: 1.5;
}
.quiz-option:active {
  background: #f5f5f5;
  border-color: #ccc;
}
.quiz-option.selected {
  background: #1a1a1a;
  color: #fff;
  border-color: #1a1a1a;
}

/* ========== 结果页 ========== */
.result-container {
  padding: 20px 24px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.result-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0 24px;
}
.result-label {
  font-size: 13px;
  color: #999;
}
.result-date {
  font-size: 13px;
  color: #999;
}

.result-image {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: #f0f0f0;
  overflow: hidden;
  margin-bottom: 24px;
}
.result-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.result-prefix {
  font-size: 14px;
  color: #999;
  margin-bottom: 8px;
}

.result-title {
  font-size: 24px;
  font-weight: 800;
  color: #1a1a1a;
  text-align: center;
  line-height: 1.4;
  margin-bottom: 8px;
}

.result-subtitle {
  font-size: 14px;
  color: #999;
  margin-bottom: 28px;
}

.result-quote-box {
  width: 100%;
  padding: 20px 24px;
  background: #fafafa;
  border-radius: 12px;
  margin-bottom: 28px;
}
.result-quote {
  font-size: 15px;
  color: #555;
  line-height: 1.7;
  text-align: center;
}

.result-tags-section {
  width: 100%;
  margin-bottom: 28px;
}
.result-tags-label {
  font-size: 13px;
  color: #999;
  margin-bottom: 12px;
}
.result-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.result-tag {
  padding: 8px 16px;
  background: #f5f5f5;
  border-radius: 20px;
  font-size: 13px;
  color: #555;
  white-space: nowrap;
}

.result-description {
  width: 100%;
  font-size: 15px;
  color: #444;
  line-height: 1.8;
  margin-bottom: 36px;
  text-align: justify;
}

/* ========== 安全区域适配 ========== */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .home-container,
  .quiz-container,
  .result-container {
    padding-bottom: calc(40px + env(safe-area-inset-bottom));
  }
}
