:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text: #142033;
  --muted: #657284;
  --line: #dbe4ee;
  --primary: #17685f;
  --primary-strong: #0f4f48;
  --accent: #b7791f;
  --danger: #b42318;
  --success: #1f7a4d;
  --shadow: 0 14px 34px rgba(20, 32, 51, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 42px;
}

.brand-center {
  text-align: center;
  padding: 18px 0 16px;
}

.brand-center h1,
.brand-small h1 {
  margin: 0;
  font-size: 38px;
  line-height: 1.15;
  font-weight: 800;
}

.brand-center p,
.eyebrow,
.muted {
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--primary);
  font-weight: 700;
  font-size: 13px;
}

.brand-small h1 {
  font-size: 28px;
}

.hero-panel,
.panel,
.module-tile,
.result-card,
.answer-card,
.admin-panel,
.login-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero-panel {
  padding: 24px;
  margin: 0 auto 22px;
  max-width: 920px;
}

.question-label {
  display: block;
  margin-bottom: 10px;
  font-size: 18px;
  font-weight: 800;
}

.search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  position: relative;
}

.input,
.textarea,
.select,
.search-input {
  width: 100%;
  min-width: 0;
  border: 1px solid #cbd6e2;
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  outline: none;
}

.input,
.select,
.search-input {
  min-height: 42px;
  padding: 10px 12px;
}

.search-input {
  min-height: 48px;
  font-size: 17px;
}

.textarea {
  padding: 10px 12px;
  resize: vertical;
}

.input:focus,
.textarea:focus,
.select:focus,
.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(23, 104, 95, 0.12);
}

.button,
.button-secondary,
.button-danger,
.button-ghost,
.tab-button {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 9px 14px;
  white-space: nowrap;
}

.button {
  background: var(--primary);
  color: #fff;
}

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

.button-secondary,
.button-ghost,
.tab-button {
  background: #eef3f7;
  color: #1f2b3a;
  border-color: #d3ddea;
}

.button-danger {
  background: #fff1f0;
  color: var(--danger);
  border-color: #ffc9c4;
}

.button-ghost {
  background: transparent;
}

.suggestions {
  position: absolute;
  left: 0;
  right: 128px;
  top: 54px;
  z-index: 5;
  display: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.suggestions.show {
  display: grid;
}

.suggestion-item {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  background: #fff;
  text-align: left;
}

.suggestion-item:hover {
  background: #f3f7fa;
}

.suggestion-title {
  color: var(--text);
  font-weight: 700;
  line-height: 1.35;
}

.suggestion-match {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.quick-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 30px auto 18px;
  max-width: 920px;
}

.module-tile {
  min-height: 116px;
  display: grid;
  place-items: center;
  padding: 18px;
  font-size: 23px;
  font-weight: 800;
  transition: transform 0.12s ease, border-color 0.12s ease;
}

.module-tile:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
}

.footer-actions {
  display: flex;
  justify-content: flex-end;
  max-width: 920px;
  margin: 16px auto 0;
}

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

.section-head h2,
.panel h2,
.admin-panel h2 {
  margin: 0;
  font-size: 20px;
}

.results {
  display: grid;
  gap: 12px;
}

.result-card {
  padding: 16px;
}

.result-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

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

.tag,
.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
}

.tag {
  background: #e7f4ef;
  color: var(--primary);
}

.status {
  background: #fff7e8;
  color: var(--accent);
}

.answer-list {
  display: grid;
  gap: 12px;
}

.answer-card {
  padding: 14px;
  box-shadow: none;
}

.answer-media {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}

.answer-video-wrap {
  display: grid;
  gap: 7px;
}

