/* ============ 基础变量 / 主题 ============ */
:root {
  --red: #c0392b;
  --red-deep: #962d22;
  --gold: #d4a017;
  --bg: #f6f4ef;
  --bg-soft: #ffffff;
  --surface: #ffffff;
  --surface-2: #f0ede6;
  --text: #1f1b18;
  --text-soft: #6b625a;
  --border: #e6e0d6;
  --shadow: 0 6px 22px rgba(60, 40, 20, 0.10);
  --shadow-lg: 0 16px 48px rgba(60, 40, 20, 0.18);
  --radius: 16px;
  --radius-sm: 10px;
  --maxw: 1080px;
  --header-h: 58px;
}
[data-theme="dark"] {
  --bg: #14110f;
  --bg-soft: #1d1916;
  --surface: #221d19;
  --surface-2: #2b2520;
  --text: #f1ebe3;
  --text-soft: #b3a89c;
  --border: #3a322b;
  --shadow: 0 6px 22px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.55);
  --red: #e0584a;
  --red-deep: #c0392b;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  padding-top: var(--header-h);
  -webkit-font-smoothing: antialiased;
  transition: background .3s, color .3s;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img { max-width: 100%; }

.content-inner { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }

/* ============ 顶部导航 ============ */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--header-h);
  background: color-mix(in srgb, var(--bg-soft) 88%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 50;
}
.topbar-inner {
  max-width: var(--maxw); margin: 0 auto; height: 100%;
  display: flex; align-items: center; gap: 12px; padding: 0 16px;
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; }
.brand-logo {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--red), var(--red-deep));
  color: #fff; font-size: 18px; font-weight: 900;
  box-shadow: 0 3px 10px rgba(192,57,43,.4);
}
.brand-text { font-size: 17px; letter-spacing: .5px; }
.topnav { margin-left: auto; display: flex; gap: 22px; font-size: 15px; color: var(--text-soft); }
.topnav a { position: relative; padding: 4px 0; transition: color .2s; }
.topnav a:hover { color: var(--red); }
.topnav a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -2px; height: 2px;
  background: var(--red); transition: right .25s;
}
.topnav a:hover::after { right: 0; }
.topbar-actions { margin-left: 4px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; font-size: 18px;
  background: var(--surface-2); display: grid; place-items: center; transition: transform .2s, background .2s;
}
.icon-btn:hover { transform: rotate(18deg); background: var(--border); }

/* ============ Hero ============ */
.hero { position: relative; overflow: hidden; }
.hero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(900px 380px at 80% -10%, rgba(212,160,23,.18), transparent 60%),
    radial-gradient(700px 360px at 0% 0%, rgba(192,57,43,.16), transparent 55%);
}
.hero-inner { position: relative; max-width: var(--maxw); margin: 0 auto; padding: 38px 16px 26px; }
.hero-head { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.avatar {
  width: 64px; height: 64px; flex: none; border-radius: 18px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--red), var(--red-deep));
  color: #fff; font-size: 30px; font-weight: 900;
  box-shadow: 0 8px 22px rgba(192,57,43,.35);
}
.hero-title h1 { font-size: 28px; line-height: 1.2; letter-spacing: .5px; }
.hero-sub { color: var(--text-soft); font-size: 14px; margin-top: 3px; }

.feature-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.feature-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px;
  background: linear-gradient(var(--red), var(--gold));
}
.feature-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.feature-tag {
  font-size: 13px; font-weight: 700; color: var(--red);
  background: color-mix(in srgb, var(--red) 12%, transparent); padding: 4px 12px; border-radius: 999px;
}
.ghost-btn {
  font-size: 13px; color: var(--text-soft); padding: 6px 10px; border-radius: 999px;
  transition: background .2s, color .2s;
}
.ghost-btn:hover { background: var(--surface-2); color: var(--red); }
.feature-quote { font-size: 21px; font-weight: 700; line-height: 1.55; }
.feature-context { color: var(--text-soft); font-size: 14px; margin-top: 10px; }
.feature-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.text-btn { color: var(--red); font-size: 14px; font-weight: 600; transition: opacity .2s; }
.text-btn:hover { opacity: .7; }

/* 搜索 */
.search-wrap {
  margin-top: 20px; display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  padding: 4px 8px 4px 16px; box-shadow: var(--shadow);
}
.search-icon { font-size: 16px; opacity: .7; }
.search-input {
  flex: 1; border: none; outline: none; background: transparent; color: var(--text);
  font-size: 15px; padding: 11px 4px;
}
.search-clear {
  width: 30px; height: 30px; border-radius: 50%; background: var(--surface-2);
  color: var(--text-soft); font-size: 13px; display: grid; place-items: center;
}

