/* =============================================================
   戒酒打卡 · 现代化 UI（浅色版）
   米白底 + 白色卡片 + 柔和阴影，移动端优先
   ============================================================= */

:root {
  --bg:        #f1f4f9;
  --bg-soft:   #ffffff;
  --card:      #ffffff;
  --card-2:    #f6f8fb;
  --border:    #e4e9f2;
  --border-2:  #d5deea;

  --text:      #1b2434;
  --muted:     #55647a;
  --dim:       #8d9bb0;

  --accent:    #0891b2;
  --accent-2:  #059669;
  --accent-3:  #6366f1;
  --warn:      #d97706;
  --danger:    #e11d48;
  --gold:      #b45309;

  --grad:      linear-gradient(135deg, #06b6d4 0%, #10b981 100%);
  --grad-warm: linear-gradient(135deg, #f59e0b 0%, #f43f5e 100%);
  --grad-cool: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%);

  --r-sm: 12px;
  --r:    16px;
  --r-lg: 20px;
  --r-xl: 26px;

  --shadow:    0 10px 30px rgba(23, 37, 66, .10);
  --shadow-sm: 0 3px 14px rgba(23, 37, 66, .06);
  --glow:      0 8px 24px rgba(6, 182, 212, .28);

  --tabbar-h: 62px;
  --topbar-h: 60px;
  --ease: cubic-bezier(.22, .68, .28, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

/* 顶部极浅色氛围渐变 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(760px 420px at 12% -6%,  rgba(6, 182, 212, .10), transparent 60%),
    radial-gradient(680px 420px at 92% 2%,   rgba(99, 102, 241, .08), transparent 58%),
    radial-gradient(820px 560px at 50% 110%, rgba(16, 185, 129, .07), transparent 62%),
    var(--bg);
}

a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.01em; line-height: 1.3; }
p  { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }

.num { font-variant-numeric: tabular-nums; letter-spacing: -.02em; }

/* ============ 布局骨架 ============ */
.app-shell { min-height: 100dvh; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--topbar-h);
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1080px; height: 100%; margin: 0 auto; padding: 0 16px;
  display: flex; align-items: center; gap: 18px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; letter-spacing: -.02em; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #0d9488, #06b6d4 55%, #22d3ee);
  box-shadow: 0 4px 12px rgba(13, 148, 136, .3);
}
.brand-mark svg { width: 19px; height: 19px; display: block; }
.topnav { display: none; gap: 4px; margin-left: auto; }
.topnav-item {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 999px; font-size: 14px; font-weight: 600;
  color: var(--muted); transition: all .2s var(--ease);
}
.topnav-item:hover { color: var(--text); background: var(--card-2); }
.topnav-item.is-active { color: #fff; background: var(--grad); box-shadow: var(--glow); }
.topbar-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.topnav + .topbar-right { margin-left: 0; }

.main {
  flex: 1; width: 100%; max-width: 1080px; margin: 0 auto;
  padding: 20px 16px calc(var(--tabbar-h) + 58px);
}
.main-bare {
  max-width: 440px; padding: 44px 20px 60px;
  display: flex; flex-direction: column; justify-content: center; min-height: calc(100dvh - var(--topbar-h));
}

/* 页头 */
.page-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.page-head-text { flex: 1; min-width: 0; }
.page-head h1 { font-size: 23px; letter-spacing: -.02em; }
.page-head p  { color: var(--muted); font-size: 13px; margin-top: 4px; }
.page-head-actions { display: flex; gap: 8px; }
.back-btn {
  flex: none; width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center; background: var(--card); border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: all .2s var(--ease);
}
.back-btn:hover { border-color: var(--border-2); }
.back-btn .icon { transform: rotate(180deg); }

/* 底部标签栏（悬浮胶囊） */
.tabbar {
  position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 40; max-width: 540px; margin: 0 auto;
  height: var(--tabbar-h);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(24px) saturate(170%);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: 0 12px 34px rgba(23, 37, 66, .14);
}
.tabbar-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--dim); font-size: 11px; font-weight: 600;
  transition: color .2s var(--ease), transform .16s var(--ease); position: relative;
  border-radius: 16px;
}
.tabbar-item .icon { width: 22px; height: 22px; }
.tabbar-item.is-active { color: var(--accent); }
.tabbar-item.is-active .icon { transform: translateY(-1px); }
.tabbar-item.is-active::before {
  content: ""; position: absolute; bottom: 8px; width: 16px; height: 3px; border-radius: 2px;
  background: var(--grad);
}
.tabbar-item:active { transform: scale(.94); }

/* ============ 卡片 ============ */
.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
  animation: rise .5s var(--ease) both;
}
.card-tight { padding: 15px; }
.card-title {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 15px; font-weight: 700; margin-bottom: 15px;
}
.card-title .sub { font-size: 12px; font-weight: 500; color: var(--dim); }
.section-label {
  font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--dim); margin: 24px 4px 10px;
}

