:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-soft: #eef3f5;
  --text: #17202a;
  --muted: #65717f;
  --line: #d9e0e6;
  --primary: #1f6f78;
  --primary-dark: #15545c;
  --green: #1d7a4d;
  --amber: #9a6400;
  --red: #b03a2e;
  --blue: #2b5c9a;
  --shadow: 0 14px 32px rgba(23, 32, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

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

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

button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  padding: 0 14px;
  cursor: pointer;
}

button:hover {
  border-color: #aebbc6;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  padding: 9px 10px;
}

textarea {
  min-height: 112px;
  resize: vertical;
}

label span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}

.hidden {
  display: none !important;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 76px;
  padding: 14px 28px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 7px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}

.brand h1,
.brand p,
.section-heading h2,
.section-heading p,
.admin-top h2,
.admin-top p,
.editor-header h2,
.editor-header p {
  margin: 0;
}

.brand h1 {
  font-size: 21px;
}

.brand p,
.section-heading p,
.admin-top p,
.editor-header p {
  color: var(--muted);
}

.section-heading p {
  white-space: nowrap;
}

.view-switch {
  display: flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.view-switch button {
  min-width: 78px;
  border: 0;
  background: transparent;
}

.view-switch button.active {
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(23, 32, 42, 0.12);
}

.session-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.session-bar button {
  min-height: 32px;
  padding: 0 10px;
}

.page-shell {
  width: min(1480px, calc(100% - 40px));
  margin: 24px auto 48px;
}

.auth-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 320px));
  gap: 18px;
  align-items: stretch;
  justify-content: center;
}

.compact-auth-panel {
  grid-template-columns: minmax(320px, 1fr) minmax(220px, 300px);
  max-width: 920px;
  margin: 0 auto;
}

.auth-copy,
.auth-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-copy {
  display: grid;
  align-content: center;
  gap: 10px;
}

.auth-copy h2,
.auth-copy p,
.auth-card h3,
.auth-card p {
  margin: 0;
}

.auth-copy h2 {
  font-size: 27px;
}

.auth-copy p,
.auth-card p {
  color: var(--muted);
}

.auth-card {
  display: grid;
  gap: 12px;
  align-content: start;
}

.qr-placeholder {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: 1px dashed #aebbc6;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(31, 111, 120, 0.08) 50%, transparent 0) 0 0 / 24px 24px,
    linear-gradient(rgba(31, 111, 120, 0.08) 50%, transparent 0) 0 0 / 24px 24px,
    #f7fafb;
  color: var(--primary-dark);
  font-weight: 650;
}

