/* ============================================================
   yuzhou · styles.css · 去 AI 感完整版
   羽毛球年轻人社区 · 暗色运动风
   
   设计原则：
   1. 颜色做减法 —— 一个主强调色 + 灰阶体系
   2. 发光克制 —— 只在焦点元素保留
   3. 圆角有叙事 —— 交互元素全圆，容器固定，小元素方角
   4. 动效两种 —— ease-out 为主，bounce 只用于物理意义场景
   5. 渐变是例外 —— 只有主 CTA 用渐变
   6. 间距有呼吸 —— 内容内部紧，内容之间松
   7. 有产品痕迹 —— 不用 emoji 冒充图标，不用无意义动画
   ============================================================ */


/* ============================================================
   1. Design Tokens
   ============================================================ */
:root {
  color-scheme: dark;

  /* ---------- 背景层（三级深度，冷灰阶） ---------- */
  --bg-0: #05080d;              /* 最底 */
  --bg-1: #0a1018;              /* 主背景 */
  --bg-2: #101822;              /* 抬升面板 */
  --bg-3: #16202c;              /* 内嵌元素 */
  --panel: #0e1720;

  /* ---------- 文字（四级对比） ---------- */
  --text-hi: #eef3f8;           /* 标题 */
  --text: #c8d4e0;              /* 正文 */
  --text-lo: #7d8b99;           /* 次要 */
  --text-dis: #4a5764;          /* 禁用 */

  /* ---------- 线条 ---------- */
  --line: rgba(140, 165, 190, .10);
  --line-mid: rgba(140, 165, 190, .16);
  --line-hi: rgba(140, 165, 190, .24);

  /* ---------- 主强调色（唯一的"亮"） ---------- */
  --accent: #7ee787;            /* 球场绿 */
  --accent-hi: #a4f0aa;
  --accent-lo: #3d8f52;
  --accent-soft: rgba(126, 231, 135, .10);
  --accent-glow: rgba(126, 231, 135, .28);

  /* ---------- 次强调色（降饱和的青，仅描边/hover） ---------- */
  --secondary: #5eb8a8;
  --secondary-soft: rgba(94, 184, 168, .08);

  /* ---------- 功能色（降饱和，克制使用） ---------- */
  --danger: #d97382;
  --danger-soft: rgba(217, 115, 130, .10);
  --warning: #d9a860;
  --info: #6ba3d9;
  --pink: #c96a9c;              /* 仅性别标识 */

  /* ---------- 段位色（收敛为 4 档） ---------- */
  --rank-bronze: #b8936a;
  --rank-silver: #a8b4c0;
  --rank-gold: #d4b866;
  --rank-jade: #7ee787;         /* 最高段位才用主色 */

  /* ---------- 圆角（4 档，不再暧昧） ---------- */
  --r-tiny: 4px;                /* 徽章、标签 */
  --r-inner: 10px;              /* 卡片内元素：图、输入框 */
  --r-outer: 18px;              /* 卡片、面板 */
  --r-pill: 999px;              /* 按钮、chip、头像 */

  /* ---------- 阴影（暗色下只有深度，没有发光） ---------- */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .28);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, .32);
  --shadow-lg: 0 12px 28px rgba(0, 0, 0, .40);

  /* ---------- 尺寸 ---------- */
  --nav-height: 74px;
  --topbar-height: 64px;

  /* ---------- 缓动（bounce 只留一处） ---------- */
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-in-out: cubic-bezier(.4, 0, .2, 1);
  --ease-bounce: cubic-bezier(.34, 1.56, .64, 1);   /* 仅用于羽毛球相关动效 */

  --dur-fast: .15s;
  --dur: .22s;
  --dur-slow: .36s;

  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  font-feature-settings: "tnum" 1, "cv11" 1;
}


/* ============================================================
   2. Reset
   ============================================================ */
* { box-sizing: border-box; }

html {
  background: var(--bg-0);
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg-0);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: transparent;
  padding: 0;
  transition: background-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              opacity var(--dur-fast) var(--ease-out);
}

button:disabled { opacity: .4; cursor: not-allowed; }

img { max-width: 100%; display: block; }

::selection { background: var(--accent-soft); color: var(--text-hi); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-tiny);
}


/* ============================================================
   3. Layout · App 容器
   ============================================================ */
.app {
  width: min(100%, 480px);
  min-height: 100dvh;
  margin: 0 auto;
  position: relative;
  overflow-x: hidden;
  background: var(--bg-1);
}

