/* ============================================================
   猫语翻译官 · 暖色治愈系设计系统
   主色 蜜桃橙 | 奶油底 | 猫爪粉点缀 | 大圆角卡片流
   ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #FFF8F2;
  --surface: #FFFFFF;
  --surface-2: #FFF1E8;
  --primary: #FF8A65;
  --primary-deep: #F0734C;
  --primary-grad: linear-gradient(135deg, #FF8A65, #FFAB6E);
  --gold: #FFC46B;
  --pink: #FFD9CE;
  --mint: #9FD8CB;
  --ink: #4A3F3A;
  --ink-2: #6B5E57;
  --muted: #A08F85;
  --line: #F3E7DE;
  --danger: #E05B5B;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-pill: 999px;
  --shadow: 0 8px 28px rgba(240, 115, 76, .12);
  --shadow-sm: 0 3px 14px rgba(240, 115, 76, .09);
  --shadow-soft: 0 6px 20px rgba(90, 70, 60, .06);
}
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  background-image:
    radial-gradient(circle at 12% 4%, rgba(255, 196, 107, .10) 0, transparent 26%),
    radial-gradient(circle at 88% 12%, rgba(255, 138, 101, .08) 0, transparent 22%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
  padding-bottom: 88px;
}
.hidden { display: none !important; }

/* ---------- 顶栏（奶油白 · 胶囊 tab） ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 250, 245, .86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.logo { font-size: 21px; font-weight: 800; color: var(--ink); letter-spacing: .5px; }
.logo .paw { margin-right: 4px; }
nav { display: flex; gap: 4px; background: var(--surface-2); border-radius: var(--radius-pill); padding: 4px; }
.nav-link {
  color: var(--ink-2); text-decoration: none; padding: 7px 16px;
  border-radius: var(--radius-pill); font-size: 14px; font-weight: 600;
  transition: all .2s;
}
.nav-link.active { background: var(--primary-grad); color: #fff; box-shadow: 0 4px 12px rgba(255,138,101,.4); }
.nav-link:not(.active):hover { color: var(--primary-deep); }

main { max-width: 700px; margin: 0 auto; padding: 16px 14px 0; }

/* ---------- 通用卡片 ---------- */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(255, 255, 255, .7);
}
.card h2 { font-size: 18px; font-weight: 800; color: var(--ink); margin-bottom: 12px; }
.sub { font-size: 12px; color: var(--muted); font-weight: 400; }

/* ---------- 按钮 ---------- */
.btn {
  border: none; border-radius: var(--radius-pill); padding: 11px 24px;
  font-size: 15px; font-weight: 700; cursor: pointer; transition: all .18s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--primary-grad); color: #fff; box-shadow: 0 6px 16px rgba(255,138,101,.35); }
.btn-outline { background: var(--surface); border: 2px solid var(--primary); color: var(--primary-deep); }
.btn-ghost { background: transparent; color: var(--ink-2); }

/* 悬浮发布按钮 */
.fab {
  position: fixed; right: 22px; bottom: 26px; z-index: 50;
  width: 62px; height: 62px; border-radius: 50%;
  background: var(--primary-grad); color: #fff;
  border: none; font-size: 34px; cursor: pointer;
  box-shadow: 0 10px 28px rgba(255,138,101,.45);
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s;
}
.fab:active { transform: scale(.92); }

