/* ============================================================
   iCity 私人日记 —— iOS 风格样式（Liquid Glass / SF Pro 语汇）
   要点：毛玻璃材质、大圆角、SF Pro + 苹方字体、44px 触控目标、
         系统蓝 #007AFF、支持深色模式与 iPhone 安全区
   ============================================================ */

:root {
  /* —— 材质 —— */
  --surface: rgba(255, 255, 255, 0.72);
  --surface-strong: rgba(255, 255, 255, 0.88);
  --surface-solid: #ffffff;
  --hairline: rgba(0, 0, 0, 0.08);
  --glass-blur: saturate(180%) blur(24px);

  /* —— 文字 —— */
  --text: #1c1c1e;
  --text-secondary: #3c3c43;
  --muted: #8e8e93;
  --muted-2: #aeaeb2;

  /* —— 强调色（iOS system blue）—— */
  --blue: #007aff;
  --blue-dark: #0060df;
  --green: #34c759;
  --green-text: #248a3d;
  --orange: #ff9500;
  --orange-text: #b25000;
  --red: #ff3b30;

  /* —— 圆角 —— */
  --r-card: 22px;
  --r-inner: 16px;
  --r-btn: 12px;
  --r-pill: 999px;

  /* —— 字号（较上一版整体放大）—— */
  /* 2026-10-04：日记正文 17→18、评论正文 15→16（各增大一号）。
     注意 --fs-comment 同时驱动评论输入框；16px 还有个副作用：
     iOS Safari 对 <16px 的输入框会自动放大页面，升到 16px 可以消除聚焦时的跳动。 */
  --fs-body: 18px;
  --fs-comment: 16px;
  --fs-secondary: 15px;
  --fs-caption: 13px;

  /* —— 内嵌分组底色（评论区的“inset group”质感）—— */
  --inset: rgba(120, 120, 128, 0.07);
  --inset-strong: rgba(120, 120, 128, 0.12);

  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.04), 0 10px 30px rgba(0, 0, 0, 0.05);
  --shadow-btn: 0 2px 10px rgba(0, 122, 255, 0.30);
}

@media (prefers-color-scheme: dark) {
  :root {
    --surface: rgba(28, 28, 30, 0.70);
    --surface-strong: rgba(44, 44, 46, 0.86);
    --surface-solid: #1c1c1e;
    --hairline: rgba(255, 255, 255, 0.12);
    --text: #f5f5f7;
    --text-secondary: #ebebf5;
    --muted: #98989f;
    --muted-2: #6e6e73;
    --blue: #0a84ff;
    --blue-dark: #409cff;
    --green-text: #4ddb7a;
    --orange-text: #ffb340;
    --red: #ff453a;
    --inset: rgba(255, 255, 255, 0.05);
    --inset-strong: rgba(255, 255, 255, 0.10);
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px rgba(0, 0, 0, 0.34);
    --shadow-btn: 0 2px 10px rgba(10, 132, 255, 0.34);
  }
}

* { box-sizing: border-box; }

/* [hidden] 是 UA 样式表里的 display:none，优先级低于作者样式。
   本项目多处给元素设了 display:flex / inline-flex（.reply-box、.btn），
   会直接把 hidden 属性顶掉，导致「回复框」和「载入更多」永远可见。
   这里统一提升优先级，让 hidden 属性始终生效。 */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
               "Helvetica Neue", "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", sans-serif;
  font-size: var(--fs-body);
  line-height: 1.5;
  color: var(--text);
  background-color: #f7f7f9;
  /* 柔和网格渐变，模拟 iOS 壁纸质感（更淡，保持“清新”） */
  background-image:
    radial-gradient(1100px 620px at 12% -8%, rgba(0, 122, 255, 0.10), transparent 60%),
    radial-gradient(900px 560px at 92% 4%, rgba(175, 82, 222, 0.09), transparent 62%),
    radial-gradient(1000px 700px at 60% 108%, rgba(52, 199, 89, 0.08), transparent 60%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}

