/* Token variables (from MasterGo DSL)
   paint_1:3      -> #FFFFFF (white)
   paint_13:15099 -> #C1DCFE (status bar light bg)
   paint_1:947    -> #000000 (black)
   paint_1:952    -> rgba(0, 0, 0, 0.36) (battery outline)
   paint_1:14     -> #000000 (black)
   paint_1:1640   -> #000000 (icon fill)
   paint_1:65     -> #3D3D3D (secondary text)
   paint_1:060    -> #FFFFFF (panel bg)
   paint_1:8      -> #D8D8D8 (divider)
   paint_13:09183 -> #1E40AF (brand blue / active)
   paint_13:31328 -> #1E40AF (brand blue / active)
   paint_13:755   -> #3D3D3D (inactive icon)
   paint_13:12803 -> #E5F0FF (tab bar bg)
*/
@import url('./tokens.css');

:root {
  --color-bg: #FFFFFF; /* paint_1:3 */
  --color-statusbar-bg: #C1DCFE; /* paint_13:15099 */
  --color-text: #000000; /* paint_1:14 */
  --color-text-secondary: #3D3D3D; /* paint_1:65 */
  --color-divider: var(--divider); /* unified divider token */
  --color-active: #1E40AF; /* paint_13:09183 / paint_13:31328 */
  --color-inactive-icon: #3D3D3D; /* paint_13:755 */
  --color-tabbar-bg: #E5F0FF; /* paint_13:12803 */

  --phone-width: 390px;
  --phone-height: 844px;
  --padding-h: 16px;

  --font-family: 'Source Han Sans', 'Noto Sans CJK SC', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  /* 全局界面竖向偏移（负值向上移动） */
  --global-shift: -56px;
}

/* Reset */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: #f5f6f8;
  font-family: var(--font-family);
  color: var(--color-text);
}

/* Phone canvas */
.info-phone {
  position: relative;
  width: var(--phone-width);
  height: var(--phone-height);
  margin: 24px auto;
  /* 使用项目通用的浅蓝渐变背景（来自 tokens.css: --bg-grad） */
  background: var(--bg-grad, var(--color-bg));
  border: 1px solid #ddd;
  border-radius: 0; /* 直角 */
  overflow: hidden;
  /* 全局上移 */
  transform: translateY(var(--global-shift));
}