.app::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: url('/assets/深色背景图.png') center/cover;
  opacity: .35;
  pointer-events: none;
}


/* ============================================================
   4. Topbar
   ============================================================ */
.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: max(8px, env(safe-area-inset-top)) 16px 8px;
  background: rgba(10, 16, 24, .88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }

.brand-mark {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: #062018;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -.02em;
}

.brand-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-hi);
  white-space: nowrap;
  letter-spacing: -.01em;
}

.brand-title span {
  color: var(--text-lo);
  font-weight: 400;
  font-size: 13px;
  margin-left: 6px;
}

.brand-subtitle {
  color: var(--text-lo);
  font-size: 11px;
  margin-top: 1px;
}

.top-spacer, .spacer { flex: 1; }

.icon-button, .avatar-button {
  border: 0;
  color: var(--text);
  background: transparent;
  min-width: 36px;
  min-height: 36px;
  display: grid;
  place-items: center;
  border-radius: var(--r-inner);
}

.icon-button:hover { background: var(--accent-soft); color: var(--text-hi); }

.avatar, .avatar-button {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: var(--r-pill);
  background: var(--bg-3);
  border: 1px solid var(--line-mid);
  font-weight: 650;
  color: var(--text-hi);
  display: grid;
  place-items: center;
  overflow: hidden;
  font-size: 14px;
}

.avatar.large {
  width: 72px;
  height: 72px;
  min-width: 72px;
  font-size: 24px;
}


/* ============================================================
   5. Content · Hero
   ============================================================ */
.content {
  padding: 0 16px calc(var(--nav-height) + 24px + env(safe-area-inset-bottom));
}

.hero { padding: 28px 0 18px; }

.eyebrow {
  color: var(--text-lo);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 600;
}

.hero h1 {
  margin: 10px 0 8px;
  font-size: clamp(26px, 7.5vw, 32px);
  line-height: 1.2;
  font-weight: 700;
  color: var(--text-hi);
  letter-spacing: -.02em;
}

.hero p {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
}

.hero strong { color: var(--accent); font-weight: 600; }

/* 状态条 */
.status-banner {
  margin: 4px 0 20px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line-mid);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-inner);
  background: var(--bg-2);
}

.status-banner .copy { flex: 1; min-width: 0; }
.status-banner strong { display: block; font-size: 14px; color: var(--text-hi); }
.status-banner small { color: var(--text-lo); display: block; margin-top: 3px; line-height: 1.45; font-size: 12px; }


/* ============================================================
   6. Chips / Badges
   ============================================================ */
.feed-toolbar, .section-head, .row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.feed-toolbar {
  margin-bottom: 12px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.feed-toolbar::-webkit-scrollbar { display: none; }

.section-head {
  justify-content: space-between;
  padding: 24px 0 12px;
}

.section-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
  color: var(--text-hi);
  letter-spacing: -.01em;
}

.muted { color: var(--text-lo); }

.chip, .scope-badge, .level-badge {
  min-height: 30px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-mid);
  background: transparent;
  color: var(--text);
  white-space: nowrap;
  font-size: 12px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
}

.chip:hover {
  background: var(--accent-soft);
  border-color: var(--line-hi);
  color: var(--text-hi);
}

.chip.active, .level-badge {
  color: #062018;
  border-color: var(--accent);
  background: var(--accent);
  font-weight: 700;
}

.scope-badge {
  min-height: 22px;
  padding: 2px 8px;
  color: var(--text-lo);
  font-size: 11px;
}

/* 段位徽章 —— 方角、无 emoji、仅用色区分 */
.rank-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: var(--r-tiny);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  color: #1a1206;
  background: var(--rank-gold);
}

