@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@500;600;700&display=swap');
@import url('https://cdn.jsdelivr.net/npm/lxgw-wenkai-webfont@1.7.0/lxgwwenkaimedium.css');

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

:root {
  --font-cn: 'LXGW WenKai', '霞鹜文楷', 'STKaiti', serif;
  --font-display: 'Baloo 2', 'LXGW WenKai', system-ui, sans-serif;
  --cream: #fff8e8;
  --cream-deep: #f8e9c9;
  --blue: #bfe7f6;
  --blue-soft: #e8f7fb;
  --orange: #ffc85d;
  --orange-deep: #f39a35;
  --brown: #8f6b48;
  --brown-soft: #c7a47d;
  --ink: #5c412b;
  --ink-light: #7d6043;
  --ink-faint: #a88f72;
  --bg: var(--cream);
  --fg: var(--ink);
  --fg-muted: var(--ink-light);
  --accent: var(--orange-deep);
  --accent-lt: var(--orange);
  --border: rgba(143, 107, 72, 0.18);
  --header-bg: rgba(255, 248, 232, 0.86);
  --html-bg: #d8f0f7;
  --shadow-soft: rgba(126, 87, 43, 0.12);
  --shadow-med: rgba(91, 61, 30, 0.18);
  --card: rgba(255, 252, 244, 0.86);
}

html.dark {
  --cream: #201a17;
  --cream-deep: #30251d;
  --blue: #4f8492;
  --blue-soft: #243b40;
  --orange: #ffc86d;
  --orange-deep: #f6a84b;
  --brown: #d9b98f;
  --brown-soft: #b89569;
  --ink: #f8e7ca;
  --ink-light: #dfc49c;
  --ink-faint: #a98b65;
  --bg: var(--cream);
  --fg: var(--ink);
  --fg-muted: var(--ink-light);
  --accent: var(--orange-deep);
  --accent-lt: var(--orange);
  --border: rgba(255, 218, 156, 0.16);
  --header-bg: rgba(32, 26, 23, 0.88);
  --html-bg: #17292d;
  --shadow-soft: rgba(0, 0, 0, 0.28);
  --shadow-med: rgba(0, 0, 0, 0.42);
  --card: rgba(48, 37, 29, 0.88);
}

html {
  min-height: 100%;
  background: var(--html-bg);
  transition: background 0.3s ease;
}

body {
  min-height: 100dvh;
  font-family: var(--font-cn);
  color: var(--fg);
  background:
    radial-gradient(circle at 14% 12%, rgba(255, 200, 93, 0.28) 0 9rem, transparent 9.2rem),
    radial-gradient(circle at 86% 18%, rgba(191, 231, 246, 0.62) 0 12rem, transparent 12.2rem),
    linear-gradient(180deg, var(--blue-soft) 0%, var(--cream) 42%, var(--cream-deep) 100%);
  transition: color 0.3s ease, background 0.3s ease;
}