/* 网格 */
.grid { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* 统计小块 */
.stat {
  position: relative; overflow: hidden;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r); padding: 15px; text-align: left;
  box-shadow: var(--shadow-sm);
  animation: rise .5s var(--ease) both;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-icon {
  font-size: 14px; margin-bottom: 10px; display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 10px; background: var(--card-2);
  border: 1px solid var(--border);
}
.stat-value { font-size: 22px; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; }
.stat-value.sm { font-size: 18px; }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 4px; }
.stat-hint  { font-size: 11px; color: var(--dim); margin-top: 4px; }
.accent-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.warn-text   { color: var(--warn); }
.gold-text   { color: var(--gold); }

/* 主视觉卡（浅色彩色渐变底） */
.hero {
  position: relative; overflow: hidden;
  border-radius: var(--r-xl); padding: 24px 20px;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(6, 182, 212, .16), transparent 58%),
    radial-gradient(120% 140% at 100% 100%, rgba(16, 185, 129, .14), transparent 58%),
    #ffffff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}
.hero::before {
  content: ""; position: absolute; left: -70px; bottom: -90px;
  width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(16, 185, 129, .14), transparent 70%);
  animation: floatBlob 9s var(--ease) infinite alternate;
}
.hero::after {
  content: ""; position: absolute; right: -60px; top: -60px;
  width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, rgba(6, 182, 212, .16), transparent 70%);
  animation: floatBlob 11s var(--ease) infinite alternate-reverse;
}
@keyframes floatBlob {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(14px, -18px, 0) scale(1.12); }
}
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: relative; z-index: 1; }
.hero-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .1em; color: var(--accent); text-transform: uppercase; }
.hero-body { display: flex; align-items: center; gap: 18px; margin-top: 10px; position: relative; z-index: 1; }
.hero-number { font-size: 52px; font-weight: 900; letter-spacing: -.05em; line-height: 1; }
.hero-unit   { font-size: 16px; font-weight: 700; color: var(--muted); margin-left: 4px; }
.hero-meta   { flex: 1; font-size: 13px; color: var(--muted); min-width: 0; }
.hero-meta strong { color: var(--text); }

/* ============ 按钮 ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 14px; border: 1px solid transparent;
  font-size: 15px; font-weight: 700; cursor: pointer;
  transition: transform .16s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease), opacity .2s;
  background: var(--card-2); color: var(--text);
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 8px 22px rgba(6, 182, 212, .30); }
.btn-primary:hover { box-shadow: 0 12px 30px rgba(6, 182, 212, .38); }
.btn-warm { background: var(--grad-warm); color: #fff; box-shadow: 0 8px 22px rgba(244, 63, 94, .25); }
.btn-cool { background: var(--grad-cool); color: #fff; }
.btn-ghost { background: var(--card); border-color: var(--border); color: var(--muted); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { color: var(--text); border-color: var(--border-2); }
.btn-danger { background: #fff1f2; border-color: #fecdd3; color: var(--danger); }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 11px; }
.btn-block { display: flex; width: 100%; }
.btn-xl { padding: 15px 22px; font-size: 16px; border-radius: 16px; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.btn-icon {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: var(--card); border: 1px solid var(--border); color: var(--muted); cursor: pointer;
  transition: all .2s var(--ease); padding: 0;
}
.btn-icon:hover { border-color: var(--border-2); color: var(--text); }

/* ============ 表单 ============ */
.field { margin-bottom: 15px; }
.label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 7px; }
.label .opt { color: var(--dim); font-weight: 500; }
.input, .select, .textarea {
  width: 100%; padding: 13px 14px; border-radius: 14px;
  background: var(--bg-soft); border: 1px solid var(--border-2);
  color: var(--text); font-size: 15px; outline: none;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--dim); }