@media (prefers-color-scheme: dark) {
  body {
    background-color: #000000;
    background-image:
      radial-gradient(1100px 620px at 12% -8%, rgba(10, 132, 255, 0.20), transparent 60%),
      radial-gradient(900px 560px at 92% 4%, rgba(175, 82, 222, 0.18), transparent 62%),
      radial-gradient(1000px 700px at 60% 108%, rgba(255, 149, 0, 0.12), transparent 60%);
  }
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 720px; margin: 0 auto; padding: 0 20px; }
.container.narrow { max-width: 420px; }

/* ---------- 玻璃卡片 ---------- */

.card,
.entry,
.composer,
.nav {
  background: var(--surface);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 0.5px solid var(--hairline);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
}

/* ---------- 按钮 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 20px;
  font-size: var(--fs-secondary);
  font-weight: 590;
  font-family: inherit;
  border: none;
  border-radius: var(--r-btn);
  background: var(--surface-strong);
  color: var(--blue);
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.12s ease, background-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { text-decoration: none; background: var(--surface-solid); }
.btn:active { transform: scale(0.97); opacity: 0.85; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 2px 10px rgba(0, 122, 255, 0.28);
}
.btn-primary:hover { background: var(--blue-dark); color: #fff; }

.btn-ghost {
  background: rgba(120, 120, 128, 0.12);
  color: var(--text-secondary);
}
.btn-ghost:hover { background: rgba(120, 120, 128, 0.2); color: var(--text); }

.btn-sm { min-height: 34px; padding: 0 14px; font-size: var(--fs-caption); border-radius: var(--r-pill); }

.btn-link {
  min-height: 32px;
  padding: 0;
  background: none;
  color: var(--blue);
  font-size: var(--fs-caption);
  font-weight: 400;
}
.btn-link:hover { background: none; text-decoration: underline; }
.btn-link:active { color: var(--red); }

/* ---------- 纯图标发送按钮（iMessage 语汇：圆形蓝底 + 向上箭头）---------- */

.send-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: var(--r-pill);
  background: var(--blue);
  color: #fff;
  cursor: pointer;
  box-shadow: var(--shadow-btn);
  transition: transform 0.12s ease, opacity 0.15s ease, background-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.send-btn:hover { background: var(--blue-dark); }
.send-btn:active { transform: scale(0.88); opacity: 0.85; }
.send-btn:disabled { opacity: 0.35; cursor: not-allowed; box-shadow: none; }
.send-btn svg { display: block; pointer-events: none; }

.send-btn-sm { width: 32px; height: 32px; box-shadow: 0 1px 6px rgba(0, 122, 255, 0.24); }
.send-btn-sm svg { width: 15px; height: 15px; }

.fit-width { width: 100%; }
.inline-form { display: inline; margin: 0; }

/* ---------- 表单 ---------- */

.form-control,
.meta-input,
.search-input,
.comment-input {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  font-size: var(--fs-secondary);
  font-family: inherit;
  color: var(--text);
  background: rgba(120, 120, 128, 0.1);
  border: 0.5px solid transparent;
  border-radius: var(--r-btn);
  outline: none;
  transition: border-color 0.15s, background-color 0.15s;
}
.form-control::placeholder,
.meta-input::placeholder,
.search-input::placeholder,
.comment-input::placeholder { color: var(--muted-2); }
.form-control:focus,
.meta-input:focus,
.search-input:focus,
.comment-input:focus {
  border-color: var(--blue);
  background: var(--surface-strong);
}
.form-group { margin-bottom: 12px; }

.alert {
  padding: 12px 14px;
  margin-bottom: 14px;
  border-radius: var(--r-inner);
  font-size: var(--fs-caption);
  background: rgba(255, 59, 48, 0.1);
  color: var(--red);
  border: 0.5px solid rgba(255, 59, 48, 0.25);
}