/* 统计 */
.stats {
  list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 22px;
}
.stats li {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px 8px; text-align: center; box-shadow: var(--shadow);
}
.stats .num { font-size: 24px; font-weight: 900; color: var(--red); line-height: 1; }
.stats .lbl { font-size: 12px; color: var(--text-soft); margin-top: 6px; }

/* ============ 内容区 ============ */
.content { padding: 30px 0 10px; }
.section-title { font-size: 21px; font-weight: 800; margin-bottom: 16px; }
.filter-bar {
  position: sticky; top: var(--header-h); z-index: 30;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  padding: 12px 0; border-bottom: 1px solid var(--border); margin-bottom: 16px;
}
.filter-bar .content-inner { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.cat-chips { display: flex; gap: 8px; overflow-x: auto; flex: 1; padding-bottom: 2px; scrollbar-width: none; }
.cat-chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 8px 15px; border-radius: 999px; font-size: 14px; font-weight: 600;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-soft);
  white-space: nowrap; transition: all .2s;
}
.chip:hover { border-color: var(--red); color: var(--red); }
.chip.active {
  background: linear-gradient(135deg, var(--red), var(--red-deep)); color: #fff; border-color: transparent;
  box-shadow: 0 4px 12px rgba(192,57,43,.35);
}
.chip.fav-active { background: var(--gold); color: #2a1d00; border-color: transparent; }
.filter-tools { display: flex; align-items: center; gap: 10px; }
.select-wrap { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-soft); }
.select-wrap select {
  font-family: inherit; font-size: 13px; padding: 7px 10px; border-radius: 8px;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); outline: none;
}