.rank-badge.lv-1 { background: var(--rank-bronze); color: #1a1008; }
.rank-badge.lv-2 { background: var(--rank-silver); color: #10161a; }
.rank-badge.lv-3 { background: var(--rank-gold); }
.rank-badge.lv-4 { background: var(--rank-jade); color: #062018; }
.rank-badge.lv-5 { background: var(--accent-hi); color: #062018; }

/* 段位进度条 */
.level-progress {
  margin-top: 12px;
  height: 4px;
  border-radius: 2px;
  background: var(--bg-3);
  overflow: hidden;
}

.level-progress > span {
  display: block;
  height: 100%;
  border-radius: 2px;
  background: var(--accent);
  transition: width var(--dur-slow) var(--ease-out);
}

/* 状态点 */
.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: var(--r-pill);
  flex: 0 0 7px;
  background: var(--text-dis);
}

.status-dot.online { background: var(--accent); }
.status-dot.busy { background: var(--danger); }
.status-dot.idle { background: var(--warning); }


/* ============================================================
   7. Post
   ============================================================ */
.post, .card, .profile-card, .settings-panel {
  border: 1px solid var(--line);
  background: var(--bg-2);
  border-radius: var(--r-outer);
}

.post {
  padding: 16px 14px;
  margin: 0 0 18px;
  position: relative;
}

.post:hover {
  border-color: var(--line-mid);
}

.post-author { display: flex; align-items: center; gap: 10px; }

.post-author-copy { flex: 1; min-width: 0; }

.post-author strong {
  display: block;
  font-size: 15px;
  font-weight: 650;
  color: var(--text-hi);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.post-author small {
  display: block;
  color: var(--text-lo);
  margin-top: 2px;
  font-size: 12px;
}

.gender { font-weight: 700; margin-left: 4px; font-size: 11px; }
.gender.male { color: var(--info); }
.gender.male::after { content: "♂"; font-size: 11px; opacity: .7; margin-left: 2px; }
.gender.female { color: var(--pink); }
.gender.female::after { content: "♀"; font-size: 11px; opacity: .7; margin-left: 2px; }

.post-copy {
  margin: 14px 0 12px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-hi);
  white-space: pre-wrap;
}

.post-media {
  width: 100%;
  aspect-ratio: 16/10;
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-inner);
  background: var(--bg-3);
  object-fit: cover;
}

/* 约球状态条 */
.match-bar {
  margin-top: 12px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: var(--r-inner);
  background: var(--bg-3);
  font-size: 12px;
}

.match-bar .dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: var(--r-pill);
  background: var(--accent);
}

.match-bar .dot.full { background: var(--danger); }

.match-bar .info { flex: 1; min-width: 0; color: var(--text-lo); }
.match-bar .info strong { color: var(--text-hi); font-weight: 650; }

.match-bar .slots { display: inline-flex; gap: 3px; }
.match-bar .slots i {
  width: 6px;
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--bg-1);
  border: 1px solid var(--line-mid);
}
.match-bar .slots i.on {
  background: var(--accent);
  border-color: var(--accent);
}

/* 操作区 —— 第一列为主 CTA，其余保持朴素 */
.post-actions {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 6px;
  margin-top: 14px;
}

.post-actions button {
  min-height: 38px;
  border-radius: var(--r-inner);
  color: var(--text-lo);
  font-size: 13px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-weight: 500;
}

.post-actions button:first-child {
  color: #062018;
  font-weight: 700;
  background: var(--accent);
  text-align: center;
}

.post-actions button:first-child:hover {
  background: var(--accent-hi);
}

.post-actions button:not(:first-child):hover {
  background: var(--bg-3);
  color: var(--text-hi);
}


/* ============================================================
   8. 空状态 / 加载态
   ============================================================ */
.empty-state {
  padding: 52px 20px;
  text-align: center;
  color: var(--text-lo);
}

.empty-state strong {
  color: var(--text-hi);
  display: block;
  font-size: 16px;
  margin-bottom: 6px;
  font-weight: 600;
}

.empty-state p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
}

.empty-actions {
  display: inline-flex;
  gap: 8px;
  margin-top: 18px;
}

.loading {
  padding: 48px 20px;
  text-align: center;
  color: var(--text-lo);
  font-size: 13px;
}