.pt10 { padding-top: 10px; }
.pt20 { padding-top: 20px; }
.pt40 { padding-top: 40px; }

/* ---------- 落地页 ---------- */

.icty-welcome .head { padding: 72px 0 40px; text-align: center; }
.logo-mark {
  display: inline-block;
  font-size: 56px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--blue);
  line-height: 1;
}
.logo-mark span { color: var(--text); }
.logo-mark.small { font-size: 38px; }
.icty-welcome h2 {
  margin: 14px 0 0;
  font-size: var(--fs-caption);
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.head-cells { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }
.cell {
  background: var(--surface);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 0.5px solid var(--hairline);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  padding: 24px;
  width: 360px;
  max-width: 100%;
  text-align: left;
}
.cell h4 { margin: 0 0 16px; font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
.cell p { margin: 0; font-size: var(--fs-caption); color: var(--muted); }

.checkbox.remember {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-caption);
  color: var(--muted);
  font-weight: 400;
  margin-top: 14px;
}

.features { list-style: none; margin: 28px 0 0; padding: 0; display: flex; gap: 16px; flex-wrap: wrap; }
.features li {
  flex: 1 1 220px;
  background: var(--surface);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 0.5px solid var(--hairline);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  padding: 22px;
}
.features h3 { margin: 0 0 2px; font-size: 19px; font-weight: 600; letter-spacing: -0.02em; }
.features h4 { margin: 0 0 10px; font-size: 11px; font-weight: 500; letter-spacing: 0.08em; color: var(--muted-2); text-transform: uppercase; }
.features p { margin: 0; font-size: var(--fs-caption); color: var(--muted); line-height: 1.6; }
.footer-note { margin: 28px 0 56px; text-align: center; font-size: 12px; color: var(--muted-2); }

/* ---------- 导航（毛玻璃吸顶 + 安全区）---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 30;
  border-radius: 0;
  border-top: none;
  border-left: none;
  border-right: none;
  padding-top: env(safe-area-inset-top);
}
.nav-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand-mark {
  color: #fff;
  background: var(--blue);
  border-radius: 8px;
  padding: 2px 8px;
  font-size: 18px;
}
.brand-text { color: var(--text); }
.nav-right { display: flex; align-items: center; gap: 14px; }
.nav-user { font-size: var(--fs-caption); color: var(--muted); }

/* ---------- 大标题（iOS Large Title）---------- */

.page-head { padding: 10px 4px 16px; }
.page-title {
  margin: 0;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.028em;
  line-height: 1.15;
  color: var(--text);
}
.page-sub { margin: 4px 0 0; font-size: var(--fs-caption); color: var(--muted); }

/* ---------- 主体 ---------- */

.app-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 20px calc(80px + env(safe-area-inset-bottom));
}

/* ---------- 撰写区 ---------- */

.composer { padding: 20px 22px; margin-bottom: 20px; }

.ctx-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  font-size: var(--fs-caption);
  color: var(--muted);
}
.ctx-item { white-space: nowrap; }
.ctx-hint { color: var(--muted-2); }

.composer-input {
  width: 100%;
  border: none;
  outline: none;
  resize: vertical;
  font-size: var(--fs-body);
  line-height: 1.65;
  color: var(--text);
  font-family: inherit;
  background: transparent;
  padding: 2px 0;
  min-height: 92px;
}
.composer-input::placeholder { color: var(--muted-2); }

.composer-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding-top: 14px;
  margin-top: 12px;
  border-top: 0.5px solid var(--hairline);
}
.composer-meta .meta-input { flex: 1 1 200px; min-width: 0; }

.composer-switches { display: flex; gap: 16px; flex-wrap: wrap; }

.composer-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 14px;
}
.spacer { flex: 1; }
.composer-status { font-size: var(--fs-caption); color: var(--muted); }