.tag-filter { margin-bottom: 14px; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.tag-filter-label { font-size: 13px; color: var(--text-soft); flex: none; }
.tag-chips { display: flex; gap: 7px; flex-wrap: wrap; }
.tag-chip {
  font-size: 12.5px; padding: 5px 11px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-soft); transition: all .2s;
}
.tag-chip:hover { color: var(--red); }
.tag-chip.active { background: var(--red); color: #fff; }

.result-info { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; font-size: 14px; color: var(--text-soft); }

/* ============ 语录卡片 ============ */
.quote-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.quote-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; display: flex; flex-direction: column; gap: 12px; cursor: pointer;
  box-shadow: var(--shadow); transition: transform .22s, box-shadow .22s, border-color .22s;
  position: relative; animation: rise .4s ease both;
}
.quote-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--red) 40%, var(--border)); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.card-top { display: flex; align-items: center; justify-content: space-between; }
.card-cat { font-size: 12.5px; font-weight: 700; color: var(--red); display: flex; align-items: center; gap: 5px; }
.card-fav {
  font-size: 16px; line-height: 1; padding: 4px; border-radius: 8px; transition: transform .2s, background .2s;
}
.card-fav:hover { background: var(--surface-2); transform: scale(1.15); }
.card-fav.on { filter: none; }
.card-quote { font-size: 16.5px; font-weight: 600; line-height: 1.6; flex: 1; }
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.mini-tag { font-size: 11.5px; color: var(--text-soft); background: var(--surface-2); padding: 3px 9px; border-radius: 999px; }
.card-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.badge { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.b-cautionary { background: rgba(230,126,34,.16); color: #c8741a; }
.b-encouraging { background: rgba(39,174,96,.16); color: #1e9e57; }
.b-neutral { background: rgba(127,140,141,.18); color: #6b7778; }
.b-humorous { background: rgba(155,89,182,.16); color: #8e44ad; }
.b-critical { background: rgba(192,57,43,.16); color: #c0392b; }
.c-verified { background: rgba(39,174,96,.16); color: #1e9e57; }
.c-attributed { background: rgba(52,152,219,.16); color: #2471a3; }
.c-paraphrased { background: rgba(127,140,141,.18); color: #6b7778; }

.empty { text-align: center; color: var(--text-soft); padding: 50px 0; font-size: 15px; }

/* ============ FAQ ============ */
.faq { padding: 40px 0; }
.faq-list { display: grid; gap: 12px; }
.faq-item {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  overflow: hidden; box-shadow: var(--shadow);
}
.faq-q {
  width: 100%; text-align: left; padding: 16px 18px; font-size: 15.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.faq-q .arrow { transition: transform .25s; color: var(--text-soft); flex: none; }
.faq-item.open .faq-q .arrow { transform: rotate(180deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.faq-a-inner { padding: 0 18px 16px; color: var(--text-soft); font-size: 14.5px; line-height: 1.8; }

/* ============ 关于 ============ */
.about { padding: 10px 0 50px; }
.about-inner { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.about-inner p { color: var(--text-soft); font-size: 14.5px; margin-top: 10px; }
.about-inner strong { color: var(--text); }
.disclaimer {
  background: color-mix(in srgb, var(--gold) 12%, transparent);
  border-left: 3px solid var(--gold); padding: 12px 14px; border-radius: 8px; margin-top: 14px !important;
}

/* ============ 页脚 ============ */
.site-footer { background: var(--bg-soft); border-top: 1px solid var(--border); padding: 26px 0; text-align: center; }
.site-footer p { font-size: 13.5px; color: var(--text-soft); }
.foot-sub { font-size: 12px; margin-top: 6px; opacity: .8; }

/* ============ 移动端底部栏 ============ */
.bottombar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 49;
  display: none; justify-content: space-around; align-items: center;
  background: color-mix(in srgb, var(--bg-soft) 94%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border); padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
}
.bottom-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 18px; padding: 4px 14px; color: var(--text-soft); }
.bottom-btn span { font-size: 11px; }
.bottom-btn:active { color: var(--red); }

/* ============ 回到顶部 ============ */
.to-top {
  position: fixed; right: 16px; bottom: 78px; z-index: 48;
  width: 46px; height: 46px; border-radius: 50%; font-size: 20px; font-weight: 700;
  background: var(--red); color: #fff; box-shadow: var(--shadow-lg);
  transition: transform .2s, opacity .2s; display: grid; place-items: center;
}
.to-top:hover { transform: translateY(-3px); }

/* ============ 弹窗 ============ */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal-mask { position: absolute; inset: 0; background: rgba(20,12,8,.55); backdrop-filter: blur(2px); animation: fade .25s; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal-panel {
  position: relative; width: min(620px, 100%); max-height: 88vh; overflow-y: auto;
  background: var(--surface); border-radius: 20px; padding: 26px; box-shadow: var(--shadow-lg);
  animation: pop .28s cubic-bezier(.2,.8,.3,1);
}
@keyframes pop { from { opacity: 0; transform: translateY(20px) scale(.97); } to { opacity: 1; transform: none; } }
.modal-close {
  position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 50%;
  background: var(--surface-2); font-size: 15px; color: var(--text-soft); display: grid; place-items: center;
}
.modal-close:hover { color: var(--red); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.modal-cat { font-size: 13px; font-weight: 700; color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); padding: 5px 12px; border-radius: 999px; }
.modal-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.modal-quote { font-size: 22px; font-weight: 800; line-height: 1.55; }
.modal-en { color: var(--text-soft); font-style: italic; font-size: 14px; margin-top: 10px; }
.modal-block { margin-top: 18px; }
.modal-block h4 { font-size: 14px; margin-bottom: 8px; color: var(--text); }
.modal-block p { color: var(--text-soft); font-size: 14.5px; }
.modal-actions { display: flex; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
.btn {
  flex: 1; min-width: 92px; padding: 12px; border-radius: 12px; font-size: 14.5px; font-weight: 700;
  background: var(--surface-2); color: var(--text); transition: transform .15s, background .2s;
}
.btn:hover { background: var(--border); }
.btn:active { transform: scale(.97); }
.btn.primary { background: linear-gradient(135deg, var(--red), var(--red-deep)); color: #fff; }

/* ============ Toast ============ */
.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%) translateY(20px);
  background: #2a201a; color: #fff; padding: 11px 20px; border-radius: 999px; font-size: 14px;
  z-index: 200; box-shadow: var(--shadow-lg); opacity: 0; transition: opacity .25s, transform .25s;
  pointer-events: none; max-width: 86vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.tag-list { display: flex; flex-wrap: wrap; gap: 7px; }

/* ============ 响应式 ============ */
@media (max-width: 720px) {
  .topnav { display: none; }
  .brand-text { font-size: 16px; }
  .hero-inner { padding: 26px 16px 18px; }
  .hero-title h1 { font-size: 23px; }
  .feature-quote { font-size: 18px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .quote-grid { grid-template-columns: 1fr; }
  .bottombar { display: flex; }
  body { padding-bottom: 64px; }
  .to-top { bottom: 86px; }
  .filter-bar .content-inner { gap: 10px; }
  .filter-tools { width: 100%; justify-content: space-between; }
  .about-inner { padding: 18px; }
}
@media (min-width: 721px) {
  .bottombar { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto; }
}