/* 加载态：极简三点，不用 emoji、不用球 */
.spinner {
  width: 20px;
  height: 20px;
  margin: 0 auto 12px;
  border: 2px solid var(--bg-3);
  border-top-color: var(--accent);
  border-radius: var(--r-pill);
  animation: spin .8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* 骨架屏 */
.skeleton-post {
  border-radius: var(--r-outer);
  padding: 16px 14px;
  margin: 0 0 18px;
  border: 1px solid var(--line);
  background: var(--bg-2);
}

.sk {
  border-radius: var(--r-tiny);
  background: linear-gradient(
    90deg,
    var(--bg-3) 0%,
    rgba(255, 255, 255, .04) 50%,
    var(--bg-3) 100%
  );
  background-size: 200% 100%;
  animation: sk-shimmer 1.6s ease-in-out infinite;
}

@keyframes sk-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.sk-avatar { width: 36px; height: 36px; border-radius: var(--r-pill); margin-bottom: 12px; }
.sk-line { height: 10px; margin-bottom: 8px; }
.sk-media { height: 180px; border-radius: var(--r-inner); margin-top: 12px; }


/* ============================================================
   9. 球场卡片
   ============================================================ */
.court-card {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 14px;
  align-items: center;
  border-radius: var(--r-outer);
  padding: 14px;
  margin: 0 0 12px;
  border: 1px solid var(--line);
  background: var(--bg-2);
}

.court-card:hover { border-color: var(--line-mid); }

.court-thumb {
  width: 88px;
  height: 88px;
  border-radius: var(--r-inner);
  background: var(--bg-3);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 32px;
  overflow: hidden;
}

.court-info h3 {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 650;
  color: var(--text-hi);
}

.court-info p {
  margin: 0 0 8px;
  color: var(--text-lo);
  font-size: 13px;
  line-height: 1.5;
}

.court-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-lo);
}

.court-meta strong { color: var(--accent); font-weight: 650; }


/* ============================================================
   10. 比分牌
   ============================================================ */
.scoreboard {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 20px 16px;
  border-radius: var(--r-outer);
  background: var(--bg-2);
  border: 1px solid var(--line);
}

.scoreboard .team { text-align: center; }

.scoreboard .team strong {
  display: block;
  font-size: 32px;
  font-weight: 700;
  color: var(--text-hi);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: -.02em;
}

.scoreboard .team small {
  color: var(--text-lo);
  font-size: 12px;
  display: block;
  margin-top: 6px;
}

.scoreboard .vs {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dis);
  letter-spacing: .12em;
}


/* ============================================================
   11. 底部导航
   ============================================================ */
.bottom-nav {
  position: fixed;
  z-index: 40;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, 480px);
  height: calc(var(--nav-height) + env(safe-area-inset-bottom));
  padding: 8px 6px env(safe-area-inset-bottom);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: rgba(10, 16, 24, .94);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.nav-item {
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text-dis);
  font-size: 11px;
  transition: color var(--dur) var(--ease-out);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-weight: 500;
}

.nav-item span {
  display: block;
  font-size: 20px;
  line-height: 22px;
}

.nav-item.active {
  color: var(--accent);
  font-weight: 600;
}

.nav-publish span {
  width: 44px;
  height: 44px;
  margin: -12px auto 2px;
  display: grid;
  place-items: center;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: #062018;
  font-size: 26px;
  font-weight: 400;
  line-height: 1;
}

.nav-publish:hover span { background: var(--accent-hi); }


/* ============================================================
   12. Card 通用
   ============================================================ */
.card {
  border-radius: var(--r-outer);
  padding: 16px;
  margin: 12px 0;
  border: 1px solid var(--line);
  background: var(--bg-2);
}

.card h3 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 650;
  color: var(--text-hi);
}

.card p { margin: 6px 0; line-height: 1.6; font-size: 14px; }

.event-meta {
  display: grid;
  gap: 6px;
  color: var(--text-lo);
  font-size: 13px;
  margin: 12px 0;
}


/* ============================================================
   13. 商城
   ============================================================ */
.market-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.market-card { min-width: 0; }

.market-visual {
  height: 116px;
  display: grid;
  place-items: center;
  margin-bottom: 10px;
  border-radius: var(--r-inner);
  background: var(--bg-3);
  border: 1px solid var(--line);
  font-size: 36px;
  overflow: hidden;
}

.price {
  color: var(--text-hi);
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}


/* ============================================================
   14. 个人中心
   ============================================================ */
.profile-card {
  margin-top: 20px;
  padding: 20px 18px;
  border-radius: var(--r-outer);
}

.profile-main { display: flex; align-items: center; gap: 14px; }

.profile-actions { display: flex; gap: 8px; margin-top: 14px; }
.profile-actions .profile-contact { flex: 1; }

.profile-main h1 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-hi);
  letter-spacing: -.01em;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  text-align: center;
}

.profile-stats > div { position: relative; }

.profile-stats > div + div::before {
  content: "";
  position: absolute;
  left: 0;
  top: 15%;
  bottom: 15%;
  width: 1px;
  background: var(--line);
}

