:root {
  /* 温暖文艺色调 */
  --bg-primary: #fdf8f3;        /* 主背景 - 奶白 */
  --bg-secondary: #f5ede3;      /* 次背景 - 米色 */
  --bg-card: #ffffff;           /* 卡片背景 */
  --text-primary: #3d2f24;      /* 主文字 - 深棕 */
  --text-secondary: #7a6558;    /* 次文字 - 暖灰棕 */
  --text-light: #b5a89a;        /* 辅助文字 */
  --accent: #c87a5e;            /* 主强调色 - 陶土橙 */
  --accent-light: #e8b49a;      /* 强调色浅 */
  --accent-soft: #f0d8c8;       /* 强调色柔 */
  --warm-pink: #e8a5a5;         /* 柔粉 */
  --warm-green: #a8c4a2;        /* 柔绿 */
  --gradient-warm: linear-gradient(135deg, #fdf8f3 0%, #f5ede3 100%);
  --shadow-soft: 0 4px 24px rgba(61, 47, 36, 0.08);
  --shadow-card: 0 8px 32px rgba(61, 47, 36, 0.1);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

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

html, body {
  min-height: 100vh;
  background: var(--gradient-warm);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei",
    "Helvetica Neue", Helvetica, Arial, sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* ============ 通用组件 ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px 24px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: inherit;
}

.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 4px 16px rgba(200, 122, 94, 0.3);
}
.btn-primary:hover {
  background: #b36a4f;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(200, 122, 94, 0.4);
}
.btn-primary:active {
  transform: translateY(0);
}
.btn-primary:disabled {
  background: var(--text-light);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1.5px solid var(--text-light);
}
.btn-secondary:hover {
  background: var(--bg-secondary);
  border-color: var(--text-secondary);
}

/* ============ 首页 ============ */
.hero {
  text-align: center;
  padding: 40px 0 32px;
}
.hero h1 {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  letter-spacing: 2px;
}
.hero h1 .accent {
  color: var(--accent);
}
.hero p.subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.8;
}

.upload-area {
  background: var(--bg-card);
  border: 2px dashed var(--accent-soft);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-soft);
  margin-bottom: 24px;
}
.upload-area:hover {
  border-color: var(--accent-light);
  background: #fefcf9;
  box-shadow: var(--shadow-card);
}
.upload-area.dragging {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: scale(1.02);
}

.upload-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.6;
}
.upload-text {
  font-size: 16px;
  color: var(--text-primary);
  font-weight: 500;
  margin-bottom: 8px;
}
.upload-hint {
  font-size: 13px;
  color: var(--text-light);
}

.upload-preview {
  margin-top: 20px;
  position: relative;
  display: none;
}
.upload-preview.show {
  display: block;
}
.upload-preview img {
  max-width: 100%;
  max-height: 280px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
}
.upload-preview .remove-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 隐藏的文件输入 */
#fileInput, #cameraInput {
  display: none;
}

.camera-hint {
  text-align: center;
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 24px;
}
.camera-hint a {
  color: var(--accent);
  text-decoration: none;
}

.privacy-note {
  text-align: center;
  font-size: 12px;
  color: var(--text-light);
  margin-top: 32px;
  line-height: 1.6;
}

/* ============ Loading ============ */
.loading-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(253, 248, 243, 0.95);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 1000;
  backdrop-filter: blur(8px);
}
.loading-overlay.show {
  display: flex;
}
.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--accent-soft);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 24px;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.loading-text {
  font-size: 15px;
  color: var(--text-secondary);
  text-align: center;
}
.loading-text .dots::after {
  content: '';
  animation: dots 1.5s steps(4, end) infinite;
}
@keyframes dots {
  0%, 20% { content: ''; }
  40% { content: '.'; }
  60% { content: '..'; }
  80%, 100% { content: '...'; }
}

/* ============ 结果页 ============ */
.result-page {
  display: none;
}
.result-page.show {
  display: block;
}