.previews { display: flex; gap: 8px; flex-wrap: wrap; }
.preview-item {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: var(--r-inner);
  overflow: hidden;
  border: 0.5px solid var(--hairline);
}
.preview-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.preview-remove {
  position: absolute;
  top: 0; right: 0;
  width: 22px; height: 22px;
  line-height: 20px;
  text-align: center;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  border: none;
  padding: 0;
  border-radius: 0 0 0 8px;
}

/* ---------- 开关 ---------- */

.switch {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: var(--fs-caption);
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
}
.switch input { width: 18px; height: 18px; margin: 0; accent-color: var(--blue); cursor: pointer; }

/* ---------- 搜索与标签（分段控件语汇）---------- */

.toolbar { margin-bottom: 18px; }
.search-form { display: flex; gap: 8px; }
.search-form .search-input { flex: 1; min-width: 0; border-radius: var(--r-pill); padding: 10px 18px; }
.search-form .btn { flex: 0 0 auto; border-radius: var(--r-pill); }

.tagbar { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.tag-chip {
  min-height: 34px;
  padding: 0 14px;
  font-size: var(--fs-caption);
  font-family: inherit;
  font-weight: 500;
  border: none;
  border-radius: var(--r-pill);
  background: rgba(120, 120, 128, 0.12);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.tag-chip:hover { background: rgba(120, 120, 128, 0.2); }
.tag-chip.active { background: var(--blue); color: #fff; }
.tag-chip .n { opacity: 0.65; margin-left: 5px; }

/* ---------- 统计（轻量胶囊，去掉卡片边框更清爽）---------- */

.stats {
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
  padding: 0 4px;
  margin-bottom: 18px;
  font-size: var(--fs-caption);
  color: var(--muted);
}
.stats b {
  color: var(--text);
  font-size: 20px;
  font-weight: 600;
  margin-right: 5px;
  letter-spacing: -0.02em;
}

/* ---------- 时间线 ---------- */

.timeline { display: flex; flex-direction: column; gap: 14px; }
.loading, .empty { text-align: center; color: var(--muted-2); padding: 48px 0; font-size: var(--fs-caption); }

.entry { padding: 20px 22px; }
.entry.is-pinned { box-shadow: var(--shadow-card), inset 3px 0 0 var(--orange); }

.entry-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
/* 日期与徽章成组，操作按钮靠右：窄屏时整组换行，不会被拆散 */
.entry-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1 1 auto;
  min-width: 0;
}
.entry-date { font-size: var(--fs-caption); color: var(--muted); }
.entry-date b { color: var(--text); font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }

.entry-badge {
  font-size: 12px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  background: var(--inset-strong);
  color: var(--muted);
  white-space: nowrap;
}
/* 已删除 .badge-pin：置顶不再出文字徽章，状态由右上角图钉图标点亮表达 */

/* 天气徽章：只显示图标（文字移入 title / aria-label 供悬停与读屏） */
.entry-badge.badge-wx {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.wx-icon { flex: 0 0 auto; opacity: 0.85; }

/* 操作按钮默认弱化，悬停显现（iOS “轻操作”语汇） */
.entry-actions {
  margin-left: auto;
  display: flex;
  gap: 2px;
  opacity: 0.45;
  transition: opacity 0.18s ease;
}
.entry:hover .entry-actions,
.entry:focus-within .entry-actions { opacity: 1; }
@media (hover: none) { .entry-actions { opacity: 1; } }

.entry-action {
  background: none;
  border: none;
  padding: 6px 10px;
  min-height: 32px;
  font-size: var(--fs-caption);
  font-family: inherit;
  color: var(--muted);
  cursor: pointer;
  border-radius: 8px;
}
/* 图标操作按钮：置顶 / 编辑 / 删除（32px 触控区，图标居中） */
.entry-action.icon-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
}
.entry-action.icon-btn svg { display: block; pointer-events: none; }
/* 已置顶：图标点亮为橙色 */
.entry-action.icon-btn.is-on {
  color: var(--orange-text);
  background: rgba(255, 149, 0, 0.14);
}
.entry-action.icon-btn.is-on:hover { background: rgba(255, 149, 0, 0.22); color: var(--orange-text); }
.entry-action.danger:hover { background: rgba(255, 59, 48, 0.1); color: var(--red); }

.entry-body {
  font-size: var(--fs-body);
  line-height: 1.65;
  white-space: pre-wrap;
  word-wrap: break-word;
  color: var(--text);
}
.entry-body.editing { display: none; }
.entry-edit {
  display: none;
  width: 100%;
  min-height: 110px;
  padding: 12px 14px;
  font-size: var(--fs-body);
  line-height: 1.6;
  font-family: inherit;
  color: var(--text);
  background: rgba(120, 120, 128, 0.1);
  border: 0.5px solid transparent;
  border-radius: var(--r-inner);
  resize: vertical;
  outline: none;
}
.entry-edit:focus { border-color: var(--blue); }
.entry.editing .entry-edit { display: block; }
.entry.editing .entry-body { display: none; }
.entry-edit-foot { display: none; gap: 10px; margin-top: 12px; }
.entry.editing .entry-edit-foot { display: flex; }

.entry-media {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  margin-top: 14px;
}
.entry-media img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: var(--r-inner);
  display: block;
  background: rgba(120, 120, 128, 0.1);
  cursor: zoom-in;
}
.entry-media.has-one img { height: 260px; }

.entry-tags { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.entry-tag {
  font-size: var(--fs-caption);
  color: var(--blue);
  background: rgba(0, 122, 255, 0.1);
  border-radius: var(--r-pill);
  padding: 5px 12px;
  cursor: pointer;
  border: none;
  font-family: inherit;
}
.entry-tag:hover { background: rgba(0, 122, 255, 0.18); }

.load-more-wrap { text-align: center; padding: 24px 0; }

/* ---------- 评论：内嵌分组（iOS inset grouped，不显示头像）---------- */

.comment-block {
  margin-top: 18px;
  padding: 14px 16px 16px;
  background: var(--inset);
  border-radius: var(--r-inner);
}
.comment-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 6px;
}
.comment-list, .comment-children { list-style: none; margin: 0; padding: 0; }
.comment-children {
  margin: 8px 0 0;
  padding-left: 12px;
  border-left: 1.5px solid var(--hairline);
}
.comment { padding: 9px 0; }


.comment-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: var(--fs-caption);
  margin-bottom: 3px;
}
/* 评论者名字：不加粗、字号小于正文，不与评论内容抢注意力 */
.comment-head b,
.comment-head .comment-who {
  color: var(--muted);
  font-weight: 400;
  font-size: 13px;
}
.comment-time { color: var(--muted-2); font-size: 12px; }

