:root {
  --bg: #FFF8F4;
  --glass: rgba(255, 255, 255, 0.58);
  --glass-2: rgba(255, 255, 255, 0.42);
  --border: rgba(255, 255, 255, 0.85);
  --border-soft: rgba(255, 255, 255, 0.6);
  --ink: #3A2028;
  --muted: #9C8388;
  --coral: #FF8A7A;
  --peach: #F4838F;
  --blue: #8FB2FF;
  --shadow: 0 14px 44px rgba(198, 134, 122, 0.18);
  --hi: inset 0 1px 0 rgba(255, 255, 255, 0.95);
  --lo: inset 0 -1px 0 rgba(180, 120, 110, 0.05);
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink); -webkit-font-smoothing: antialiased; line-height: 1.55; min-height: 100vh;
  background: linear-gradient(165deg, #FFF8F4 0%, #FDEDEA 50%, #F6EEFB 100%);
  background-attachment: fixed;
}
button { font-family: inherit; }

/* ===== 呼吸流光背景 ===== */
.aurora { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(64px); will-change: transform, opacity; }
.b1 { width: 62vmax; height: 62vmax; left: -16vmax; top: -22vmax; background: rgba(255, 168, 150, 0.62); animation: breathe1 20s ease-in-out infinite alternate; }
.b2 { width: 56vmax; height: 56vmax; right: -18vmax; bottom: -20vmax; background: rgba(190, 175, 255, 0.5); animation: breathe2 26s ease-in-out infinite alternate; }
.b3 { width: 42vmax; height: 42vmax; left: 32%; top: 38%; background: rgba(255, 200, 220, 0.5); animation: breathe3 30s ease-in-out infinite alternate; }
@keyframes breathe1 { 0% { transform: translate(0, 0) scale(1); opacity: .75; } 100% { transform: translate(7vw, 5vh) scale(1.16); opacity: 1; } }
@keyframes breathe2 { 0% { transform: translate(0, 0) scale(1.12); opacity: .7; } 100% { transform: translate(-6vw, -5vh) scale(1); opacity: .95; } }
@keyframes breathe3 { 0% { transform: translate(0, 0) scale(1); opacity: .5; } 100% { transform: translate(-5vw, 4vh) scale(1.2); opacity: .8; } }

/* ===== 玻璃面板 ===== */
.glass {
  background: var(--glass);
  backdrop-filter: blur(24px) saturate(170%);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow), var(--hi), var(--lo);
}

/* ===== 页面 ===== */
.page { position: relative; z-index: 1; max-width: 480px; margin: 0 auto; padding: 26px 16px 116px; }

/* ===== 头部 ===== */
.hero { text-align: center; padding: 20px 0 8px; position: relative; isolation: isolate; }
.hero::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 6%;
  width: 82%;
  height: 74%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.8), rgba(255, 214, 196, 0.32) 45%, transparent 72%);
  filter: blur(26px);
  z-index: -1;
  animation: glassGlow 7s ease-in-out infinite;
  pointer-events: none;
}
@font-face {
  font-family: 'YQSerif';
  src: url('fonts/yuanqi-serif.woff2') format('woff2');
  font-weight: 300;
  font-display: swap;
}
.hero h1 {
  position: relative;
  display: inline-block;
  padding: 6px 14px;
  font-family: 'YQSerif', 'Noto Serif SC', 'Songti SC', 'SimSun', serif;
  font-size: clamp(52px, 17vw, 96px);
  font-weight: 300;
  letter-spacing: 4px;
  line-height: 1.05;
  background: linear-gradient(180deg, var(--coral) 0%, var(--peach) 55%, #ff5f86 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  filter: drop-shadow(0 8px 18px rgba(255, 120, 140, 0.32));
  animation: glassBob 7s ease-in-out infinite;
}
.hero h1::before {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  padding: inherit;
  font: inherit;
  letter-spacing: inherit;
  white-space: nowrap;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.9) 47%, rgba(255, 255, 255, 0.35) 55%, transparent 70%);
  background-size: 260% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: glassSheen 6.5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes glassSheen {
  0%, 8% { background-position: 170% 0; }
  60%, 100% { background-position: -70% 0; }
}
@keyframes glassBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
@keyframes glassGlow {
  0%, 100% { opacity: 0.55; transform: translateX(-50%) scale(1); }
  50% { opacity: 0.85; transform: translateX(-50%) scale(1.06); }
}
.hero .tagline { font-size: 14px; letter-spacing: 6px; color: var(--coral); margin-top: 10px; }
.hero .sub { font-size: 13px; color: var(--muted); margin-top: 6px; }

/* ===== 上传 ===== */
.upload { display: block; cursor: pointer; margin-top: 18px; }
.upload-box {
  min-height: 220px; display: flex; align-items: center; justify-content: center; overflow: hidden;
  border-style: dashed; border-color: rgba(255, 138, 122, 0.4); transition: border-color .3s, background .3s;
}
.upload-box:active { border-color: var(--coral); background: rgba(255, 255, 255, 0.72); }
.upload-box img { max-width: 100%; max-height: 320px; display: block; border-radius: 14px; }
.upload-hint { color: var(--muted); font-size: 15px; letter-spacing: 1px; }