html.dark body {
  background:
    radial-gradient(circle at 14% 12%, rgba(246, 168, 75, 0.16) 0 9rem, transparent 9.2rem),
    radial-gradient(circle at 86% 18%, rgba(79, 132, 146, 0.22) 0 12rem, transparent 12.2rem),
    linear-gradient(180deg, #20383c 0%, var(--cream) 46%, #171310 100%);
}

body:not(.admin-body) {
  display: grid;
  grid-template-rows: auto 1fr auto;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.34;
  background-image:
    radial-gradient(circle, rgba(143, 107, 72, 0.16) 1px, transparent 1.2px),
    radial-gradient(circle, rgba(255, 200, 93, 0.16) 1px, transparent 1.2px);
  background-position: 0 0, 18px 22px;
  background-size: 42px 42px, 54px 54px;
}

body.admin-body {
  min-height: 100dvh;
  overflow-y: auto;
}

a { color: inherit; }
button, input, textarea { font: inherit; }
[hidden] { display: none !important; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.62);
  box-shadow: 0 8px 28px rgba(129, 96, 58, 0.08);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

html.dark .site-header { border-bottom-color: var(--border); }

.header-inner {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 10px clamp(16px, 4vw, 34px);
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand, .site-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  min-width: 0;
}

.brand-logo {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  object-fit: cover;
  box-shadow: 0 8px 20px var(--shadow-soft);
}

.brand-copy, .site-logo {
  min-width: 0;
}

.site-title {
  font-family: var(--font-display);
  font-size: clamp(1.22rem, 3vw, 1.64rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  display: block;
}

.site-title a {
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
}

.title-accent { color: var(--accent); }
.title-dim { color: var(--brown); }

.site-subtitle {
  display: block;
  margin-top: 5px;
  font-size: 0.78rem;
  color: var(--fg-muted);
  letter-spacing: 0.08em;
  font-weight: 700;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-logout {
  height: 38px;
  padding: 0 15px;
  font-size: 0.82rem;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(143, 107, 72, 0.14);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.48);
  color: var(--brown);
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 6px 16px rgba(129, 96, 58, 0.08);
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
  flex-shrink: 0;
}

.icon-btn:hover {
  transform: translateY(-2px);
  background: var(--orange);
  color: #66421e;
}

.page {
  position: relative;
  z-index: 1;
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: clamp(24px, 5vw, 56px) clamp(16px, 4vw, 34px) clamp(32px, 6vw, 70px);
}

.guest-view {
  min-height: calc(100dvh - 172px);
  display: grid;
  grid-template-columns: minmax(260px, 0.95fr) minmax(280px, 1.05fr);
  align-items: center;
  gap: clamp(24px, 6vw, 72px);
}

.day-scene {
  position: relative;
  min-height: 430px;
  border-radius: 42px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.66), rgba(255, 248, 232, 0.3)),
    linear-gradient(180deg, var(--blue) 0%, var(--blue-soft) 58%, var(--cream-deep) 100%);
  box-shadow: 0 24px 54px var(--shadow-soft);
  border: 1px solid rgba(255, 255, 255, 0.72);
}

html.dark .day-scene {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(32, 26, 23, 0.1)),
    linear-gradient(180deg, #1a3039 0%, #243b40 54%, #30251d 100%);
  border-color: rgba(255, 218, 156, 0.12);
}

.day-scene::before {
  content: '今天也辛苦了';
  position: absolute;
  left: 30px;
  top: 28px;
  z-index: 4;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(255, 248, 232, 0.72);
  color: var(--brown);
  font-weight: 700;
  box-shadow: 0 10px 22px rgba(143, 107, 72, 0.08);
}

html.dark .day-scene::before {
  background: rgba(248, 231, 202, 0.9);
  color: #4c3728;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
}

.sun {
  position: absolute;
  top: 56px;
  right: 48px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 18px rgba(255, 200, 93, 0.22), 0 0 60px rgba(255, 200, 93, 0.56);
}

html.dark .sun {
  background: #f8e7ca;
  box-shadow:
    inset -18px 7px 0 #243b40,
    0 0 0 14px rgba(248, 231, 202, 0.08),
    0 0 44px rgba(248, 231, 202, 0.28);
}

.cloud {
  position: absolute;
  width: 128px;
  height: 44px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 12px 24px rgba(105, 151, 166, 0.14);
}

.cloud::before, .cloud::after {
  content: '';
  position: absolute;
  bottom: 16px;
  border-radius: 50%;
  background: inherit;
}

.cloud::before { width: 54px; height: 54px; left: 18px; }
.cloud::after { width: 66px; height: 66px; right: 16px; }
.cloud-one { left: 38px; top: 132px; }
.cloud-two { right: 64px; top: 220px; transform: scale(0.76); opacity: 0.72; }
html.dark .cloud {
  background: rgba(171, 196, 201, 0.28);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.16);
}

.hill {
  position: absolute;
  bottom: -88px;
  width: 72%;
  height: 220px;
  border-radius: 50% 50% 0 0;
  background: #d8c19f;
}