.profile-stats strong {
  display: block;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-hi);
  font-variant-numeric: tabular-nums;
}

.profile-stats small { color: var(--text-lo); font-size: 12px; }

.archive-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.archive-item {
  padding: 12px;
  border-radius: var(--r-inner);
  background: var(--bg-3);
  border: 1px solid transparent;
}

.archive-item:hover { border-color: var(--line-mid); }

.archive-item small {
  color: var(--text-lo);
  display: block;
  margin-bottom: 3px;
  font-size: 12px;
}


/* ============================================================
   15. 设置
   ============================================================ */
.settings-panel {
  margin: 14px 0;
  border-radius: var(--r-outer);
  overflow: hidden;
}

.settings-row {
  width: 100%;
  min-height: 56px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  text-align: left;
  font-size: 14px;
}

.settings-row:hover { background: var(--bg-3); }
.settings-row:last-child { border-bottom: 0; }

.settings-row .glyph {
  width: 24px;
  color: var(--text-lo);
  font-size: 16px;
  text-align: center;
  flex: 0 0 24px;
}

.settings-row .arrow {
  margin-left: auto;
  color: var(--text-dis);
  font-size: 14px;
}


/* ============================================================
   16. 按钮
   ============================================================ */
.button {
  min-height: 40px;
  padding: 10px 16px;
  border: 1px solid var(--line-mid);
  border-radius: var(--r-inner);
  background: transparent;
  color: var(--text-hi);
  font-weight: 550;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.button:hover { background: var(--bg-3); border-color: var(--line-hi); }

.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #062018;
  font-weight: 700;
}

.button.primary:hover { background: var(--accent-hi); border-color: var(--accent-hi); }

.button.small { min-height: 30px; padding: 6px 12px; font-size: 12px; }

.button.danger {
  color: var(--danger);
  border-color: rgba(217, 115, 130, .30);
  background: transparent;
}

.button.danger:hover { background: var(--danger-soft); }

.button.full { width: 100%; }

.text-button {
  border: 0;
  background: transparent;
  color: var(--accent);
  min-height: 34px;
  font-size: 13px;
  font-weight: 550;
  padding: 0 4px;
}

.text-button:hover { color: var(--accent-hi); }


/* ============================================================
   17. 弹层
   ============================================================ */
.modal {
  position: fixed;
  z-index: 60;
  inset: 0;
  display: grid;
  align-items: end;
  background: rgba(0, 0, 0, .65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fade-in var(--dur) var(--ease-out);
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.sheet {
  width: min(100%, 480px);
  max-height: 92dvh;
  margin: 0 auto;
  overflow: auto;
  padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: var(--r-outer) var(--r-outer) 0 0;
  background: var(--bg-2);
  animation: sheet-up var(--dur-slow) var(--ease-out);
}

@keyframes sheet-up {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.sheet-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 650;
  color: var(--text-hi);
}

.sheet-close {
  width: 32px;
  height: 32px;
  border-radius: var(--r-inner);
  color: var(--text-lo);
  font-size: 20px;
  display: grid;
  place-items: center;
}

.sheet-close:hover { background: var(--bg-3); color: var(--text-hi); }


/* ============================================================
   18. 表单
   ============================================================ */
.form { display: grid; gap: 14px; }

.field { display: grid; gap: 6px; }

.field label, .field-label {
  font-size: 12px;
  color: var(--text-lo);
  font-weight: 500;
}

.field input,
.field textarea,
.field select,
.admin-row input,
.admin-row select {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line-mid);
  border-radius: var(--r-inner);
  background: var(--bg-3);
  color: var(--text-hi);
  font-size: 14px;
  transition: border-color var(--dur-fast) var(--ease-out);
}

.field input::placeholder,
.field textarea::placeholder { color: var(--text-dis); }

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--accent);
  outline: none;
}

.field textarea { min-height: 100px; resize: vertical; }

.inline { display: flex; gap: 8px; align-items: center; }
.inline > :first-child { flex: 1; }

.topic-picker { display: flex; gap: 6px; flex-wrap: wrap; }

.topic-option {
  border: 1px solid var(--line-mid);
  border-radius: var(--r-pill);
  padding: 6px 12px;
  background: transparent;
  color: var(--text);
  font-size: 12px;
}

.topic-option:hover { border-color: var(--line-hi); color: var(--text-hi); }

.topic-option.selected {
  border-color: var(--accent);
  color: #062018;
  background: var(--accent);
  font-weight: 650;
}