/* ===== 按钮（含流光） ===== */
.primary {
  position: relative; overflow: hidden; display: block; width: 100%; border: 0; border-radius: 18px;
  padding: 16px; margin-top: 16px; font-size: 16px; font-weight: 600; color: #fff; cursor: pointer;
  background: linear-gradient(100deg, var(--coral), var(--peach));
  box-shadow: 0 12px 30px rgba(255, 138, 122, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transition: transform .12s ease, opacity .2s;
}
.primary::after {
  content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: skewX(-20deg); animation: sweep 3.6s ease-in-out infinite;
}
@keyframes sweep { 0% { left: -60%; } 55%, 100% { left: 130%; } }
.primary:active { transform: scale(.98); }
.primary:disabled { opacity: .4; box-shadow: none; cursor: not-allowed; }
.primary:disabled::after { display: none; }
.ghost {
  display: block; width: 100%; border-radius: 18px; padding: 14px; margin-top: 12px; font-size: 15px; cursor: pointer;
  color: var(--ink); background: var(--glass-2); border: 1px solid var(--border);
  backdrop-filter: blur(14px) saturate(150%); -webkit-backdrop-filter: blur(14px) saturate(150%);
  transition: background .25s, transform .12s;
}
.ghost:active { background: rgba(255, 255, 255, 0.72); transform: scale(.99); }

/* ===== 同意 ===== */
.consent { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.consent input { accent-color: var(--coral); }

/* ===== 加载 ===== */
#loadingStage { text-align: center; padding: 60px 0; color: var(--muted); }
.spinner { width: 40px; height: 40px; border: 3px solid rgba(255, 138, 122, 0.18); border-top-color: var(--coral); border-radius: 50%; margin: 0 auto 16px; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 最近检测 ===== */
.recent { padding: 16px 18px; margin-top: 16px; }
.recent h3 { font-size: 15px; font-weight: 600; margin-bottom: 10px; }
.record { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.5); cursor: pointer; }
.record:last-child { border-bottom: 0; }
.record-main { min-width: 0; }
.record-title { font-weight: 600; font-size: 14px; }
.record-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.record-arrow { color: var(--coral); font-size: 13px; }

/* ===== 赞美 / 声明 ===== */
.praise { text-align: center; padding: 20px 18px; margin-bottom: 14px; }
.praise-main { font-size: 17px; font-weight: 600; }
.praise-sub { font-size: 12px; color: var(--muted); margin-top: 8px; line-height: 1.75; }

/* ===== KPI ===== */
.kpis { display: flex; padding: 18px 0; margin-bottom: 12px; }
.kpi { flex: 1; text-align: center; position: relative; }
.kpi:not(:last-child)::after { content: ""; position: absolute; right: 0; top: 22%; height: 56%; width: 1px; background: rgba(255, 255, 255, 0.55); }
.kpi span { display: block; font-size: 16px; font-weight: 700; color: var(--coral); }
.kpi i { font-style: normal; font-size: 12px; color: var(--muted); }
.meta { text-align: center; font-size: 12px; color: var(--muted); margin: 2px 0 18px; }

/* ===== 区块 ===== */
.block { padding: 18px; margin-bottom: 14px; }
.block h3 { font-size: 15px; font-weight: 600; margin-bottom: 12px; }

/* ===== 博主 ===== */
.blogger {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: rgba(255, 255, 255, 0.5); border: 1px solid var(--border-soft); border-radius: 16px;
  padding: 12px 14px; margin-bottom: 9px;
}
.blogger:last-child { margin-bottom: 0; }
.blogger-info { min-width: 0; text-decoration: none; color: inherit; }
.blogger-info.linkable { cursor: pointer; }
.blogger-info.linkable .blogger-name::after { content: " ›"; color: var(--coral); font-weight: 400; }
.blogger-name { font-weight: 600; font-size: 15px; }
.blogger-desc { font-size: 12px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rate { display: flex; gap: 6px; flex-shrink: 0; }
.rate button { border: 1px solid var(--border-soft); background: rgba(255, 255, 255, 0.55); border-radius: 20px; padding: 5px 11px; font-size: 12px; color: var(--muted); cursor: pointer; transition: all .18s; }
.rate button.fit:active { border-color: var(--coral); color: #E05545; background: rgba(255, 138, 122, 0.16); }
.rate button.unfit:active { border-color: var(--blue); color: #5C7CC4; background: rgba(143, 178, 255, 0.18); }
.rated { font-size: 12px; color: var(--coral); }

/* ===== 妆容 ===== */
.look { background: rgba(255, 255, 255, 0.42); border: 1px solid var(--border-soft); border-radius: 16px; padding: 14px; margin-bottom: 10px; }
.look:last-child { margin-bottom: 0; }
.look-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.look-name { font-weight: 600; font-size: 15px; }
.look-tag { font-size: 12px; color: var(--muted); }
.look .blogger { background: rgba(255, 255, 255, 0.45); }

/* ===== 色号 ===== */
.shade { display: flex; align-items: center; gap: 12px; background: rgba(255, 255, 255, 0.5); border: 1px solid var(--border-soft); border-radius: 16px; padding: 12px 14px; margin-bottom: 9px; }
.shade:last-child { margin-bottom: 0; }
.swatch { width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0; border: 1px solid rgba(255, 255, 255, 0.9); box-shadow: 0 2px 8px rgba(160, 110, 100, 0.18); }
.shade-info { min-width: 0; }
.shade-name { font-weight: 600; font-size: 14px; }
.shade-desc { font-size: 12px; color: var(--muted); margin-top: 2px; }
.shade-cat { margin-left: auto; font-size: 11px; color: var(--coral); flex-shrink: 0; }

/* ===== 记录 tab ===== */
.page-head { padding: 16px 4px 14px; }
.page-head h2 { font-size: 22px; letter-spacing: 1px; }
.page-sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.record-panel { padding: 6px 18px; }
.record-panel .record:last-child { border-bottom: 0; }
.empty { text-align: center; color: var(--muted); font-size: 14px; padding: 40px 0; }

/* ===== 我的 tab ===== */
.mine-hero { text-align: center; padding: 34px 20px; margin-bottom: 14px; }
.mine-logo { font-size: 26px; letter-spacing: 3px; font-weight: 700; }
.mine-tagline { font-size: 13px; color: var(--coral); letter-spacing: 4px; margin-top: 8px; }
.mine-stats { display: flex; padding: 20px 0; margin-bottom: 14px; }
.mine-stats .stat { flex: 1; text-align: center; }
.mine-stats .stat b { display: block; font-size: 22px; color: var(--coral); }
.mine-stats .stat span { font-size: 12px; color: var(--muted); }
.mine-foot { text-align: center; font-size: 12px; color: var(--muted); }
.ai-tag { display: inline-block; font-size: 11px; font-weight: 600; color: #fff; background: linear-gradient(100deg, var(--coral), var(--peach)); padding: 2px 8px; border-radius: 8px; margin-right: 8px; vertical-align: middle; }
.legal-links { display: flex; gap: 18px; justify-content: center; margin-top: 14px; padding: 12px; }
.legal-links a { font-size: 13px; color: var(--coral); text-decoration: none; }
.site-footer { text-align: center; margin-top: 14px; padding-bottom: 8px; }
.legal-note { font-size: 11.5px; color: var(--muted); line-height: 1.6; margin: 0 8px 8px; }
.icp a { font-size: 12px; color: var(--muted); text-decoration: none; }

/* ===== 底部导航 ===== */
.tabbar {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%);
  width: calc(100% - 32px); max-width: 448px; z-index: 5; display: flex; gap: 4px; padding: 6px; border-radius: 22px;
}
.tab { flex: 1; border: 0; background: transparent; padding: 10px 0; border-radius: 16px; font-size: 14px; color: var(--muted); cursor: pointer; transition: all .25s; }
.tab.active { color: #fff; background: linear-gradient(100deg, var(--coral), var(--peach)); box-shadow: 0 6px 18px rgba(255, 138, 122, 0.32); }

/* ===== 弹窗 ===== */
.mask { position: fixed; inset: 0; background: rgba(60, 40, 50, 0.22); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); display: flex; align-items: flex-end; z-index: 10; }
.sheet { width: 100%; border-radius: 26px 26px 0 0; padding: 24px 20px 32px; }
.sheet h3 { font-size: 17px; margin-bottom: 16px; text-align: center; }
.sheet input, .sheet select {
  width: 100%; border: 1px solid var(--border-soft); border-radius: 14px; padding: 12px 14px; margin-bottom: 12px;
  font-size: 15px; outline: none; background: rgba(255, 255, 255, 0.6); color: var(--ink);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.sheet input:focus, .sheet select:focus { border-color: var(--coral); }
.sheet .primary { margin-top: 4px; }
.sug-photo { display: block; text-align: center; font-size: 13px; color: var(--coral); border: 1px dashed var(--border-soft); border-radius: 12px; padding: 11px; margin-bottom: 12px; cursor: pointer; }

/* ===== toast ===== */
.toast {
  position: fixed; left: 50%; bottom: 92px; transform: translateX(-50%); z-index: 20; text-align: center;
  background: rgba(58, 32, 40, 0.82); color: #fff; padding: 10px 18px; border-radius: 22px; font-size: 13px; max-width: 84%;
}

/* ===== 降级 ===== */
@media (prefers-reduced-transparency: reduce) {
  .glass, .ghost, .tabbar, .sheet { background: #fff; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .blob { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .blob, .primary::after, .spinner { animation: none; }
  .primary, .ghost, .tab, .rate button { transition: none; }
}
@supports not (backdrop-filter: blur(1px)) {
  .glass, .ghost, .tabbar, .sheet { background: rgba(255, 255, 255, 0.92); }
}