.hill-one { left: -12%; }
.hill-two { right: -16%; bottom: -104px; background: #e7cd9d; }
html.dark .hill-one { background: #6c5741; }
html.dark .hill-two { background: #80643f; }

.scene-logo {
  position: absolute;
  left: 50%;
  bottom: 70px;
  z-index: 5;
  width: min(52%, 230px);
  transform: translateX(-50%);
  filter: drop-shadow(0 18px 20px rgba(99, 72, 42, 0.18));
}

.quote-frame {
  position: relative;
  width: 100%;
  padding: clamp(28px, 5vw, 48px);
  border-radius: 34px;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.76);
  box-shadow: 0 24px 60px var(--shadow-soft);
}

.guest-quote-card {
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.guest-quote-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 28px 66px var(--shadow-med);
}

.guest-quote-card:focus-visible {
  outline: 4px solid rgba(255, 200, 93, 0.42);
  outline-offset: 4px;
}

.quote-frame::before {
  content: '';
  position: absolute;
  inset: 14px;
  border: 2px dashed rgba(255, 200, 93, 0.5);
  border-radius: 24px;
  pointer-events: none;
}

.quote-kicker {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  margin-bottom: 20px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--brown);
  font-size: 0.86rem;
  font-weight: 700;
}

.quote-text {
  position: relative;
  z-index: 1;
  padding: 0 26px;
  font-size: clamp(1.18rem, 2.4vw, 1.52rem);
  line-height: 2;
  color: var(--fg);
  font-weight: 700;
  letter-spacing: 0;
  text-align: left;
}

.quote-text::before {
  content: '“';
  position: absolute;
  left: 0;
  top: -10px;
  color: var(--orange);
  font-family: var(--font-display);
  font-size: 2.4rem;
  line-height: 1;
  opacity: 0.82;
}

.quote-text::after {
  content: '”';
  display: inline;
  margin-left: 6px;
  color: var(--orange);
  font-family: var(--font-display);
  font-size: 1.8rem;
  line-height: 0;
  opacity: 0.82;
}

.quote-loading {
  color: var(--fg-muted);
  font-style: italic;
}

.quote-actions {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.quote-actions span {
  padding: 8px 12px;
  border-radius: 999px;
  background: #fff2c8;
  color: var(--brown);
  font-size: 0.84rem;
  font-weight: 700;
}

html.dark .quote-actions span { background: rgba(255, 200, 93, 0.14); }

.feed-view {
  width: min(900px, 100%);
  margin: 0 auto;
}

.category-bar {
  display: flex;
  gap: 7px;
  justify-content: center;
  align-items: center;
  margin: 0;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255, 252, 244, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.64);
  box-shadow: 0 12px 30px var(--shadow-soft);
  flex: 0 0 auto;
}

.category-filter {
  position: relative;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(143, 107, 72, 0.16);
  border-radius: 12px;
  background: rgba(232, 247, 251, 0.78);
  color: var(--brown);
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(129, 96, 58, 0.08);
  transition: transform 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.category-filter:hover,
.category-filter.is-active {
  transform: translateY(-2px);
  color: var(--accent);
}

.category-filter:hover {
  background: #fff0bf;
}

.category-filter svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.category-count {
  position: absolute;
  right: -5px;
  bottom: -5px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--orange);
  color: #69431f;
  border: 2px solid var(--cream);
  font-family: var(--font-display);
  font-size: 0.6rem;
  font-weight: 700;
  line-height: 1;
}

html.dark .category-bar { background: rgba(48, 37, 29, 0.62); }
html.dark .category-filter { background: rgba(79, 132, 146, 0.18); }

.feed-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
  padding: 22px clamp(18px, 4vw, 28px);
  border-radius: 30px;
  background: linear-gradient(135deg, rgba(255, 248, 232, 0.9), rgba(232, 247, 251, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 18px 42px var(--shadow-soft);
}

html.dark .feed-hero {
  background: linear-gradient(135deg, rgba(48, 37, 29, 0.92), rgba(36, 59, 64, 0.84));
}

.feed-hero-copy {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
}

.feed-hero-tools {
  grid-column: 1;
  grid-row: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(100%, 560px);
}

.feed-search {
  width: min(300px, 100%);
  height: 36px;
  margin-top: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid rgba(143, 107, 72, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--fg-muted);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.feed-search svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
  flex: 0 0 auto;
}

.feed-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--fg);
  font-size: 0.84rem;
  line-height: 1;
}

.feed-search input::placeholder {
  color: var(--fg-muted);
  opacity: 0.72;
}

html.dark .feed-search {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 218, 156, 0.14);
}

.feed-eyebrow {
  margin-bottom: 6px;
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 700;
}

.feed-hero h1 {
  font-size: clamp(1.18rem, 2.5vw, 1.72rem);
  line-height: 1.25;
  letter-spacing: 0;
  white-space: normal;
}