.comment-reply, .comment-del {
  background: none;
  border: none;
  padding: 4px 7px;
  font-size: 12px;
  font-family: inherit;
  color: var(--muted-2);
  cursor: pointer;
  border-radius: 6px;
}
.comment-reply { margin-left: auto; }
.comment-reply:hover { background: rgba(0, 122, 255, 0.1); color: var(--blue); }
.comment-del:hover { background: rgba(255, 59, 48, 0.1); color: var(--red); }

.comment-body {
  font-size: var(--fs-comment);
  line-height: 1.62;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-wrap: break-word;
}
.comment-empty { font-size: var(--fs-caption); color: var(--muted-2); margin: 4px 0 8px; }

/* 输入行：胶囊输入框 + 圆形图标发送按钮 */
.comment-form { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.comment-form .comment-input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 40px;
  padding: 9px 18px;
  border-radius: var(--r-pill);
  font-size: var(--fs-comment);
}
.reply-box { display: flex; gap: 8px; align-items: center; margin: 8px 0 2px; }
.reply-box .comment-input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 34px;
  padding: 6px 14px;
  font-size: var(--fs-comment);
  border-radius: var(--r-pill);
}

/* ---------- 局部更新的过渡动画（让增删改「无感」）---------- */

@keyframes comment-flash {
  from { background: rgba(0, 122, 255, 0.14); }
  to   { background: transparent; }
}
.comment.is-new {
  animation: comment-flash 1.3s ease-out;
  border-radius: 10px;
}

