:root {
  --bg: #f4f6f5;
  --surface: #fff;
  --surface-soft: #f7faf9;
  --surface-green: #e7f4ed;
  --text: #17211e;
  --muted: #66726e;
  --line: #d7e0dc;
  --green: #257d58;
  --red: #ae3d37;
  --shadow: 0 12px 28px #17211e12;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.65;
}
.symptom-cards .issue-option {
  min-height: 76px;
  padding: 18px;
  text-align: left;
  font-size: 17px;
}
.symptom-cards .issue-option:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 3px;
}
.answer-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 22px 0;
}
.answer-cards button {
  min-height: 60px;
  text-align: left;
  white-space: normal;
  font-size: 17px;
}
.answer-cards small { display: block; margin-top: 6px; }
.card-extras { margin: 16px 0; }
.card-extras summary { cursor: pointer; }
.card-instruction { white-space: pre-line; }
.question-card:focus { outline: 2px solid var(--line); outline-offset: 4px; }
.question-card .answer-cards { display: grid; grid-template-columns: 1fr; }
.question-card .answer-cards button { min-height: 60px; font-size: 17px; }
.question-card h3 { font-size: 22px; }
.step-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.has-step .intro { margin-bottom: 10px; }
.has-step .intro > div { display: none; }
.has-step .modelbar p { display: none; }
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  background: white;
  border-radius: 10px;
  padding: 10px 16px;
  color: var(--text);
  min-height: 44px;
}
button:hover {
  border-color: var(--green);
  background: var(--surface-soft);
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button.primary {
  background: var(--green);
  color: white;
  border-color: var(--green);
}
button.danger {
  color: var(--red);
}
button.text {
  border: 0;
  background: transparent;
  padding: 6px 10px;
}
button.active {
  border-color: var(--green);
  background: var(--surface-green);
  color: var(--green);
}
:focus-visible {
  outline: 3px solid #79b899;
  outline-offset: 3px;
}
input,
select,
textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  color: var(--text);
  min-width: 0;
}
textarea {
  min-height: 100px;
  resize: vertical;
}
label {
  display: block;
  margin: 12px 0 5px;
  font-size: 14px;
}
h1,
h2,
h3,
p {
  margin: 0 0 12px;
}
h1 {
  font-size: 28px;
  line-height: 1.35;
  letter-spacing: -0.5px;
}
h2 {
  font-size: 20px;
}
h3 {
  font-size: 16px;
}
p:last-child {
  margin-bottom: 0;
}
a {
  color: var(--green);
}
small,
.muted {
  color: var(--muted);
  font-size: 13px;
}
.eyebrow {
  color: var(--green);
  letter-spacing: 1px;
  font-size: 12px;
  font-weight: 700;
}
.skip {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 20;
}
.skip:focus {
  top: 12px;
  background: white;
  padding: 10px;
}
.loading {
  padding: 64px 24px;
}
.topbar {
  background: white;
  border-bottom: 1px solid var(--line);
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.mark {
  background: var(--green);
  color: white;
  border-radius: 12px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 700;
}
.brand strong {
  display: block;
  font-size: 17px;
}
.brand small {
  display: block;
  font-size: 12px;
}
.row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.row > * {
  min-width: 0;
}
.row .grow {
  flex: 1;
}
.tag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--surface-green);
  color: var(--green);
  font-size: 12px;
}
.internal {
  background: #fff3df;
  border-bottom: 1px solid #ebd5b2;
  padding: 7px 24px;
  text-align: center;
  font-size: 12px;
  color: #855316;
}
.shell {
  max-width: 1480px;
  margin: auto;
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  min-height: calc(100dvh - 110px);
}
.sidebar {
  padding: 26px 20px;
  border-right: 1px solid var(--line);
  background: #f7faf9;
}
.sidebar .primary {
  width: 100%;
  margin-bottom: 22px;
}
.mobile-history-toggle {
  display: none;
}
.sidebar-records {
  display: block;
}
.sidebar h2 {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 1px;
}
.history {
  display: grid;
  gap: 7px;
  margin: 14px 0;
  min-width: 0;
  overflow: hidden;
}
.history button {
  text-align: left;
  display: block;
  width: 100%;
  padding: 12px;
  font-size: 13px;
  background: transparent;
  border-color: transparent;
  min-width: 0;
  overflow: hidden;
}
.history button.active {
  background: white;
  border-color: var(--line);
  box-shadow: 0 3px 8px #00000004;
}
.history strong {
  display: block;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  font-weight: 500;
}
.history small {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.main {
  padding: 30px clamp(18px, 3.5vw, 54px) 40px;
  min-width: 0;
}
.intro {
  margin-bottom: 26px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
}
.intro p {
  color: var(--muted);
  font-size: 14px;
  max-width: 650px;
}
.status {
  white-space: nowrap;
  color: var(--green);
  font-size: 12px;
  padding-top: 8px;
}
.status.error {
  color: var(--red);
}
.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 2px 3px #17211e02;
}
.modelbar {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) 1.5fr;
  align-items: center;
  gap: 20px;
}
.modelbar label {
  margin: 0 0 6px;
}
.modelbar p {
  font-size: 13px;
  color: var(--muted);
}
.tabs {
  display: flex;
  gap: 6px;
  margin: 20px 0;
  overflow-x: auto;
}
.tabs button {
  white-space: nowrap;
  border: 0;
  background: transparent;
  border-radius: 8px;
  font-size: 14px;
}
.tabs button.active {
  background: var(--surface-green);
  color: var(--green);
}
.conversation {
  display: grid;
  gap: 16px;
  min-height: 160px;
  margin: 6px 0 24px;
}
.conversation.empty {
  min-height: 0;
  margin-bottom: 12px;
}
.message {
  max-width: 92%;
  border-radius: 12px;
  padding: 16px 18px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--surface-soft);
  border: 1px solid #e8eeeb;
}
.message.user {
  justify-self: end;
  background: var(--surface-green);
  border-color: transparent;
}
.message strong {
  display: block;
  font-size: 12px;
  color: var(--green);
  margin-bottom: 7px;
}
.message p {
  font-size: 14px;
}
.message .understood {
  margin-top: 10px;
  color: var(--green);
  font-size: 13px;
  font-weight: 600;
}
.message .sources {
  white-space: normal;
  font-size: 12px;
  color: var(--muted);
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}
.composer {
  border-top: 1px solid var(--line);
  padding-top: 20px;
}
.composer textarea {
  min-height: 90px;
}
.composer .row {
  justify-content: space-between;
  margin-top: 10px;
}
.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}
.suggestions button {
  font-size: 12px;
  padding: 7px 12px;
  min-height: 36px;
}
.empty {
  padding: 24px 8px;
  color: var(--muted);
  text-align: center;
}
.empty-symbol {
  font-size: 28px;
  color: var(--green);
  margin-bottom: 8px;
}
.actions {
  position: static;
  background: #f4f6f5f2;
  backdrop-filter: blur(10px);
  padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  z-index: 2;
  border-top: 1px solid var(--line);
}
.step {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  margin-top: 14px;
}
.intake > p:not(.eyebrow) {
  max-width: 62ch;
}
.issue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 20px 0;
}
.issue-option {
  min-height: 68px;
  min-width: 0;
  text-align: left;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 14px;
}
.issue-option small {
  color: var(--muted);
}
.issue-option strong,
.issue-option small {
  min-width: 0;
  overflow-wrap: anywhere;
}
.choices {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 16px 0;
}
.choices button {
  padding: 8px;
  font-size: 13px;
}
.check {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 9px 0;
}
.check input {
  width: 18px;
  height: 18px;
  min-height: 18px;
}
.notice {
  padding: 12px 16px;
  background: #fff3df;
  color: #825216;
  border-radius: 10px;
  font-size: 13px;
  margin: 14px 0;
}
.source {
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.list {
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}
.list li {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
}
.evidence-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}
.asset {
  display: block;
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  border-radius: 8px;
}
.auth {
  max-width: 960px;
  margin: 70px auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 54px;
  align-items: center;
}
.auth h1 {
  font-size: 36px;
  margin: 16px 0 20px;
}
.auth .card {
  padding: 28px;
}
.auth ul {
  padding-left: 20px;
  color: var(--muted);
  font-size: 14px;
}
.auth .primary {
  width: 100%;
  margin-top: 14px;
}
.auth details {
  margin-top: 20px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
summary {
  cursor: pointer;
}
.admin table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
}
.admin th,
.admin td {
  text-align: left;
  padding: 12px 8px;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.table-wrap {
  overflow-x: auto;
}
.pagination {
  margin-top: 15px;
  justify-content: space-between;
}
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.editor textarea {
  min-height: 240px;
  font-family: Consolas, monospace;
  font-size: 12px;
}
.admin .main {
  max-width: 1200px;
  margin: auto;
}
.admin details {
  margin: 14px 0;
}
.admin .problems {
  max-height: 230px;
  overflow: auto;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.auth-error {
  color: var(--red);
  font-size: 13px;
  margin-top: 10px;
}
#notice {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  max-width: calc(100% - 32px);
  border-radius: 10px;
  background: #17211e;
  color: white;
  box-shadow: var(--shadow);
  font-size: 13px;
}
#notice:not(:empty) {
  padding: 12px 18px;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 26px;
  max-width: 620px;
  width: calc(100% - 32px);
  max-height: 85dvh;
  overflow: auto;
  box-shadow: var(--shadow);
}
dialog::backdrop {
  background: #17211e66;
}
dialog textarea {
  min-height: 160px;
}
dialog .row {
  margin-top: 18px;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12px;
}
.pending-card {
  border-left: 3px solid var(--green);
}
.offline {
  background: #fdebea;
  color: var(--red);
}
@media (max-width: 900px) {
  .shell {
    grid-template-columns: 210px minmax(0, 1fr);
  }
  .main {
    padding: 24px 20px;
  }
  .sidebar {
    padding: 24px 12px;
  }
  .card {
    padding: 20px;
  }
  .modelbar {
    grid-template-columns: 1fr;
  }
  .auth {
    gap: 28px;
    margin-top: 40px;
  }
  .auth h1 {
    font-size: 29px;
  }
  .choices {
    grid-template-columns: 1fr 1fr;
  }
  .two-col {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 600px) {
  .topbar {
    padding: 12px 16px;
  }
  .brand strong {
    font-size: 15px;
  }
  .brand small {
    font-size: 10px;
  }
  .mark {
    width: 36px;
    height: 36px;
    font-size: 19px;
  }
  .topbar .tag {
    display: none;
  }
  .topbar button {
    padding: 6px 10px;
    min-height: 38px;
  }
  .internal {
    padding: 6px 16px;
    text-align: left;
    font-size: 11px;
  }
  .shell {
    display: block;
  }
  .sidebar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
    padding: 12px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .sidebar .primary {
    width: 100%;
    margin: 0;
  }
  .mobile-history-toggle {
    display: block;
    width: 100%;
    padding-inline: 8px;
  }
  .sidebar-records {
    display: none;
    grid-column: 1 / -1;
  }
  .sidebar-records.open {
    display: block;
  }
  .sidebar h2 {
    display: none;
  }
  .sidebar input {
    margin-top: 12px;
  }
  .history {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 124px;
    overflow-x: hidden;
    overflow-y: auto;
    margin: 10px 0 0;
    gap: 8px;
  }
  .history button {
    min-width: 0;
    max-width: none;
    padding: 9px;
  }
  .sidebar .pagination {
    margin-top: 5px;
  }
  .main {
    padding: 20px 16px;
  }
  .intro {
    margin-bottom: 18px;
    display: block;
  }
  .intro h1 {
    font-size: 24px;
  }
  .status {
    padding: 0;
  }
  .card {
    padding: 18px;
    border-radius: 13px;
    margin-bottom: 16px;
  }
  .modelbar {
    gap: 12px;
  }
  .tabs {
    margin: 14px 0;
  }
  .tabs button {
    padding: 8px 12px;
    font-size: 13px;
  }
  .message {
    max-width: 100%;
    padding: 14px;
  }
  .composer .row {
    align-items: flex-start;
  }
  .composer small {
    max-width: 170px;
    font-size: 11px;
  }
  .actions button {
    flex: 1;
    padding: 9px;
    font-size: 13px;
  }
  .auth {
    display: block;
    margin: 30px auto;
    padding: 0 20px;
  }
  .auth .card {
    padding: 22px;
    margin-top: 28px;
  }
  .auth h1 {
    font-size: 28px;
  }
  .auth ul {
    display: none;
  }
  .step {
    padding: 14px;
  }
  .issue-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .issue-option {
    min-height: 56px;
  }
  .admin .main {
    padding: 20px 14px;
  }
  .intro .row {
    margin-top: 10px;
  }
  dialog {
    padding: 20px;
  }
  .two-col {
    gap: 10px;
  }
  .brand small {
    max-width: 150px;
  }
  #notice {
    top: calc(env(safe-area-inset-top) + 8px);
    bottom: auto;
    width: calc(100% - 32px);
    text-align: center;
    pointer-events: none;
  }
  .table-wrap th,
  .table-wrap td {
    min-width: 78px;
  }
  .table-wrap td:first-child {
    min-width: 130px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}
#admin-status {
  width: auto;
  min-width: 150px;
  flex: 0 1 180px;
}
.issue-editor fieldset {
  border: 0;
  padding: 0;
  min-width: 0;
}
.issue-editor details {
  border: 1px solid #d1dfdc;
  border-radius: 10px;
  padding: 12px;
  margin: 12px 0;
}
.issue-editor summary {
  cursor: pointer;
  font-weight: 600;
}
.issue-editor input[type="checkbox"] {
  width: auto;
}
@media (max-width: 600px) {
  #admin-status {
    width: 100%;
    flex-basis: 100%;
  }
  .table-wrap::after {
    content: "左右滑动表格查看状态和操作";
    display: block;
    color: #536b67;
    font-size: 12px;
    padding-top: 8px;
  }
}
.location-guide { margin: 12px 0; }
.card-location-media { display: block; width: 100%; max-height: 280px; object-fit: contain; border-radius: 12px; background: #f4f7f6; }
.location-guide button { margin-top: 8px; }
@media (max-width: 480px) {
  .tabs { gap: 2px; }
  .tabs button { padding: 10px 8px; font-size: 13px; }
}
