:root {
  --bg: #f7f8f6;
  --surface: #ffffff;
  --surface-2: #eef3f1;
  --text: #17202a;
  --muted: #647179;
  --line: #e3e8ed;
  --accent: #156f79;
  --accent-2: #0f5b66;
  --accent-soft: #edf7f6;
  --hot: #d8482f;
  --warning: #b7791f;
  --warm-bg: #fff7e6;
  --code-bg: #fafbf8;
  --code-text: #263642;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 10px 28px rgba(28, 43, 56, 0.055);
  --shadow-lift: 0 18px 44px rgba(28, 43, 56, 0.095);
}

:root[data-theme="dark"] {
  --bg: #101418;
  --surface: #171d22;
  --surface-2: #20272d;
  --text: #e8edf0;
  --muted: #9aa7ad;
  --line: #303942;
  --accent: #4db6c2;
  --accent-2: #83d8e3;
  --accent-soft: #17333a;
  --hot: #ff6b57;
  --warning: #f5bd55;
  --warm-bg: #332814;
  --code-bg: #12181d;
  --code-text: #e8edf0;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 10px 26px rgba(0, 0, 0, 0.22);
  --shadow-lift: 0 18px 44px rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

img,
svg,
video {
  max-width: 100%;
}

html {
  max-width: 100%;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  max-width: 100%;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

:root[data-theme="dark"] input,
:root[data-theme="dark"] textarea,
:root[data-theme="dark"] .topbar::before,
:root[data-theme="dark"] .top-topic-nav .topic-card,
:root[data-theme="dark"] .top-search input,
:root[data-theme="dark"] .prompt-search input,
:root[data-theme="dark"] .brief-item,
:root[data-theme="dark"] .category-pill,
:root[data-theme="dark"] .prompt-category-chip,
:root[data-theme="dark"] .recommended-tool,
:root[data-theme="dark"] .prompt-card,
:root[data-theme="dark"] .practice-card,
:root[data-theme="dark"] .practice-detail,
:root[data-theme="dark"] .feed-card,
:root[data-theme="dark"] .pagination,
:root[data-theme="dark"] .pagination button,
:root[data-theme="dark"] .note-dialog,
:root[data-theme="dark"] .consultation-float-button,
:root[data-theme="dark"] .secondary-button,
:root[data-theme="dark"] .segmented button,
:root[data-theme="dark"] .admin-login-button,
:root[data-theme="dark"] .back-link,
:root[data-theme="dark"] .danger-button,
:root[data-theme="dark"] .source-link {
  background: var(--surface);
  color: var(--text);
}

:root[data-theme="dark"] .danger-button {
  border-color: #5d3437;
  color: #ff8b8b;
}

:root[data-theme="dark"] .danger-button:hover {
  border-color: #9a4d51;
  background: #2c171a;
}

:root[data-theme="dark"] .landing-hero {
  background:
    linear-gradient(135deg, rgba(23, 51, 58, 0.82), rgba(23, 29, 34, 0.96) 52%),
    var(--surface);
}

:root[data-theme="dark"] .landing-slide:first-child {
  background: linear-gradient(135deg, #13292d 0%, #171d22 58%, #2a2418 100%);
}

:root[data-theme="dark"] .about-author-slide {
  background: linear-gradient(135deg, #132824 0%, #171d22 52%, #2b2317 100%);
}

:root[data-theme="dark"] .contact-slide {
  background: linear-gradient(135deg, #211c2c 0%, #171d22 50%, #132823 100%);
}

:root[data-theme="dark"] .landing-metrics a {
  background: rgba(32, 39, 45, 0.72);
  border-color: var(--line);
  box-shadow: none;
}

:root[data-theme="dark"] .landing-metrics a:hover {
  border-color: rgba(77, 182, 194, 0.48);
  box-shadow: var(--shadow-lift);
}

:root[data-theme="dark"] .primary-button {
  box-shadow: 0 10px 24px rgba(77, 182, 194, 0.15);
}

:root[data-theme="dark"] .markdown-view,
:root[data-theme="dark"] .prompt-card pre {
  background: var(--code-bg);
  color: var(--text);
}

:root[data-theme="dark"] .top-topic-nav .topic-card.active,
:root[data-theme="dark"] .category-pill.active,
:root[data-theme="dark"] .practice-card.active,
:root[data-theme="dark"] .segmented button.active {
  background: var(--accent-soft);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

button {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 270px minmax(560px, 1fr) minmax(300px, 360px);
  align-items: center;
  gap: 18px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  backdrop-filter: blur(12px);
}

.topbar > *,
.home-shell > *,
.hero-card,
.tool-overview,
.knowledge-section,
.feed-section,
.panel,
.brief-list,
.brief-item,
.recommended-tool,
.practice-layout,
.practice-list,
.practice-detail,
.feed-card,
.pagination {
  min-width: 0;
}

.brief-item > *,
.feed-card > *,
.practice-detail-head > * {
  min-width: 0;
}

.topbar::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  z-index: -1;
  width: 100vw;
  height: 100%;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 248, 246, 0.94);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: block;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(7, 19, 37, 0.08);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  white-space: nowrap;
  font-size: 18px;
  font-weight: 760;
  letter-spacing: 0;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.top-search {
  position: relative;
  display: block;
  width: 100%;
  justify-self: stretch;
}

.top-search span {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.top-search input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 48px;
  padding: 12px 14px 12px 54px;
  background: #fff;
  color: var(--text);
  outline: none;
  box-shadow: var(--shadow);
  font-weight: 500;
}

.top-search input:focus,
.note-dialog input:focus,
.note-dialog textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(21, 111, 121, 0.12);
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 11px 16px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(21, 111, 121, 0.18);
}

.primary-button:hover {
  background: var(--accent-2);
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 15px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
}

.secondary-button:hover {
  border-color: var(--accent);
  color: var(--accent-2);
}

.danger-button {
  border: 1px solid #e5b8b8;
  border-radius: 999px;
  padding: 10px 15px;
  background: #fff;
  color: #b42318;
  cursor: pointer;
  font-weight: 700;
}

.danger-button:hover {
  border-color: #d0443e;
  background: #fff5f5;
}

.side-control-dock {
  position: fixed;
  left: max(18px, calc((100vw - 1180px) / 2 - 232px));
  bottom: 22px;
  z-index: 20;
  display: grid;
  gap: 12px;
  justify-items: end;
  width: 204px;
}

.theme-switcher {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 5px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.theme-switcher button {
  border: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  min-height: 34px;
  padding: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  width: 44px;
}

.theme-switcher button.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 12px rgba(21, 111, 121, 0.22);
}

.admin-login-button {
  justify-self: end;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(21, 111, 121, 0.18);
  border-radius: 999px;
  padding: 0;
  background: var(--accent-soft);
  color: var(--accent-2);
  cursor: pointer;
  box-shadow: var(--shadow);
}

.admin-login-button svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.admin-login-button:hover {
  border-color: var(--accent);
  background: var(--surface);
  color: var(--accent);
}

.admin-login-button.logged-in {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.consultation-float {
  position: fixed;
  right: max(18px, calc((100vw - 1180px) / 2));
  top: 50%;
  z-index: 30;
  transform: translateY(-50%);
  user-select: none;
}

.consultation-float-button {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  padding: 0;
  background:
    radial-gradient(circle at 31% 24%, rgba(255, 255, 255, 0.98) 0 8%, rgba(106, 224, 208, 0.95) 19%, transparent 32%),
    linear-gradient(145deg, #24b9aa 0%, #156f79 56%, #0f4d61 100%);
  color: #fff;
  cursor: grab;
  font-weight: 800;
  touch-action: none;
  box-shadow:
    0 16px 36px rgba(21, 111, 121, 0.28),
    inset 0 -12px 24px rgba(4, 39, 48, 0.25),
    inset 0 10px 20px rgba(255, 255, 255, 0.2);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
  animation: consultation-orb-float 4.2s ease-in-out infinite;
}

.consultation-float-button::before,
.consultation-float-button::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.consultation-float-button::before {
  inset: -9px;
  z-index: -2;
  background: rgba(36, 185, 170, 0.18);
  box-shadow:
    0 0 0 1px rgba(36, 185, 170, 0.16),
    0 0 34px rgba(36, 185, 170, 0.34);
  animation: consultation-orb-pulse 2.8s ease-in-out infinite;
}

.consultation-float-button::after {
  inset: 9px 11px auto auto;
  z-index: -1;
  width: 24px;
  height: 24px;
  background: rgba(255, 255, 255, 0.26);
  filter: blur(1px);
}

.consultation-float-button:hover {
  border-color: rgba(255, 255, 255, 0.92);
  box-shadow:
    0 22px 52px rgba(21, 111, 121, 0.36),
    inset 0 -12px 24px rgba(4, 39, 48, 0.24),
    inset 0 10px 20px rgba(255, 255, 255, 0.24);
  transform: translateX(-5px) scale(1.04);
}

.consultation-float.is-dragging {
  z-index: 60;
}

.consultation-float.is-dragging .consultation-float-button {
  cursor: grabbing;
  animation: none;
  box-shadow:
    0 26px 58px rgba(21, 111, 121, 0.38),
    inset 0 -12px 24px rgba(4, 39, 48, 0.22),
    inset 0 10px 20px rgba(255, 255, 255, 0.25);
  transform: scale(1.03);
}

.consultation-float-badge {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 999px;
  padding: 4px 9px;
  background: #fff3bf;
  color: #8a5a00;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.1;
  box-shadow: 0 8px 18px rgba(138, 90, 0, 0.15);
}

.consultation-float-text {
  width: 58px;
  margin-top: 2px;
  font-size: 17px;
  line-height: 1.18;
  letter-spacing: 0;
  text-align: center;
  text-shadow: 0 1px 8px rgba(0, 43, 54, 0.36);
  white-space: normal;
}

.consultation-float-text span {
  display: block;
}

.consultation-float-core {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  place-items: center;
  width: 28px;
  height: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.92);
  font-size: 11px;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.consultation-float-button:hover .consultation-float-badge {
  background: #fff7d6;
}

:root[data-theme="dark"] .consultation-float-button {
  border-color: rgba(255, 255, 255, 0.34);
  background:
    radial-gradient(circle at 31% 24%, rgba(255, 255, 255, 0.88) 0 7%, rgba(77, 182, 194, 0.9) 18%, transparent 32%),
    linear-gradient(145deg, #1b8f98 0%, #145f69 56%, #0f3745 100%);
}

:root[data-theme="dark"] .consultation-float-badge {
  background: #f5bd55;
  color: #312000;
}

@keyframes consultation-orb-float {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 0 -5px;
  }
}

@keyframes consultation-orb-pulse {
  0%,
  100% {
    opacity: 0.72;
    scale: 1;
  }
  50% {
    opacity: 1;
    scale: 1.08;
  }
}

.admin-only[hidden] {
  display: none;
}

body:not(.is-admin) #add-practice-button,
body:not(.is-admin) #add-prompt-button,
body:not(.is-admin) .practice-actions {
  display: none !important;
}

.top-topic-nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(128px, 1fr));
  gap: 10px;
  min-width: 0;
}

.top-topic-nav .topic-card {
  --topic-bg: #f2f8ff;
  --topic-border: #d7e8f7;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--topic-border);
  border-radius: var(--radius);
  min-height: 48px;
  padding: 11px 13px;
  background: linear-gradient(180deg, #ffffff 0%, var(--topic-bg) 100%);
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow);
  transition:
    border-color 0.2s ease,
    background-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.top-topic-nav .topic-card:nth-child(1) {
  --topic-bg: #fff1ed;
  --topic-border: #f4d8ce;
}

.top-topic-nav .topic-card:nth-child(2) {
  --topic-bg: #fff8dc;
  --topic-border: #eadcaa;
}

.top-topic-nav .topic-card:nth-child(3) {
  --topic-bg: #eef7ff;
  --topic-border: #cfe0ee;
}

.top-topic-nav .topic-card:nth-child(4) {
  --topic-bg: #eef9f4;
  --topic-border: #cce6dd;
}

.top-topic-nav .topic-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-lift);
  transform: translateY(-1px);
}

.top-topic-nav .topic-card.active {
  border-color: var(--accent);
  background: linear-gradient(180deg, #178693 0%, #0f6671 100%);
  color: #fff;
  box-shadow:
    0 0 0 3px rgba(21, 111, 121, 0.16),
    0 14px 30px rgba(21, 111, 121, 0.22);
  transform: translateY(-1px);
}

.top-topic-nav .topic-card strong {
  margin: 0;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
}

.top-topic-nav .topic-card small {
  display: none;
}

.top-topic-nav .topic-card span:first-child {
  min-width: 0;
}

.top-topic-nav .topic-card span:last-child {
  color: var(--accent);
  font-size: 12px;
  font-weight: 760;
  min-width: max-content;
  text-align: left;
}

.top-topic-nav .topic-card.active span:last-child {
  color: #fff;
}

.home-shell {
  display: grid;
  gap: 28px;
  width: min(1180px, calc(100% - 32px));
  margin: 26px auto 56px;
}

.landing-hero {
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
  background:
    linear-gradient(135deg, rgba(237, 247, 246, 0.78), rgba(255, 255, 255, 0.9) 52%),
    var(--surface);
  box-shadow: var(--shadow);
}

.landing-carousel-track {
  display: grid;
  grid-template-columns: 1fr;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.landing-slide {
  grid-area: 1 / 1;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  align-items: stretch;
  gap: 24px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 22px;
  background: #f7fbfb;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition:
    opacity 0.28s ease,
    visibility 0.28s ease;
}

.landing-slide:first-child {
  background: linear-gradient(135deg, #effbfa 0%, #f8fcff 58%, #fff7e8 100%);
}

.landing-slide.active {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.landing-slide > * {
  min-width: 0;
}

.landing-copy {
  display: grid;
  align-content: center;
  gap: 14px;
}

.landing-copy h1 {
  max-width: 620px;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.04;
}

.landing-copy h2 {
  max-width: 640px;
  margin: 0;
  font-size: clamp(32px, 4.4vw, 50px);
  line-height: 1.08;
  letter-spacing: 0;
}

.landing-copy p:not(.eyebrow) {
  max-width: 640px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

.landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

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

.landing-metrics a {
  display: grid;
  align-content: space-between;
  min-height: 116px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 8px 22px rgba(28, 43, 56, 0.045);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.landing-metrics a:hover {
  border-color: rgba(21, 111, 121, 0.32);
  box-shadow: var(--shadow-lift);
  transform: translateY(-1px);
}

.landing-metrics span {
  color: var(--accent);
  font-size: 32px;
  font-weight: 760;
  line-height: 1;
}

.landing-metrics strong {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.landing-waterfall {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 66px;
  gap: 12px;
  align-content: center;
}

.landing-waterfall.compact {
  grid-auto-rows: 74px;
}

.about-author-slide {
  grid-template-columns: minmax(0, 1.12fr) minmax(470px, 0.88fr);
  background: linear-gradient(135deg, #f0fbf8 0%, #ffffff 50%, #fff6e5 100%);
}

.about-author-slide .landing-copy {
  padding-right: 4px;
}

.about-author-slide .landing-waterfall {
  grid-template-columns: 1fr;
  grid-auto-rows: 52px;
  align-content: center;
  gap: 8px;
  width: min(100%, 560px);
  justify-self: end;
  padding-bottom: 18px;
}

.about-author-slide .waterfall-card {
  gap: 4px;
  grid-column: auto;
  grid-row: auto;
  overflow: hidden;
  padding: 7px 13px;
}

.about-author-slide .waterfall-card.wide {
  grid-column: auto;
}

.about-author-slide .waterfall-card.tall {
  grid-row: auto;
}

.waterfall-card {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  border: 1px solid rgba(21, 111, 121, 0.14);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 10px 24px rgba(28, 43, 56, 0.06);
}

.waterfall-card.tall {
  grid-row: span 2;
}

.waterfall-card.wide {
  grid-column: span 2;
}

.waterfall-card span {
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.waterfall-card p {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.48;
}

.about-author-slide .waterfall-card p {
  font-size: 12.5px;
  line-height: 1.36;
}

.about-author-slide .waterfall-card span {
  font-size: 12px;
}

.contact-slide {
  grid-template-columns: minmax(0, 0.9fr) minmax(430px, 1.1fr);
  background: linear-gradient(135deg, #f7f3ff 0%, #ffffff 48%, #edf9f6 100%);
}

.contact-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 560px;
}

.contact-tags span {
  border: 1px solid rgba(21, 111, 121, 0.16);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(28, 43, 56, 0.04);
}

.contact-qr-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}

.contact-qr-card {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
  border: 1px solid rgba(21, 111, 121, 0.14);
  border-radius: var(--radius);
  min-height: 0;
  padding: 12px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 12px 26px rgba(28, 43, 56, 0.07);
}

.contact-qr-card img {
  display: block;
  width: 100%;
  height: 212px;
  border-radius: var(--radius-sm);
  background: #fff;
  object-fit: contain;
}

.contact-qr-card span {
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 850;
  text-align: center;
}

.landing-carousel-controls {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.landing-carousel-button,
.landing-carousel-dots button {
  border: 0;
  background: transparent;
  color: var(--accent-2);
  box-shadow: none;
  cursor: pointer;
}

.landing-carousel-button {
  position: absolute;
  top: 50%;
  display: grid;
  place-items: center;
  width: 44px;
  height: 76px;
  border-radius: 999px;
  padding: 0;
  color: rgba(21, 111, 121, 0.58);
  font-size: 44px;
  font-weight: 250;
  line-height: 1;
  pointer-events: auto;
  transform: translateY(-50%);
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

#landing-prev-button {
  left: 10px;
}

#landing-next-button {
  right: 10px;
}

.landing-carousel-dots {
  position: absolute;
  left: 50%;
  bottom: 16px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  pointer-events: auto;
  transform: translateX(-50%);
}

.landing-carousel-dots button {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  padding: 0;
  box-shadow: none;
  transition:
    width 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease;
}

.landing-carousel-dots button.active {
  width: 24px;
  border-color: var(--accent);
  background: var(--accent);
}

.landing-carousel-button:hover {
  background: rgba(255, 255, 255, 0.42);
  color: rgba(21, 111, 121, 0.92);
  transform: translateY(-50%) scale(1.03);
}

.hero-card,
.tool-overview,
.knowledge-section,
.feed-section,
.resource-strip,
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-card,
.knowledge-section,
.feed-section,
.panel {
  padding: 22px;
}

.hero-card,
.tool-overview,
.knowledge-section,
.feed-section,
.landing-hero {
  scroll-margin-top: 92px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.section-title span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.section-subtitle {
  max-width: 520px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(30px, 4vw, 42px);
  font-weight: 760;
  line-height: 1.1;
}

h2 {
  margin-bottom: 0;
  font-size: 22px;
  font-weight: 730;
  letter-spacing: 0;
}

.brief-list {
  display: grid;
  gap: 12px;
  max-height: 680px;
  overflow-y: auto;
  padding-right: 8px;
  scrollbar-gutter: stable;
}

.brief-list::-webkit-scrollbar {
  width: 10px;
}

.brief-list::-webkit-scrollbar-track {
  background: var(--surface-2);
  border-radius: 999px;
}

.brief-list::-webkit-scrollbar-thumb {
  background: #c5d3dc;
  border-radius: 999px;
  border: 2px solid var(--surface-2);
}

.brief-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: #fff;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.brief-item:hover {
  border-color: rgba(21, 111, 121, 0.32);
  box-shadow: var(--shadow-lift);
  transform: translateY(-1px);
}

.brief-fire {
  color: var(--hot);
  font-size: 16px;
  line-height: 1.4;
}

.brief-item h3 {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 720;
  line-height: 1.35;
}

.brief-item h3 a:hover {
  color: var(--accent-2);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.brief-item p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.65;
}

.brief-item time {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.tool-overview {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  overflow: hidden;
}

.tool-categories,
.recommended-tools {
  padding: 22px;
}

.tool-categories {
  border-right: 1px solid var(--line);
  background: var(--surface-2);
}

.category-list {
  display: grid;
  gap: 10px;
}

.category-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 48px;
  padding: 12px 14px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
  text-align: left;
}

.category-pill span {
  color: var(--accent);
  font-size: 13px;
  font-weight: 760;
}

.category-pill.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-2);
}

.recommended-tool-list {
  --tool-card-row-height: 304px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: var(--tool-card-row-height);
  gap: 12px;
  max-height: calc((var(--tool-card-row-height) * 2) + 12px);
  overflow-y: auto;
  padding-right: 8px;
  scrollbar-gutter: stable;
}

.recommended-tool-list::-webkit-scrollbar {
  width: 10px;
}

.recommended-tool-list::-webkit-scrollbar-track {
  background: var(--surface-2);
  border-radius: 999px;
}

.recommended-tool-list::-webkit-scrollbar-thumb {
  background: #c5d3dc;
  border: 2px solid var(--surface-2);
  border-radius: 999px;
}

.recommended-tool {
  display: grid;
  gap: 12px;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 17px;
  background: #fff;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.recommended-tool:hover {
  border-color: rgba(21, 111, 121, 0.28);
  box-shadow: var(--shadow-lift);
  transform: translateY(-1px);
}

.tool-rating-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  width: fit-content;
}

.star-rating {
  color: var(--warning);
  font-size: 13px;
  font-weight: 760;
  white-space: nowrap;
  letter-spacing: 1px;
}

.recommended-tool h3 {
  margin-bottom: 5px;
  font-size: 17px;
  font-weight: 720;
}

.tool-title-link {
  color: var(--text);
  text-decoration: none;
}

.tool-title-link:hover,
.tool-title-link:focus-visible {
  color: var(--accent-2);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.recommended-tool p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.tool-detail-fields {
  display: grid;
  gap: 7px;
  margin: 0;
}

.tool-detail-fields div {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.tool-detail-fields dt {
  color: var(--text);
  font-weight: 700;
}

.tool-detail-fields dd {
  margin: 0;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.recommend {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 5px 9px;
  background: var(--accent-soft);
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 700;
}

.recommend.secondary {
  background: var(--warm-bg);
  color: var(--warning);
}

.knowledge-section {
  display: grid;
  gap: 14px;
}

.prompt-section > .section-title {
  grid-template-columns: minmax(160px, auto) minmax(0, 1fr) auto;
  align-items: start;
}

.prompt-tools {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.prompt-category-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.prompt-category-chip {
  --chip-bg: #f4f9ff;
  --chip-border: #d8e8f6;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--chip-border);
  border-radius: 999px;
  min-height: 36px;
  padding: 7px 12px;
  background: linear-gradient(180deg, #ffffff 0%, var(--chip-bg) 100%);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    background-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.prompt-category-chip:nth-child(6n + 1) {
  --chip-bg: #edf8f7;
  --chip-border: #cbe6e2;
}

.prompt-category-chip:nth-child(6n + 2) {
  --chip-bg: #fff6dc;
  --chip-border: #eadba8;
}

.prompt-category-chip:nth-child(6n + 3) {
  --chip-bg: #f0f6ff;
  --chip-border: #d2e0f4;
}

.prompt-category-chip:nth-child(6n + 4) {
  --chip-bg: #fff0ec;
  --chip-border: #f0d3ca;
}

.prompt-category-chip:nth-child(6n + 5) {
  --chip-bg: #f1f7e8;
  --chip-border: #d7e5c2;
}

.prompt-category-chip:nth-child(6n) {
  --chip-bg: #f5f1ff;
  --chip-border: #ded4f4;
}

.prompt-category-chip span {
  color: var(--accent);
  font-weight: 760;
}

.prompt-category-chip:hover {
  border-color: var(--accent);
  background: linear-gradient(180deg, #f8ffff 0%, #dff5f2 100%);
  color: var(--accent-2);
}

.prompt-category-chip.active {
  border-color: var(--accent);
  background: linear-gradient(180deg, #178693 0%, #0f6671 100%);
  color: #fff;
  box-shadow:
    0 0 0 3px rgba(21, 111, 121, 0.14),
    0 10px 22px rgba(21, 111, 121, 0.2);
  transform: translateY(-1px);
}

.prompt-category-chip.active span {
  color: #fff;
}

.prompt-search {
  position: relative;
  display: block;
  width: min(480px, 100%);
}

.prompt-search span {
  position: absolute;
  top: 50%;
  left: 13px;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 14px;
}

.prompt-search input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 13px 8px 38px;
  background: #fff;
  color: var(--text);
  outline: none;
  font-size: 13px;
  font-weight: 500;
}

.prompt-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(21, 111, 121, 0.1);
}

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

.prompt-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 17px;
  background: #fff;
}

.prompt-card-head {
  display: grid;
  gap: 8px;
}

.prompt-card h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 720;
}

.prompt-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.prompt-card pre,
.markdown-view {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px;
  background: var(--code-bg);
  color: var(--code-text);
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.rich-editor-shell {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}

.rich-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-bottom: 1px solid var(--line);
  padding: 8px;
  background: var(--surface-2);
}

.rich-editor-toolbar button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 9px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.rich-editor-toolbar button:hover,
.rich-editor-toolbar button.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.rich-editor {
  min-height: 300px;
  max-height: 520px;
  overflow-y: auto;
  padding: 14px;
}

.rich-editor .tiptap,
.rich-content {
  color: var(--code-text);
  font-size: 14px;
  line-height: 1.55;
  outline: none;
}

.rich-editor .tiptap > :first-child,
.rich-content > :first-child {
  margin-top: 0;
}

.rich-editor .tiptap > :last-child,
.rich-content > :last-child {
  margin-bottom: 0;
}

.rich-editor .tiptap p,
.rich-content p {
  margin: 0.18em 0 0.55em;
}

.rich-editor .tiptap h1,
.rich-editor .tiptap h2,
.rich-editor .tiptap h3,
.rich-content h1,
.rich-content h2,
.rich-content h3 {
  margin: 0.65em 0 0.35em;
  line-height: 1.25;
}

.rich-editor .tiptap h1,
.rich-content h1 {
  font-size: 24px;
  font-weight: 760;
}

.rich-editor .tiptap h2,
.rich-content h2 {
  font-size: 20px;
  font-weight: 740;
}

.rich-editor .tiptap h3,
.rich-content h3 {
  font-size: 17px;
  font-weight: 720;
}

.rich-editor .tiptap ul,
.rich-editor .tiptap ol,
.rich-content ul,
.rich-content ol {
  margin: 0.25em 0 0.6em;
  padding-left: 1.45em;
}

.rich-editor .tiptap li,
.rich-content li {
  margin: 0.12em 0;
}

.rich-editor .tiptap img,
.rich-content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 12px 0;
  border-radius: var(--radius-sm);
}

.rich-editor .tiptap pre,
.rich-content pre {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: var(--code-bg);
}

.rich-image-input {
  display: none;
}

.practice-layout {
  display: grid;
  gap: 16px;
  align-items: stretch;
}

.practice-list {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.practice-section .practice-list {
  --practice-card-row-height: 158px;
  grid-auto-rows: var(--practice-card-row-height);
  max-height: calc((var(--practice-card-row-height) * 4) + (10px * 3));
  overflow-y: auto;
  padding-right: 8px;
  scrollbar-gutter: stable;
}

.practice-section .practice-list::-webkit-scrollbar {
  width: 10px;
}

.practice-section .practice-list::-webkit-scrollbar-track {
  background: var(--surface-2);
  border-radius: 999px;
}

.practice-section .practice-list::-webkit-scrollbar-thumb {
  background: #c5d3dc;
  border: 2px solid var(--surface-2);
  border-radius: 999px;
}

.practice-section .practice-card {
  min-height: 0;
  overflow: hidden;
}

.practice-section .practice-card strong,
.practice-section .practice-card span {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
}

.practice-section .practice-card strong {
  -webkit-line-clamp: 2;
}

.practice-section .practice-card span {
  -webkit-line-clamp: 2;
}

.practice-card {
  display: grid;
  gap: 8px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.practice-card:hover,
.practice-card.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: var(--shadow);
}

.practice-card:hover {
  transform: translateY(-1px);
}

.practice-card time,
.practice-detail time {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.practice-card strong {
  font-size: 15px;
  font-weight: 720;
  line-height: 1.45;
}

.practice-card span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.prompt-list .practice-card em {
  color: var(--accent);
  font-size: 12px;
  font-style: normal;
  font-weight: 760;
}

.prompt-layout {
  grid-template-columns: 340px minmax(0, 1fr);
  align-items: start;
}

.prompt-list {
  grid-template-columns: 1fr;
  align-content: start;
  max-height: calc((76px * 6) + (8px * 5));
  overflow-y: auto;
  padding-right: 6px;
}

.prompt-list .practice-card {
  min-height: 76px;
  gap: 5px;
  padding: 12px 14px;
}

.prompt-list .practice-card strong {
  font-size: 14px;
  line-height: 1.35;
}

.prompt-list .practice-card span {
  display: -webkit-box;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.practice-detail {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  height: 580px;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  overflow: hidden;
  background: #fff;
}

.practice-detail-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.practice-detail-head .tag-row {
  grid-column: 1 / -1;
}

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

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

.copy-prompt-button {
  min-width: 104px;
}

.copy-prompt-button.copied {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-2);
}

.practice-edit-button {
  align-self: start;
  padding: 9px 14px;
}

.practice-detail h3 {
  margin: 3px 0 0;
  font-size: 20px;
  font-weight: 740;
  line-height: 1.25;
}

.practice-detail .markdown-view {
  min-height: 0;
  overflow-y: auto;
}

.automation-detail-page {
  max-width: 1040px;
  margin-inline: auto;
}

.automation-detail-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.automation-detail-card {
  height: auto;
  min-height: min(720px, calc(100dvh - 180px));
  overflow: visible;
}

.automation-detail-card .markdown-view {
  overflow: visible;
}

.back-link {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 14px;
  background: #fff;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.prompt-section .prompt-list {
  max-height: calc((76px * 6) + (8px * 5));
  overflow-y: auto;
  padding-right: 6px;
}

.automation-detail-page .automation-detail-card {
  height: auto;
  max-height: none;
}

.prompt-detail .markdown-view {
  max-height: none;
  overflow-y: auto;
  white-space: pre-wrap;
}

.prompt-detail {
  height: 520px;
  min-height: 0;
}

.control-panel {
  margin-bottom: 12px;
}

.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.segmented button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 13px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-weight: 650;
}

.segmented button.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-2);
  font-weight: 760;
}

.feed-list {
  display: grid;
  gap: 10px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  width: fit-content;
  max-width: 100%;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 16px;
  background: #fff;
  box-shadow: var(--shadow);
}

.pagination button {
  min-width: 40px;
  height: 40px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 13px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
}

.pagination button:hover,
.pagination button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.pagination-summary {
  color: var(--muted);
  white-space: nowrap;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pagination-ellipsis {
  color: var(--muted);
  font-weight: 700;
}

.pagination .prev-page,
.pagination .next-page {
  min-width: 82px;
}

.feed-card {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  background: #fff;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.feed-card:hover,
.feed-card.active {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.feed-date {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.feed-card h3 {
  margin-bottom: 5px;
  font-size: 16px;
  font-weight: 720;
  line-height: 1.4;
}

.feed-card h3 a:hover {
  color: var(--accent-2);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.feed-card p {
  display: -webkit-box;
  margin-bottom: 8px;
  color: var(--muted);
  overflow: hidden;
  font-size: 13.5px;
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.meta-row,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.meta-row {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
}

.tag {
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--surface-2);
  color: var(--accent-2);
  font-size: 11px;
  font-weight: 700;
}

.source-link {
  display: inline-flex;
  width: fit-content;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 9px;
  background: #fff;
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 700;
}

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

.resource-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
}

.resource-link {
  display: grid;
  gap: 6px;
  min-height: 92px;
  padding: 20px;
  border-right: 1px solid var(--line);
  background: #fff;
}

.resource-link:last-child {
  border-right: 0;
}

.resource-link:hover {
  background: var(--surface-2);
}

.resource-link strong {
  font-size: 17px;
}

.resource-link span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.note-dialog {
  width: min(520px, calc(100% - 28px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
  box-shadow: 0 16px 48px rgba(20, 34, 45, 0.2);
}

.note-dialog::backdrop {
  background: rgba(18, 29, 37, 0.38);
}

.dialog-fallback-open::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(18, 29, 37, 0.38);
}

.note-dialog.fallback-open {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 100;
  display: block;
  transform: translate(-50%, -50%);
}

.note-dialog form {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dialog-head button {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 28px;
}

.note-dialog label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.note-dialog input,
.note-dialog textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  background: #fff;
  color: var(--text);
  outline: none;
}

.practice-dialog {
  width: min(720px, calc(100% - 28px));
}

.consultation-dialog {
  width: min(430px, calc(100% - 28px));
}

.consultation-dialog form {
  gap: 16px;
}

.consultation-qr {
  display: block;
  width: min(100%, 330px);
  height: auto;
  max-height: min(56vh, 330px);
  margin: 0 auto;
  border-radius: var(--radius-sm);
  object-fit: contain;
  background: #fff;
}

.consultation-prompt {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.55;
  text-align: center;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

:root[data-theme="dark"] .prompt-category-chip,
:root[data-theme="dark"] .category-pill,
:root[data-theme="dark"] .segmented button,
:root[data-theme="dark"] .secondary-button,
:root[data-theme="dark"] .top-topic-nav .topic-card {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
}

:root[data-theme="dark"] .top-topic-nav .topic-card:not(.active),
:root[data-theme="dark"] .prompt-category-chip:not(.active) {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, var(--tint-bg) 100%);
  border-color: var(--tint-border);
}

:root[data-theme="dark"] .top-topic-nav .topic-card:nth-child(1) {
  --tint-bg: rgba(255, 107, 87, 0.14);
  --tint-border: rgba(255, 107, 87, 0.26);
}

:root[data-theme="dark"] .top-topic-nav .topic-card:nth-child(2) {
  --tint-bg: rgba(245, 189, 85, 0.14);
  --tint-border: rgba(245, 189, 85, 0.28);
}

:root[data-theme="dark"] .top-topic-nav .topic-card:nth-child(3) {
  --tint-bg: rgba(104, 157, 255, 0.14);
  --tint-border: rgba(104, 157, 255, 0.28);
}

:root[data-theme="dark"] .top-topic-nav .topic-card:nth-child(4) {
  --tint-bg: rgba(77, 182, 194, 0.14);
  --tint-border: rgba(77, 182, 194, 0.28);
}

:root[data-theme="dark"] .prompt-category-chip:nth-child(6n + 1) {
  --tint-bg: rgba(77, 182, 194, 0.13);
  --tint-border: rgba(77, 182, 194, 0.26);
}

:root[data-theme="dark"] .prompt-category-chip:nth-child(6n + 2) {
  --tint-bg: rgba(245, 189, 85, 0.14);
  --tint-border: rgba(245, 189, 85, 0.28);
}

:root[data-theme="dark"] .prompt-category-chip:nth-child(6n + 3) {
  --tint-bg: rgba(104, 157, 255, 0.13);
  --tint-border: rgba(104, 157, 255, 0.26);
}

:root[data-theme="dark"] .prompt-category-chip:nth-child(6n + 4) {
  --tint-bg: rgba(255, 107, 87, 0.13);
  --tint-border: rgba(255, 107, 87, 0.26);
}

:root[data-theme="dark"] .prompt-category-chip:nth-child(6n + 5) {
  --tint-bg: rgba(136, 190, 95, 0.13);
  --tint-border: rgba(136, 190, 95, 0.26);
}

:root[data-theme="dark"] .prompt-category-chip:nth-child(6n) {
  --tint-bg: rgba(161, 126, 255, 0.13);
  --tint-border: rgba(161, 126, 255, 0.26);
}

:root[data-theme="dark"] .prompt-category-chip:hover,
:root[data-theme="dark"] .category-pill.active,
:root[data-theme="dark"] .segmented button.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--text);
}

:root[data-theme="dark"] .prompt-category-chip.active,
:root[data-theme="dark"] .top-topic-nav .topic-card.active {
  background: linear-gradient(180deg, #2fb5c1 0%, #178693 100%);
  border-color: #83d8e3;
  color: #fff;
  box-shadow:
    0 0 0 3px rgba(77, 182, 194, 0.2),
    0 14px 30px rgba(0, 0, 0, 0.28);
}

:root[data-theme="dark"] .prompt-category-chip.active span,
:root[data-theme="dark"] .top-topic-nav .topic-card.active span:last-child {
  color: #fff;
}

:root[data-theme="dark"] .landing-metrics a {
  background: rgba(32, 39, 45, 0.72);
  border-color: var(--line);
}

:root[data-theme="dark"] .waterfall-card,
:root[data-theme="dark"] .contact-tags span,
:root[data-theme="dark"] .contact-qr-card,
:root[data-theme="dark"] .landing-carousel-dots button {
  background: rgba(32, 39, 45, 0.72);
  border-color: rgba(77, 182, 194, 0.18);
}

:root[data-theme="dark"] .landing-carousel-button {
  background: transparent;
  color: rgba(131, 216, 227, 0.66);
}

:root[data-theme="dark"] .landing-carousel-button:hover {
  background: rgba(32, 39, 45, 0.34);
  color: rgba(179, 238, 245, 0.95);
}

:root[data-theme="dark"] .waterfall-card p {
  color: var(--text);
}

:root[data-theme="dark"] .landing-carousel-dots button.active {
  background: var(--accent);
  border-color: var(--accent);
}

@media (max-width: 1020px) {
  .topbar,
  .tool-overview,
  .practice-layout {
    grid-template-columns: 1fr;
  }

  .landing-slide {
    grid-template-columns: 1fr;
  }

  .landing-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .top-topic-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: min(520px, 88vw);
    justify-self: start;
  }

  .top-search {
    width: 100%;
  }

  .tool-categories {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .recommended-tool-list {
    max-height: min(70vh, calc((var(--tool-card-row-height) * 2) + 12px));
  }

  .resource-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .resource-link:nth-child(2) {
    border-right: 0;
  }
}

@media (max-width: 720px) {
  html,
  body {
    overflow-x: hidden;
  }

  .side-control-dock {
    position: static;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: min(100% - 24px, 1180px);
    margin: 10px auto 0;
  }

  .theme-switcher {
    grid-template-columns: repeat(3, 1fr);
    width: 154px;
    border-radius: 999px;
    padding: 4px;
    box-shadow: 0 6px 18px rgba(28, 43, 56, 0.06);
  }

  .theme-switcher button {
    width: auto;
    min-height: 36px;
    font-size: 16px;
  }

  .admin-login-button {
    border: 1px solid rgba(21, 111, 121, 0.18);
    width: 44px;
    height: 44px;
    padding: 0;
    background: var(--accent-soft);
    box-shadow: 0 6px 18px rgba(28, 43, 56, 0.06);
  }

  .consultation-float {
    right: 8px;
    top: 52%;
  }

  .consultation-float-button {
    width: 78px;
    height: 78px;
  }

  .consultation-float-badge {
    top: -5px;
    padding: 3px 7px;
    font-size: 10px;
  }

  .consultation-float-text {
    width: 48px;
    font-size: 14px;
    line-height: 1.15;
  }

  .consultation-float-core {
    bottom: 9px;
    width: 24px;
    height: 16px;
    font-size: 10px;
  }

  .topbar {
    position: static;
    gap: 12px;
    width: min(100% - 24px, 1180px);
    padding: 12px 0;
  }

  .home-shell {
    width: min(100% - 24px, 1180px);
    gap: 18px;
    margin-top: 16px;
  }

  .landing-hero {
    min-height: 0;
  }

  .landing-slide {
    gap: 18px;
    padding: 18px 18px 58px;
  }

  .landing-copy {
    gap: 12px;
  }

  .landing-copy h1 {
    font-size: clamp(31px, 11vw, 42px);
  }

  .landing-copy h2 {
    font-size: clamp(28px, 10vw, 38px);
  }

  .landing-copy p:not(.eyebrow) {
    font-size: 14px;
    line-height: 1.75;
  }

  .landing-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .landing-actions .primary-button,
  .landing-actions .secondary-button {
    padding-inline: 10px;
    font-size: 13px;
  }

  .landing-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .landing-metrics a {
    min-height: 78px;
    padding: 12px;
  }

  .landing-metrics span {
    font-size: 25px;
  }

  .landing-waterfall {
    grid-auto-rows: minmax(78px, auto);
  }

  .waterfall-card,
  .waterfall-card.tall,
  .waterfall-card.wide {
    grid-column: auto;
    grid-row: auto;
  }

  .waterfall-card p {
    font-size: 13px;
  }

  .contact-qr-card img {
    height: 220px;
  }

  .landing-carousel-controls {
    inset: 0;
  }

  .landing-carousel-button {
    width: 34px;
    height: 62px;
    font-size: 36px;
  }

  #landing-prev-button {
    left: 6px;
  }

  #landing-next-button {
    right: 6px;
  }

  .landing-carousel-dots {
    bottom: 14px;
  }

  .hero-card,
  .knowledge-section,
  .feed-section,
  .panel {
    padding: 16px;
  }

  .section-title {
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 14px;
  }

  .section-title span {
    flex: 0 0 auto;
    font-size: 12px;
  }

  .prompt-section > .section-title {
    grid-template-columns: 1fr;
  }

  .prompt-search {
    width: 100%;
  }

  .top-topic-nav {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .top-topic-nav .topic-card {
    gap: 8px;
    min-height: 56px;
    padding: 12px;
  }

  .top-topic-nav .topic-card strong {
    font-size: 15px;
  }

  .top-topic-nav .topic-card span:last-child {
    min-width: 30px;
  }

  .top-search input {
    min-height: 48px;
    padding-top: 11px;
    padding-bottom: 11px;
    font-size: 14px;
  }

  .brief-list {
    max-height: min(58vh, 520px);
    padding-right: 4px;
  }

  .brief-item {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    padding: 14px;
  }

  .brief-fire {
    justify-self: start;
  }

  .brief-item time {
    grid-column: 2;
    font-size: 11px;
  }

  .brief-item h3 {
    font-size: 16px;
  }

  .brief-item p {
    font-size: 13px;
    line-height: 1.6;
  }

  .tool-overview {
    overflow: visible;
  }

  .tool-categories,
  .recommended-tools {
    padding: 16px;
  }

  .practice-detail {
    max-height: min(58vh, 460px);
  }

  .practice-section .practice-list {
    max-height: min(70vh, calc((var(--practice-card-row-height) * 4) + (10px * 3)));
  }

  .prompt-section .prompt-list {
    max-height: calc((76px * 6) + (8px * 5));
  }

  .prompt-detail {
    height: auto;
    max-height: none;
    scroll-margin-top: 12px;
  }

  .practice-detail {
    height: min(64vh, 540px);
    padding: 16px;
  }

  .practice-detail-head {
    grid-template-columns: 1fr;
  }

  .prompt-section > .section-title {
    grid-template-columns: 1fr;
  }

  .practice-actions {
    justify-content: flex-start;
  }

  .prompt-detail-actions {
    justify-content: flex-start;
  }

  .practice-detail h3 {
    font-size: 18px;
  }

  .practice-card {
    padding: 11px;
  }

  .practice-card strong {
    font-size: 14px;
  }

  .practice-card span {
    font-size: 12px;
  }

  .rich-content {
    font-size: 13px;
  }

  .rich-content pre,
  .rich-editor .tiptap pre {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }

  .rich-content code,
  .rich-editor .tiptap code {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .pagination {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    border-radius: 22px;
    padding: 12px;
  }

  .pagination-summary {
    white-space: normal;
    text-align: center;
  }

  .pagination-controls {
    flex-wrap: wrap;
    justify-content: center;
    gap: 7px;
  }

  .pagination button {
    min-width: 36px;
    height: 36px;
    padding: 0 11px;
  }

  .pagination .prev-page,
  .pagination .next-page {
    min-width: 72px;
  }

  .brand small {
    white-space: normal;
  }

  h1 {
    font-size: 30px;
  }

  .feed-card {
    grid-template-columns: 1fr;
    gap: 7px;
    padding: 10px;
  }

  .recommended-tool-list,
  .prompt-grid,
  .resource-strip {
    grid-template-columns: 1fr;
  }

  .recommended-tool-list {
    --tool-card-row-height: 248px;
    max-height: min(68vh, calc((var(--tool-card-row-height) * 4) + 36px));
  }

  .resource-link,
  .resource-link:nth-child(2) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .resource-link:last-child {
    border-bottom: 0;
  }

  .note-dialog {
    width: min(100% - 20px, 720px);
    max-height: calc(100dvh - 20px);
    overflow-y: auto;
  }

  .note-dialog form {
    gap: 12px;
    padding: 14px;
  }

  .consultation-dialog form {
    padding: 16px;
  }

  .consultation-qr {
    width: min(100%, 300px);
  }

  .consultation-prompt {
    font-size: 16px;
  }

  .dialog-actions {
    flex-wrap: wrap;
  }

  .dialog-actions button {
    flex: 1 1 120px;
  }

  .rich-editor {
    min-height: 240px;
    max-height: 44vh;
    padding: 12px;
  }

  .rich-editor-toolbar {
    gap: 5px;
    padding: 7px;
  }

  .rich-editor-toolbar button {
    padding: 6px 8px;
  }
}

@media (max-width: 520px) {
  .landing-waterfall {
    grid-template-columns: 1fr;
  }

  .contact-qr-grid {
    grid-template-columns: 1fr;
  }

  .contact-qr-card img {
    height: 210px;
  }
}
