:root {
  --brand: #ffe47e;
  --bg: #ffe47e;
  --text: #222222;
  --muted: #666666;
  --card: #f8f9fa;
  --border: #e5e7eb;
  --accent: #e0245e; /* 按钮强调色（红色），与背景区分 */
}

/* 深色模式（可切换） */
.theme-dark {
  --bg: #0f1419;
  --text: #e6e6e6;
  --muted: #8899a6;
  --card: #15202b;
  --border: #1f2b36;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg); color: var(--text);
}

.app-header {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo { width: 40px; height: 40px; border-radius: 8px; box-shadow: 0 0 0 3px var(--brand); }
.titles h1 { margin: 0; font-size: 18px; }
.subtitle { color: var(--muted); font-size: 12px; }
.actions { display: flex; align-items: center; gap: 12px; }
.theme-toggle { color: var(--muted); font-size: 12px; display:inline-flex; align-items:center; position: relative; margin-left: 22px; }

.container { max-width: 780px; margin: 0 auto; padding: 16px; }

.postbox { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.post-controls { display: grid; gap: 8px; }
.post-actions { display: flex; align-items: center; gap: 12px; }
.hint { color: var(--muted); font-size: 12px; }
.text { width: 100%; background: #fff; color: #222; border: 1px solid var(--border); padding: 8px; border-radius: 8px; }
.theme-dark .text { background: #0c1117; color: var(--text); }
.primary { background: var(--accent); color: #fff; border: none; padding: 8px 12px; border-radius: 999px; cursor: pointer; }
#btn-refresh-top { font-size: 16px; padding: 10px 16px; }

.timeline { margin-top: 16px; }
.feed { display: flex; flex-direction: column; gap: 12px; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 12px; display: grid; gap: 8px;
}
.card .meta { color: var(--muted); font-size: 12px; }
.card .content { white-space: pre-wrap; }
.card .actions { display: flex; align-items: center; gap: 16px; }
.like-btn,
.comment-btn {
  background: transparent; border: none; cursor: pointer; color: #bbb;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 14px; line-height: 1;
  border-radius: 999px; min-width: 40px; min-height: 40px;
}
.like-btn { font-size: 30px; }
.comment-btn { font-size: 28px; }
.like-btn.liked { color: #e0245e; }
.comment-input { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.comment-list { display: grid; gap: 6px; }
.comment-item { font-size: 13px; color: var(--text); }
.comment-item .by { color: var(--muted); margin-right: 6px; }

.app-footer { text-align: center; padding: 16px; color: var(--muted); }

/* 通用隐藏工具类 */
.hidden { display: none !important; }

/* 右下角返回顶部按钮 */
.float-top {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 48px;
  height: 48px;
  background: var(--accent); /* 与其它按钮一致的红色 */
  color: #fff;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px; /* 放大箭头 */
  line-height: 1;
  box-shadow: 0 6px 14px rgba(0,0,0,0.15);
  cursor: pointer;
}

/* 细微下移，使 ^ 视觉居中 */
.float-top .caret { display: inline-block; transform: translateY(2px); }

/* 透明、直径不大于 emoji 边长的反向遮罩：透明中心 + 蓝色环 */
.float-top::after {
  content: none;
}

/* 无限下拉触发器占位（移除按钮版） */
/* 加载更多按钮样式已移除，改由哨兵自动触发 */

/* 已看确认哨兵占位 */
#view-sentinel { height: 1px; }

/* 切换开关样式 */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .2s; border-radius: 24px; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; top: 3px; background-color: white; transition: .2s; border-radius: 50%; }
input:checked + .slider { background-color: var(--accent); }
input:checked + .slider:before { transform: translateX(20px); }

#bottom-loader {
  font-size: 16px;
  color: var(--text);
}

/* 主题开关左侧图标：浅色为太阳，深色为月亮 */
.theme-toggle::before {
  content: "☀️";
  position: absolute;
  left: -22px;
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
  font-size: 18px;
  line-height: 1;
  pointer-events: none;
  z-index: 1;
}
.theme-dark .theme-toggle::before {
  content: "🌙";
}