.feed-logo {
  grid-column: 2;
  grid-row: 1 / 3;
  width: clamp(72px, 18vw, 118px);
  height: clamp(72px, 18vw, 118px);
  object-fit: cover;
  border-radius: 30px;
  flex-shrink: 0;
}

.compass-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 18px;
}

.compass-card {
  min-height: 158px;
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 22px;
  background: var(--card);
  box-shadow: 0 12px 30px var(--shadow-soft);
}

.compass-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.compass-card-head span {
  color: var(--fg);
  font-size: 0.92rem;
  font-weight: 700;
}

.compass-card-head button {
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(232, 247, 251, 0.72);
  color: var(--fg-muted);
  cursor: pointer;
  font-size: 0.74rem;
  font-weight: 700;
}

.compass-card-head button:hover {
  background: #fff0bf;
  color: var(--accent);
}

.guide-list,
.belief-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.guide-item span {
  display: inline-flex;
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
}

.guide-item p,
.compass-card > p,
.belief-list p {
  color: var(--fg-muted);
  font-size: 0.84rem;
  line-height: 1.62;
}

.belief-list p {
  padding-left: 10px;
  border-left: 3px solid rgba(255, 200, 93, 0.5);
}

html.dark .compass-card-head button {
  background: rgba(79, 132, 146, 0.16);
}

.quote-feed {
  columns: 2 300px;
  column-gap: 18px;
}

.feed-card {
  display: inline-flex;
  width: 100%;
  gap: 13px;
  margin: 0 0 18px;
  padding: 16px;
  break-inside: avoid;
  border-radius: 24px;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 12px 32px var(--shadow-soft);
  animation: cardIn 0.42s ease both;
  animation-delay: calc(var(--delay) * 34ms);
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.feed-avatar {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  overflow: hidden;
  flex: 0 0 auto;
  background: var(--blue-soft);
}

.feed-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.feed-card-body { min-width: 0; flex: 1; }

.feed-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--fg-muted);
  font-size: 0.82rem;
}

.feed-meta strong {
  color: var(--fg);
  font-size: 0.92rem;
}

.feed-card p {
  color: var(--fg);
  line-height: 1.82;
  font-size: 1rem;
  word-break: break-word;
}

.belief-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  margin-top: 12px;
  padding: 0 12px;
  border: 1px solid rgba(143, 107, 72, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  color: var(--fg-muted);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 700;
}

.belief-toggle:hover,
.belief-toggle.is-active {
  background: #fff0bf;
  color: #c47a12;
}

.belief-toggle.is-error {
  background: #ffe2d8;
  color: #b45a42;
}

html.dark .belief-toggle {
  background: rgba(255, 255, 255, 0.06);
}

html.dark .belief-toggle.is-active {
  background: rgba(255, 200, 93, 0.18);
  color: #ffc86d;
}

.tweet-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.tweet-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  height: 38px;
  border: 1px solid rgba(143, 107, 72, 0.14);
  border-radius: 999px;
  background: rgba(232, 247, 251, 0.72);
  color: var(--fg-muted);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  transition: transform 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.tweet-actions button:hover {
  transform: translateY(-1px);
  color: var(--accent);
}

.tweet-actions button:not(.is-active):hover {
  background: rgba(255, 255, 255, 0.72);
}

.tweet-actions button.is-active {
  transform: translateY(-1px);
  color: var(--accent);
}

.tweet-actions button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.tweet-actions button.is-error {
  background: #ffe2d8;
  color: #b45a42;
}

html.dark .tweet-actions button {
  background: rgba(79, 132, 146, 0.16);
}

html.dark .tweet-actions button:not(.is-active):hover {
  background: rgba(255, 255, 255, 0.08);
}

html.dark .tweet-actions button.is-active {
  color: var(--accent);
}

.category-invest.is-active {
  background: #fff0bf;
  color: #c47a12;
  border-color: rgba(243, 154, 53, 0.35);
}

.category-like.is-active {
  background: #fff0f5;
  color: #c8647d;
  border-color: rgba(200, 100, 125, 0.22);
}

.category-life.is-active {
  background: #dff1ff;
  color: #347fb1;
  border-color: rgba(52, 127, 177, 0.3);
}

.category-future.is-active {
  background: #e5f6db;
  color: #5f9441;
  border-color: rgba(95, 148, 65, 0.3);
}