.video-speed-control {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.video-speed-select {
  min-height: 28px;
  padding: 3px 8px;
  border: 1px solid #cbd6e2;
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-size: 12px;
}

.answer-document-preview {
  display: block;
  width: 100%;
  height: min(720px, 70vh);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}

.answer-document-download {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}

.answer-document-download span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.answer-preview-status {
  padding: 12px 14px;
  border: 1px solid #d7e9e3;
  border-radius: 6px;
  background: #f3faf7;
  color: var(--primary-strong);
}

.answer-preview-status.is-error {
  border-color: #f3c8c4;
  background: #fff6f5;
  color: var(--danger);
}

.feedback-row,
.form-row,
.admin-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.feedback-row {
  margin-top: 12px;
}

.approval {
  color: var(--primary);
  font-weight: 800;
}

.empty {
  padding: 18px;
  border: 1px dashed #c8d4e1;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(460px, 100%);
  padding: 24px;
  display: grid;
  gap: 14px;
}

.login-logo {
  width: min(190px, 58vw);
  height: 56px;
  object-fit: contain;
  object-position: left center;
}

.login-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}

.login-tab {
  min-width: 0;
  min-height: 56px;
  padding: 8px 4px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  white-space: normal;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.login-tab:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(30, 72, 61, 0.08);
}

.login-tab[data-login-method="wecom"] {
  border-color: #c9e8d6;
  background: #f2fbf5;
  color: #18724d;
}

.login-tab[data-login-method="phone"] {
  border-color: #c9def0;
  background: #f2f8fd;
  color: #286b9d;
}

.login-tab[data-login-method="account"] {
  border-color: #c8dddd;
  background: #f1f8f7;
  color: #17685f;
}

.login-tab[data-login-method="wecom"].active {
  background: #d9f2e2;
  box-shadow: 0 3px 10px rgba(24, 114, 77, 0.16);
}

.login-tab[data-login-method="phone"].active {
  background: #dbeefa;
  box-shadow: 0 3px 10px rgba(40, 107, 157, 0.16);
}

.login-tab[data-login-method="account"].active {
  background: #d9ecea;
  box-shadow: 0 3px 10px rgba(23, 104, 95, 0.16);
}

.login-method-panel {
  display: grid;
  gap: 12px;
}

