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

:root {
  --primary: #6c5ce7;
  --primary-light: #a29bfe;
  --primary-dark: #5541c8;
  --accent: #fd79a8;
  --accent-light: #fab1c8;
  --bg: #f8f7ff;
  --card-bg: #ffffff;
  --text: #2d3436;
  --text-secondary: #636e72;
  --text-muted: #b2bec3;
  --border: #dfe6e9;
  --success: #00b894;
  --warning: #fdcb6e;
  --error: #e17055;
  --shadow-sm: 0 2px 8px rgba(108, 92, 231, 0.08);
  --shadow-md: 0 8px 30px rgba(108, 92, 231, 0.12);
  --shadow-lg: 0 20px 60px rgba(108, 92, 231, 0.15);
  --radius: 16px;
  --radius-sm: 10px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* ===== 拍摄提醒条 ===== */
.notice-overlay {
  position: relative; z-index: 10;
  max-width: 640px; margin: 20px auto 28px auto;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  overflow: hidden;
  animation: noticeIn 0.5s ease-out;
}
@keyframes noticeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
.notice-overlay.hidden-notice { display: none; }
.notice-bar {
  background: linear-gradient(135deg, #fff8e7 0%, #fff3d6 100%);
  padding: 18px 24px;
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px;
  border-bottom: 2px solid #f0d78c;
}
.notice-content { display: flex; align-items: flex-start; gap: 14px; flex: 1; }
.notice-icon { font-size: 36px; flex-shrink: 0; line-height: 1; }
.notice-body strong { font-size: 19px; color: #c0392b; }
.notice-body p { font-size: 14px; color: #8b6914; margin-top: 4px; line-height: 1.5; }
.notice-body p strong {
  font-size: 15px; color: #c0392b;
  background: #fff3e0; padding: 2px 8px; border-radius: 4px;
}
.notice-images {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  padding: 0 16px 16px;
}
.notice-images img {
  display: block; width: 100%; max-height: 350px;
  object-fit: contain; background: #f5f5f5;
  border-radius: 8px;
}
.notice-close {
  flex-shrink: 0;
  width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid #d4a853; background: #fff;
  font-size: 18px; color: #8b6914; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.notice-close:hover { background: #c0392b; border-color: #c0392b; color: #fff; }

.bg-decoration {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(108,92,231,0.06) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(253,121,168,0.06) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(108,92,231,0.03) 0%, transparent 60%);
}

/* ===== 顶部联系栏 ===== */
.top-contact-bar {
  position: sticky; top: 0; z-index: 100;
  background: linear-gradient(135deg, #6c5ce7, #5541c8);
  color: #fff; text-align: center;
  padding: 10px 16px;
  box-shadow: 0 2px 12px rgba(108,92,231,0.3);
}
.contact-bar-inner {
  display: flex; align-items: center; justify-content: center;
  gap: 16px; flex-wrap: wrap;
  font-size: 18px; font-weight: 700;
}
.contact-bar-inner a {
  color: #fff; text-decoration: none;
}
.contact-bar-inner a:hover {
  text-decoration: underline;
}
.addr-link {
  cursor: pointer;
  margin-right: 2px;
}
.contact-divider {
  color: rgba(255,255,255,0.4);
}

/* 标题下方联系方式 */
.header-contact {
  display: flex; align-items: center; justify-content: center;
  gap: 20px; flex-wrap: wrap;
  margin-top: 8px; font-size: 17px; font-weight: 700;
  color: var(--primary);
  background: rgba(108,92,231,0.06);
  padding: 10px 24px; border-radius: 24px;
  display: inline-flex;
}
.header-contact a {
  color: var(--primary); text-decoration: none;
}
.header-contact a:hover {
  text-decoration: underline;
}
.header-contact .addr-link {
  color: var(--primary);
}

.container { max-width: 820px; margin: 0 auto; padding: 40px 20px 60px; position: relative; z-index: 1; }

.header { text-align: center; margin-bottom: 36px; }
.logo { font-size: 56px; margin-bottom: 12px; animation: float 3s ease-in-out infinite; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.header h1 {
  font-size: 32px; font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  margin-bottom: 8px;
}
.subtitle { font-size: 16px; color: var(--text-secondary); }

/* 上传区域 */
.upload-section { margin-bottom: 32px; }
.upload-area {
  background: var(--card-bg); border: 2px dashed var(--border);
  border-radius: var(--radius); padding: 48px 24px; text-align: center;
  cursor: pointer; transition: all var(--transition);
  min-height: 240px; display: flex; align-items: center; justify-content: center;
}
.upload-area:hover { border-color: var(--primary-light); box-shadow: var(--shadow-md); }
.upload-area.drag-over { border-color: var(--primary); background: rgba(108,92,231,0.04); }
.upload-area.has-image { border-style: solid; padding: 12px; }
.upload-default { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.upload-icon { color: var(--primary-light); margin-bottom: 8px; }
.upload-text { font-size: 18px; font-weight: 500; }
.upload-link { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.upload-hint { font-size: 13px; color: var(--text-muted); }
.upload-preview img { width: 100%; max-height: 400px; object-fit: contain; border-radius: var(--radius-sm); display: block; }

/* 操作栏 */
.action-bar {
  margin-top: 16px; background: var(--card-bg); border-radius: var(--radius);
  padding: 20px 24px; box-shadow: var(--shadow-sm);
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 20px; justify-content: space-between;
}
.height-input-group { flex: 1; min-width: 200px; }
.height-input-group label { display: block; font-size: 14px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.height-input-row { display: flex; align-items: center; gap: 8px; }
.height-input-row input {
  width: 120px; padding: 10px 14px; border: 2px solid var(--border);
  border-radius: 10px; font-size: 16px; outline: none; transition: border-color var(--transition);
}
.height-input-row input:focus { border-color: var(--primary); }
.height-unit { font-size: 16px; color: var(--text-secondary); font-weight: 600; }
.ref-select {
  width: 200px; padding: 10px 12px;
  border: 2px solid var(--border); border-radius: 10px;
  font-size: 14px; outline: none; background: #fff;
  transition: border-color var(--transition); cursor: pointer;
}
.ref-select:focus { border-color: var(--primary); }
.action-buttons { display: flex; gap: 10px; }

.btn {
  padding: 12px 28px; border-radius: 50px; border: none;
  font-size: 15px; font-weight: 600; cursor: pointer;
  transition: all var(--transition); display: inline-flex; align-items: center; gap: 8px;
}
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.btn-outline { background: #fff; color: var(--text); border: 2px solid var(--border); }
.btn-outline:hover { border-color: var(--primary-light); }
.spinner {
  width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 结果 */
.result-section { margin-bottom: 40px; animation: slideUp 0.5s ease-out; }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.result-section-title { font-size: 22px; font-weight: 700; margin-bottom: 20px; text-align: center; }
.ai-disclaimer {
  text-align: center;
  font-size: 13px; font-weight: 600; color: #8b6914;
  background: #fff8e7; border: 1px solid #f0d78c;
  padding: 8px 20px; border-radius: 16px;
  margin: -8px auto 20px;
  display: table;
}

/* ===== 一目了然摘要条 ===== */
.summary-banner {
  display: flex; align-items: stretch;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 8px 40px rgba(108,92,231,0.12);
  margin-bottom: 20px;
  overflow: hidden;
  animation: slideUp 0.5s ease-out;
}
.summary-item {
  flex: 1; text-align: center;
  padding: 24px 16px 20px;
  display: flex; flex-direction: column; align-items: center;
  gap: 6px;
}
.summary-length { background: linear-gradient(180deg, #f8f7ff 0%, #fff 100%); }
.summary-dye { background: linear-gradient(180deg, #fff5f7 0%, #fff 100%); }
.summary-quality { background: linear-gradient(180deg, #fffef5 0%, #fff 100%); }
.summary-divider { width: 1px; background: #e9e5f8; flex-shrink: 0; }
.summary-badge {
  font-size: 13px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 1px;
}
.summary-big {
  font-size: 42px; font-weight: 900; line-height: 1.1;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.summary-sub {
  font-size: 14px; color: var(--text-secondary); font-weight: 500;
  min-height: 20px;
}
/* 染发大字 */
.summary-big.dyed-text {
  background: linear-gradient(135deg, #e17055, #fd79a8);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.summary-big.natural-text {
  background: linear-gradient(135deg, #00b894, #636e72);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
/* 发质大星星 */
.summary-stars { display: flex; gap: 4px; justify-content: center; }
.summary-stars .big-star {
  font-size: 36px; line-height: 1;
}
.summary-stars .big-star.filled {
  color: #fdcb6e;
  text-shadow: 0 3px 10px rgba(253,203,110,0.6);
}
.summary-stars .big-star.empty { color: #dfe6e9; }

/* 仪表盘 */
.dashboard {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 16px; margin-bottom: 20px;
}
.dash-card {
  background: var(--card-bg); border-radius: var(--radius);
  padding: 24px 28px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
  border-left: 4px solid transparent;
  transition: transform var(--transition), box-shadow var(--transition);
}
.dash-card:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(0,0,0,0.10); }
.dash-card.length-card {
  grid-column: 1 / -1;
  border-left-color: var(--primary);
  background: linear-gradient(135deg, #ffffff 0%, #f8f7ff 100%);
}
.dash-card.dye-card { border-left-color: var(--accent); }
.dash-card.quality-card { border-left-color: #fdcb6e; }
.dash-card.tips-card { grid-column: 1 / -1; border-left-color: var(--success); }

.card-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px; padding-bottom: 12px;
  border-bottom: 2px solid #f0edff;
}
.card-icon {
  font-size: 28px;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
}
.length-card .card-icon { background: rgba(108,92,231,0.1); }
.dye-card .card-icon { background: rgba(253,121,168,0.1); }
.quality-card .card-icon { background: rgba(253,203,110,0.15); }
.tips-card .card-icon { background: rgba(0,184,148,0.1); }
.card-title { font-size: 16px; font-weight: 700; }

/* 长度标尺 */
.length-ruler { margin: 12px 0; }
.ruler-track {
  position: relative; height: 14px;
  background: #e9e5f8;
  border-radius: 7px; margin-bottom: 8px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.06);
}
.ruler-fill {
  height: 100%; border-radius: 7px;
  background: linear-gradient(90deg, #6c5ce7, #a29bfe, #fd79a8, #e17055);
  transition: width 1s cubic-bezier(0.22, 0.61, 0.36, 1);
  width: 0%;
  box-shadow: 0 0 12px rgba(108,92,231,0.4);
  position: relative;
}
.ruler-fill::after {
  content: ''; position: absolute; right: 0; top: 50%; transform: translate(50%, -50%);
  width: 18px; height: 18px; background: #fff;
  border-radius: 50%; border: 3px solid var(--accent);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.ruler-labels {
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--text-muted);
  font-weight: 600; padding: 0 4px;
}
.length-value {
  font-size: 56px; font-weight: 900; text-align: center;
  line-height: 1.1;
  background: linear-gradient(135deg, #6c5ce7 0%, #e17055 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  margin: 12px 0 4px;
  filter: drop-shadow(0 2px 4px rgba(108,92,231,0.2));
}
.length-body-part {
  text-align: center; font-size: 16px; font-weight: 600;
  color: var(--primary);
  background: rgba(108,92,231,0.06);
  display: inline-block; padding: 4px 16px; border-radius: 20px;
  margin: 0 auto; display: table;
}
.length-tier {
  text-align: center; font-size: 17px; font-weight: 800;
  color: var(--error);
  background: rgba(225,112,85,0.08);
  display: table; padding: 6px 20px; border-radius: 20px;
  margin: 12px auto 0;
}

/* 染发 */
.dye-indicator {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 12px; padding: 12px 0;
}
.dye-dot {
  width: 64px; height: 64px; border-radius: 50%;
  border: 4px solid var(--border);
  transition: all 0.5s ease;
  flex-shrink: 0;
}
.dye-dot.dyed {
  border-color: var(--accent);
  background: linear-gradient(135deg, #fd79a8 0%, #e17055 50%, #a29bfe 100%);
  animation: dyePulse 2s ease-in-out infinite;
  box-shadow: 0 0 24px rgba(253,121,168,0.3);
}
.dye-dot.natural {
  border-color: #636e72;
  background: linear-gradient(135deg, #2d3436 0%, #636e72 50%, #b2bec3 100%);
  box-shadow: 0 0 24px rgba(0,0,0,0.15);
}
@keyframes dyePulse {
  0%,100% { box-shadow: 0 0 16px rgba(253,121,168,0.3); }
  50% { box-shadow: 0 0 36px rgba(253,121,168,0.6); }
}
.dye-label { font-size: 28px; font-weight: 800; }
.dye-label.dyed { color: #e17055; }
.dye-label.natural { color: #2d3436; }
.dye-detail {
  font-size: 15px; color: var(--text-secondary);
  font-weight: 500;
}

/* 发质 */
.quality-grid { display: flex; flex-direction: column; gap: 14px; }
.quality-item { display: flex; align-items: center; justify-content: space-between; }
.quality-label { font-size: 14px; font-weight: 600; color: var(--text); min-width: 60px; }
.stars { display: flex; gap: 4px; }
.stars .star {
  font-size: 26px; line-height: 1;
  transition: all 0.3s ease;
}
.stars .star.filled {
  color: #fdcb6e;
  text-shadow: 0 2px 6px rgba(253,203,110,0.5);
}
.stars .star:not(.filled) {
  color: #dfe6e9;
}
.damage-bar-container { display: flex; align-items: center; gap: 10px; }
.damage-bar {
  width: 100px; height: 10px;
  border-radius: 5px; background: #e9ecef;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.08);
}
.damage-bar-inner { height: 100%; border-radius: 5px; transition: width 1s ease-out; }
.damage-bar-inner.low { background: linear-gradient(90deg, #00b894, #55efc4); }
.damage-bar-inner.medium { background: linear-gradient(90deg, #fdcb6e, #ffeaa7); }
.damage-bar-inner.high { background: linear-gradient(90deg, #fdcb6e, #e17055, #d63031); }
.damage-text {
  font-size: 15px; font-weight: 700;
  min-width: 48px;
}
.quality-value {
  font-size: 18px; font-weight: 700; color: var(--primary);
  background: rgba(108,92,231,0.06);
  padding: 2px 12px; border-radius: 12px;
}

/* 建议 */
.dash-card.tips-card { grid-column: 1 / -1; }
.tips-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.tips-list li { padding: 12px 16px; background: #f8f7ff; border-radius: 10px; font-size: 14px; border-left: 3px solid var(--primary-light); line-height: 1.5; }

/* 详细报告 */
.detail-report { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.detail-report summary { padding: 16px 24px; font-size: 15px; font-weight: 600; cursor: pointer; user-select: none; color: var(--primary); }
.detail-report summary:hover { background: #f8f7ff; }
.detail-content { padding: 0 24px 20px; line-height: 1.8; font-size: 14px; color: var(--text); }
.detail-content h2 { font-size: 17px; margin: 16px 0 8px; color: var(--primary); }
.detail-content ul { padding-left: 20px; margin: 6px 0; }
.detail-content li { margin: 3px 0; }
.detail-content strong { color: var(--primary); }

/* ===== 示例图片画廊 ===== */
.gallery-section {
  margin-bottom: 40px;
  text-align: center;
}
.gallery-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
}
.gallery-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.gallery-item {
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 3 / 4;
  background: #f0f0f0;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: var(--shadow-sm);
}
.gallery-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (max-width: 600px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 提示 */
.tips-section { margin-bottom: 32px; }
.tips-section h2 { font-size: 20px; text-align: center; margin-bottom: 20px; }
.tips-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.tip-card { background: var(--card-bg); border-radius: var(--radius-sm); padding: 20px; box-shadow: var(--shadow-sm); transition: transform var(--transition); }
.tip-card:hover { transform: translateY(-2px); }
.tip-icon { font-size: 28px; display: block; margin-bottom: 8px; }
.tip-card h3 { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.tip-card p { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.tip-card-highlight { background: linear-gradient(135deg, #fff9e6, #fff3cd); border: 2px solid #ffc107; }
.tip-card-highlight h3 { color: #e6a800; }

/* Multi-tip banner */
.multi-tip-banner {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(135deg, #fff8e1, #ffe082);
  border: 3px solid #ff9800; border-radius: 12px;
  padding: 22px 26px; margin-top: 18px;
  animation: pulse-border 2s infinite;
}
.multi-tip-icon { font-size: 36px; flex-shrink: 0; }
.multi-tip-text { font-size: 20px; color: #e65100; line-height: 1.5; font-weight: 500; }
@keyframes pulse-border {
  0%, 100% { border-color: #ff9800; box-shadow: 0 0 0 0 rgba(255,152,0,0.4); }
  50% { border-color: #ff5722; box-shadow: 0 0 0 6px rgba(255,152,0,0); }
}

.footer { text-align: center; padding-top: 20px; border-top: 1px solid var(--border); }
.footer p { font-size: 13px; color: var(--text-muted); }

/* Toast */
.toast {
  position: fixed; top: 24px; left: 50%; transform: translateX(-50%);
  background: #fff; border-radius: 50px; padding: 14px 28px;
  box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 10px;
  z-index: 1000; font-size: 14px; font-weight: 500; animation: toastIn 0.3s ease-out;
}
.toast.error { border: 1px solid var(--error); color: var(--error); }
.toast.success { border: 1px solid var(--success); color: var(--success); }
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(-12px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

.hidden { display: none !important; }

@media (max-width: 600px) {
  .container { padding: 20px 14px 40px; }
  .header h1 { font-size: 26px; }
  .subtitle { font-size: 14px; }
  .upload-area { padding: 32px 16px; min-height: 200px; }
  .upload-text { font-size: 15px; }
  .action-bar { flex-direction: column; align-items: stretch; }
  .action-buttons .btn { flex: 1; justify-content: center; }
  .summary-banner { flex-direction: column; }
  .summary-divider { width: 100%; height: 1px; }
  .summary-item { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 14px 16px; }
  .summary-big { font-size: 28px; }
  .dashboard { grid-template-columns: 1fr; }
  .dash-card.length-card, .dash-card.tips-card { grid-column: 1; }
  .dash-card { padding: 16px; }
  .length-value { font-size: 26px; }
  .tips-grid { grid-template-columns: 1fr; }
}