html.dark .category-invest.is-active {
  background: rgba(255, 200, 93, 0.2);
  color: #ffc86d;
}

html.dark .category-like.is-active {
  background: rgba(214, 90, 120, 0.13);
  color: #f4b2c1;
}

html.dark .category-life.is-active {
  background: rgba(76, 154, 206, 0.22);
  color: #9bd4ff;
}

html.dark .category-future.is-active {
  background: rgba(116, 178, 78, 0.2);
  color: #b7e792;
}

.tweet-actions svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  flex: 0 0 auto;
}

.action-count { opacity: 0.72; }

.load-more-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 168px;
  height: 44px;
  margin: 10px auto 0;
  padding: 0 22px;
  border: 1px solid rgba(143, 107, 72, 0.16);
  border-radius: 999px;
  background: var(--orange);
  color: #684626;
  cursor: pointer;
  font-weight: 700;
  box-shadow: 0 12px 28px rgba(243, 154, 53, 0.18);
}

.load-more-btn:hover {
  transform: translateY(-1px);
}

.site-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 18px 24px 24px;
  color: var(--fg-muted);
}

.footer-text {
  font-size: 0.88rem;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.footer-copy {
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: 0.74rem;
  opacity: 0.68;
}

.footer-copy a {
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}

.admin-page {
  position: relative;
  z-index: 1;
  max-width: 880px;
  margin: 0 auto;
  padding: 44px 24px 60px;
  width: 100%;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding: 18px 20px;
  border-radius: 24px;
  background: var(--card);
  box-shadow: 0 12px 32px var(--shadow-soft);
  flex-wrap: wrap;
  gap: 12px;
}

.admin-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-title {
  font-size: 1.14rem;
  font-weight: 700;
  color: var(--fg);
}

.admin-subtitle {
  font-size: 0.78rem;
  color: var(--fg-muted);
  margin-top: 4px;
}

.pwd-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0 24px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease, margin 0.3s ease;
  margin-bottom: 0;
}

.pwd-section.open {
  max-height: 420px;
  padding: 22px 24px;
  margin-bottom: 20px;
}

.login-card {
  position: relative;
  z-index: 1;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 28px;
  padding: 42px 44px;
  max-width: 420px;
  margin: 68px auto;
  box-shadow: 0 20px 48px var(--shadow-soft);
}

.login-card h2 {
  font-size: 1.1rem;
  text-align: center;
  margin-bottom: 26px;
  color: var(--fg);
}

.form-group { margin-bottom: 16px; }