.login-inline-message {
  min-height: 18px;
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.login-inline-message.warning {
  color: #9a6a16;
}

.login-inline-message.error {
  color: #b44e45;
}

.login-inline-message.success {
  color: #18724d;
}

.wecom-login-note {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid #cce9db;
  border-radius: 7px;
  background: #f1fbf6;
  color: var(--primary);
}

.wecom-login-note span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.admin-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.admin-nav {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 8px;
}

.tab-button {
  text-align: left;
}

.tab-button.active {
  background: var(--primary);
  color: #fff;
}

.admin-content {
  display: grid;
  gap: 14px;
}

.admin-panel {
  padding: 16px;
}

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

.stat {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.dashboard-card {
  width: 100%;
  min-height: 92px;
  color: inherit;
  text-align: left;
}

.dashboard-card:hover {
  border-color: var(--primary);
  background: #eef8f5;
}

.stat strong {
  display: block;
  font-size: 28px;
}

.module-filter,
.filter-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.download-category-tabs {
  margin: 16px 0 12px;
}

.filter-row {
  margin-bottom: 12px;
}

.module-filter .tab-button,
.filter-row .tab-button {
  min-height: 34px;
  padding: 7px 10px;
}

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

.form-grid .full {
  grid-column: 1 / -1;
}

.field-group {
  display: grid;
  gap: 4px;
}

.field-label {
  font-weight: 700;
}

.list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.list-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.answer-editor-shell {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.answer-editor-toolbar,
.answer-block-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.answer-editor {
  display: grid;
  gap: 12px;
}

.answer-editor-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #b9d8c9;
  border-radius: 8px;
  background: #f8fcf9;
}

.answer-editor-head,
.answer-block-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.answer-editor-title {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.answer-editor-title strong {
  color: var(--primary-strong);
  white-space: nowrap;
}

.answer-editor-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.answer-editor-actions button {
  min-height: 32px;
  padding: 6px 9px;
  font-size: 12px;
}

.answer-enabled-row {
  margin: 0;
}

.answer-block-list {
  display: grid;
  gap: 8px;
}

.answer-block-editor {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #d7e4dd;
  border-radius: 7px;
  background: #fff;
}

.answer-block-head strong {
  color: #2459b8;
}

.answer-block-head .status {
  margin-left: 7px;
}

.answer-block-content {
  min-height: 92px;
  line-height: 1.7;
}

.answer-callout-input {
  border-color: #eadb9e;
  background: #fffbed;
}

.answer-block-file {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.answer-block-file-name {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.answer-editor-media-preview {
  display: block;
  width: min(100%, 520px);
  max-height: 240px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}

.answer-editor-card.is-drag-over {
  outline: 2px solid #198754;
  outline-offset: -2px;
  background: #f0faf4;
}

.answer-block-file .answer-document-preview {
  width: 100%;
  height: 480px;
  max-height: 65vh;
}

.answer-file-picker {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  cursor: pointer;
}

.answer-file-picker input {
  display: none;
}

.answer-upload-message {
  flex: 1 1 260px;
  min-width: 0;
}

.hidden {
  display: none !important;
}

@media (max-width: 860px) {
  .module-grid,
  .admin-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-nav {
    position: static;
  }

  .search-row {
    grid-template-columns: 1fr;
  }

  .suggestions {
    right: 0;
    top: 102px;
  }

  .answer-editor-head,
  .answer-block-head,
  .answer-editor-title {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .answer-editor-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .page {
    width: min(100% - 20px, 1180px);
    padding-top: 14px;
  }

  .topline,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .brand-center h1 {
    font-size: 32px;
  }

  .module-tile {
    min-height: 92px;
  }

  .button,
  .button-secondary,
  .button-danger,
  .button-ghost {
    width: 100%;
  }
}

/* Natural Voice brand workspace */
:root {
  --brand: #0cc000;
  --brand-fill: #c4efd0;
  --brand-deep: #087c55;
  --brand-soft: #e5f8ef;
  --ink: #142d27;
  --muted: #71827c;
  --line: #dcebe4;
  --mist: #f3faf7;
  --surface: #ffffff;
  --sky: #e7f5f8;
  --coral: #fff0eb;
  --navy: #193c34;
  --shadow: 0 14px 32px rgba(20, 67, 49, 0.07);
}

body.app-page {
  background: var(--mist);
  color: var(--ink);
  overflow-x: hidden;
}

body.app-page .page {
  width: min(1240px, calc(100% - 40px));
  padding: 26px 0 58px;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
  text-decoration: none;
}

.brand-logo {
  display: block;
  width: 212px;
  height: auto;
  max-width: 100%;
}

.brand-context {
  padding-left: 13px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.app-page .topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-width: 0;
  margin-bottom: 24px;
}

.top-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 17px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.top-nav-link, .admin-link { text-decoration: none; white-space: nowrap; }
.top-nav-link:hover, .top-nav-link.active, .admin-link:hover { color: var(--brand-deep); }
.top-nav-link.active { font-weight: 800; }
.admin-link { padding-left: 17px; border-left: 1px solid var(--line); color: var(--brand-deep); font-weight: 800; }
.name-chip { display: flex; align-items: center; gap: 7px; padding: 5px 10px 5px 5px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.name-avatar { width: 24px; height: 24px; flex: 0 0 auto; border: 1px solid #a8e3c8; border-radius: 50%; background: var(--brand-soft); }
.name-text { max-width: 112px; overflow: hidden; color: var(--brand-deep); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.top-logout { padding: 0; border: 0; background: transparent; color: var(--muted); font-size: 12px; }
.top-logout:hover { color: var(--brand-deep); }

.app-page .hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr);
  gap: 16px;
}

.app-page .search-panel, .app-page .insight-panel, .app-page .recent-panel, .app-page .download-panel, .app-page .result-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.app-page .search-panel {
  position: relative;
  min-height: 302px;
  max-width: none;
  margin: 0;
  padding: 30px;
  overflow: hidden;
  background: var(--surface);
}

.app-page .search-panel::after {
  content: "自然之声";
  position: absolute;
  right: -10px;
  bottom: -25px;
  color: #effaf4;
  font-size: 84px;
  font-weight: 900;
  line-height: 1;
}

.app-page .search-panel > * { position: relative; z-index: 1; }
.app-page .eyebrow, .app-page .insight-label { margin: 0; color: var(--brand-deep); font-size: 11px; font-weight: 800; letter-spacing: .12em; }
.app-page .search-panel h1 { max-width: 540px; margin: 10px 0 8px; font-size: 38px; line-height: 1.15; }
.app-page .hero-copy { max-width: 520px; margin-bottom: 22px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.app-page .question-label { margin-bottom: 8px; color: var(--ink); font-size: 16px; font-weight: 850; }

.app-page .search-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  max-width: 680px;
  padding: 6px 6px 6px 12px;
  border: 1px solid #bfdfd0;
  border-radius: 8px;
  background: #f9fcfa;
}

.search-mark { width: 12px; height: 12px; border: 1.5px solid var(--brand-deep); border-radius: 50%; position: relative; }
.search-mark::after { content: ""; position: absolute; right: -4px; bottom: -2px; width: 5px; height: 1.5px; background: var(--brand-deep); transform: rotate(45deg); }
.app-page .search-input { min-height: 38px; padding: 7px 8px; border: 0; background: transparent; font-size: 14px; }
.app-page .search-input:focus { border: 0; box-shadow: none; }

.primary-button, .secondary-button {
  min-height: 38px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 6px;
  white-space: nowrap;
}

.primary-button { background: var(--brand-fill); border-color: #a8dfb8; color: var(--brand-deep); font-weight: 850; }
.primary-button:hover { background: #b5e8c3; }
.secondary-button { background: var(--brand-soft); border-color: #c8e8d6; color: var(--brand-deep); }
.secondary-button:hover { background: #d5f2e2; }

.app-page .search-row:focus-within { z-index: 10; }
.app-page .suggestions { position: static; grid-column: 1 / -1; width: 100%; z-index: 20; max-height: 260px; overflow-y: auto; border-color: var(--line); }
.app-page .quick-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.quick-tag { padding: 5px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 10px; }
.quick-tag:hover { border-color: #8bd4ac; color: var(--brand-deep); }
.app-page .quick-actions { margin-top: 14px; }

.app-page .insight-panel {
  position: relative;
  min-height: 302px;
  padding: 27px;
  overflow: hidden;
  background: var(--brand-fill);
  color: #07371f;
}

.insight-panel::before, .insight-panel::after { content: ""; position: absolute; border: 1px solid rgba(7, 55, 31, .16); border-radius: 50%; }
.insight-panel::before { width: 205px; height: 205px; top: -55px; right: -75px; }
.insight-panel::after { width: 142px; height: 142px; top: -23px; right: -43px; }
.insight-panel > * { position: relative; z-index: 1; }
.app-page .insight-panel .insight-label { color: #07371f; }
.app-page .insight-panel h2 { max-width: 240px; margin: 25px 0 9px; font-size: 23px; line-height: 1.25; }
.app-page .insight-panel p { max-width: 250px; margin: 0; color: #1d5b3d; font-size: 12px; line-height: 1.6; }
.insight-stats { position: absolute; right: 27px; bottom: 24px; left: 27px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding-top: 13px; border-top: 1px solid rgba(7, 55, 31, .22); }
.insight-stats strong { display: block; font-size: 20px; line-height: 1; }
.insight-stats span { display: block; margin-top: 5px; color: #1d5b3d; font-size: 9px; }

.app-page .modules-section { margin-top: 26px; }
.app-page .section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.app-page .section-heading h2 { margin: 0; font-size: 19px; }
.section-note { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.section-link { color: var(--brand-deep); font-size: 11px; font-weight: 800; }

.app-page .module-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 176px; gap: 14px; max-width: none; margin: 0; }
.app-page .module-card {
  --module-bg: #ffffff;
  --module-line: #dcebe4;
  --module-accent: #4d8c73;
  --module-ink: #19382d;
  --module-muted: #6f827b;
  position: relative;
  display: flex;
  height: 176px;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  overflow: hidden;
  border: 1px solid var(--module-line);
  border-radius: 9px;
  background: var(--module-bg);
  color: var(--module-ink);
  text-align: left;
  box-shadow: 0 7px 18px rgba(25, 67, 51, .045);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.app-page .module-card:hover { border-color: var(--module-accent); transform: translateY(-3px); box-shadow: 0 13px 25px rgba(25, 67, 51, .11); }
.app-page .module-card::after { position: absolute; right: -24px; bottom: -30px; width: 124px; height: 124px; border: 1px solid color-mix(in srgb, var(--module-accent) 24%, transparent); border-radius: 50%; content: ""; pointer-events: none; }
.module-index { position: relative; z-index: 1; color: var(--module-accent); font-size: 11px; font-weight: 900; letter-spacing: .08em; }
.app-page .module-card strong { position: relative; z-index: 1; display: block; margin: 0 0 5px; color: var(--module-ink); font-size: 21px; line-height: 1.25; }
.app-page .module-card > span:last-child { position: relative; z-index: 1; display: block; max-width: 245px; color: var(--module-muted); font-size: 12px; line-height: 1.55; }
.module-mark { position: absolute; top: 17px; right: 17px; z-index: 1; display: grid; width: 42px; height: 42px; place-items: center; border: 2px solid var(--module-accent); border-radius: 50%; color: var(--module-accent); background: rgba(255, 255, 255, .38); font-size: 13px; font-weight: 900; }
.module-theme-mint { --module-bg: #e6f8ef !important; --module-line: #afe0c4 !important; --module-accent: #2a9570 !important; --module-ink: #173b2e !important; --module-muted: #648278 !important; }
.module-theme-lilac { --module-bg: #f2edfc !important; --module-line: #d9caed !important; --module-accent: #8064a8 !important; --module-ink: #302446 !important; --module-muted: #766d83 !important; }
.module-theme-coral { --module-bg: #fff0ea !important; --module-line: #f0c6b7 !important; --module-accent: #c66e51 !important; --module-ink: #42271f !important; --module-muted: #8c7167 !important; }
.module-theme-sky { --module-bg: #eaf6fc !important; --module-line: #b9dceb !important; --module-accent: #3e8eac !important; --module-ink: #193844 !important; --module-muted: #68828c !important; }
.module-theme-yellow { --module-bg: #fff8e5 !important; --module-line: #ecd799 !important; --module-accent: #a17e2d !important; --module-ink: #42371e !important; --module-muted: #897b59 !important; }
.module-theme-blue { --module-bg: #edf1ff !important; --module-line: #c6d1ef !important; --module-accent: #5b70ad !important; --module-ink: #252d4d !important; --module-muted: #707a9a !important; }
.module-theme-neutral { --module-bg: #ffffff; }

.search-results-section { margin-top: 28px; }
.app-page .results-list { display: grid; gap: 12px; }
.app-page .result-card { padding: 18px; background: var(--surface); }
.app-page .result-card.is-expanded { box-shadow: 0 10px 26px rgba(20, 32, 51, .1); }
.app-page .result-card h3 { margin: 0 0 8px; font-size: 18px; line-height: 1.4; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 9px; }
.app-page .tag { background: var(--brand-soft); color: var(--brand-deep); }
.app-page .result-card .button-secondary { display: inline-flex; margin-top: 3px; }
.result-count { color: var(--muted); font-size: 12px; }

/* Keep matched questions visually distinct without weakening text contrast. */
.app-page .results-list > .result-card {
  border-left-width: 4px;
}

.app-page .results-list > .result-card:nth-child(5n + 1) {
  background: #eaf8ef;
  border-color: #a9dfbd;
}

.app-page .results-list > .result-card:nth-child(5n + 2) {
  background: #fff0f0;
  border-color: #efb7b9;
}

.app-page .results-list > .result-card:nth-child(5n + 3) {
  background: #edf6ff;
  border-color: #b7d5ee;
}

.app-page .results-list > .result-card:nth-child(5n + 4) {
  background: #fff8df;
  border-color: #ecd58a;
}

.app-page .results-list > .result-card:nth-child(5n + 5) {
  background: #f5efff;
  border-color: #d3c1ee;
}

.inline-detail {
  display: grid;
  gap: 12px;
  margin: 16px 2px 0;
  padding-top: 16px;
  border-top: 1px solid rgba(20, 32, 51, .12);
}

.inline-detail-header {
  padding: 12px 14px;
  border: 1px solid rgba(20, 32, 51, .1);
  border-radius: 7px;
  background: rgba(255, 255, 255, .72);
}

.inline-detail-header h4 { margin: 0 0 6px; font-size: 17px; line-height: 1.4; }
.inline-detail-header p { margin: 0; }
.loading-detail { color: var(--muted); }
.answer-file-link { display: inline-flex; width: fit-content; max-width: 100%; overflow-wrap: anywhere; }

.answer-list > .answer-card {
  border-width: 1px;
  background: #fbfefc;
}

.answer-list > .answer-card:nth-child(5n + 1) {
  background: #f0fbf3;
  border-color: #b6e3c5;
}

.answer-list > .answer-card:nth-child(5n + 2) {
  background: #fff4f4;
  border-color: #efc4c6;
}

.answer-list > .answer-card:nth-child(5n + 3) {
  background: #f2f8ff;
  border-color: #c1dcf1;
}

.answer-list > .answer-card:nth-child(5n + 4) {
  background: #fffbed;
  border-color: #eadb9e;
}

.answer-list > .answer-card:nth-child(5n + 5) {
  background: #f8f3ff;
  border-color: #dfd0f1;
}

.answer-card > h3 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.answer-card > h3::before {
  content: "";
  width: 5px;
  height: 20px;
  flex: 0 0 auto;
  border-radius: 4px;
  background: #86cdb0;
}

.answer-list > .answer-card:nth-child(5n + 2) > h3::before { background: #e69b9e; }
.answer-list > .answer-card:nth-child(5n + 3) > h3::before { background: #82b9d7; }
.answer-list > .answer-card:nth-child(5n + 4) > h3::before { background: #dfbd5e; }
.answer-list > .answer-card:nth-child(5n + 5) > h3::before { background: #b2a2d4; }

/* Question titles and answer controls follow the visual hierarchy of the reference UI. */
.result-question,
.app-page .result-card .result-question,
.detail-question-title {
  color: #2459b8;
}

.keyword-highlight {
  color: #d83c3c;
  background: transparent;
  font-weight: 800;
}

.answer-card > h3 {
  color: #c43d36;
  font-size: 16px;
  line-height: 1.4;
}

.answer-content {
  display: grid;
  gap: 14px;
  min-width: 0;
  color: #142033;
  font-size: 17px;
  line-height: 1.8;
}

.answer-blocks {
  display: grid;
  gap: 12px;
}

.answer-block {
  min-width: 0;
}

.answer-block-text {
  white-space: normal;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  overflow-wrap: anywhere;
}

.answer-content .answer-video-wrap {
  width: 100%;
  max-width: 960px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  box-sizing: border-box;
}

.answer-content video.answer-media {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  max-height: none;
  object-fit: contain;
  background: #151515;
}

.answer-image-open {
  display: grid;
  place-items: center;
  width: 100%;
  max-width: 960px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  cursor: zoom-in;
}

.answer-image-open img.answer-media {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 420px;
  border: 0;
  border-radius: 0;
}

.answer-document {
  position: relative;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}

.answer-document .answer-document-download {
  border: 0;
  flex-wrap: wrap;
}

.answer-document.has-preview .answer-document-download { padding-right: 110px; }

.answer-document .answer-document-download span {
  flex: 1 1 180px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.answer-document-disclosure > summary {
  position: absolute;
  top: 12px;
  right: 12px;
  cursor: pointer;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
  background: #fff;
}

.answer-document-body {
  display: grid;
  gap: 8px;
  padding: 0 12px 12px;
}

.document-open-link {
  justify-self: end;
  font-size: 13px;
}

.answer-image-viewer {
  width: fit-content;
  max-width: 94vw;
  max-height: 92vh;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.answer-image-viewer::backdrop { background: rgb(0 0 0 / 65%); }
.answer-image-viewer form { display: flex; justify-content: flex-end; margin-bottom: 10px; }
.answer-image-viewer img { display: block; max-width: 86vw; max-height: 76vh; object-fit: contain; }

.answer-block-callout {
  padding: 12px 14px;
  border-left: 4px solid #d7ad45;
  border-radius: 5px;
  background: #fff8df;
  color: #5c4613;
}

.answer-block-media {
  display: grid;
  gap: 6px;
}

.answer-block-caption {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.answer-card .approval,
.answer-card .muted,
.answer-card .message,
.answer-card .answer-preview-status,
.answer-card .answer-document-download {
  font-size: 12px;
  line-height: 1.5;
}

.answer-card .feedback-row {
  margin-top: 10px;
}

.answer-card .feedback-button,
.answer-card .submit-comment-button {
  min-height: 30px;
  padding: 5px 10px;
  font-size: 12px;
}

.answer-card .comment-input {
  min-height: 52px;
  padding: 7px 9px;
  font-size: 12px;
  line-height: 1.5;
}

@media (max-width: 560px) {
  .answer-content {
    font-size: 16px;
  }
}

.app-page .knowledge-strip { display: grid; grid-template-columns: 1.1fr .9fr; gap: 12px; margin-top: 12px; }
.app-page .recent-panel, .app-page .download-panel { padding: 17px; background: var(--surface); }
.app-page .download-panel { background: var(--navy); color: #eefcf4; }
.mini-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.mini-heading h2 { margin: 0; font-size: 14px; }
.mini-heading span { color: var(--brand-deep); font-size: 10px; font-weight: 800; }
.download-panel .mini-heading span { color: var(--brand); }
.knowledge-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0 0; margin-top: 10px; border-top: 1px solid #edf3ef; font-size: 11px; }
.knowledge-item:first-of-type { padding-top: 0; margin-top: 0; border-top: 0; }
.knowledge-item small { color: var(--muted); white-space: nowrap; }
.download-panel .knowledge-item { border-top-color: #2e594c; }
.download-panel .knowledge-item small { color: #abc6ba; }

body.app-page dialog { border: 0; border-radius: 8px; padding: 0; box-shadow: 0 22px 70px rgba(20, 67, 49, .22); }
body.app-page dialog::backdrop { background: rgba(20, 53, 42, .28); }

@media (max-width: 1040px) {
  .app-page .top-nav-link { display: none; }
  .app-page .admin-link { padding-left: 0; border-left: 0; }
  .app-page .hero-grid { grid-template-columns: minmax(0, 1fr) 300px; }
}

@media (max-width: 860px) {
  .app-page .hero-grid { grid-template-columns: 1fr; }
  .app-page .module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 176px; }
  .app-page .knowledge-strip { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  body.app-page .page { width: min(100% - 20px, 1240px); padding-top: 16px; }
  .app-page .topbar { align-items: flex-start; flex-direction: column; }
  .app-page .top-nav { width: 100%; justify-content: space-between; }
  .app-page .brand-context { display: none; }
  .app-page .brand-logo { width: 190px; }
  .app-page .search-panel { padding: 22px 18px; }
  .app-page .search-panel h1 { max-width: 100%; font-size: 29px; overflow-wrap: anywhere; }
  .app-page .search-row { grid-template-columns: 18px minmax(0, 1fr); }
  .app-page .search-row .primary-button { grid-column: 1 / -1; width: 100%; }
  .app-page .module-grid { grid-template-columns: 1fr; grid-auto-rows: 154px; }
  .app-page .module-card { height: 154px; padding: 18px; }
  .app-page .section-heading { align-items: stretch; flex-direction: column; }
  .app-page .quick-actions { align-items: stretch; flex-direction: column; }
  .app-page .quick-actions .secondary-button { width: 100%; }
}

.site-footer {
  width: min(100% - 32px, 1240px);
  margin: 8px auto 0;
  padding: 20px 0 28px;
  text-align: center;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}

.site-footer a {
  display: inline-block;
  min-height: 32px;
  padding: 6px 8px;
  color: inherit;
  text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--brand-deep);
  text-decoration: underline;
}
