* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, 'PingFang SC', 'Helvetica Neue', sans-serif; min-height: 100vh; color: #333; }
.container { max-width: 420px; margin: 0 auto; padding: 20px 16px; min-height: 100vh; }

/* === Home Page === */
.home-bg { background: linear-gradient(180deg, #ffecd2 0%, #fcb69f 100%); }
.home-header { text-align: center; padding: 40px 0 24px; }
.home-header h1 { font-size: 28px; font-weight: 800; color: #333; }
.home-header p { font-size: 15px; color: #666; margin-top: 8px; }
.service-cards { display: flex; flex-direction: column; gap: 16px; }
.service-card { background: rgba(255,255,255,0.9); border-radius: 20px; padding: 24px 20px; box-shadow: 0 8px 24px rgba(0,0,0,0.06); cursor: pointer; transition: transform 0.2s; text-decoration: none; color: inherit; }
.service-card:active { transform: scale(0.97); }
.card-top { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.card-emoji { font-size: 40px; }
.card-info h3 { font-size: 18px; font-weight: 700; }
.card-info .price { font-size: 20px; font-weight: 800; color: #e74c3c; }
.card-desc { font-size: 14px; color: #888; line-height: 1.6; }
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.card-tag { font-size: 12px; padding: 4px 10px; border-radius: 12px; font-weight: 600; }

/* === Service Pages === */
.service-header { text-align: center; padding: 40px 0 24px; }
.service-header .emoji { font-size: 48px; margin-bottom: 12px; }
.service-header h1 { font-size: 24px; font-weight: 800; color: #333; }
.service-header p { font-size: 14px; color: #666; margin-top: 6px; }
.back-btn { display: inline-flex; align-items: center; gap: 4px; color: #666; text-decoration: none; font-size: 14px; padding: 8px 0; }

/* Upload Area */
.upload-section { margin: 20px 0; }
.upload-area { border: 2px dashed rgba(0,0,0,0.15); border-radius: 20px; padding: 40px 20px; text-align: center; cursor: pointer; transition: all 0.3s; background: rgba(255,255,255,0.6); }
.upload-area:hover, .upload-area.dragover { border-color: rgba(0,0,0,0.3); background: rgba(255,255,255,0.8); }
.upload-area .icon { font-size: 48px; margin-bottom: 12px; }
.upload-area .text { font-size: 16px; font-weight: 600; color: #555; }
.upload-area .hint { font-size: 13px; color: #999; margin-top: 6px; }
.upload-area input[type="file"] { display: none; }

/* Preview */
.preview-section { display: none; margin: 16px 0; text-align: center; }
.preview-section.show { display: block; }
.preview-img { max-width: 200px; max-height: 200px; border-radius: 16px; object-fit: cover; box-shadow: 0 4px 16px rgba(0,0,0,0.1); }
.preview-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.preview-row .preview-img { max-width: 150px; max-height: 150px; }

/* Submit Button */
.submit-btn { width: 100%; padding: 16px; border: none; border-radius: 16px; font-size: 18px; font-weight: 700; color: white; cursor: pointer; transition: all 0.3s; margin-top: 16px; }
.submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.submit-btn:not(:disabled):active { transform: scale(0.97); }

/* Loading */
.loading-section { display: none; text-align: center; padding: 60px 20px; }
.loading-section.show { display: block; }
.loading-spinner { width: 60px; height: 60px; border: 4px solid rgba(0,0,0,0.1); border-top-color: currentColor; border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 20px; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: 16px; color: #666; }
.loading-fun { font-size: 14px; color: #999; margin-top: 8px; animation: fadeInOut 3s infinite; }
@keyframes fadeInOut { 0%,100% { opacity: 0.5; } 50% { opacity: 1; } }

/* Results */
.result-section { display: none; }
.result-section.show { display: block; }
.result-card { background: rgba(255,255,255,0.9); border-radius: 20px; padding: 24px 20px; margin-bottom: 16px; box-shadow: 0 4px 20px rgba(0,0,0,0.06); }
.result-card h2 { font-size: 18px; font-weight: 700; margin-bottom: 12px; }
.result-card h3 { font-size: 16px; font-weight: 600; margin: 12px 0 8px; }
.result-card p { font-size: 14px; line-height: 1.7; color: #555; }
.result-card .label { font-size: 13px; color: #999; margin-bottom: 4px; }

/* Score Bar */
.score-item { margin-bottom: 14px; }
.score-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.score-name { font-size: 14px; font-weight: 600; }
.score-value { font-size: 16px; font-weight: 800; }
.score-bar { height: 8px; background: rgba(0,0,0,0.08); border-radius: 4px; overflow: hidden; }
.score-fill { height: 100%; border-radius: 4px; transition: width 1s ease-out; }
.score-comment { font-size: 13px; color: #888; margin-top: 4px; }

/* Big Score */
.big-score { text-align: center; padding: 20px; }
.big-score .number { font-size: 64px; font-weight: 900; }
.big-score .out-of { font-size: 18px; color: #888; }
.big-score .label { font-size: 14px; color: #666; margin-top: 4px; }

/* Tags */
.result-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.result-tag { padding: 6px 14px; border-radius: 16px; font-size: 13px; font-weight: 600; }

/* Animal */
.animal-hero { text-align: center; padding: 24px; }
.animal-hero .animal-emoji { font-size: 72px; }
.animal-hero .animal-name { font-size: 24px; font-weight: 800; margin-top: 8px; }
.animal-hero .match { font-size: 16px; color: #666; margin-top: 4px; }

/* Mental Age */
.age-hero { text-align: center; padding: 24px; }
.age-hero .age-number { font-size: 72px; font-weight: 900; }
.age-hero .age-unit { font-size: 20px; color: #888; }
.age-hero .age-label { font-size: 16px; margin-top: 8px; }

/* Couple */
.match-hero { text-align: center; padding: 24px; }
.match-hero .heart { font-size: 48px; animation: pulse 1.5s infinite; }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.15); } }
.match-hero .match-score { font-size: 64px; font-weight: 900; }
.match-hero .match-level { font-size: 18px; margin-top: 4px; }

/* Poem */
.poem { font-style: italic; line-height: 2; text-align: center; font-size: 15px; color: #666; padding: 16px; background: rgba(255,255,255,0.5); border-radius: 12px; }

/* Code Input */
.code-section { margin: 16px 0; }
.code-input { width: 100%; padding: 14px 16px; border: 2px solid rgba(0,0,0,0.1); border-radius: 14px; font-size: 18px; font-weight: 600; text-align: center; letter-spacing: 4px; text-transform: uppercase; background: rgba(255,255,255,0.7); outline: none; transition: border-color 0.3s; }
.code-input:focus { border-color: var(--accent); }
.code-input::placeholder { letter-spacing: 1px; font-weight: 400; font-size: 14px; }
.code-error { font-size: 13px; color: #e74c3c; margin-top: 6px; text-align: center; display: none; }
.code-error.show { display: block; }
.code-hint { font-size: 13px; color: #999; text-align: center; margin-top: 8px; }

/* Retry */
.retry-btn { display: block; width: 100%; padding: 14px; border: 2px solid rgba(0,0,0,0.1); border-radius: 16px; background: rgba(255,255,255,0.6); font-size: 16px; font-weight: 600; color: #666; cursor: pointer; text-align: center; margin-top: 16px; }

/* Error */
.error-section { display: none; text-align: center; padding: 40px 20px; }
.error-section.show { display: block; }
.error-section .error-emoji { font-size: 48px; margin-bottom: 12px; }
.error-section .error-msg { font-size: 15px; color: #e74c3c; margin-bottom: 16px; }

/* Theme colors */
.theme-pink { --accent: #ff6b81; --accent-light: #fff0f0; --accent-text: #e74c3c; }
.theme-purple { --accent: #a18cd1; --accent-light: #f3e5f5; --accent-text: #8e24aa; }
.theme-green { --accent: #56ab2f; --accent-light: #e8f5e9; --accent-text: #27ae60; }
.theme-blue { --accent: #667eea; --accent-light: #ede7f6; --accent-text: #5e35b1; }
.theme-red { --accent: #f5576c; --accent-light: #fce4ec; --accent-text: #e74c3c; }

.submit-btn { background: linear-gradient(135deg, var(--accent), var(--accent)); }
.score-fill { background: var(--accent); }
.big-score .number { color: var(--accent); }
.result-tag { background: var(--accent-light); color: var(--accent-text); }
.loading-spinner { color: var(--accent); }
.animal-hero .animal-name { color: var(--accent-text); }
.age-hero .age-number { color: var(--accent); }
.age-hero .age-label { color: var(--accent-text); }
.match-hero .match-score { color: var(--accent); }
.match-hero .match-level { color: var(--accent-text); }