@keyframes entry-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}
.entry.is-new { animation: entry-in 0.28s ease-out; }

/* 用户开启「减弱动态效果」时不播放动画 */
@media (prefers-reduced-motion: reduce) {
  .comment.is-new, .entry.is-new { animation: none; }
}

/* ---------- 公开主页 ---------- */

.profile-head { padding: 10px 4px 18px; margin-bottom: 0; }
.profile-name {
  margin: 0 0 4px;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.028em;
  line-height: 1.15;
}
.profile-meta { margin: 3px 0; font-size: var(--fs-caption); color: var(--muted); }

/* ---------- 提示与灯箱 ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(28px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: rgba(28, 28, 30, 0.9);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  color: #fff;
  padding: 12px 22px;
  border-radius: var(--r-pill);
  font-size: var(--fs-caption);
  font-weight: 500;
  z-index: 100;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  cursor: zoom-out;
}
.lightbox img { max-width: 92vw; max-height: 92vh; border-radius: var(--r-inner); }

/* ---------- iPhone 适配 ---------- */

@media (max-width: 640px) {
  .icty-welcome .head { padding: 48px 0 32px; }
  .app-inner { padding: 14px 12px calc(72px + env(safe-area-inset-bottom)); }

  /* 手机端：纵向留白加大、字号与控件略收，减轻拥挤感 */
  .timeline { gap: 12px; }
  .entry { padding: 18px 15px; border-radius: var(--r-inner); }
  .entry-head { margin-bottom: 14px; row-gap: 8px; }
  .entry-meta { gap: 5px; }
  .entry-date { font-size: 12px; }
  .entry-badge { font-size: 11px; padding: 3px 8px; }
  .entry-body { line-height: 1.75; }
  .entry-edit { min-height: 96px; }

  .composer { padding: 16px 15px; border-radius: var(--r-inner); }
  .composer-meta { gap: 10px; }
  .composer-switches { gap: 14px; }

  .comment-block { padding: 12px 12px 14px; margin-top: 16px; }
  .comment { padding: 10px 0; }
  .comment-body { line-height: 1.7; }
  .comment-children { padding-left: 10px; margin-top: 6px; }

  .cell { width: 100%; }
  .features { flex-direction: column; }
  .stats { gap: 16px; }
  .page-title { font-size: 28px; }
  .entry-media { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  .entry-actions { opacity: 1; }
}

.muted-note { font-size: var(--fs-caption); color: var(--muted-2); }

/* ---------- 语音：录音按钮 / 状态条 / 播放条 ---------- */

/* 录音入口：与发送按钮同尺寸的圆形图标按钮 */
.rec-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: var(--r-pill);
  background: rgba(120, 120, 128, 0.12);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, transform 0.12s;
  -webkit-tap-highlight-color: transparent;
}
.rec-btn:hover { background: rgba(120, 120, 128, 0.2); }
.rec-btn:active { transform: scale(0.94); }
.rec-btn svg { display: block; pointer-events: none; }
.rec-btn-sm { width: 34px; height: 34px; }

/* 正在录音：变红并呼吸 */
.rec-btn.is-rec {
  background: rgba(255, 59, 48, 0.16);
  color: var(--red);
  animation: rec-pulse 1.2s ease-in-out infinite;
}
@keyframes rec-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.35); }
  50%      { box-shadow: 0 0 0 6px rgba(255, 59, 48, 0); }
}