.search-band {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 520px);
  gap: 18px;
  align-items: end;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.admin-top {
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.search-main label {
  display: block;
  margin-bottom: 8px;
  font-size: 16px;
  font-weight: 650;
}

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

.filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.user-grid {
  display: grid;
  grid-template-columns: minmax(360px, 500px) minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
  align-items: start;
}

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

.list-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.section-heading h2 {
  font-size: 19px;
}

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

.primary-button:hover {
  border-color: var(--primary-dark);
  background: var(--primary-dark);
}

.danger-button {
  border-color: #d9b5b0;
  color: var(--red);
}

.danger-button:hover {
  border-color: var(--red);
  background: #fff6f4;
}

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

.faq-card,
.detail-column,
.submit-panel,
.admin-sidebar,
.admin-list-panel,
.admin-editor {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.faq-card {
  display: grid;
  gap: 0;
  min-height: 48px;
  padding: 12px 14px;
  text-align: left;
  overflow: hidden;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.faq-card.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(31, 111, 120, 0.14);
}

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

.faq-card-head h3 {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.faq-card-head time {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
}

.faq-card:hover,
.faq-card:focus-visible {
  border-color: #aebbc6;
  background: #fbfcfd;
}

.faq-card h3 {
  font-size: 15px;
  line-height: 1.35;
}

.faq-preview {
  display: grid;
  gap: 8px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.18s ease, opacity 0.14s ease, margin-top 0.18s ease;
}

.faq-card:hover .faq-preview,
.faq-card:focus-visible .faq-preview,
.faq-card.active .faq-preview {
  max-height: 180px;
  margin-top: 9px;
  opacity: 1;
}

.faq-card h3,
.admin-ticket h3,
.sidebar-block h3 {
  margin: 0;
}

.faq-meta,
.faq-summary,
.admin-ticket p,
.evidence-box p,
.upload-box p {
  color: var(--muted);
}

.faq-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
}

.conclusion,
.status-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 26px;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 13px;
  font-weight: 650;
}

.conclusion.ok,
.status-pill.published {
  background: #e5f4ed;
  color: var(--green);
}

.conclusion.partial,
.status-pill.draft {
  background: #fff3d9;
  color: var(--amber);
}

.conclusion.custom {
  background: #e8eff8;
  color: var(--blue);
}

.conclusion.unsupported {
  background: #fde8e5;
  color: var(--red);
}

.status-pill.pending {
  background: #edf1f4;
  color: #455463;
}

.detail-column {
  position: sticky;
  top: 100px;
  max-height: calc(100vh - 124px);
  min-height: 520px;
  overflow: auto;
  padding: 22px;
}

.detail-column.not-floating {
  position: static;
  max-height: none;
  overflow: visible;
}

.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.detail-header h2 {
  margin: 6px 0 8px;
  font-size: 25px;
}

.eyebrow {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  text-transform: uppercase;
}

.answer-section {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.info-block {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.info-block h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.info-block p {
  margin: 0;
}

.image-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.mock-image {
  display: grid;
  place-items: center;
  min-height: 92px;
  border: 1px dashed #aebbc6;
  border-radius: 6px;
  background: #f7fafb;
  color: var(--muted);
  font-size: 13px;
}

.submit-panel {
  padding: 22px;
}

.submit-page {
  max-width: 1120px;
  margin: 0 auto;
}

.submit-heading {
  align-items: flex-start;
  margin-bottom: 20px;
}

.submit-heading > div {
  max-width: 740px;
}

.submit-heading button {
  flex: 0 0 auto;
}

.submit-form,
.editor-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.submit-form {
  grid-template-columns: minmax(240px, 320px) minmax(360px, 1fr);
  align-items: start;
}

.submit-form > label:not(.wide-field),
.submit-form > .identity-field {
  grid-column: auto;
}

.identity-field {
  min-height: 68px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7fafb;
}

.identity-field span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}

.identity-field strong {
  display: block;
  font-size: 16px;
}

.identity-field p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.wide-field {
  grid-column: 1 / -1;
}

.upload-box,
.form-actions,
.evidence-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.upload-box,
.evidence-box {
  min-height: 84px;
  padding: 14px;
  border: 1px dashed #aebbc6;
  border-radius: 8px;
  background: #f7fafb;
}

.upload-box strong,
.upload-box p,
.evidence-box strong,
.evidence-box p {
  margin: 0;
}

.admin-layout {
  display: grid;
  grid-template-columns: 260px minmax(420px, 520px) minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
  align-items: start;
}

.admin-sidebar,
.admin-list-panel,
.admin-editor {
  padding: 18px;
}

.admin-editor {
  position: sticky;
  top: 100px;
  max-height: calc(100vh - 124px);
  overflow: auto;
}

.admin-editor.not-floating {
  position: static;
  max-height: none;
  overflow: visible;
}

.sidebar-block + .sidebar-block {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.sidebar-block {
  display: grid;
  gap: 12px;
}

.person-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.person-row b {
  color: var(--green);
  font-size: 12px;
}

.person-row.muted {
  color: var(--muted);
}

.person-row.muted b {
  color: var(--muted);
}

.person-row.pending-person b {
  color: var(--amber);
}

.person-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.person-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.person-card-head strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.person-card-head b {
  flex: 0 0 auto;
  color: var(--green);
  font-size: 12px;
}

.person-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.person-card.pending-person .person-card-head b {
  color: var(--amber);
}

.person-card.muted {
  color: var(--muted);
}

.person-card.muted .person-card-head b {
  color: var(--muted);
}

.person-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.person-actions button {
  min-height: 30px;
  padding: 0 8px;
  font-size: 12px;
  white-space: nowrap;
}

.person-actions button:disabled {
  cursor: default;
  opacity: 0.48;
}

.person-actions button:nth-child(3):last-child,
.person-actions .danger-button {
  grid-column: 1 / -1;
}

.category-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.category-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-row small {
  min-width: 24px;
  color: var(--muted);
  text-align: right;
}

.icon-actions {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}

.icon-actions button {
  display: grid;
  place-items: center;
  width: 28px;
  min-height: 28px;
  padding: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
}

.icon-actions button:hover {
  color: var(--text);
}

.icon-actions button:first-child {
  font-size: 14px;
}

.sidebar-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.admin-search {
  max-width: 220px;
}

.admin-list-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  row-gap: 12px;
  align-items: start;
}

.admin-list-heading .admin-search {
  grid-column: 1 / -1;
  max-width: none;
}

.admin-ticket {
  position: relative;
  display: grid;
  gap: 7px;
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
}

.admin-ticket + .admin-ticket {
  margin-top: 10px;
}

.admin-ticket.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(31, 111, 120, 0.12);
}

.admin-ticket.pinned {
  border-left: 4px solid var(--primary);
  padding-left: 11px;
}

.admin-ticket .status-pill {
  position: absolute;
  top: 12px;
  right: 12px;
}

.pin-mark {
  position: absolute;
  top: 45px;
  right: 12px;
  min-height: 22px;
  border-radius: 999px;
  padding: 2px 8px;
  background: #e7f4f5;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 650;
}

.admin-ticket h3 {
  margin-top: 10px;
  padding-right: 84px;
  font-size: 16px;
}

.admin-ticket.pinned h3 {
  padding-right: 112px;
}

.editor-header {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

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

.editor-actions button {
  width: 88px;
  padding: 0 10px;
  white-space: nowrap;
}

.editor-grid {
  margin-top: 16px;
}

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

.category-editor {
  grid-column: 1 / -1;
}

.category-picker > div > span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}

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

.secondary-category-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  min-height: 30px;
  color: var(--text);
  font-size: 13px;
}