.input:focus, .select:focus, .textarea:focus {
  border-color: #06b6d4;
  box-shadow: 0 0 0 3px rgba(6, 182, 212, .16);
}
.select { appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2355647a' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 18px;
  padding-right: 38px;
}
.select option { background: #fff; color: var(--text); }
.textarea { resize: vertical; min-height: 78px; }
.input-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.input-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.help-text { font-size: 12px; color: var(--dim); margin-top: 6px; }

/* 分段控件 */
.segmented {
  display: flex; gap: 6px; padding: 5px; border-radius: 14px;
  background: var(--card-2); border: 1px solid var(--border);
}
.segmented-item {
  flex: 1; padding: 9px 10px; border-radius: 10px; text-align: center;
  font-size: 13px; font-weight: 700; color: var(--muted); cursor: pointer;
  transition: all .2s var(--ease); border: none; background: transparent;
}
.segmented-item.is-active { background: var(--grad); color: #fff; box-shadow: 0 4px 12px rgba(6, 182, 212, .25); }

/* 酒种选择网格 */
.drink-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.drink-chip {
  position: relative; padding: 14px 6px 12px; border-radius: 15px; cursor: pointer;
  background: var(--card-2); border: 1.5px solid var(--border);
  text-align: center; transition: all .18s var(--ease);
}
.drink-chip:hover { border-color: var(--border-2); transform: translateY(-2px); }
.drink-chip.is-active {
  border-color: #06b6d4;
  background: #ecfeff;
  box-shadow: 0 6px 18px rgba(6, 182, 212, .18);
}
.drink-chip.is-active::after {
  content: "✓"; position: absolute; top: 6px; right: 8px;
  width: 18px; height: 18px; border-radius: 50%; font-size: 11px; font-weight: 800;
  display: grid; place-items: center; color: #fff; background: var(--grad);
}
.drink-chip .emo { font-size: 25px; display: block; }
.drink-chip .nm  { font-size: 12.5px; font-weight: 700; margin-top: 5px; display: block; color: var(--text); }
.drink-chip .abv { font-size: 10.5px; color: var(--dim); margin-top: 1px; display: block; }

/* 情绪选择 */
.mood-row { display: flex; gap: 8px; flex-wrap: wrap; }
.mood-chip {
  padding: 8px 13px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: var(--card-2); border: 1.5px solid var(--border); color: var(--muted);
  cursor: pointer; transition: all .18s var(--ease);
}
.mood-chip.is-active { background: #ecfeff; border-color: #06b6d4; color: var(--accent); }

/* ============ 头像 ============ */
.avatar {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
  font-weight: 800; font-size: 17px; color: #fff; flex: none;
  background: linear-gradient(135deg, var(--ac), color-mix(in srgb, var(--ac) 60%, #0b2530));
}
.avatar-sm { width: 34px; height: 34px; border-radius: 11px; font-size: 14px; }
.avatar-lg { width: 62px; height: 62px; border-radius: 20px; font-size: 24px; }

/* ============ 徽章 / 标签 ============ */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700;
  background: var(--card-2); color: var(--muted); border: 1px solid var(--border);
}
.badge-accent { background: #ecfeff; color: var(--accent); border-color: #a5f3fc; }
.badge-warn   { background: #fffbeb; color: var(--warn); border-color: #fde68a; }
.badge-danger { background: #fff1f2; color: var(--danger); border-color: #fecdd3; }
.badge-gold   { background: #fffbeb; color: var(--gold); border-color: #fcd34d; }

/* ============ 列表 ============ */
.list { display: flex; flex-direction: column; }
.list-item {
  display: flex; align-items: center; gap: 12px; padding: 13px 0;
  border-bottom: 1px solid #eef1f6;
}
.list-item:last-child { border-bottom: none; }
.list-main { flex: 1; min-width: 0; }
.list-title { font-weight: 600; font-size: 14px; }
.list-sub   { font-size: 12px; color: var(--dim); margin-top: 2px; }
.list-right { text-align: right; flex: none; }
.list-right .v { font-weight: 700; font-size: 14px; }

/* 排行榜 */
.rank-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border-radius: var(--r); background: var(--card); border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  margin-bottom: 9px; transition: all .2s var(--ease);
}
.rank-row:hover { border-color: var(--border-2); }
.rank-row.is-me { border-color: #67e8f9; background: #f0fdff; }
.rank-no {
  width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center;
  font-weight: 800; font-size: 13px; flex: none;
  background: var(--card-2); color: var(--muted); border: 1px solid var(--border);
}
.rank-no.top1 { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #fff; border: none; }
.rank-no.top2 { background: linear-gradient(135deg, #e2e8f0, #94a3b8); color: #fff; border: none; }
.rank-no.top3 { background: linear-gradient(135deg, #fb923c, #c2703a); color: #fff; border: none; }
.rank-name { font-weight: 700; font-size: 14px; }
.rank-sub  { font-size: 12px; color: var(--dim); }
.rank-value { margin-left: auto; text-align: right; font-weight: 800; font-size: 16px; letter-spacing: -.02em; }

/* 徽章墙 */
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; }
.ach {
  padding: 15px 8px; border-radius: var(--r); text-align: center;
  background: var(--card-2); border: 1px solid var(--border);
  transition: all .2s var(--ease); position: relative; overflow: hidden;
}
.ach.is-locked { opacity: .45; filter: grayscale(1); }
.ach.is-unlocked { border-color: #67e8f9; background: #f0fdff; }
.ach.is-unlocked::after {
  content: ""; position: absolute; inset: -40% -40% auto auto; width: 90px; height: 90px;
  background: radial-gradient(circle, rgba(6, 182, 212, .14), transparent 70%);
}
.ach-icon { font-size: 28px; display: block; margin-bottom: 6px; }
.ach-name { font-size: 12px; font-weight: 700; }
.ach-desc { font-size: 10px; color: var(--dim); margin-top: 3px; line-height: 1.4; }

/* 里程碑时间线 */
.timeline { position: relative; padding-left: 26px; }
.timeline::before {
  content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px;
  background: linear-gradient(180deg, #67e8f9, #eef1f6);
}
.tl-item { position: relative; padding: 10px 0; }
.tl-item::before {
  content: ""; position: absolute; left: -22px; top: 17px; width: 10px; height: 10px; border-radius: 50%;
  background: #fff; border: 2px solid var(--border-2);
}
.tl-item.is-done::before { background: #10b981; border-color: #6ee7b7; box-shadow: 0 0 0 3px rgba(16, 185, 129, .18); }
.tl-item.is-next::before { background: #f59e0b; border-color: #fcd34d; box-shadow: 0 0 0 3px rgba(245, 158, 11, .16); }
.tl-title { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.tl-desc  { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.tl-item.is-locked .tl-title, .tl-item.is-locked .tl-desc { color: var(--dim); }

/* ============ 图表 ============ */
.ring-wrap { display: flex; align-items: center; gap: 20px; }
.ring { width: 132px; height: 132px; flex: none; }
.ring-top { fill: var(--dim); font-size: 11px; font-weight: 600; }
.ring-main { fill: var(--text); font-size: 26px; font-weight: 800; }
.ring-sub { fill: var(--dim); font-size: 10px; }
.chart { width: 100%; max-width: 560px; height: auto; margin: 0 auto; }
.axis-text { fill: var(--dim); font-size: 10px; }
.heatmap { width: 100%; max-width: 460px; height: auto; margin: 0 auto; }
.donut { width: 150px; height: 150px; flex: none; margin: 0 auto; }
.chart-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.legend { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend-val { font-weight: 700; font-variant-numeric: tabular-nums; }

.progress { height: 8px; border-radius: 999px; background: #edf0f5; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 999px; transition: width .8s var(--ease); }

/* 热力图图例 */
.heat-legend {
  display: flex; align-items: center; gap: 8px; justify-content: flex-start; flex-wrap: wrap;
  font-size: 11.5px; color: var(--dim); margin-top: 12px;
}
.heat-legend span { display: inline-flex; align-items: center; gap: 5px; }
.heat-legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }

/* ============ 提示 ============ */
.flash {
  padding: 12px 15px; border-radius: 14px; margin-bottom: 14px; font-size: 14px; font-weight: 600;
  border: 1px solid var(--border); background: var(--card);
  animation: rise .4s var(--ease) both;
}
.flash-success { background: #ecfdf5; border-color: #a7f3d0; color: #047857; }
.flash-error   { background: #fff1f2; border-color: #fecdd3; color: #be123c; }
.flash-info    { background: #ecfeff; border-color: #a5f3fc; color: #0e7490; }
.flash-warn    { background: #fffbeb; border-color: #fde68a; color: #b45309; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 48px);
  transform: translate(-50%, 20px); z-index: 90;
  padding: 12px 20px; border-radius: 14px; font-size: 14px; font-weight: 600;
  background: #1b2434; color: #f1f5f9; border: 1px solid #334155;
  box-shadow: var(--shadow); opacity: 0; pointer-events: none;
  transition: opacity .25s var(--ease), transform .25s var(--ease);
  max-width: 84vw; text-align: center;
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

.empty { padding: 34px 16px; text-align: center; color: var(--dim); font-size: 13.5px; line-height: 1.8; }
.empty .emo { font-size: 34px; display: block; margin-bottom: 8px; opacity: .75; }

/* 小贴士 */
.tip-card {
  display: flex; gap: 12px; padding: 15px; border-radius: var(--r);
  background: linear-gradient(135deg, #eef2ff, #ecfeff);
  border: 1px solid #c7d2fe;
  font-size: 13.5px; color: #4338ca; line-height: 1.6;
}
.tip-card .emo { font-size: 20px; flex: none; }

/* 认证页 */
.auth-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-xl);
  padding: 30px 24px; box-shadow: var(--shadow);
  animation: rise .55s var(--ease) both;
}
.auth-logo { text-align: center; margin-bottom: 22px; }
.auth-logo .mark {
  width: 64px; height: 64px; border-radius: 20px; margin: 0 auto 12px;
  display: grid; place-items: center; font-size: 32px;
  background: var(--grad); box-shadow: 0 12px 30px rgba(6, 182, 212, .3);
}
.auth-logo h1 { font-size: 24px; letter-spacing: -.03em; }
.auth-logo p  { color: var(--muted); font-size: 13px; margin-top: 6px; }
.auth-alt { text-align: center; font-size: 13px; color: var(--muted); margin-top: 18px; }
.auth-alt a { color: var(--accent); font-weight: 700; }

/* 分段 Tab */
.tabs {
  display: flex; gap: 6px; padding: 5px; border-radius: 14px; margin-bottom: 15px;
  background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.tab {
  flex: 1; padding: 9px; border-radius: 10px; text-align: center;
  font-size: 13px; font-weight: 700; color: var(--muted);
  transition: all .2s var(--ease);
}
.tab:hover { color: var(--text); }
.tab.is-active { background: var(--grad); color: #fff; box-shadow: 0 4px 12px rgba(6, 182, 212, .25); }

/* 提示条 */
.alert-line {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 13px;
  font-size: 13px; font-weight: 600; margin-bottom: 12px;
}
.alert-line.warn { background: #fffbeb; border: 1px solid #fde68a; color: #b45309; }
.alert-line.ok   { background: #ecfdf5; border: 1px solid #a7f3d0; color: #047857; }

/* 表格（安装页） */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--border); }
.table th { color: var(--muted); font-weight: 600; font-size: 12px; }
.table td.ok { color: #047857; }
.table td.bad { color: #be123c; }
code, .code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--card-2); border: 1px solid var(--border);
  padding: 2px 7px; border-radius: 6px; font-size: 12.5px;
}
pre.code {
  display: block; padding: 13px; border-radius: 12px; overflow-x: auto; line-height: 1.6;
  background: #f8fafc; border: 1px solid var(--border);
}

/* 动画 */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pop {
  0%   { transform: scale(.8); opacity: 0; }
  60%  { transform: scale(1.06); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(6, 182, 212, .30); }
  50%      { box-shadow: 0 0 0 10px rgba(6, 182, 212, 0); }
}
.pop { animation: pop .45s var(--ease) both; }
.delay-1 { animation-delay: .06s; }
.delay-2 { animation-delay: .12s; }
.delay-3 { animation-delay: .18s; }
.delay-4 { animation-delay: .24s; }
.delay-5 { animation-delay: .30s; }

.icon { width: 20px; height: 20px; flex: none; }

/* ============ 今日打卡面板（首页置顶） ============ */
.checkin-panel {
  position: relative; overflow: hidden;
  border-radius: var(--r-xl); padding: 20px;
  margin-bottom: 14px;
  background:
    radial-gradient(120% 130% at 8% 0%, rgba(6, 182, 212, .13), transparent 58%),
    #ffffff;
  border: 1px solid #a5f3fc;
  box-shadow: var(--shadow);
  animation: rise .5s var(--ease) both;
}
.checkin-panel.is-done {
  background:
    radial-gradient(120% 130% at 8% 0%, rgba(16, 185, 129, .14), transparent 58%),
    #ffffff;
  border-color: #a7f3d0;
}
.checkin-panel.is-drank {
  background:
    radial-gradient(120% 130% at 8% 0%, rgba(245, 158, 11, .13), transparent 58%),
    #ffffff;
  border-color: #fde68a;
}
.ck-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ck-title { font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.ck-sub   { font-size: 12.5px; color: var(--muted); margin-top: 4px; line-height: 1.5; }
.ck-date  { font-size: 12px; font-weight: 700; color: var(--accent); flex: none; }
.is-done .ck-date { color: #059669; }
.is-drank .ck-date { color: #d97706; }
.ck-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 15px; }
.ck-patch {
  display: block; width: 100%; margin-top: 10px; padding: 9px 10px;
  font-size: 12.5px; font-weight: 600; color: var(--dim);
  background: transparent; border: 1px dashed var(--border-2); border-radius: 12px; cursor: pointer;
  transition: all .2s var(--ease);
}
.ck-patch:hover { color: var(--text); background: var(--card-2); }

/* ============ 底部弹窗 ============ */
.sheet-mask {
  position: fixed; inset: 0; z-index: 80; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(23, 32, 48, .42);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none; transition: opacity .26s var(--ease);
}
.sheet-mask.is-open { opacity: 1; pointer-events: auto; }
.sheet {
  width: 100%; max-width: 520px; padding: 14px 22px calc(26px + env(safe-area-inset-bottom));
  border-radius: 26px 26px 0 0; text-align: center;
  background: #ffffff;
  border: 1px solid var(--border); border-bottom: none;
  box-shadow: 0 -18px 50px rgba(23, 37, 66, .18);
  transform: translateY(100%); transition: transform .32s var(--ease);
}
.sheet-mask.is-open .sheet { transform: translateY(0); }
.sheet-bar { width: 40px; height: 4px; border-radius: 999px; background: var(--border-2); margin: 0 auto 16px; }
.sheet-emo { font-size: 42px; animation: pop .5s var(--ease) both; }
.sheet-title { font-size: 19px; margin: 8px 0 6px; }
.sheet-sub { font-size: 13px; color: var(--muted); line-height: 1.6; margin-bottom: 18px; }
.sheet-close {
  display: block; width: 100%; margin-top: 12px; padding: 10px;
  font-size: 13px; font-weight: 600; color: var(--dim);
  background: transparent; border: none; cursor: pointer;
}
.sheet-close:hover { color: var(--text); }

/* ============ 本月打卡日历 ============ */
.cal { user-select: none; }
.cal-head, .cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px;
}
.cal-head { margin-bottom: 8px; }
.cal-head span { text-align: center; font-size: 11px; font-weight: 700; color: var(--dim); }
.cal-cell {
  aspect-ratio: 1 / 1; min-height: 36px; border-radius: 11px;
  display: grid; place-items: center; font-size: 12.5px; font-weight: 700;
  background: var(--card-2); border: 1px solid var(--border); color: var(--dim);
}
.cal-cell.is-empty { background: transparent; border-color: transparent; }
.cal-cell.is-clean {
  background: linear-gradient(140deg, #d1fae5, #cffafe);
  border-color: #6ee7b7; color: #047857;
}
.cal-cell.is-drank {
  background: linear-gradient(140deg, #fef3c7, #ffe4e6);
  border-color: #fcd34d; color: #b45309;
}
.cal-cell.is-none { color: var(--dim); }
.cal-cell.is-skip { opacity: .35; }
.cal-cell.is-today { outline: 2px solid #06b6d4; outline-offset: 1px; color: var(--text); }
.cal-legend {
  display: flex; gap: 16px; justify-content: center; flex-wrap: wrap;
  font-size: 11.5px; color: var(--dim); margin-top: 13px;
}
.cal-legend span { display: inline-flex; align-items: center; gap: 5px; }
.cal-legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.cal-legend .k-clean { background: #6ee7b7; }
.cal-legend .k-drank { background: #fcd34d; }
.cal-legend .k-none  { background: #e4e9f2; }

/* 逐月月历（统计页饮酒日历） */
.cal-month + .cal-month { margin-top: 20px; padding-top: 16px; border-top: 1px dashed var(--border); }
.cal-month-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.cal-month-name { font-size: 14px; font-weight: 800; color: var(--text); }
.cal-month-sum  { font-size: 12px; color: var(--dim); font-weight: 600; }

/* 月历翻页导航 */
.cal-nav {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-bottom: 14px;
}
.cal-nav-title { text-align: center; }
.cal-nav-title .cal-month-name { display: block; font-size: 15px; }
.cal-nav-title .cal-month-sum  { display: block; font-size: 11.5px; margin-top: 2px; }
.btn.is-disabled { opacity: .4; pointer-events: none; }

/* ============ 步骤头（记录页） ============ */
.step-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.step-no {
  width: 30px; height: 30px; border-radius: 10px; flex: none;
  display: grid; place-items: center; font-size: 14px; font-weight: 800; color: #fff;
  background: var(--grad); box-shadow: 0 5px 14px rgba(6, 182, 212, .28);
}
.step-title { font-size: 15px; font-weight: 800; }
.step-sub   { font-size: 12px; color: var(--dim); margin-top: 2px; line-height: 1.5; }

/* ============ 响应式 ============ */
@media (min-width: 768px) {
  .topnav { display: flex; }
  .tabbar { display: none; }
  .main { padding: 28px 24px 52px; }
  .main-bare { padding: 56px 24px; }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .hero-number { font-size: 64px; }
  .toast { bottom: 34px; }
  .ck-actions { gap: 12px; }
}
@media (max-width: 420px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .hero-number { font-size: 44px; }
  .stat-value { font-size: 19px; }
  .card { padding: 17px; }
  .page-head h1 { font-size: 21px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ============ 社交：角标 / 聊天 ============ */
.tabbar-icon { position: relative; display: inline-grid; place-items: center; }
.nav-badge {
  position: absolute; top: -4px; right: -12px;
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 9px;
  background: #f43f5e; color: #fff; font-size: 10px; font-weight: 800;
  display: grid; place-items: center; line-height: 1;
  box-shadow: 0 0 0 2px #fff;
}
.rank-mini-btn {
  width: 30px; height: 30px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--card-2); color: var(--muted);
  display: grid; place-items: center; font-size: 13px; font-weight: 800;
  cursor: pointer; transition: all .18s var(--ease); text-decoration: none; padding: 0;
}
.rank-mini-btn:hover { border-color: #67e8f9; color: #0891b2; background: #ecfeff; }

.msg-list { display: flex; flex-direction: column; gap: 10px; padding: 2px 0 14px; }
.msg-day { text-align: center; font-size: 11px; color: var(--dim); margin: 10px 0 2px; font-weight: 600; }
.msg {
  max-width: 78%; padding: 10px 14px; border-radius: 16px 16px 16px 5px;
  font-size: 14px; line-height: 1.65; word-break: break-word;
  background: #fff; border: 1px solid var(--border); align-self: flex-start;
  box-shadow: var(--shadow-sm);
  animation: rise .25s var(--ease) both;
}
.msg.me {
  align-self: flex-end; border: none; border-radius: 16px 16px 5px 16px;
  background: linear-gradient(135deg, #0d9488, #06b6d4); color: #fff;
}
.msg-time { font-size: 10px; color: var(--dim); margin-top: 5px; }
.msg.me .msg-time { color: rgba(255,255,255,.78); text-align: right; }
.chat-form {
  position: sticky; bottom: calc(var(--tabbar-h) + 58px);
  display: flex; gap: 8px; padding: 10px;
  background: rgba(255,255,255,.92); backdrop-filter: blur(14px);
  border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow);
}
@media (min-width: 768px) { .chat-form { bottom: 20px; } }

/* ============ 好友页：搜索条 / 推荐网格 ============ */
.friend-search { display: flex; gap: 8px; margin-bottom: 16px; }
.rec-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 14px; }
.rec-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 14px 12px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  box-shadow: var(--shadow-sm); animation: rise .45s var(--ease) both;
}
.rec-card .avatar { width: 44px; height: 44px; border-radius: 14px; font-size: 18px; }
.rec-name { font-size: 14px; font-weight: 700; }
.rec-sub  { font-size: 11px; color: var(--dim); margin-bottom: 4px; }
.rec-card .btn { width: 100%; }
.btn-accent {
  background: linear-gradient(135deg, #0d9488, #06b6d4); color: #fff;
  border: none; box-shadow: 0 4px 14px rgba(13, 148, 136, .28);
}
.btn-accent:hover { filter: brightness(1.05); }
@media (min-width: 768px) { .rec-grid { grid-template-columns: repeat(4, 1fr); } }

/* ============ 自定义头像 / 展示勋章 / 分页 ============ */
.avatar { overflow: hidden; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-edit { position: relative; cursor: pointer; }
.avatar-edit .avatar-cam {
  position: absolute; right: -2px; bottom: -2px;
  width: 22px; height: 22px; border-radius: 50%;
  background: #fff; border: 1px solid var(--border);
  display: grid; place-items: center; font-size: 11px;
  box-shadow: var(--shadow-sm);
}

.sc-icons { display: inline-flex; gap: 2px; margin-left: 5px; vertical-align: -1px; }
.sc-icon { font-size: 13px; line-height: 1; filter: drop-shadow(0 1px 1px rgba(0,0,0,.08)); }

.sc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sc-chip {
  display: flex; align-items: center; gap: 6px; justify-content: center;
  padding: 9px 6px; border-radius: 12px; cursor: pointer;
  background: var(--bg-soft); border: 1.5px solid var(--border);
  transition: all .18s var(--ease); user-select: none;
}
.sc-chip-icon { font-size: 17px; }
.sc-chip-name { font-size: 12px; font-weight: 600; color: var(--muted); }
.sc-chip.is-on { border-color: #22d3ee; background: #ecfeff; box-shadow: 0 2px 10px rgba(34,211,238,.18); }
.sc-chip.is-on .sc-chip-name { color: #0e7490; }

.pager {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 12px;
}
.pager-btn {
  padding: 8px 14px; border-radius: 12px; font-size: 13px; font-weight: 700;
  background: var(--card); border: 1px solid var(--border); color: var(--text);
  text-decoration: none; transition: all .18s var(--ease);
}
.pager-btn:hover { border-color: #67e8f9; color: #0891b2; }
.pager-btn.is-disabled { opacity: .4; pointer-events: none; }
.pager-info { font-size: 12px; color: var(--dim); font-weight: 600; }

.rank-acts { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.rank-acts form { display: flex; }

.chat-peer {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; margin-bottom: 12px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
}