/* 撰写区的录音按钮带文字，做成胶囊 */
.composer-foot .rec-btn {
  width: auto;
  height: 34px;
  padding: 0 14px;
  gap: 6px;
  font-size: var(--fs-caption);
  font-family: inherit;
  border-radius: var(--r-pill);
}

/* 顶部录音状态条 */
.rec-bar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 8px 14px;
  border-radius: var(--r-pill);
  background: var(--surface-strong);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 0.5px solid var(--hairline);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
  color: var(--text);
  font-size: var(--fs-secondary);
}
.rec-bar .btn { min-height: 30px; padding: 0 14px; font-size: var(--fs-caption); }
.rec-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--red);
  animation: rec-pulse 1.2s ease-in-out infinite;
}
.rec-time { font-variant-numeric: tabular-nums; min-width: 40px; }

/* 播放条：圆形播放键 + 进度轨 + 时长，下方可选一行转写文字 */
.audio-player {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 380px;
  margin: 8px 0 2px;
  padding: 7px 12px 7px 8px;
  border-radius: var(--r-inner);
  background: var(--inset);
}
.audio-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.audio-play {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.audio-play:active { transform: scale(0.94); }
.audio-play svg { display: block; pointer-events: none; }
/* 默认显示三角；播放中换成双竖条（两个图标都在 DOM 里，靠 CSS 切换） */
.audio-play .i-pause { display: none; }
.audio-player.playing .audio-play .i-play { display: none; }
.audio-player.playing .audio-play .i-pause { display: block; }

.audio-track {
  flex: 1 1 auto;
  min-width: 60px;
  /* 轨道本身只有 5px 高，手指很难点中；用上下 padding 撑出 20px 的可点区域，
     视觉高度靠内部那条 .audio-fill 保持纤细 */
  height: 20px;
  display: flex;
  align-items: center;
  cursor: pointer;
  touch-action: none;   /* 拖动时不要触发页面滚动 */
}
.audio-track::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 5px;
  border-radius: 999px;
  background: rgba(120, 120, 128, 0.22);
  pointer-events: none;
}
.audio-track { position: relative; }
.audio-fill {
  position: relative;
  width: 0%;
  height: 5px;
  border-radius: 999px;
  background: var(--blue);
  transition: width 0.1s linear;
}
/* 拖动中：加粗轨道并去掉过渡，让手感跟手 */
.audio-player.scrubbing .audio-track::before { height: 7px; }
.audio-player.scrubbing .audio-fill { height: 7px; transition: none; }
.audio-time {
  flex: 0 0 auto;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* 语音转写文字（ASR 结果）：跟着播放条，字号比正文小一档，作为附注存在 */
.audio-transcript {
  margin: 2px 0 2px 2px;
  padding-left: 8px;
  border-left: 2px solid rgba(0, 122, 255, 0.35);
  font-size: var(--fs-caption);
  line-height: 1.6;
  color: var(--muted);
  white-space: pre-wrap;
  word-break: break-word;
}
.asr-tag {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(0, 122, 255, 0.12);
  color: var(--blue);
  font-size: 11px;
  vertical-align: 1px;
}

/* 待提交的语音附件（撰写区 / 评论框下方） */
.audio-preview,
.comment-audio {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.audio-preview:empty,
.comment-audio:empty { display: none; }
.audio-remove {
  border: none;
  background: none;
  padding: 4px 8px;
  font-family: inherit;
  font-size: 12px;
  color: var(--red);
  cursor: pointer;
  border-radius: 6px;
}
.audio-remove:hover { background: rgba(255, 59, 48, 0.1); }

@media (prefers-reduced-motion: reduce) {
  .rec-btn.is-rec, .rec-dot { animation: none; }
}

/* 系统开启「增强对比 / 减弱透明效果」时退化为不透明 */
@media (prefers-reduced-transparency: reduce) {
  .card, .entry, .composer, .nav, .cell, .features li {
    background: var(--surface-solid);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}