/* Status bar */
.status-bar {
  position: absolute;
  left: 5px; top: 0;
  width: calc(100% - 9px);
  height: 47px;
  background: var(--color-statusbar-bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 10px;
}
.status-time {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text);
}
.status-icons {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.status-icons svg { display: block; height: 12px; }

/* Header */
.header-title {
  position: absolute;
  top: 67px; left: 0; right: 0;
  width: 40px; height: 29px;
  margin: 0 auto;
  font-size: 20px; /* font_9:969 */
  line-height: 29px;
  text-align: center;
}
.header-actions {
  position: absolute;
  top: 72px; right: 16px;
  display: flex;
  gap: 25px;
}
.header-actions button {
  all: unset;
  cursor: pointer;
  width: 24px; height: 24px;
  display: grid; place-items: center;
}
/* Ensure header action icons (放大镜 / +) render at the same size */
.header-actions svg {
  width: 24px !important;
  height: 24px !important;
  display: block;
  fill: var(--color-text);
}

/* Tabs */
.top-tabs {
  position: absolute;
  top: 135px; left: 0; right: 0;
  display: flex;
  justify-content: space-around;
  padding: 0 24px;
  color: var(--color-text-secondary);
  font-size: 14px; /* font_8:929 */
  /* circle sizing variables: default 56px (more精致), compact modifier sets 48px */
  --tab-circle-size: 56px;
  --tab-circle-glow: 12px;
}

/* 新增：顶部标签的圆形图标样式（参考截图） */
.top-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.top-tab .tab-label { font-size: 12px; color: var(--color-text-secondary); }
.tab-circle {
  width: var(--tab-circle-size);
  height: var(--tab-circle-size);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 8px 20px rgba(16,24,40,0.06);
}
/* inner soft glow using pseudo-element */
.tab-circle::before{
  content: '';
  position: absolute;
  /* 更聚焦的 glow：缩小扩散范围、降低模糊和透明度，避免覆盖图标 */
  inset: calc(-1 * var(--tab-circle-glow) / 2);
  border-radius: 50%;
  filter: blur(10px);
  opacity: 0.6;
  pointer-events: none;
  z-index: 0;
}
/* color variants (gradients similar to screenshot) */
.circle-peach { background: radial-gradient(circle at center, #FF8A5B 0%, #FFB78D 50%, #FFDCCF 100%); background-position: center center; }
.circle-peach::before { background: rgba(255,138,91,0.12); }
.circle-blue { background: radial-gradient(circle at center, #2563EB 0%, #7FB6FF 50%, #DBEDFF 100%); background-position: center center; }
.circle-blue::before { background: rgba(37,99,235,0.10); }
.circle-purple { background: radial-gradient(circle at center, #6D28D9 0%, #BFA5FF 50%, #EDE6FF 100%); background-position: center center; }
.circle-purple::before { background: rgba(109,40,217,0.10); }
.circle-yellow { background: radial-gradient(circle at center, #F59E0B 0%, #FFD580 50%, #FFF3D6 100%); background-position: center center; }
.circle-yellow::before { background: rgba(245,158,11,0.10); }

/* 在圆内放一个小图标占位（可用 SVG 或 emoji），这里用一个小点作为占位 */
/* inner icon background + icon positioning */
.tab-circle .icon-bg,
.tab-circle svg {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
}
/* 隐藏圆内的白色小圆 — 用户要求去掉圆内白色 */
.tab-circle .icon-bg {
  display: none;
}
.tab-circle svg { width: 22px; height: 22px; fill: #fff; stroke: none; z-index: 2; shape-rendering: geometricPrecision; image-rendering: -webkit-optimize-contrast; vector-effect: non-scaling-stroke; }

/* 按需：使用同类色填充图标（给 svg 加 class="icon-colored"） */
.tab-circle svg.icon-colored { fill: currentColor; stroke: none; }

/* ----- 可选：单个圆使用描边（outline）图标 -----
   使用方法：在想要以描边显示的 svg 上添加 class="outline"。
   例：<svg class="icon-social outline" ...></svg>
   效果：svg 使用对应 .tab-circle 的 color 作为描边色（同类色），并移除填充。
*/
.tab-circle { color: inherit; }
.circle-peach { --icon-stroke: #c2410c; color: var(--icon-stroke); }
.circle-blue  { --icon-stroke: #1e40af; color: var(--icon-stroke); }
.circle-purple{ --icon-stroke: #5b21b6; color: var(--icon-stroke); }
.circle-yellow{ --icon-stroke: #b45309; color: var(--icon-stroke); }

.tab-circle svg.outline {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6px;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

/* 私信图标更清晰：为特定的 icon-chat outline 增加描边宽度 */
.tab-circle svg.icon-chat.outline {
  stroke-width: 2px;
}

/* dual 模式：白色填充 + 同色描边（可选） */
.tab-circle svg.outline-dual {
  fill: #fff;
  stroke: currentColor;
  stroke-width: 1.1px;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

/* compact modifier: smaller circles (48px) */
.top-tabs.compact {
  --tab-circle-size: 48px;
  --tab-circle-glow: 10px;
}

/* Section title */
.section-title {
  position: absolute;
  top: 255px; left: 19px; /* moved up total 18px (10 + 6 + 2) */
  font-size: 16px; /* font_1:587 */
}

/* Friends list panel */
.friends-panel {
  position: absolute;
  top: 303px; left: 19px; /* moved up total 18px (10 + 6 + 2) */
  width: 355px; min-height: 468px;
  background: var(--color-bg); /* paint_1:060 */
  border-radius: 10px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.friend-row {
  position: relative;
  height: 66px; /* ~468/7 */
  border-top: 1px solid var(--divider);
  padding: 10px 12px 10px 64px; /* 为头像预留空间 */
}
.friend-row:first-child { border-top: 1px solid var(--divider); }
.friend-avatar {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 50%;
  background: #eee; /* fallback if svg/img missing */
  border: 1px solid rgba(0,0,0,0.06);
  overflow: hidden; /* ensure circular crop */
}
/* make inline SVG or img fill the avatar circle */
.friend-avatar svg,
.friend-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 50%;
}
.friend-name { font-size: 16px; line-height: 24px; }
.friend-preview {
  font-size: 10px; line-height: 14px; color: var(--color-text-secondary);
}
.friend-time {
  position: absolute; right: 12px; top: 12px;
  font-size: 10px; line-height: 14px; color: var(--color-text-secondary);
}

/* Bottom navigation */
.tabbar {
  position: absolute;
  left: 0; right: 0; bottom: 0; height: 58px; /* extend to bottom and include gap area */
  padding-bottom: 8px; /* keep inner items aligned and create spacing */
  background: var(--color-tabbar-bg);
  display: grid; grid-template-columns: repeat(5, 1fr);
  align-items: center;
  border-top: 1px solid var(--divider);
}
.tabbar-item {
  display: grid; justify-items: center; align-content: center;
  gap: 4px;
  font-size: 12px; /* font_1:60/1:0108 */
  /* 使用 currentColor 控制图标：默认设为不活跃颜色 */
  color: var(--color-inactive-icon);
  padding-bottom: 4px; /* small padding so text doesn't touch the very bottom */
}
/* 让 svg 使用 currentColor 作为描边色，去掉填充，以便用 color 控制状态色 */
.tabbar-item svg {
  width: 24px; height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6px;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.tabbar-item.active { color: var(--color-active); }

/* Ensure tab links inherit the tab color and don't use default browser link color */
.tabbar-item .tab-link,
.tabbar-item .tab-link:visited {
  color: inherit;
  text-decoration: none;
  font-size: 12px;
}

/* Utility */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Blue circular background for AI tab (ensure AI tab matches other pages) */
.tab .tab-icon.tab-ai,
.tabbar-item svg.tab-ai,
.tabbar-item .tab-icon.tab-ai {
  display: inline-grid;
  place-items: center;
  width: 44px !important;
  height: 44px !important;
  border-radius: 50%;
  background: linear-gradient(180deg, #E9F1FF 0%, #D0E2FF 100%);
  color: var(--tab);
  padding: 8px;
  box-sizing: border-box;
  /* configurable via --tab-ai-shift */
  transform: translateY(var(--tab-ai-shift));
}
.tab .tab-icon.tab-ai *,
.tabbar-item svg.tab-ai * {
  stroke: currentColor !important;
  fill: currentColor !important;
  vector-effect: non-scaling-stroke;
}

.tab .tab-icon.tab-ai + .tab-link,
.tab .tab-icon.tab-ai + span,
.tabbar-item svg.tab-ai + .tab-link,
.tabbar-item svg.tab-ai + span,
.tabbar-item .tab-icon.tab-ai + .tab-link,
.tabbar-item .tab-icon.tab-ai + span {
  display:inline-block;
  transform: translateY(var(--tab-ai-shift));
}

.tabbar { overflow: visible; }

/* Fix: move AI教练 label slightly up so it's not clipped by the bottom edge on small screens
   Only adjusts the AI tab label/icon in this page. */
.tabbar-item[data-tab="ai"] > div,
.tabbar-item[data-tab="ai"] .tab-link {
  transform: translateY(-8px);
  /* ensure no extra clipping — allow a small bottom gap */
  margin-bottom: 2px;
}

.tabbar-item[data-tab="ai"] svg {
  transform: translateY(-3px);
}
