:root {
  color-scheme: light;
  --ink: #20242b;
  --muted: #66707c;
  --line: #dce1e6;
  --soft-line: #eceff2;
  --surface: #ffffff;
  --canvas: #f3f5f6;
  --brand: #c92243;
  --brand-dark: #a81735;
  --brand-hover: #aa1735;
  --brand-soft: #fff0f3;
  --teal: #116d67;
  --teal-soft: #e6f4f2;
  --gold: #a66a0a;
  --gold-soft: #fff5dc;
  --blue: #17668d;
  --blue-soft: #eaf5fa;
  --violet: #70408d;
  --violet-soft: #f4ecf8;
  --danger: #b31d37;
  --shadow: 0 14px 40px rgba(26, 31, 39, 0.08);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.65;
  letter-spacing: 0;
}
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button, a, summary { -webkit-tap-highlight-color: transparent; }
button { min-height: 42px; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 3px solid rgba(17, 109, 103, 0.34);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.site-header {
  position: sticky;
  z-index: 30;
  top: 0;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(12px);
}

.header-inner {
  width: min(1180px, calc(100% - 40px));
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 0 auto;
}

.brand { min-width: 0; display: inline-flex; align-items: center; gap: 11px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand img { width: 40px; height: 40px; flex: 0 0 auto; object-fit: contain; }
.brand span { display: grid; line-height: 1.25; }
.brand strong { font-size: 16px; }
.brand small { margin-top: 3px; color: #858d97; font-size: 9px; font-weight: 700; }

.account-area { position: relative; }
.account-button {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 0;
  padding: 5px 7px;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
}
.account-avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: #303740; font-size: 13px; font-weight: 800; }
.account-copy { display: grid; min-width: 110px; text-align: left; line-height: 1.35; }
.account-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.account-copy small { color: var(--muted); font-size: 11px; }
.account-menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 8px);
  right: 0;
  width: 210px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}
.account-menu span { display: block; overflow: hidden; padding: 9px 10px; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.account-menu button { width: 100%; border: 0; border-radius: 4px; padding: 8px 10px; color: var(--danger); background: transparent; text-align: left; cursor: pointer; }
.account-menu button:hover { background: var(--brand-soft); }

.eyebrow { margin: 0 0 6px; color: var(--brand); font-size: 12px; font-weight: 800; }
.auth-loading { min-height: calc(100vh - 140px); display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--muted); }
.auth-loading img { width: 58px; height: 58px; }
.auth-loading p { margin: 0; }
.loading-spinner { width: 22px; height: 22px; border: 2px solid #d4d9de; border-top-color: var(--teal); border-radius: 50%; animation: spin 700ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.login-view { min-height: calc(100vh - 140px); display: grid; place-items: center; padding: 54px 20px 70px; }
.login-panel {
  width: min(760px, 100%);
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow);
}
.login-brand-block { padding: 46px 42px; color: #f7f8f9; background: #23282f; }
.login-brand-block img { width: 72px; height: 72px; margin-bottom: 42px; }
.login-brand-block .eyebrow { color: #e5ad4a; }
.login-brand-block h1 { margin: 0; font-size: 25px; line-height: 1.35; }
.login-brand-block > p:last-child { margin: 10px 0 0; color: #b9c0c7; }
.login-form { display: grid; align-content: center; gap: 20px; padding: 46px 42px; }
.login-footnote { grid-column: 1 / -1; margin: 0; border-top: 1px solid var(--soft-line); padding: 13px 20px; color: var(--muted); background: #fafbfc; text-align: center; font-size: 12px; }
.input-with-action { position: relative; display: block; }
.input-with-action input { padding-right: 58px; }
.input-with-action button { position: absolute; right: 5px; bottom: 4px; min-height: 34px; border: 0; padding: 5px 9px; color: var(--teal); background: transparent; cursor: pointer; }

.workspace { width: min(1120px, calc(100% - 40px)); min-height: calc(100vh - 140px); margin: 0 auto; padding: 42px 0 70px; }
.workspace-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.workspace-heading h1 { margin: 0; font-size: 28px; line-height: 1.3; }
.workspace-heading > div > p:last-child { margin: 7px 0 0; color: var(--muted); }
.new-report-command { display: inline-flex; align-items: center; justify-content: center; gap: 5px; }

.workspace-tabs { display: flex; gap: 28px; margin-top: 30px; border-bottom: 1px solid var(--line); }
.workspace-tab { position: relative; min-height: 48px; border: 0; padding: 0 2px; color: var(--muted); background: transparent; font-weight: 700; cursor: pointer; }
.workspace-tab::after { position: absolute; right: 0; bottom: -1px; left: 0; height: 3px; background: var(--brand); content: ""; opacity: 0; }
.workspace-tab.is-active { color: var(--ink); }
.workspace-tab.is-active::after { opacity: 1; }

.summary-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin-top: 22px; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #fff; }
.summary-strip > button { min-width: 0; min-height: 76px; border: 0; border-right: 1px solid var(--line); padding: 13px 18px; color: var(--ink); background: #fff; text-align: left; cursor: pointer; }
.summary-strip > button:last-child { border-right: 0; }
.summary-strip > button:hover, .summary-strip > button.is-active { background: #f7faf9; }
.summary-strip > button.is-active { box-shadow: inset 0 -3px var(--teal); }
.summary-strip span { display: block; color: var(--muted); font-size: 12px; }
.summary-strip strong { display: block; margin-top: 1px; font-size: 22px; }

.report-queue { margin-top: 16px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.queue-toolbar { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); padding: 10px 16px; }
.queue-toolbar h2 { display: inline; margin: 0 10px 0 0; font-size: 15px; }
.queue-toolbar span { color: var(--muted); font-size: 12px; }
.user-table-wrap { overflow-x: auto; }
.user-report-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.user-report-table th, .user-report-table td { border-bottom: 1px solid var(--soft-line); padding: 14px 16px; text-align: left; vertical-align: middle; }
.user-report-table th { color: var(--muted); background: #fafbfc; font-size: 12px; font-weight: 600; }
.user-report-table th:first-child { width: 38%; }
.user-report-table th:nth-child(2) { width: 17%; }
.user-report-table th:nth-child(3) { width: 14%; }
.user-report-table th:nth-child(4) { width: 19%; }
.user-report-table th:last-child { width: 12%; }
.user-report-table tr:last-child td { border-bottom: 0; }
.report-title { display: block; overflow: hidden; color: var(--ink); text-overflow: ellipsis; white-space: nowrap; }
.ticket-code { display: block; margin-top: 3px; color: #7a838d; font-family: Consolas, monospace; font-size: 11px; }
.muted-cell { color: var(--muted); font-size: 12px; }
.detail-command { border: 0; padding: 4px; color: var(--teal); background: transparent; white-space: nowrap; cursor: pointer; }

.empty-state { padding: 58px 20px; text-align: center; }
.empty-state img { width: 54px; height: 54px; opacity: .7; }
.empty-state h3 { margin: 14px 0 3px; font-size: 16px; }
.empty-state p { margin: 0 0 18px; color: var(--muted); }

.new-report-form { margin-top: 22px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: var(--shadow); }
.form-header { min-height: 90px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); padding: 20px 28px; }
.form-header h2 { margin: 0; font-size: 20px; }
.draft-status { color: var(--muted); font-size: 12px; }
.form-main-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; }
.form-primary-column { display: grid; gap: 20px; padding: 28px; }
.attachment-panel { border-left: 1px solid var(--line); padding: 28px 24px; background: #fafbfc; }
.attachment-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.attachment-heading span { color: var(--muted); font-size: 11px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.three-columns { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.field { min-width: 0; display: grid; align-content: start; gap: 7px; }
.field > span { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #424a54; font-size: 13px; font-weight: 700; }
.field > span small { color: #8a929c; font-size: 10px; font-weight: 400; }
.field b, .check-row b { color: var(--brand); }
.field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid #cbd2d9;
  border-radius: 5px;
  outline: none;
  color: var(--ink);
  background: #fff;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.field input, .field select { min-height: 44px; padding: 9px 12px; }
.field textarea { min-height: 106px; resize: vertical; padding: 10px 12px; }
.field input::placeholder, .field textarea::placeholder { color: #9da5ae; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(17, 109, 103, .12); }

.upload-field { min-height: 128px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px dashed #aeb7c1; border-radius: 6px; background: #fff; text-align: center; cursor: pointer; }
.upload-field:hover, .upload-field.is-dragging { border-color: var(--teal); background: var(--teal-soft); }
.upload-field input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-field strong { color: var(--teal); }
.upload-field span { margin-top: 4px; color: var(--muted); font-size: 11px; }
.upload-field:focus-within { outline: 3px solid rgba(17, 109, 103, .34); outline-offset: 2px; }
.attachment-preview-list { display: grid; gap: 8px; margin-top: 12px; }
.attachment-preview { min-width: 0; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 5px; padding: 7px; background: #fff; }
.file-preview { width: 38px; height: 38px; display: grid; place-items: center; overflow: hidden; border-radius: 4px; color: #68717b; background: #edf0f2; font-size: 9px; font-weight: 800; }
.file-preview img { width: 100%; height: 100%; object-fit: cover; }
.file-copy { min-width: 0; display: grid; line-height: 1.35; }
.file-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.file-copy small { color: var(--muted); font-size: 10px; }
.file-remove { min-height: 32px; border: 0; padding: 4px; color: var(--danger); background: transparent; font-size: 11px; cursor: pointer; }

.diagnostic-details { border-top: 1px solid var(--line); }
.diagnostic-details summary { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 28px; list-style: none; cursor: pointer; }
.diagnostic-details summary::-webkit-details-marker { display: none; }
.diagnostic-details summary > span:first-child { display: grid; }
.diagnostic-details summary small { margin-top: 2px; color: var(--muted); font-weight: 400; }
.diagnostic-details summary > span:last-child { color: var(--teal); font-size: 12px; }
.diagnostic-details[open] summary > span:last-child { font-size: 0; }
.diagnostic-details[open] summary > span:last-child::after { content: "收起"; font-size: 12px; }
.diagnostic-content { display: grid; gap: 19px; border-top: 1px solid var(--soft-line); padding: 24px 28px 30px; }
.check-row { display: flex; align-items: flex-start; gap: 9px; color: #4b535d; }
.check-row input { width: 17px; height: 17px; flex: 0 0 auto; margin: 2px 0 0; accent-color: var(--brand); }
.check-row span { flex: 1; }
.contact-field { max-width: 480px; }
.submit-bar { min-height: 80px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-top: 1px solid var(--line); padding: 16px 28px; }
.submit-actions { display: flex; gap: 10px; }
.error-summary { margin: 18px 28px 0; border-left: 3px solid var(--danger); padding: 10px 13px; color: var(--danger); background: #fff4f5; font-weight: 700; }
.honeypot { position: absolute; left: -9999px; }

.primary-button { min-width: 116px; min-height: 44px; border: 1px solid var(--brand); border-radius: 5px; padding: 9px 18px; color: #fff; background: var(--brand); font-weight: 700; cursor: pointer; }
.primary-button:hover { border-color: var(--brand-hover); background: var(--brand-hover); }
.primary-button:disabled { border-color: #b7bcc2; background: #b7bcc2; cursor: wait; }
.quiet-button { min-height: 40px; border: 1px solid #c9d0d7; border-radius: 5px; padding: 8px 13px; color: #444d57; background: #fff; cursor: pointer; }
.quiet-button:hover { border-color: #939ca6; background: #f8f9fa; }
.full-button { width: 100%; }
.inline-message { min-height: 20px; margin: 0; color: var(--danger); font-size: 12px; }
.padded-message { padding: 0 16px 12px; }

.status-pill { display: inline-flex; align-items: center; min-height: 27px; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.status-pending { color: #855000; background: var(--gold-soft); }
.status-reviewing { color: #125a7b; background: var(--blue-soft); }
.status-need_info { color: #67357f; background: var(--violet-soft); }
.status-fixed { color: #0d615b; background: var(--teal-soft); }
.status-closed { color: #555f69; background: #edf0f2; }

dialog { color: var(--ink); }
dialog::backdrop { background: rgba(24, 29, 36, .58); }
.report-dialog { width: min(760px, calc(100% - 24px)); max-height: min(900px, calc(100vh - 30px)); border: 0; border-radius: 8px; padding: 0; box-shadow: 0 30px 90px rgba(14, 18, 24, .3); }
.dialog-header { position: sticky; z-index: 2; top: 0; min-height: 82px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); padding: 18px 24px; background: rgba(255,255,255,.98); }
.dialog-header h2 { margin: 3px 0 0; font-size: 20px; overflow-wrap: anywhere; }
.icon-close { border: 0; padding: 0 7px; color: #66707b; background: transparent; font-size: 27px; cursor: pointer; }
.report-detail-content { padding: 0 24px 34px; }
.detail-section { padding: 23px 0; border-bottom: 1px solid var(--soft-line); }
.detail-section:last-child { border-bottom: 0; }
.detail-section h3 { margin: 0 0 14px; font-size: 14px; }
.detail-status-line { display: flex; align-items: center; justify-content: space-between; gap: 14px; color: var(--muted); font-size: 12px; }
.detail-meta-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin: 19px 0 0; }
.detail-meta-grid dt { color: var(--muted); font-size: 11px; }
.detail-meta-grid dd { margin: 3px 0 0; overflow-wrap: anywhere; font-weight: 700; }
.detail-copy-block + .detail-copy-block { margin-top: 17px; }
.detail-copy-block > strong { display: block; margin-bottom: 5px; font-size: 12px; }
.detail-copy-block p { margin: 0; color: #424b55; white-space: pre-wrap; overflow-wrap: anywhere; }
.detail-file-list, .message-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.detail-attachment { border: 1px solid var(--line); border-radius: 4px; padding: 6px 9px; color: var(--teal); background: #fff; font-size: 11px; }
.message-timeline { display: grid; gap: 12px; }
.message-item { max-width: 86%; border-radius: 6px; padding: 12px 14px; background: #f2f4f5; }
.message-admin { border-left: 3px solid var(--teal); background: #f1f8f7; }
.message-user { justify-self: end; border-right: 3px solid #454d57; }
.message-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.message-head strong { font-size: 12px; }
.message-head time { color: var(--muted); font-size: 10px; }
.message-item > p { margin: 6px 0 0; white-space: pre-wrap; }
.conversation-empty { margin: 0; color: var(--muted); }
.follow-up-form { display: grid; gap: 10px; margin-top: 20px; border-top: 1px solid var(--soft-line); padding-top: 18px; }
.follow-up-form.needs-info { border: 1px solid #dcc3e8; border-left: 3px solid var(--violet); padding: 14px; background: #fbf7fd; }
.follow-up-form textarea { width: 100%; resize: vertical; border: 1px solid #cbd2d9; border-radius: 5px; padding: 9px 11px; }
.follow-up-actions { display: flex; align-items: center; gap: 12px; }
.follow-up-actions input { min-width: 0; flex: 1; }
.follow-up-actions .inline-message { flex: 1; }

.success-dialog { width: min(460px, calc(100% - 24px)); border: 0; border-radius: 8px; padding: 32px; box-shadow: 0 30px 90px rgba(14, 18, 24, .3); }
.success-mark { width: 44px; height: 44px; display: grid; place-items: center; margin: 0 0 17px; border-radius: 50%; color: var(--teal); background: var(--teal-soft); font-size: 23px; font-weight: 800; }
.success-dialog h2 { margin: 0; font-size: 22px; }
.success-dialog > p:not(.success-mark) { margin: 7px 0 20px; color: var(--muted); }
.success-ticket { display: flex; align-items: center; justify-content: space-between; gap: 14px; border: 1px solid var(--line); padding: 12px; }
.success-ticket span { color: var(--muted); font-size: 12px; }
.success-ticket strong { font-family: Consolas, monospace; }
.success-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }

.toast { position: fixed; z-index: 100; right: 24px; bottom: 24px; max-width: min(360px, calc(100% - 32px)); border-radius: 5px; padding: 11px 15px; color: #fff; background: #262d35; box-shadow: var(--shadow); }
.site-footer { min-height: 72px; display: flex; align-items: center; justify-content: center; gap: 24px; border-top: 1px solid var(--line); color: var(--muted); background: #fff; font-size: 12px; }

.policy-page { width: min(820px, calc(100% - 40px)); min-height: calc(100vh - 140px); margin: 0 auto; padding: 58px 0 80px; }
.policy-page h1 { margin: 0; font-size: 28px; }
.policy-page > section { margin-top: 32px; padding-top: 25px; border-top: 1px solid var(--line); }
.policy-page h2 { margin: 0; font-size: 16px; }
.policy-page section p { margin: 8px 0 0; color: #4e5761; }
.header-link { font-weight: 700; }

@media (max-width: 800px) {
  .header-inner { width: calc(100% - 28px); min-height: 62px; }
  .brand img { width: 36px; height: 36px; }
  .brand strong { font-size: 14px; }
  .brand small, .account-copy { display: none; }
  .login-view { padding: 28px 14px 48px; }
  .login-panel { grid-template-columns: 1fr; }
  .login-brand-block { padding: 28px 26px; }
  .login-brand-block img { width: 55px; height: 55px; margin-bottom: 20px; }
  .login-form { padding: 28px 26px; }
  .workspace { width: calc(100% - 24px); padding: 28px 0 50px; }
  .workspace-heading { align-items: flex-start; }
  .workspace-heading h1 { font-size: 24px; }
  .workspace-heading > div > p:last-child { display: none; }
  .new-report-command { min-width: auto; padding: 8px 12px; }
  .summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-strip > button { min-height: 65px; border-bottom: 1px solid var(--line); }
  .summary-strip > button:nth-child(2n) { border-right: 0; }
  .summary-strip > button:last-child { border-bottom: 0; }
  .user-report-table thead { display: none; }
  .user-report-table, .user-report-table tbody { display: block; }
  .user-report-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px 14px; border-bottom: 1px solid var(--line); padding: 14px; }
  .user-report-table td { display: block; border: 0; padding: 0; }
  .user-report-table td:first-child { grid-column: 1 / -1; }
  .user-report-table td:nth-child(2) { display: none; }
  .user-report-table td:nth-child(3) { grid-column: 1; }
  .user-report-table td:nth-child(4) { grid-column: 1; }
  .user-report-table td:last-child { grid-column: 2; grid-row: 2 / span 2; align-self: center; }
  .form-header { padding: 18px 20px; }
  .form-main-grid { grid-template-columns: 1fr; }
  .form-primary-column { padding: 22px 20px; }
  .attachment-panel { border-top: 1px solid var(--line); border-left: 0; padding: 22px 20px; }
  .form-row, .three-columns { grid-template-columns: 1fr; }
  .diagnostic-details summary, .diagnostic-content { padding-right: 20px; padding-left: 20px; }
  .submit-bar { align-items: stretch; flex-direction: column; padding: 18px 20px; }
  .submit-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .error-summary { margin-right: 20px; margin-left: 20px; }
  .detail-meta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .follow-up-actions { align-items: stretch; flex-direction: column; }
  .follow-up-actions input, .follow-up-actions button { width: 100%; }
  .policy-page { width: calc(100% - 32px); padding: 38px 0 58px; }
}

@media (max-width: 430px) {
  .workspace-heading .new-report-command { font-size: 12px; }
  .workspace-tabs { gap: 22px; }
  .summary-strip > button { padding: 10px 14px; }
  .attachment-heading { align-items: flex-start; flex-direction: column; gap: 2px; }
  .privacy-check { font-size: 12px; }
  .success-actions { grid-template-columns: 1fr; }
  .message-item { max-width: 96%; }
  .report-detail-content { padding-right: 18px; padding-left: 18px; }
  .dialog-header { padding-right: 18px; padding-left: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
