/* 浏览器镜像网页样式。数值照搬手机聊天页（lib/main.dart AppTheme / ThemeColors /
   _buildUserBubble / _buildAIBubble / _buildDateDivider / _TypingDots），日夜两套跟随系统。
   宽屏排布（11/09 梦樱定）：聊天无背景，列宽跟着窗口伸缩；左右留给 1B / 2 的抽屉按钮。 */

:root {
  --bg: #ffffff;            /* AppTheme.dayBg */
  --header: #f8f8f8;        /* AppTheme.dayHeader */
  --border: #eeeeee;        /* AppTheme.dayBorder */
  --text: #1a1a1a;          /* AppTheme.dayText */
  --subtext: #999999;       /* AppTheme.daySubtext */
  --bubble-user: #b5e8c8;   /* ThemeColors.dayBubble */
  --bubble-user-text: #1a1a1a;
  --bubble-ai: #ffffff;     /* AppTheme.dayBubbleAI */
  --bubble-ai-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
  --avatar: #e8f5ee;
  --dot: rgba(0, 0, 0, 0.2);
  --accent: #34c759;        /* AppTheme.accent / ThemeColors.buttonColor */
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1c1e;          /* AppTheme.nightBg */
    --header: #1c1c1e;      /* AppTheme.nightHeader */
    --border: #2c2c2e;      /* AppTheme.nightBorder */
    --text: #e5e5e7;        /* AppTheme.nightText */
    --subtext: #636366;     /* AppTheme.nightSubtext */
    --bubble-user: #1a4a2e; /* ThemeColors.nightBubble */
    --bubble-user-text: rgba(255, 255, 255, 0.9);
    --bubble-ai: #2c2c2e;   /* AppTheme.nightBubbleAI */
    --bubble-ai-shadow: none;
    --avatar: #2c2c2e;
    --dot: rgba(255, 255, 255, 0.3);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", -apple-system, "Microsoft YaHei", sans-serif;
}
#app { height: 100%; display: flex; flex-direction: column; }

/* ── 顶栏 ── */
.header {
  flex: none;
  background: var(--header);
  border-bottom: 0.5px solid var(--border);
  padding: 10px 16px;
  text-align: center;
}
.title { font-size: 17px; font-weight: 500; }
.status { font-size: 11px; color: var(--subtext); margin-top: 2px; }
.status[data-state="online"]::before {
  content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent); margin-right: 5px; vertical-align: middle;
}

/* ── 消息列表 ── */
.list { flex: 1; overflow-y: auto; }
.column { padding: 12px 16px; }
.divider { text-align: center; font-size: 11px; color: var(--subtext); padding: 12px 0; }
.row { display: flex; align-items: flex-start; margin-bottom: 14px; }
.row.user { justify-content: flex-end; padding-left: 50px; }
.avatar {
  flex: none; width: 40px; height: 40px; border-radius: 50%;
  background: var(--avatar); margin-right: 8px;
}
.bubble-col { display: flex; flex-direction: column; max-width: 72%; min-width: 0; }
.row.user .bubble-col { align-items: flex-end; }
.bubble {
  padding: 10px 13px;
  font-size: 16px;
  line-height: 1.4;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.bubble.user {
  background: var(--bubble-user);
  color: var(--bubble-user-text);
  border-radius: 18px 4px 18px 18px;
}
.bubble.ai {
  background: var(--bubble-ai);
  color: var(--text);
  border-radius: 4px 18px 18px 18px;
  box-shadow: var(--bubble-ai-shadow);
}
.time { font-size: 10px; color: var(--subtext); margin-top: 3px; min-height: 12px; }

.bubble.typing { padding: 14px 16px; display: flex; gap: 5px; }
.dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--dot);
  animation: bounce 600ms ease-in-out infinite alternate;
}
.dot:nth-child(2) { animation-delay: 150ms; }
.dot:nth-child(3) { animation-delay: 300ms; }
@keyframes bounce { from { transform: translateY(0); } to { transform: translateY(-7px); } }

.notice { text-align: center; font-size: 11px; color: var(--subtext); margin: -6px 0 14px; }
.row.user + .notice, .bubble-col .notice { margin-top: 4px; }
.link {
  background: none; border: none; padding: 0 0 0 8px; font: inherit;
  color: var(--accent); cursor: pointer;
}

/* ── 输入栏 ── */
.inputbar {
  flex: none;
  background: var(--header);
  border-top: 0.5px solid var(--border);
  padding: 8px 14px;
}
.inputbar-inner { display: flex; gap: 8px; align-items: flex-end; }
/* 阿粲 40 高、上移 4；星星 24×24 贴输入框右侧 10（照 _ChatPageState 输入栏）。 */
.acan { flex: none; height: 40px; transform: translateY(-4px); user-select: none; -webkit-user-drag: none; }
.input-wrap { flex: 1; position: relative; display: flex; min-width: 0; }
.star {
  position: absolute; right: 10px; bottom: 7px; width: 24px; height: 24px;
  user-select: none; -webkit-user-drag: none;
}
.input {
  flex: 1; resize: none; font: inherit; font-size: 16px; line-height: 1.4;
  color: var(--text); background: var(--bg);
  border: 0.5px solid var(--border); border-radius: 18px; padding: 8px 40px 8px 14px;
  max-height: 160px; outline: none;
}
.send {
  flex: none; height: 38px; padding: 0 16px; border: none; border-radius: 19px;
  background: var(--accent); color: #fff; font: inherit; font-size: 15px; cursor: pointer;
}

/* ── 配对页 ── */
.pair { margin: auto; text-align: center; padding: 24px 16px; }
.pair-title { font-size: 17px; font-weight: 500; }
.pair-hint { font-size: 12px; color: var(--subtext); margin: 6px 0 18px; }
.pair-qr { width: 240px; height: 240px; image-rendering: pixelated; border-radius: 12px; }
.pair-fp { font-size: 28px; letter-spacing: 6px; margin-top: 14px; font-variant-numeric: tabular-nums; }
.pair-status { font-size: 12px; color: var(--subtext); margin-top: 8px; }