.result-header {
  text-align: center;
  padding: 32px 0 24px;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 20px;
}
.tag {
  display: inline-block;
  padding: 8px 18px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 100px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.tag:nth-child(2) {
  background: #f0e8d8;
  color: #8a7a5a;
}
.tag:nth-child(3) {
  background: #d8e4d4;
  color: #5a7a52;
}

.overall-comment {
  font-size: 18px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.6;
  padding: 20px 24px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  margin-bottom: 28px;
  text-align: center;
  position: relative;
}
.overall-comment::before {
  content: '"';
  position: absolute;
  top: 8px;
  left: 20px;
  font-size: 36px;
  color: var(--accent-light);
  font-family: Georgia, serif;
  line-height: 1;
}
.overall-comment::after {
  content: '"';
  position: absolute;
  bottom: -16px;
  right: 20px;
  font-size: 36px;
  color: var(--accent-light);
  font-family: Georgia, serif;
  line-height: 1;
}

/* 雷达图区域 */
.radar-section {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  box-shadow: var(--shadow-soft);
  margin-bottom: 24px;
}
.section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 20px;
  text-align: center;
  letter-spacing: 1px;
}
.radar-wrapper {
  position: relative;
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
  aspect-ratio: 1;
}
.radar-wrapper canvas {
  width: 100% !important;
  height: 100% !important;
}

/* 高亮点 */
.highlights-list {
  margin-bottom: 24px;
}
.highlight-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-soft);
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.highlight-card:last-child {
  margin-bottom: 0;
}
.highlight-score {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  background: var(--accent-soft);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.highlight-score .num {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}
.highlight-score .unit {
  font-size: 10px;
  color: var(--accent);
  opacity: 0.7;
  margin-top: 2px;
}
.highlight-content {
  flex: 1;
  min-width: 0;
}
.highlight-dim {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.highlight-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* 故事卡片 */
.story-card {
  background: linear-gradient(135deg, #fef9f4 0%, #f5ede3 100%);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  margin-bottom: 20px;
  position: relative;
  box-shadow: var(--shadow-soft);
}
.story-card .section-label {
  font-size: 12px;
  color: var(--text-light);
  letter-spacing: 2px;
  margin-bottom: 12px;
  text-transform: uppercase;
}
.story-text {
  font-size: 15px;
  color: var(--text-primary);
  line-height: 1.8;
  font-style: italic;
}
.story-deco {
  position: absolute;
  font-size: 80px;
  color: var(--accent-soft);
  font-family: Georgia, serif;
  line-height: 1;
  opacity: 0.4;
}
.story-deco.open { top: 10px; left: 12px; }
.story-deco.close { bottom: -20px; right: 12px; }

/* 建议卡片 */
.tip-card {
  background: #e8f0e4;
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 32px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.tip-icon {
  font-size: 20px;
  flex-shrink: 0;
}
.tip-text {
  font-size: 14px;
  color: #3d5a3a;
  line-height: 1.6;
}

/* 操作按钮组 */
.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 40px;
}

/* 分享弹窗 */
.share-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(61, 47, 36, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
  backdrop-filter: blur(4px);
}
.share-modal.show {
  display: flex;
}
.share-content {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 400px;
  width: 100%;
  text-align: center;
}
.share-content h3 {
  font-size: 18px;
  margin-bottom: 16px;
  color: var(--text-primary);
}
.share-preview {
  background: var(--gradient-warm);
  border-radius: var(--radius-md);
  padding: 24px 16px;
  margin-bottom: 20px;
}
.share-preview .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 12px;
}
.share-preview .tags .tag {
  font-size: 13px;
  padding: 4px 12px;
}
.share-preview .comment {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  font-style: italic;
}
.share-preview .brand {
  margin-top: 16px;
  font-size: 11px;
  color: var(--text-light);
  letter-spacing: 2px;
}
.share-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.share-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px;
  background: var(--bg-secondary);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  color: var(--text-secondary);
  transition: all 0.2s;
}
.share-option:hover {
  background: var(--accent-soft);
  color: var(--accent);
}
.share-option .icon {
  font-size: 24px;
}

.close-share {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: none;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
}

/* 页脚 */
.footer {
  text-align: center;
  font-size: 12px;
  color: var(--text-light);
  padding: 24px 0;
}