/* ---------- 分类标签栏 ---------- */
.cat-bar {
  display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.cat-bar::-webkit-scrollbar { display: none; }
.cat-pill {
  flex-shrink: 0; padding: 8px 18px; border-radius: var(--radius-pill);
  background: var(--surface); color: var(--ink-2); font-size: 13px; font-weight: 600;
  cursor: pointer; border: 1px solid var(--line); transition: all .18s;
}
.cat-pill.active { background: var(--primary-grad); color: #fff; border-color: transparent; box-shadow: 0 4px 12px rgba(255,138,101,.35); }

/* ---------- 帖子卡片流 ---------- */
.post-card {
  background: var(--surface); border-radius: var(--radius-lg);
  overflow: hidden; margin-bottom: 16px; cursor: pointer;
  box-shadow: var(--shadow-sm); border: 1px solid rgba(255,255,255,.8);
  transition: transform .15s, box-shadow .2s;
}
.post-card:active { transform: scale(.99); }
.media-wrap { position: relative; }
.media-wrap video { width: 100%; display: block; aspect-ratio: 16/9; object-fit: cover; background: #000; }
/* 音频卡 */
.audio-card {
  background: var(--primary-grad); padding: 22px 20px;
  display: flex; align-items: center; gap: 16px; color: #fff;
}
.audio-card .play {
  width: 52px; height: 52px; border-radius: 50%; border: none; flex-shrink: 0;
  background: rgba(255,255,255,.25); color: #fff; font-size: 22px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; backdrop-filter: blur(4px);
}
.audio-card .eq { flex: 1; display: flex; align-items: center; gap: 3px; height: 40px; }
.audio-card .eq i {
  width: 4px; border-radius: 2px; background: rgba(255,255,255,.7);
  animation: eqbar 1s ease-in-out infinite;
}
.audio-card .eq i:nth-child(2n) { animation-delay: .2s; }
.audio-card .eq i:nth-child(3n) { animation-delay: .4s; }
@keyframes eqbar { 0%,100% { height: 8px; } 50% { height: 34px; } }
.audio-card.paused .eq i { animation-play-state: paused; height: 12px; }
.audio-card .dur { font-size: 13px; font-weight: 600; opacity: .9; }

.post-body { padding: 14px 18px 12px; }
.post-title { font-size: 17px; font-weight: 800; color: var(--ink); line-height: 1.45; }
.post-desc { font-size: 14px; color: var(--ink-2); margin-top: 6px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-meta {
  display: flex; align-items: center; gap: 10px; margin-top: 12px;
  padding-top: 10px; border-top: 1px solid var(--line);
}
.avatar {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  background: var(--pink); color: var(--primary-deep);
  display: flex; align-items: center; justify-content: center; font-size: 13px;
}
.meta-name { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.meta-time { font-size: 12px; color: var(--muted); }
.meta-spacer { flex: 1; }
.tag-pill {
  font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: var(--radius-pill);
  background: var(--surface-2); color: var(--primary-deep);
}
.reply-count { font-size: 13px; color: var(--muted); font-weight: 600; }

/* ---------- 弹层（详情 / 发帖） ---------- */
.mask {
  position: fixed; inset: 0; z-index: 60; background: rgba(60,40,30,.5);
  backdrop-filter: blur(4px); display: flex; align-items: flex-end; justify-content: center;
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.sheet {
  width: 100%; max-width: 700px; max-height: 92vh; overflow-y: auto;
  background: var(--bg); border-radius: 26px 26px 0 0; padding: 18px 18px 30px;
  animation: slideUp .28s cubic-bezier(.2,.9,.3,1);
}
@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-handle { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 14px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sheet-title { font-size: 19px; font-weight: 800; color: var(--ink); }
.sheet-close {
  width: 34px; height: 34px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--surface); color: var(--ink-2); font-size: 16px;
  box-shadow: var(--shadow-sm);
}

/* 详情媒体 */
.detail-media { border-radius: var(--radius-md); overflow: hidden; margin-bottom: 14px; background: #000; }
.detail-media video { width: 100%; display: block; max-height: 60vh; }
.detail-title { font-size: 20px; font-weight: 800; color: var(--ink); }
.detail-meta { display: flex; align-items: center; gap: 8px; margin: 8px 0 12px; }
.detail-desc { font-size: 15px; color: var(--ink-2); line-height: 1.8; padding: 12px 14px;
  background: var(--surface); border-radius: var(--radius-md); }

/* 回帖 */
.reply-head { font-size: 15px; font-weight: 800; color: var(--ink); margin: 20px 0 12px; display: flex; align-items: center; gap: 6px; }
.reply-list { display: flex; flex-direction: column; gap: 10px; }
.reply-item { background: var(--surface); border-radius: var(--radius-md); padding: 12px 14px; }
.reply-row { display: flex; align-items: center; gap: 8px; }
.reply-name { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.reply-time { font-size: 11px; color: var(--muted); }
.reply-content { font-size: 14px; color: var(--ink); margin-top: 6px; line-height: 1.6; }

/* 回帖输入 */
.reply-form { display: flex; gap: 8px; margin-top: 14px; }
.reply-form input {
  flex: 1; border: none; background: var(--surface); border-radius: var(--radius-pill);
  padding: 12px 18px; font-size: 14px; color: var(--ink);
  box-shadow: var(--shadow-sm); outline: none;
}
.reply-form .send { border: none; border-radius: var(--radius-pill); padding: 12px 22px;
  background: var(--primary-grad); color: #fff; font-size: 14px; font-weight: 700; cursor: pointer; }

/* ---------- 发帖表单 ---------- */
.form-field { margin-bottom: 14px; }
.form-label { font-size: 13px; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; display: block; }
.form-input {
  width: 100%; border: 2px solid var(--line); border-radius: var(--radius-md);
  padding: 12px 14px; font-size: 15px; color: var(--ink); background: var(--surface); outline: none;
  transition: border .2s;
}
.form-input:focus { border-color: var(--primary); }
textarea.form-input { min-height: 96px; resize: vertical; line-height: 1.7; }
select.form-input { appearance: none; }
.upload-zone {
  border: 2px dashed #F0CDB8; border-radius: var(--radius-md); padding: 26px 14px;
  text-align: center; color: var(--muted); font-size: 14px; cursor: pointer;
  background: var(--surface-2); transition: border .2s;
}
.upload-zone:hover { border-color: var(--primary); }
.upload-zone .big { font-size: 34px; display: block; margin-bottom: 6px; }
.file-preview { margin-top: 10px; border-radius: var(--radius-md); overflow: hidden; }
.file-preview video { width: 100%; display: block; max-height: 240px; }
.file-preview .fname { font-size: 12px; color: var(--muted); padding: 6px 10px; background: var(--surface); }

/* ---------- 翻译页录音 ---------- */
.hero-card { text-align: center; }
.mic-wrap { position: relative; width: 132px; height: 132px; margin: 6px auto 10px; }
.mic-btn {
  position: relative; z-index: 2; width: 108px; height: 108px; border-radius: 50%;
  border: none; cursor: pointer; background: var(--primary-grad); color: #fff; font-size: 42px;
  box-shadow: 0 10px 26px rgba(255,138,101,.4); display: flex; align-items: center; justify-content: center;
  transition: transform .08s;
}
.mic-btn:active { transform: scale(.95); }
.mic-btn.recording { background: linear-gradient(135deg, #F0734C, #E05B5B); }
.mic-btn:disabled { opacity: .5; cursor: not-allowed; }
.mic-pulse { position: absolute; inset: 0; border-radius: 50%; background: rgba(255,138,101,.2); opacity: 0; }
.mic-status { font-size: 15px; color: var(--primary-deep); font-weight: 700; min-height: 22px; }
.mic-timer { font-size: 13px; color: var(--gold); margin-top: 4px; }
.upload-row { margin-top: 16px; border-top: 1px dashed #F0CDB8; padding-top: 14px; }
.upload-or { font-size: 12px; color: var(--muted); display: block; margin-bottom: 8px; }
.upload-btn {
  display: inline-block; border: 2px solid var(--primary); color: var(--primary-deep);
  border-radius: var(--radius-pill); padding: 9px 24px; font-size: 14px; font-weight: 600; cursor: pointer;
}

/* ---------- 结果卡 ---------- */
.result-card { animation: pop .25s ease; text-align: center; }
@keyframes pop { from { transform: scale(.97); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.res-emoji { font-size: 56px; }
.res-name { font-size: 23px; font-weight: 800; color: var(--ink); margin-top: 4px; }
.res-emotion { color: var(--primary-deep); font-size: 14px; font-weight: 600; }
.res-meaning { font-size: 17px; margin: 10px 0 4px; color: var(--ink); }
.conf-row { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 10px 0 4px; }
.conf-label { font-size: 12px; color: var(--muted); }
.conf-bar { width: 55%; height: 9px; background: var(--pink); border-radius: 5px; overflow: hidden; }
.conf-fill { height: 100%; background: var(--primary-grad); }
.conf-num { font-size: 15px; font-weight: 800; color: var(--primary-deep); }
.res-reason { font-size: 12px; color: var(--muted); text-align: center; }
.res-block { margin-top: 14px; text-align: left; }
.res-label { font-size: 13px; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
.res-text { font-size: 14px; color: var(--ink-2); }
.scene-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.scene-tag { background: var(--surface-2); border: none; color: var(--primary-deep); border-radius: var(--radius-pill); padding: 4px 14px; font-size: 12px; font-weight: 600; }
.res-others { margin-top: 12px; border-top: 1px dashed #F0CDB8; padding-top: 10px; text-align: left; }
.other-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.other-row:last-child { border-bottom: none; }
.other-conf { color: var(--primary-deep); font-size: 13px; font-weight: 700; }
.res-actions { margin-top: 16px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------- 知识库 ---------- */
.db-item { border-bottom: 1px solid var(--line); }
.db-item:last-child { border-bottom: none; }
.db-head { display: flex; align-items: center; padding: 10px 0; cursor: pointer; }
.db-emoji { font-size: 28px; margin-right: 12px; }
.db-mid { flex: 1; }
.db-name { font-size: 15px; font-weight: 700; color: var(--ink); }
.db-emotion { font-size: 12px; color: var(--primary-deep); }
.db-arrow { color: var(--muted); transition: transform .2s; }
.db-detail { padding: 0 2px 12px; }
.db-label { font-size: 12px; color: var(--muted); margin-top: 8px; font-weight: 600; }
.db-text { font-size: 13px; color: var(--ink-2); }

/* ---------- 采集页 ---------- */
.form-row { display: flex; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.form-row:last-child { border-bottom: none; }
.form-label-2 { width: 84px; font-size: 14px; color: var(--ink-2); font-weight: 600; }
select, .form-input-2 { flex: 1; font-size: 14px; color: var(--primary-deep); border: none; background: transparent; padding: 6px 0; outline: none; }
.collect-rec-btn { width: 100%; padding: 16px; border-radius: var(--radius-pill); border: none;
  background: var(--primary-grad); color: #fff; font-size: 16px; font-weight: 700; cursor: pointer;
  box-shadow: 0 6px 16px rgba(255,138,101,.35); }
.collect-rec-btn.rec { background: linear-gradient(135deg, #F0734C, #E05B5B); }
.sample-row { display: flex; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.sample-emoji { font-size: 24px; margin-right: 10px; }
.sample-mid { flex: 1; }
.sample-name { font-size: 14px; font-weight: 700; }
.sample-meta { font-size: 11px; color: var(--muted); }
.sample-del { color: var(--danger); cursor: pointer; font-size: 18px; padding: 4px 8px; }
.toolbar { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.tool-btn { flex: 1; min-width: 140px; padding: 11px; border-radius: var(--radius-pill); border: none; font-size: 13px; font-weight: 700; cursor: pointer; }
.tool-btn.primary { background: var(--primary-grad); color: #fff; }
.tool-btn.gold { background: var(--gold); color: #fff; }
.tool-btn.danger { background: var(--surface); border: 2px solid var(--danger); color: var(--danger); }

/* ---------- 状态 ---------- */
.empty-state { text-align: center; padding: 46px 0; }
.empty-state .big { font-size: 56px; }
.empty-state .txt { color: var(--muted); margin-top: 10px; font-size: 14px; }
.loading { text-align: center; color: var(--muted); padding: 30px; font-size: 14px; }

.footer { text-align: center; color: var(--muted); font-size: 12px; margin-top: 24px; }