.media-picker {
  min-height: 120px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line-hi);
  border-radius: var(--r-inner);
  background: var(--bg-3);
  overflow: hidden;
  color: var(--text-lo);
  font-size: 13px;
}

.media-picker:hover { border-color: var(--accent); }

.media-picker strong {
  display: block;
  color: var(--text-hi);
  font-size: 22px;
  text-align: center;
  font-weight: 300;
}

.media-preview {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  display: block;
}

.notice {
  padding: 12px 14px;
  border-radius: var(--r-inner);
  background: var(--bg-3);
  color: var(--text-lo);
  font-size: 12px;
  line-height: 1.6;
  border-left: 2px solid var(--info);
}


/* ============================================================
   19. 管理 / 城市排行
   ============================================================ */
.admin-section { margin: 20px 0; }

.admin-section h3 {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 650;
  color: var(--text-hi);
}

.admin-row {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-row > div:first-child { flex: 1; min-width: 0; }
.admin-row small { color: var(--text-lo); line-height: 1.5; font-size: 12px; }

.city-rank {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.rank-number {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: var(--r-tiny);
  background: var(--bg-3);
  color: var(--text-lo);
  font-weight: 650;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.city-rank:nth-child(1) .rank-number {
  background: var(--rank-gold);
  color: #1a1206;
}

.city-rank:nth-child(2) .rank-number {
  background: var(--rank-silver);
  color: #10161a;
}

.city-rank:nth-child(3) .rank-number {
  background: var(--rank-bronze);
  color: #1a1008;
}


/* ============================================================
   20. 登录页
   ============================================================ */
.auth {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 36px 24px max(42px, env(safe-area-inset-bottom));
  background: linear-gradient(rgba(3, 9, 20, .30), rgba(3, 9, 20, .95)), url('/assets/启动页.jpeg') center/cover;
}

.auth-brand {
  margin-bottom: auto;
  padding-top: 15vh;
  text-align: center;
}

.auth-brand .brand-mark {
  width: 72px;
  height: 72px;
  margin: auto;
  font-size: 26px;
}

.auth h1 {
  font-size: 28px;
  margin: 18px 0 6px;
  font-weight: 700;
  color: var(--text-hi);
  letter-spacing: -.02em;
}

.auth p { color: var(--text); margin: 0; font-size: 14px; }

.auth-actions { display: grid; gap: 10px; }


/* ============================================================
   21. Toast
   ============================================================ */
.toast {
  position: fixed;
  z-index: 90;
  left: 50%;
  bottom: 92px;
  transform: translate(-50%, 10px);
  max-width: calc(100% - 32px);
  padding: 10px 14px;
  border-radius: var(--r-inner);
  background: var(--text-hi);
  color: var(--bg-1);
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
  box-shadow: var(--shadow-lg);
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }


/* ============================================================
   22. 工具类
   ============================================================ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.tabular { font-variant-numeric: tabular-nums; }

.divider {
  height: 1px;
  margin: 16px 0;
  background: var(--line);
  border: 0;
}


/* ============================================================
   23. 评论 · 头像修复 + 排版
   ============================================================ */
.comment {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.comment:last-child { border-bottom: 0; }

.comment .avatar,
.comment-avatar,
.comment-item .avatar,
[class*="comment"] .avatar {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  max-width: 36px;
  border-radius: var(--r-pill);
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  font-size: 13px;
}

.comment-body {
  flex: 1;
  min-width: 0;
}

.comment-body strong {
  display: block;
  font-size: 13px;
  font-weight: 650;
  color: var(--text-hi);
  margin-bottom: 3px;
}

.comment-body small {
  display: block;
  font-size: 12px;
  color: var(--text-lo);
  line-height: 1.55;
}


/* ============================================================
   24. 无障碍 · 减少动效
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .sk {
    animation: none !important;
    background: var(--bg-3) !important;
  }
}


/* ============================================================
   25. 响应式 · 桌面端
   ============================================================ */
@media (min-width: 700px) {
  body { padding: 24px 0; }

  .app {
    min-height: calc(100dvh - 48px);
    border: 1px solid var(--line);
    border-radius: 20px;
    overflow: hidden;
  }

  .bottom-nav {
    bottom: 0px;
    border-radius: 0 0 20px 20px;
  }

  .modal { align-items: center; }

  .sheet {
    border-bottom: 1px solid var(--line);
    border-radius: var(--r-outer);
  }
}
/* ============================================================
   26. 修正 · 话题标签 / 点赞 / 评论图标
   ============================================================ */

/* ---------- 话题：从实心按钮改为纯色文字 ---------- */
.post-actions button:first-child {
  background: transparent;
  color: var(--accent);
  font-weight: 600;
  box-shadow: none;
}

.post-actions button:first-child:hover {
  background: var(--accent-soft);
  color: var(--accent-hi);
}

/* 如果你的 HTML 里话题是独立元素，也可以用这个类 */
.topic-tag {
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  background: transparent;
  padding: 0;
  border: 0;
}

/* ---------- 点赞：点亮红色 ---------- */
/* 默认状态：灰色描边心 */
.post-actions button.like {
  color: var(--text-lo);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

/* 已点赞：红色实心 */
.post-actions button.like.liked,
.post-actions button.like[aria-pressed="true"] {
  color: #e75a6e;
  font-weight: 600;
}

.post-actions button.like.liked svg,
.post-actions button.like[aria-pressed="true"] svg {
  fill: #e75a6e;
  stroke: #e75a6e;
}

/* hover 时给一点点提示，但不亮 */
.post-actions button.like:hover {
  background: rgba(231, 90, 110, .08);
}

/* ---------- 评论：气泡图标 ---------- */
.post-actions button.comment {
  color: var(--text-lo);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.post-actions button.comment:hover {
  background: var(--bg-3);
  color: var(--text-hi);
}

/* ---------- 图标尺寸统一（SVG 或 inline 图标） ---------- */
.post-actions button svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  stroke-width: 1.8;
  fill: none;
  stroke: currentColor;
  transition: fill var(--dur-fast) var(--ease-out),
              stroke var(--dur-fast) var(--ease-out);
}
/* ============================================================
   27. 修正 · 评论头像 / 话题靠左 / 评论气泡图标
   ============================================================ */

/* ---------- 1. 评论项整体 ---------- */
.comment,
.comment-item,
.comment-row,
[class*="comment"] {
  display: flex;
  align-items: flex-start;   /* 关键：防止子元素被拉伸 */
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

/* ---------- 2. 评论头像：锁死正方形，居中 ---------- */
/* 不管类名叫什么，只要在评论项里的小圆头像都管 */
.comment .avatar,
.comment-item .avatar,
.comment-row .avatar,
[class*="comment"] .avatar,
.comment-avatar,
[class*="comment-avatar"] {
  flex: 0 0 36px !important;
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  max-width: 36px !important;
  min-height: 36px !important;
  max-height: 36px !important;
  aspect-ratio: 1 / 1 !important;
  border-radius: 50% !important;
  display: grid !important;
  place-items: center !important;
  overflow: hidden !important;
  font-size: 13px;
  background: var(--bg-3);
  border: 1px solid var(--line-mid);
}

/* ---------- 3. 评论正文列 ---------- */
.comment-body,
.comment-content,
[class*="comment"] > div:not([class*="avatar"]) {
  flex: 1;
  min-width: 0;
}

/* ---------- 4. 话题标签：纯色文字，贴左 ---------- */
.post-actions {
  grid-template-columns: auto 1fr 1fr;   /* 第一列自适应宽度 */
}

.post-actions button:first-child {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 4px !important;
  color: var(--accent) !important;
  font-weight: 600;
  text-align: left;
  justify-self: start;      /* 贴左 */
  width: auto;
  min-height: 38px;
}

.post-actions button:first-child:hover {
  background: var(--accent-soft) !important;
  border-radius: var(--r-inner);
}

/* ---------- 5. 点赞 / 评论：统一图标对齐 ---------- */
.post-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.post-actions button svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  stroke-width: 1.8;
  fill: none;
  stroke: currentColor;
}

/* ---------- 6. 点赞点亮红色 ---------- */
.post-actions button.like.liked,
.post-actions button[data-liked="true"] {
  color: #e75a6e;
}

.post-actions button.like.liked svg,
.post-actions button[data-liked="true"] svg {
  fill: #e75a6e;
  stroke: #e75a6e;
}
/* ============================================================
   28. post-actions 布局重写（不依赖类名）
   ============================================================ */

/* ---------- 1. 整体：左-中-右三段式，不用 grid ---------- */
.post-actions {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 14px;
  padding-top: 2px;
}

/* ---------- 2. 三个按钮：不管类名，按位置分配 ---------- */
.post-actions > * {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-lo);
  white-space: nowrap;
  flex: 0 0 auto;
}

/* ---------- 3. 话题（第一个）：贴左，纯文字，主色 ---------- */
.post-actions > *:nth-child(1) {
  color: var(--accent);
  font-weight: 600;
  margin-right: auto;   /* 关键：把它右边的所有内容推到最右 */
}

.post-actions > *:nth-child(1):hover {
  color: var(--accent-hi);
}

/* ---------- 4. 评论（第二个）和点赞（第三个）：固定靠右 ---------- */
.post-actions > *:nth-child(2),
.post-actions > *:nth-child(3) {
  color: var(--text-lo);
}

.post-actions > *:nth-child(2):hover,
.post-actions > *:nth-child(3):hover {
  color: var(--text-hi);
}

/* ---------- 5. 图标统一尺寸 ---------- */
.post-actions svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  stroke-width: 1.8;
  fill: none;
  stroke: currentColor;
}

/* ---------- 6. 点赞点亮：不管类名，认这几个状态 ---------- */
.post-actions > *:nth-child(3).liked,
.post-actions > *:nth-child(3).active,
.post-actions > *:nth-child(3).is-liked,
.post-actions > *:nth-child(3)[aria-pressed="true"],
.post-actions > *:nth-child(3)[data-liked="true"] {
  color: #e75a6e !important;
}

.post-actions > *:nth-child(3).liked svg,
.post-actions > *:nth-child(3).active svg,
.post-actions > *:nth-child(3).is-liked svg,
.post-actions > *:nth-child(3)[aria-pressed="true"] svg,
.post-actions > *:nth-child(3)[data-liked="true"] svg {
  fill: #e75a6e !important;
  stroke: #e75a6e !important;
}
/* ============================================================
   29. 消息列表
   ============================================================ */

/* ---------- 会话列表容器：卡片式包裹 ---------- */
.conversation-list,
.chat-list,
.session-list {
  display: flex;
  flex-direction: column;
  border-radius: var(--r-outer);
  border: 1px solid var(--line);
  background: var(--bg-2);
  overflow: hidden;
}

/* ---------- 单个会话项 ---------- */
.conversation,
.chat-item,
.session-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  width: 100%;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out);
}

.conversation:last-child,
.chat-item:last-child,
.session-item:last-child {
  border-bottom: 0;
}

.conversation:hover,
.chat-item:hover,
.session-item:hover {
  background: var(--bg-3);
}

/* ---------- 头像 ---------- */
.conversation .avatar,
.chat-item .avatar,
.session-item .avatar {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  min-width: 44px;
  max-width: 44px;
  aspect-ratio: 1 / 1;
  border-radius: var(--r-pill);
  background: var(--bg-3);
  border: 1px solid var(--line-mid);
  display: grid;
  place-items: center;
  overflow: hidden;
  font-size: 15px;
  font-weight: 650;
  color: var(--text-hi);
}

/* ---------- 中间信息列 ---------- */
.conversation .info,
.chat-item .info,
.session-item .info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.conversation .info strong,
.chat-item .info strong,
.session-item .info strong {
  font-size: 14px;
  font-weight: 650;
  color: var(--text-hi);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conversation .info small,
.chat-item .info small,
.session-item .info small {
  font-size: 12px;
  color: var(--text-lo);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

/* ---------- 右侧：时间 + 未读 ---------- */
.conversation .meta,
.chat-item .meta,
.session-item .meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex: 0 0 auto;
}

.conversation .time,
.chat-item .time,
.session-item .time {
  font-size: 11px;
  color: var(--text-dis);
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   30. 消息列表 · 位置版（不依赖类名）
   ============================================================ */

/* 找"消息 / 1 个会话"标题后面的列表容器——通常是一个 section 或 div */
/* 这里用 :has() 精准命中"包含 3 个以上子元素且在当前页面下半部分"的容器 */

/* 更直接的做法：给这一行加视觉分隔——下划线 + hover */
.section-head + div > *,
.section-head ~ div > * {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out);
}

.section-head + div > *:last-child,
.section-head ~ div > *:last-child {
  border-bottom: 0;
}

.section-head + div > *:hover,
.section-head ~ div > *:hover {
  background: var(--bg-2);
  border-radius: var(--r-inner);
}
