:root {
  --bg: #0f1419;
  --bg2: #1a222d;
  --card: #232d3b;
  --line: #2f3b4c;
  --text: #e8eef6;
  --muted: #8b9bb0;
  --accent: #3dd6c6;
  --accent2: #5b8cff;
  --danger: #ff6b7a;
  --ok: #6bcf7f;
  --radius: 14px;
  --tab-h: 58px;
  font-family: "SF Pro Display", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
button, input, textarea { font: inherit; }
a { color: var(--accent); text-decoration: none; }
#app {
  min-height: 100%;
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  position: relative;
  background: var(--bg);
  box-shadow: 0 0 0 1px rgba(255,255,255,.04);
}

.screen { min-height: 100vh; display: flex; flex-direction: column; }
.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(61,214,198,.18), transparent 60%),
    radial-gradient(700px 400px at 100% 0%, rgba(91,140,255,.16), transparent 55%),
    var(--bg);
}
.auth-card {
  width: min(420px, 100%);
  background: rgba(26,34,45,.92);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px 24px;
  backdrop-filter: blur(10px);
}
.brand { font-size: 26px; font-weight: 700; letter-spacing: .02em; line-height: 1.3; }
.brand span { color: var(--accent); }
.sub { color: var(--muted); margin: 8px 0 22px; font-size: 14px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  padding: 12px 12px;
  outline: none;
}
.field input:focus, .field textarea:focus { border-color: var(--accent); }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; border: 0; border-radius: 10px; padding: 12px 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #041018; font-weight: 700; cursor: pointer; width: 100%;
}
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); font-weight: 500; }
.btn.sm { width: auto; padding: 8px 12px; font-size: 13px; }
.err { color: var(--danger); font-size: 13px; min-height: 18px; margin: 8px 0; }
.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tabs button {
  flex: 1; background: var(--bg); border: 1px solid var(--line); color: var(--muted);
  border-radius: 999px; padding: 8px; cursor: pointer;
}
.tabs button.on { color: var(--text); border-color: var(--accent); }

.top {
  position: sticky; top: 0; z-index: 5;
  background: rgba(15,20,25,.9); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  padding: 14px 16px; display: flex; align-items: center; gap: 10px;
}
.top h1 { font-size: 18px; margin: 0; flex: 1; }
.search {
  margin: 12px 16px 0;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; display: flex; gap: 8px;
}
.search input { flex: 1; background: transparent; border: 0; color: var(--text); outline: none; }
.list { padding: 12px 16px calc(var(--tab-h) + 20px); display: grid; gap: 12px; }
.card-wrap {
  position: relative;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
}
.card-wrap .fav-btn {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  background: rgba(15,20,25,.72);
}
.card-wrap .thumb { border-radius: var(--radius) var(--radius) 0 0; }
.card {
  background: transparent; border: 0; border-radius: var(--radius);
  padding: 14px; cursor: pointer;
}
.card .thumb { margin: -14px -14px 12px; overflow: hidden; border-radius: var(--radius) var(--radius) 0 0; background: #0a0e13; }
.card .thumb img { width: 100%; max-height: 180px; object-fit: cover; display: block; }
.card .meta { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12px; margin-bottom: 8px; padding-right: 40px; }
.card .title { font-size: 16px; font-weight: 600; padding-right: 8px; }
.card .sum {
  color: var(--muted); font-size: 13px; margin-top: 6px; line-height: 1.5;
  white-space: pre-line;
  max-height: 4.5em; /* 约 3 行，保留换行 */
  overflow: hidden;
}
.detail .sum {
  color: var(--muted); font-size: 14px; margin-top: 10px; line-height: 1.55; white-space: pre-line;
}
.detail .body-text {
  margin-top: 12px; white-space: pre-wrap; line-height: 1.6;
}
.fav-btn {
  flex: 0 0 auto;
  width: 36px; height: 36px; padding: 0;
  border: 1px solid var(--line); border-radius: 10px;
  background: transparent; color: var(--muted);
  font-size: 18px; line-height: 1; cursor: pointer;
}
.fav-btn.on { color: #f5c542; border-color: #785e1a; background: rgba(245,197,66,.12); }
.fav-btn:disabled { opacity: .6; }
.top .fav-btn { margin-left: auto; background: transparent; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag { font-size: 11px; padding: 3px 8px; border-radius: 999px; background: #182230; color: var(--accent); border: 1px solid #2a3a4d; cursor: pointer; }
.tag:active { opacity: .8; }

.tabbar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 430px;
  height: var(--tab-h);
  box-sizing: border-box;
  background: rgba(15,20,25,.96);
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: stretch;
  backdrop-filter: blur(12px);
  padding: 0;
  margin: 0;
  z-index: 20;
}
.tabbar button {
  flex: 1 1 0%;
  min-width: 0;
  margin: 0;
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 0 8px;
  text-align: center;
}
.tabbar button.on { color: var(--accent); }
.tabbar .ico { font-size: 18px; line-height: 1; }

.detail { padding: 16px 16px calc(var(--tab-h) + 24px); }
.detail .hero {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px;
}
.detail .hero h2 {
  margin: 6px 0 0; font-size: 20px; font-weight: 600; line-height: 1.35; color: var(--text);
}
.detail .hero .meta { color: var(--muted); font-size: 12px; }
.detail img, .detail video { width: 100%; border-radius: 12px; margin-top: 12px; background: #000; }
.muted { color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 40px 16px; }

.chat-list .card .title { font-size: 15px; }
.chat-room { display: flex; flex-direction: column; height: calc(100vh - var(--tab-h)); }
.msgs { flex: 1; overflow: auto; padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.bubble {
  max-width: 78%; padding: 10px 12px; border-radius: 14px; line-height: 1.45; font-size: 14px;
  background: var(--card); border: 1px solid var(--line);
}
.bubble.me { align-self: flex-end; background: #1b3a3a; border-color: #2d5552; }
.composer {
  display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--bg2);
}
.composer input { flex: 1; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; color: var(--text); padding: 10px 12px; }
.composer button { width: auto; }

.profile { padding: 16px; }
.profile .box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
