/* 开源快看 · Web —— 小红书式图文浏览 */

:root {
  --red: #ff2442;
  --ink: #111418;
  --ink2: #55595f;
  --ink3: #86888c;
  --bg: #f7f8fa;
  --card: #ffffff;
  --line: #ececef;
  --green: #0f9d58;
  --orange: #f60;
  --gold: #b8860b;
  --radius: 18px;
  --shadow: 0 2px 14px rgba(17, 20, 26, 0.06);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; }

/* ---- 导航 ---- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 19px;
  font-weight: 900;
  letter-spacing: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.logo-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--red);
  margin-top: 6px;
}

.links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.links a {
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 15px;
  line-height: 20px;
  color: var(--ink2);
  cursor: pointer;
}

.links a:hover { background: #f0f1f4; }

.links a.on {
  background: var(--ink);
  color: #fff;
  font-weight: 600;
}

#auth-area {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 10px;
  height: 36px;
}

.user-chip {
  font-size: 13px;
  color: var(--ink);
  font-weight: 600;
  background: #f2f3f5;
  border-radius: 999px;
  padding: 8px 16px;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.login-link {
  font-size: 14px;
  font-weight: 600;
  color: #fff !important;
  background: var(--red);
  padding: 8px 20px !important;
  line-height: 20px;
}

.login-link:hover { background: #e91e3c !important; }

.logout-link {
  font-size: 13px;
  color: var(--ink3) !important;
  cursor: pointer;
  padding: 8px 6px !important;
  line-height: 20px;
}

.fav-pill {
  display: inline-block;
  min-width: 20px;
  text-align: center;
  font-size: 12px;
  background: var(--red);
  color: #fff;
  border-radius: 999px;
  padding: 1px 6px;
}

.links a.on .fav-pill { background: #fff; color: var(--red); }

/* ---- Hero ---- */

.hero {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 52px 24px 42px;
  text-align: center;
}

.hero h1 {
  font-size: 40px;
  font-weight: 900;
  letter-spacing: 1px;
}

.hero p {
  margin-top: 12px;
  font-size: 16px;
  color: var(--ink2);
}

.searchbox {
  max-width: 620px;
  margin: 28px auto 0;
  display: flex;
  background: #fff;
  border-radius: 999px;
  padding: 6px;
  box-shadow: 0 8px 32px rgba(17, 20, 26, 0.1);
}

.searchbox input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 16px;
  padding: 10px 20px;
  color: var(--ink);
}

.searchbox button {
  border: none;
  background: var(--red);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  border-radius: 999px;
  padding: 10px 28px;
  cursor: pointer;
}

.searchbox button:hover { filter: brightness(1.06); }

.quick {
  margin-top: 18px;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.quick button {
  border: 1px solid #e8eaed;
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink2);
  font-size: 13px;
  border-radius: 999px;
  padding: 7px 16px;
  cursor: pointer;
}

.quick button:hover { border-color: var(--red); color: var(--red); }

/* ---- 分类页签 ---- */

.chips {
  max-width: 1200px;
  margin: 20px auto 0;
  padding: 0 24px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.chip {
  border: none;
  background: #fff;
  color: var(--ink2);
  font-size: 14px;
  border-radius: 999px;
  padding: 8px 18px;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.chip.on {
  background: var(--ink);
  color: #fff;
  font-weight: 600;
}

/* ---- 每日精选横幅 ---- */

.pick-banner {
  max-width: 1200px;
  margin: 20px auto 0;
  padding: 0 24px;
}

.pick-banner .inner {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 10px 40px rgba(17, 20, 26, 0.14);
}

.pick-banner img {
  width: 100%;
  height: 240px;
  object-fit: cover;
}

.pick-banner .mask {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 22px 26px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.28) 0%, rgba(0, 0, 0, 0.55) 55%, rgba(0, 0, 0, 0.82) 100%);
  color: #fff;
}

