/* ==========================================================================
   base.css — 设计令牌 / 重置 / 整体骨架
   微信原文配色与尺寸尽量贴近官方
   ========================================================================== */

:root {
  /* 品牌与功能色 */
  --wx-green: #07C160;
  --wx-green-dark: #06AD56;
  --wx-bubble-me: #95EC69;      /* 我方气泡 */
  --wx-bubble-other: #FFFFFF;   /* 对方气泡 */
  --wx-link: #576B95;
  --wx-red: #FA5151;
  --wx-orange: #FA9D3B;
  --wx-gold: #E5A13A;

  /* 中性色（浅色） */
  --bg-page: #EDEDED;
  --bg-panel: #F7F7F7;
  --bg-list: #FFFFFF;
  --bg-input: #FFFFFF;
  --bg-nav: #EDEDED;
  --bg-active: #E5E5E5;
  --bg-hover: #F2F2F2;

  --text-main: #191919;
  --text-sub: #B2B2B2;
  --text-desc: #888888;
  --text-on-green: #FFFFFF;

  --line: #E5E5E5;
  --line-strong: #D9D9D9;

  --nav-h: 44px;
  --tabbar-h: 50px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  --radius-sm: 4px;
  --radius: 6px;
  --radius-lg: 10px;

  --shadow-1: 0 1px 3px rgba(0,0,0,.08);
  --shadow-2: 0 6px 24px rgba(0,0,0,.16);

  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue",
          "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  --font-num: "SF Pro Display", -apple-system, "Helvetica Neue", Arial, sans-serif;

  /* 桌面三栏宽度 */
  --col-list: 300px;
  --col-side: 320px;
}

/* 深色模式 */
[data-theme="dark"] {
  --bg-page: #111111;
  --bg-panel: #1E1E1E;
  --bg-list: #191919;
  --bg-input: #2C2C2C;
  --bg-nav: #1E1E1E;
  --bg-active: #2A2A2A;
  --bg-hover: #262626;

  --text-main: #D8D8D8;
  --text-sub: #6B6B6B;
  --text-desc: #7C7C7C;

  --line: #2E2E2E;
  --line-strong: #333333;
  --wx-bubble-other: #2C2C2C;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0; height: 100%;
  font-family: var(--font);
  color: var(--text-main);
  background: var(--bg-page);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

body { overflow: hidden; }

button, input, textarea, select {
  font-family: inherit; font-size: inherit; color: inherit; outline: none; border: none; background: none;
}
button { cursor: pointer; }
a { color: var(--wx-link); text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img { display: block; max-width: 100%; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,.18); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,.3); }
::-webkit-scrollbar-track { background: transparent; }

.hidden { display: none !important; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 启动屏 */
.splash {
  position: fixed; inset: 0; z-index: 9999;
  background: #EDEDED;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  transition: opacity .35s ease;
}
[data-theme="dark"] .splash { background: #111; }
.splash-logo {
  width: 108px; height: 108px; border-radius: 22px;
  background: var(--wx-green);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 30px rgba(7,193,96,.4);
}
.splash-name { color: var(--text-desc); font-size: 14px; letter-spacing: 1px; }
.splash.out { opacity: 0; pointer-events: none; }

/* 应用根 */
.app { height: 100%; width: 100%; display: flex; overflow: hidden; }

/* 头像通用 */
.avatar {
  border-radius: var(--radius-sm);
  background: var(--wx-green);
  color: #fff; font-weight: 500;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex: none; user-select: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.round { border-radius: 50%; }

/* 通用工具类 */
.flex { display: flex; }
.flex-1 { flex: 1; min-width: 0; }
.center { display: flex; align-items: center; justify-content: center; }
.row { display: flex; align-items: center; gap: 10px; }
.spacer { flex: 1; }