.form-group label {
  display: block;
  font-size: 0.8rem;
  color: var(--fg-muted);
  margin-bottom: 7px;
  font-weight: 700;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 11px 14px;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid var(--border);
  border-radius: 16px;
  color: var(--fg);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

html.dark .form-group input,
html.dark .form-group textarea {
  background: rgba(255, 255, 255, 0.06);
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(255, 200, 93, 0.22);
}

.form-group textarea {
  resize: vertical;
  min-height: 94px;
  line-height: 1.7;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 17px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.86rem;
  cursor: pointer;
  transition: transform 0.16s ease, background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
  outline: none;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
}

.btn:hover { transform: translateY(-1px); }
.btn-primary, .btn-add {
  background: var(--accent);
  color: #fffaf0;
  border-color: var(--accent);
  box-shadow: 0 10px 20px rgba(243, 154, 53, 0.18);
}

.btn-primary { width: 100%; }
.btn-primary:hover, .btn-add:hover { background: var(--orange); color: #684626; }
.btn-danger { background: #fff1ec; color: #b45a42; border-color: rgba(180, 90, 66, 0.22); font-size: 0.76rem; padding: 5px 11px; }
.btn-danger:hover { background: #ffe2d8; }
.btn-ghost, .btn-warning { background: rgba(232, 247, 251, 0.68); color: var(--fg-muted); border-color: var(--border); }
.btn-ghost:hover, .btn-warning:hover { background: #fff0bf; color: var(--accent); }
html.dark .btn-danger { background: rgba(180, 90, 66, 0.12); }

.error-msg { color: #b45a42; font-size: 0.78rem; margin-top: 8px; text-align: center; min-height: 16px; }
.success-msg { color: var(--accent); font-size: 0.78rem; margin-top: 8px; text-align: center; min-height: 16px; }

.panel {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 24px;
  padding: 22px 24px;
  margin-bottom: 20px;
  box-shadow: 0 12px 32px var(--shadow-soft);
}

.panel h3 {
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 14px;
}

.panel-toggle { cursor: pointer; display: flex; align-items: center; justify-content: space-between; margin-bottom: 0; }
.panel-toggle.open { margin-bottom: 14px; }
.panel-body { display: none; }
.panel-body.open { display: block; }
.add-quote-form { display: flex; gap: 12px; align-items: flex-end; }
.add-quote-form .form-group { flex: 1; margin-bottom: 0; }

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.page-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(232, 247, 251, 0.68);
  color: var(--fg-muted);
  font-family: var(--font-display);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-btn:hover { background: #fff0bf; border-color: var(--accent); color: var(--accent); }
.page-btn.active { background: var(--accent); color: #fffaf0; border-color: var(--accent); }
.page-btn:disabled { opacity: 0.34; cursor: default; pointer-events: none; }

.quotes-count { font-size: 0.76rem; color: var(--fg-muted); margin-left: 7px; font-weight: 400; }
.quote-list { display: flex; flex-direction: column; gap: 9px; }

.quote-item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 15px;
  background: rgba(255, 255, 255, 0.44);
  border: 1px solid var(--border);
  border-radius: 18px;
}

html.dark .quote-item { background: rgba(255, 255, 255, 0.05); }
.quote-item-main { flex: 1; min-width: 0; }
.quote-item-text { display: block; font-size: 0.88rem; line-height: 1.75; color: var(--fg-muted); word-break: break-word; }
.quote-item-num { font-size: 0.76rem; color: var(--ink-faint); min-width: 30px; padding-top: 3px; font-family: var(--font-display); text-align: right; }

.quote-baskets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.basket-btn {
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.52);
  color: var(--fg-muted);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 700;
  transition: transform 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.basket-btn:hover {
  transform: translateY(-1px);
  background: #fff0bf;
  color: var(--accent);
}

.basket-btn:disabled { cursor: wait; opacity: 0.72; }
.basket-daily.is-active { background: #fff0bf; color: #c47a12; border-color: rgba(243, 154, 53, 0.35); }
.basket-decision.is-active { background: #dff1ff; color: #347fb1; border-color: rgba(52, 127, 177, 0.3); }
.basket-belief.is-active { background: #e5f6db; color: #5f9441; border-color: rgba(95, 148, 65, 0.3); }
.basket-reverse.is-active { background: #fff2e7; color: #b86b33; border-color: rgba(184, 107, 51, 0.26); }

html.dark .basket-btn { background: rgba(255, 255, 255, 0.06); }
html.dark .basket-daily.is-active { background: rgba(255, 200, 93, 0.2); color: #ffc86d; }
html.dark .basket-decision.is-active { background: rgba(76, 154, 206, 0.22); color: #9bd4ff; }
html.dark .basket-belief.is-active { background: rgba(116, 178, 78, 0.2); color: #b7e792; }
html.dark .basket-reverse.is-active { background: rgba(214, 130, 68, 0.18); color: #ffc09b; }

.beliefs-page {
  width: min(1080px, 100%);
}

.beliefs-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  margin-bottom: 22px;
  padding: clamp(24px, 5vw, 38px);
  border-radius: 30px;
  background: linear-gradient(135deg, rgba(255, 248, 232, 0.92), rgba(232, 247, 251, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 18px 42px var(--shadow-soft);
}

html.dark .beliefs-hero {
  background: linear-gradient(135deg, rgba(48, 37, 29, 0.92), rgba(36, 59, 64, 0.84));
}

.beliefs-hero h1 {
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1;
  letter-spacing: 0;
  color: var(--accent);
}

.beliefs-hero p:last-child {
  max-width: 36rem;
  margin-top: 12px;
  color: var(--fg-muted);
  line-height: 1.75;
  font-weight: 700;
}

.beliefs-hero img {
  width: clamp(92px, 18vw, 148px);
  height: clamp(92px, 18vw, 148px);
  object-fit: cover;
  border-radius: 34px;
  box-shadow: 0 18px 36px var(--shadow-soft);
}

.beliefs-auth-state {
  display: grid;
  place-items: center;
  gap: 16px;
  padding: 42px 24px;
  border-radius: 26px;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.68);
  box-shadow: 0 16px 36px var(--shadow-soft);
  color: var(--fg-muted);
  text-align: center;
}

.beliefs-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.belief-section {
  min-height: 260px;
  padding: 20px;
  border-radius: 24px;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.68);
  box-shadow: 0 14px 34px var(--shadow-soft);
}

.belief-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.basket-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  background: #fff0bf;
  color: #9b621c;
  font-weight: 700;
}

.belief-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--brown);
  font-family: var(--font-display);
  font-weight: 700;
}

.belief-note {
  margin-bottom: 16px;
  color: var(--fg-muted);
  font-size: 0.88rem;
  line-height: 1.7;
}

.belief-quote-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.belief-quote {
  margin: 0;
  padding: 13px 14px 13px 16px;
  border-left: 4px solid rgba(255, 200, 93, 0.62);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.46);
  color: var(--fg);
  line-height: 1.78;
  word-break: break-word;
}

.belief-empty {
  padding: 24px 12px;
  border: 1px dashed var(--border);
  border-radius: 16px;
  color: var(--fg-muted);
  font-size: 0.88rem;
  text-align: center;
}

.belief-daily .basket-chip { background: #fff0bf; color: #9b621c; }
.belief-decision .basket-chip { background: #dff1ff; color: #347fb1; }
.belief-belief .basket-chip { background: #e5f6db; color: #5f9441; }
.belief-reverse .basket-chip { background: #fff2e7; color: #b86b33; }

html.dark .belief-quote { background: rgba(255, 255, 255, 0.05); }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--fg-muted);
  text-decoration: none;
  font-weight: 700;
}

.back-link:hover { color: var(--accent); }

.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: var(--fg);
  color: var(--bg);
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 0.84rem;
  opacity: 0;
  transition: all 0.28s ease;
  pointer-events: none;
  z-index: 100;
  white-space: nowrap;
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.empty-state { text-align: center; padding: 36px 0; color: var(--fg-muted); font-style: italic; font-size: 0.9rem; }

@media (max-width: 760px) {
  .header-inner { min-height: 68px; }
  .header-actions { flex-wrap: wrap; justify-content: flex-end; }
  .header-logout { height: 34px; padding: 0 11px; font-size: 0.76rem; }
  .home-header-actions {
    width: 154px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    justify-items: stretch;
  }
  .home-header-actions .home-primary-action {
    width: 100%;
    min-width: 0;
    padding: 0 6px;
  }
  .home-header-actions .home-tool-action {
    width: 42px;
    height: 42px;
    justify-self: center;
  }
  .home-header-actions .home-primary-action:nth-of-type(1) { grid-column: 1; grid-row: 1; }
  .home-header-actions .home-primary-action:nth-of-type(2) { grid-column: 2; grid-row: 1; }
  .home-header-actions #homeLogoutBtn { grid-column: 3; grid-row: 1; }
  .home-header-actions .home-tool-action:nth-of-type(3) { grid-column: 1; grid-row: 2; }
  .home-header-actions #themeToggle { grid-column: 2; grid-row: 2; }
  .home-header-actions .home-tool-action:nth-of-type(4) { grid-column: 3; grid-row: 2; }
  .beliefs-header-actions {
    width: 154px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    justify-items: stretch;
  }
  .beliefs-header-actions .beliefs-nav-action,
  .beliefs-header-actions .beliefs-logout-action {
    width: 100%;
    min-width: 0;
    padding: 0 6px;
  }
  .beliefs-header-actions .beliefs-tool-action {
    grid-column: 1;
    grid-row: 2;
    width: 42px;
    height: 42px;
    justify-self: center;
  }
  .beliefs-header-actions .beliefs-logout-action {
    grid-column: 2 / 4;
    grid-row: 2;
  }
  .brand-logo { width: 48px; height: 48px; border-radius: 16px; }
  .site-subtitle { font-size: 0.72rem; }
  .icon-btn { width: 38px; height: 38px; }
  .guest-view { grid-template-columns: 1fr; min-height: 0; }
  .day-scene { min-height: 320px; border-radius: 32px; }
  .scene-logo { width: min(46%, 180px); bottom: 54px; }
  .sun { width: 72px; height: 72px; right: 34px; top: 54px; }
  .cloud-one { left: 24px; top: 126px; }
  .cloud-two { right: 32px; top: 188px; }
  .quote-frame { border-radius: 28px; }
  .quote-feed { columns: 1; }
  .feed-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
    gap: 12px;
  }
  .feed-hero-copy { grid-column: 1 / -1; grid-row: 1; }
  .feed-hero h1 { white-space: normal; }
  .feed-hero-tools {
    grid-column: 1;
    grid-row: 2;
    display: flex;
    flex-direction: column;
    align-self: stretch;
    gap: 8px;
    height: 92px;
  }
  .feed-search { width: 100%; height: 36px; flex: 0 0 auto; }
  .category-bar { width: 100%; height: 48px; justify-content: space-between; flex: 0 0 auto; }
  .feed-logo {
    grid-column: 2;
    grid-row: 2;
    align-self: start;
    width: 92px;
    height: 92px;
    border-radius: 22px;
  }
  .compass-panel { grid-template-columns: 1fr 1fr; }
  .beliefs-hero {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    border-radius: 24px;
  }
  .beliefs-hero img {
    width: 88px;
    height: 88px;
    border-radius: 24px;
  }
  .beliefs-grid { grid-template-columns: 1fr; }
  .admin-page {
    padding: 28px 14px 52px;
  }
  .admin-header {
    align-items: stretch;
    padding: 16px;
  }
  .admin-actions {
    width: 100%;
    justify-content: flex-start;
    gap: 7px;
  }
  .admin-actions .btn {
    min-height: 34px;
    padding: 7px 12px;
    font-size: 0.78rem;
  }
  .panel {
    padding: 18px 14px;
    border-radius: 20px;
  }
  .quote-item {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 9px 10px;
    padding: 13px;
  }
  .quote-item-num {
    grid-column: 1;
    grid-row: 1;
  }
  .quote-item-main {
    grid-column: 2;
    grid-row: 1;
  }
  .quote-baskets {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }
  .basket-btn {
    width: 100%;
    height: 32px;
    padding: 0 8px;
    font-size: 0.72rem;
  }
  .quote-item .btn-danger {
    grid-column: 2;
    grid-row: 2;
    justify-self: start;
    margin-left: 0;
  }
  .tweet-actions { gap: 6px; }
  .tweet-actions button { font-size: 0.72rem; }
  .login-card { margin: 42px 16px; padding: 32px 24px; }
  .add-quote-form { flex-direction: column; align-items: stretch; }
}

@media (max-width: 480px) {
  .header-actions { gap: 5px; }
  .home-header-actions {
    width: 142px;
    gap: 5px;
  }
  .home-header-actions .home-primary-action {
    height: 32px;
    font-size: 0.72rem;
  }
  .home-header-actions .home-tool-action {
    width: 36px;
    height: 36px;
  }
  .beliefs-header-actions {
    width: 142px;
    gap: 5px;
  }
  .beliefs-header-actions .beliefs-nav-action,
  .beliefs-header-actions .beliefs-logout-action {
    height: 32px;
    font-size: 0.72rem;
  }
  .beliefs-header-actions .beliefs-tool-action {
    width: 36px;
    height: 36px;
  }
  .brand { gap: 9px; }
  .brand-logo { width: 42px; height: 42px; }
  .site-title { font-size: 1.15rem; }
  .site-subtitle { max-width: 8em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .day-scene { min-height: 270px; }
  .quote-frame { padding: 28px 22px; }
  .quote-text { font-size: 1.08rem; line-height: 1.9; }
  .quote-text { padding: 0 20px; }
  .feed-hero { border-radius: 24px; }
  .feed-card { padding: 14px; border-radius: 22px; }
  .feed-avatar { width: 38px; height: 38px; border-radius: 14px; }
  .compass-panel { grid-template-columns: 1fr; }
  .compass-card { min-height: 0; }
  .beliefs-hero {
    grid-template-columns: 1fr;
  }
  .beliefs-hero img {
    width: 82px;
    height: 82px;
  }
  .belief-section { padding: 17px; }
  .tweet-actions span:not(.action-count) { display: none; }
  .category-bar { gap: 8px; }
  .category-filter { width: 36px; height: 36px; border-radius: 12px; }
}