.secondary-category-option input {
  width: auto;
}

.secondary-category-option span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-hint {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.tag-editor {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 40px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.tag-editor button {
  min-height: 28px;
  padding: 0 9px;
  border-color: #c6d0d8;
  background: #f7fafb;
  font-size: 13px;
}

.answer-box {
  min-height: 150px;
}

.evidence-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 16px;
}

@media (max-width: 1100px) {
  .user-grid,
  .admin-layout,
  .search-band,
  .admin-top,
  .auth-panel,
  .compact-auth-panel {
    grid-template-columns: 1fr;
  }

  .admin-layout {
    gap: 14px;
  }
}

@media (max-width: 720px) {
  .app-header {
    position: static;
    align-items: stretch;
    flex-direction: column;
    padding: 14px;
  }

  .page-shell {
    width: calc(100% - 24px);
    margin-top: 14px;
  }

  .filters,
  .search-row,
  .submit-form,
  .editor-grid,
  .evidence-row,
  .image-strip,
  .secondary-category-grid {
    grid-template-columns: 1fr;
  }

  .section-heading,
  .detail-header,
  .editor-header,
  .upload-box,
  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .view-switch button {
    flex: 1;
  }

  .session-bar {
    justify-content: space-between;
  }

  .detail-column,
  .admin-editor {
    position: static;
    max-height: none;
    overflow: visible;
  }
}