.pick-banner .head { font-size: 13px; color: #ffd3da; }
.pick-banner .name { font-size: 22px; font-weight: 800; margin-top: 4px; }
.pick-banner .summary { font-size: 14px; opacity: 0.92; margin-top: 4px; }

/* ---- 瀑布流 ---- */

.hidden { display: none !important; }

.grid {
  max-width: 1140px;
  margin: 22px auto 0;
  padding: 0 24px;
  columns: 3 300px;
  column-gap: 20px;
}

.card {
  display: inline-block;
  width: 100%;
  margin-bottom: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  break-inside: avoid;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(17, 20, 26, 0.08);
}

.card .cover {
  width: 100%;
  min-height: 120px;
  background: #f0f2f5;
  object-fit: cover;
}

.card .cover-fallback {
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  font-weight: 800;
  color: #c3c9d1;
  background: #f6f7f9;
}

.card .body { padding: 14px 16px 10px; }

.card .summary {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.card .desc {
  margin-top: 6px;
  font-size: 12px;
  color: var(--ink3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card .tags {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 999px;
  background: #f2f3f5;
  color: var(--ink3);
}

.tag.green { background: #e5f8ec; color: var(--green); }
.tag.orange { background: #fff1e5; color: var(--orange); }
.tag.blue { background: #e8f1ff; color: #0969da; }

.card .footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px 14px;
}

.card .avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #eee;
}

.card .owner {
  font-size: 12px;
  color: var(--ink3);
  max-width: 40%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card .spacer { flex: 1; }

.card .stars { font-size: 12px; color: var(--gold); }

.heart {
  border: none;
  background: none;
  font-size: 18px;
  color: #c6c9cd;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.heart.on { color: var(--red); }

/* ---- 搜索结果条 ---- */

.results-bar {
  max-width: 1140px;
  margin: 20px auto 0;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 17px;
  font-weight: 700;
}

.results-bar a {
  font-size: 13px;
  font-weight: 500;
  color: var(--red);
  cursor: pointer;
  border: 1px solid #ffd3da;
  border-radius: 999px;
  padding: 4px 14px;
}

/* ---- 登录 / 注册弹窗 ---- */

.auth-card {
  max-width: 400px;
  padding: 30px 32px 26px;
}

.auth-title { font-size: 20px; font-weight: 800; }
.auth-sub { margin-top: 6px; font-size: 13px; color: var(--ink3); }

.auth-tabs {
  display: flex;
  gap: 8px;
  margin: 20px 0 16px;
  background: #f2f3f5;
  border-radius: 999px;
  padding: 4px;
}

.auth-tabs button {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 14px;
  color: var(--ink2);
  border-radius: 999px;
  padding: 8px 0;
  cursor: pointer;
}

.auth-tabs button.on {
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  box-shadow: var(--shadow);
}

.auth-card input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 15px;
  margin-bottom: 12px;
  outline: none;
}

.auth-card input:focus { border-color: var(--red); }

.auth-submit {
  width: 100%;
  border: none;
  background: var(--red);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  border-radius: 12px;
  padding: 13px 0;
  cursor: pointer;
  margin-top: 4px;
}

.auth-err {
  margin-top: 12px;
  font-size: 13px;
  color: var(--red);
  background: #fff0f3;
  border-radius: 10px;
  padding: 10px 14px;
}

/* ---- 加载与状态 ---- */

.sentinel { text-align: center; color: var(--ink3); font-size: 13px; padding: 24px 0 60px; }

.empty {
  text-align: center;
  color: var(--ink3);
  padding: 80px 20px;
  font-size: 15px;
}

.inline-link {
  color: var(--red);
  cursor: pointer;
  text-decoration: underline;
}

.error-box {
  max-width: 620px;
  margin: 40px auto;
  text-align: center;
  color: var(--ink2);
}

.error-box button {
  margin-top: 14px;
  border: none;
  background: var(--ink);
  color: #fff;
  border-radius: 999px;
  padding: 8px 26px;
  cursor: pointer;
}

/* ---- 精选页 ---- */

.page-wrap { max-width: 1200px; margin: 0 auto; padding: 24px 24px 60px; }

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 800;
  margin: 34px 0 14px;
}

.section-title::before {
  content: '';
  width: 4px;
  height: 18px;
  border-radius: 2px;
  background: var(--red);
}

.hint { font-size: 13px; color: var(--ink3); margin: -8px 0 16px; }

.hero-card {
  border-radius: 24px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 12px 44px rgba(255, 36, 66, 0.12);
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
}

.hero-card img { width: 50%; min-height: 260px; object-fit: cover; }

.hero-card .body {
  width: 50%;
  padding: 30px 34px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-card .name { font-size: 26px; font-weight: 900; }
.hero-card .summary { margin-top: 12px; font-size: 16px; line-height: 1.7; color: #444; }
.hero-card .meta { margin-top: 18px; display: flex; align-items: center; gap: 10px; }
.hero-card .stars { margin-left: auto; color: var(--gold); font-size: 14px; }

.trend-row {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.trend-card {
  flex: none;
  width: 300px;
  background: #fff;
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.trend-card:hover { box-shadow: 0 10px 30px rgba(17, 20, 26, 0.12); }

.trend-card .name {
  font-size: 15px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trend-card .summary {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink2);
  height: 42px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.trend-card .meta { margin-top: 12px; display: flex; align-items: center; gap: 12px; }
.trend-card .delta { color: var(--orange); font-size: 13px; font-weight: 700; }

.row-list .row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border-radius: 16px;
  padding: 14px 18px;
  margin-bottom: 12px;
  cursor: pointer;
}

.row-list .row:hover { box-shadow: var(--shadow); }

.row-list img { width: 44px; height: 44px; border-radius: 12px; background: #f0f2f5; }
.row-list .main { flex: 1; min-width: 0; }
.row-list .name { font-size: 15px; font-weight: 700; }
.row-list .summary {
  font-size: 13px;
  color: var(--ink3);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row-list .stars { font-size: 13px; color: var(--gold); }

/* ---- 聊天 ---- */

.chat-page {
  max-width: 780px;
  margin: 0 auto;
  padding: 24px 24px 0;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 60px - 50px);
}

.msgs { flex: 1; overflow-y: auto; padding-bottom: 16px; }

.chat-welcome { text-align: center; padding: 60px 20px 30px; }
.chat-welcome .emoji { font-size: 48px; }
.chat-welcome h2 { margin-top: 12px; font-size: 26px; }
.chat-welcome p { margin-top: 8px; color: var(--ink3); font-size: 14px; line-height: 1.7; }

.msg { margin-bottom: 18px; display: flex; flex-direction: column; }
.msg.user { align-items: flex-end; }
.msg.bot { align-items: flex-start; }

.bubble {
  max-width: 76%;
  padding: 12px 18px;
  border-radius: 18px;
  font-size: 15px;
  line-height: 1.65;
}

.bubble.user {
  background: var(--red);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.bubble.bot {
  background: #fff;
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow);
}

.recs { display: flex; gap: 12px; margin-top: 12px; overflow-x: auto; padding-bottom: 4px; }

.rec-card {
  flex: none;
  width: 230px;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.rec-card img { width: 100%; height: 110px; object-fit: cover; background: #f0f2f5; }
.rec-card .name { padding: 10px 12px 0; font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-card .summary {
  padding: 4px 12px 12px;
  font-size: 12px;
  color: var(--ink3);
  line-height: 1.5;
  height: 44px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.chat-inputbar {
  display: flex;
  gap: 12px;
  padding: 14px 0 20px;
}

.chat-inputbar input {
  flex: 1;
  border: none;
  outline: none;
  background: #fff;
  border-radius: 999px;
  padding: 13px 22px;
  font-size: 15px;
  box-shadow: var(--shadow);
}

.chat-inputbar button {
  border: none;
  background: var(--red);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  border-radius: 999px;
  padding: 0 30px;
  cursor: pointer;
}

.chat-inputbar button:disabled { opacity: 0.5; cursor: default; }

.chat-gate {
  max-width: 520px;
  margin: 90px auto;
  text-align: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 52px 40px;
}

.gate-title { font-size: 26px; font-weight: 800; }

.gate-sub {
  margin-top: 14px;
  color: var(--ink3);
  font-size: 14px;
  line-height: 1.9;
}

.gate-btn {
  margin-top: 26px;
  border: none;
  background: var(--red);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  border-radius: 999px;
  padding: 12px 44px;
  cursor: pointer;
}

.gate-btn:hover { filter: brightness(1.06); }

/* ---- 收藏页 ---- */

.fav-page { max-width: 900px; }

/* ---- 详情弹窗 ---- */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(17, 20, 26, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.modal.hidden { display: none; }

.modal-card {
  background: #fff;
  border-radius: 22px;
  max-width: 680px;
  width: 100%;
  max-height: 86vh;
  overflow-y: auto;
}

.modal-card img.cover { width: 100%; height: 280px; object-fit: cover; background: #f0f2f5; }

.modal-pad { padding: 24px 30px 30px; }

.modal-head { display: flex; align-items: center; gap: 14px; }

.modal-head .name {
  flex: 1;
  font-size: 24px;
  font-weight: 900;
  color: #0969da;
  word-break: break-all;
}

.fav-btn {
  border: 1px solid #d0d7de;
  background: #fff;
  color: var(--ink2);
  font-size: 14px;
  border-radius: 999px;
  padding: 8px 20px;
  cursor: pointer;
}

.fav-btn.on {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.modal-pad .tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; align-items: center; }
.modal-pad .stars { color: var(--gold); font-size: 14px; }

.modal-pad h3 {
  font-size: 13px;
  color: var(--ink3);
  font-weight: 500;
  margin: 22px 0 8px;
}

.modal-pad .big {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.7;
}

.modal-pad .audience { margin-top: 10px; font-size: 14px; color: var(--ink2); }
.modal-pad .origin { margin-top: 10px; font-size: 13px; color: var(--ink3); line-height: 1.6; }

.hl { display: flex; gap: 10px; margin-bottom: 8px; font-size: 14px; line-height: 1.6; align-items: baseline; }

.hl .dot {
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ddf4ff;
  color: #0969da;
  font-size: 12px;
  text-align: center;
  line-height: 20px;
}

.modal-actions { margin-top: 24px; display: flex; gap: 12px; flex-wrap: wrap; }

.modal-actions a, .modal-actions button {
  flex: 1;
  min-width: 200px;
  text-align: center;
  border-radius: 12px;
  padding: 12px 18px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.act-primary { background: #1f883d; color: #fff; border: none; }
.act-primary:hover { filter: brightness(1.06); }

.act-ghost { background: #fff; color: var(--ink); border: 1px solid #d0d7de; }

.modal-hint { margin-top: 14px; font-size: 12px; color: var(--ink3); text-align: center; }

/* ---- 页脚 ---- */

.footer {
  text-align: center;
  color: var(--ink3);
  font-size: 13px;
  padding: 30px 20px 40px;
}

.footer a { color: #0969da; }

@media (max-width: 720px) {
  .hero h1 { font-size: 30px; }
  .hero-card img, .hero-card .body { width: 100%; }
  .grid { columns: 2 150px; }
  .links a { padding: 8px 10px; font-size: 14px; }
}
