:root {
  --paper: #fff;
  --canvas: #f7f8fa;
  --ink: #202124;
  --muted: #656970;
  --line: #e5e7eb;
  --blue: #245bb5;
  --danger: #a63b35;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 280px; font-size: 14px; line-height: 1.6; }
button, input, select { font: inherit; border-radius: 6px; }
button, a, input, select, summary { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; min-height: 44px; min-width: 44px; }
button:disabled { cursor: not-allowed; opacity: .45; }
a { color: inherit; }
:focus-visible { outline: 3px solid #82a8e6; outline-offset: 2px; }
input:focus-visible, select:focus-visible { outline-offset: 1px; border-color: var(--blue); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -100px; left: 16px; padding: 10px 16px; background: var(--ink); color: white; z-index: 10; border-radius: 4px; }
.skip-link:focus { top: 10px; }
.site-header { border-bottom: 1px solid var(--line); }
.header-inner { min-height: 64px; max-width: 1248px; padding: 6px 32px; margin: 0 auto; display: flex; align-items: center; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 16px; font-weight: 600; text-decoration: none; white-space: nowrap; flex: none; }
.brand-mark { width: 27px; height: 27px; color: var(--blue); flex: none; }
.account { margin-left: auto; display: flex; align-items: center; gap: 12px; min-width: 0; }
#account-name { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
#logout { flex: none; }
.button-primary, .button-secondary, .button-quiet { border: 1px solid transparent; padding: 9px 16px; line-height: 1.5; }
.button-primary { background: var(--blue); color: white; font-weight: 550; }
.button-primary:hover:not(:disabled) { background: #1b478f; }
.button-secondary { background: var(--paper); border-color: #d4d7dc; color: var(--ink); }
.button-secondary:hover:not(:disabled), .button-quiet:hover:not(:disabled) { background: var(--canvas); }
.button-quiet { background: transparent; color: var(--muted); padding-inline: 12px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 24px; line-height: 1.4; font-weight: 600; letter-spacing: -.4px; }
h2 { font-size: 14px; font-weight: 550; }
h3 { font-size: 15px; font-weight: 600; }
.muted, .field-hint { color: var(--muted); }
.auth-view { max-width: 384px; padding: 0 24px; margin: clamp(56px, 10vh, 112px) auto 40px; }
.auth-description { color: var(--muted); margin-top: 10px; }
.auth-form { margin-top: 24px; display: grid; gap: 18px; }
.field { min-width: 0; }
.field label { display: block; font-size: 13px; margin-bottom: 6px; }
input, select { width: 100%; min-width: 0; min-height: 46px; border: 1px solid #d4d7dc; padding: 10px 12px; color: var(--ink); background: var(--paper); font-size: 16px; }
input::placeholder { color: #7b8088; opacity: 1; }
.field-hint { font-size: 12px; margin-top: 6px; }
.auth-submit { width: 100%; min-height: 46px; }
.error-text { font-size: 13px; color: var(--danger); overflow-wrap: anywhere; }
#boot-message { margin-top: 10px; }
#boot-retry, #waiting-retry { margin-top: 20px; }
.workspace { max-width: 1248px; padding: 32px 32px 24px; margin: 0 auto; }
.search-form { margin-top: 18px; display: flex; gap: 10px; }
.search-input-wrap { position: relative; flex: 1; min-width: 0; }
.search-input-wrap svg { position: absolute; width: 20px; height: 20px; left: 16px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--muted); }
#query { height: 52px; padding-left: 46px; font-size: 16px; }
.search-form .button-primary { flex: none; min-width: 88px; padding-inline: 22px; }
.filter-panel { margin-top: 6px; margin-bottom: 10px; }
summary { min-height: 44px; width: fit-content; padding: 10px 12px 10px 0; color: var(--muted); cursor: pointer; user-select: none; }
.filter-panel[open] summary { color: var(--ink); }
.filters { display: grid; grid-template-columns: repeat(3, minmax(0, 210px)) auto; align-items: end; gap: 16px; padding: 4px 0 18px; }
.filters .field label { color: var(--muted); }
.reset-button { justify-self: start; }
.inline-notice { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid #e1c6c1; border-radius: 6px; color: var(--danger); padding: 8px 12px; margin-block: 12px; overflow-wrap: anywhere; }
.inline-notice .button-quiet { color: var(--danger); flex: none; }
.results-section { border-top: 1px solid var(--line); }
.results-toolbar { padding: 14px 0; }
.result-count { display: inline-block; font-size: 13px; color: var(--muted); font-weight: 400; margin-left: 8px; }
#results { min-height: 160px; }
table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 14px; }
.col-code { width: 15%; }
.col-name { width: 27%; }
.col-content { width: 37%; }
.col-manager { width: 13%; }
.col-action { width: 8%; }
th { background: var(--canvas); color: var(--muted); font-weight: 400; font-size: 12px; text-align: left; padding: 10px 12px; border-block: 1px solid var(--line); }
td { padding: 12px; vertical-align: top; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; white-space: pre-wrap; }
th:first-child, td:first-child { padding-left: 14px; }
tr:hover td { background: #fafbfc; }
.record-link { background: none; border: 0; color: var(--blue); text-align: left; font-weight: 550; font-variant-numeric: tabular-nums; padding: 0; margin: -6px 0; min-height: 44px; max-width: 100%; overflow-wrap: anywhere; white-space: pre-wrap; border-radius: 3px; line-height: 1.5; }
.record-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.project-name { font-weight: 550; }
.project-customer { color: var(--muted); font-size: 12px; margin-top: 3px; }
.project-content { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; white-space: pre-wrap; overflow-wrap: anywhere; }
.detail-link { font-weight: 400; font-size: 13px; white-space: nowrap; }
.status-badge { display: inline-block; font-size: 11px; line-height: 1.6; padding: 1px 6px; border: 1px solid #d4d7dc; border-radius: 4px; color: var(--muted); background: var(--canvas); }
.status-void { color: var(--danger); border-color: #e1c6c1; background: #fcf5f4; }
.results-message { text-align: center; min-height: 200px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: var(--canvas); border-block: 1px solid var(--line); padding: 28px 20px; }
#results-message-title { font-size: 15px; font-weight: 550; }
#results-message-description { font-size: 13px; }
#results-retry { margin-top: 6px; }
.mobile-results { display: none; }
.pagination { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 0; }
.pagination p { font-size: 12px; }
.page-actions { display: flex; align-items: center; gap: 16px; }
#page-number { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.data-footer { padding-top: 14px; font-size: 12px; color: var(--muted); }
dialog { border: 1px solid var(--line); border-radius: 10px; padding: 0; width: min(760px, calc(100% - 48px)); max-height: calc(100dvh - 48px); color: var(--ink); background: var(--paper); box-shadow: 0 20px 80px #20212426; overflow: auto; overscroll-behavior: contain; }
dialog::backdrop { background: #20212466; }
body:has(dialog[open]) { overflow: hidden; }
.dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 24px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--paper); z-index: 1; }
.dialog-header h2 { min-width: 0; font-size: 20px; overflow-wrap: anywhere; }
.dialog-header button { flex: none; }
.dialog-header button span { margin-left: 6px; font-size: 20px; }
.dialog-body { padding: 22px 24px; }
.detail-message { color: var(--muted); padding: 12px 0 20px; overflow-wrap: anywhere; }
.detail-code-line { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.detail-code { font-size: 22px; font-weight: 600; color: var(--blue); overflow-wrap: anywhere; min-width: 0; font-variant-numeric: tabular-nums; }
.detail-code-line button { flex: none; }
#copy-feedback { color: var(--blue); margin-bottom: 16px; }
#copy-feedback:empty { margin-top: 0; }
.detail-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 28px; margin: 0; }
.detail-fields > div { min-width: 0; }
.detail-fields dt { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.detail-fields dd { margin: 0; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.8; }
.detail-wide { grid-column: 1 / -1; }
.continuations { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 18px; }
.continuations h3 { margin-bottom: 12px; }
.continuation-item { padding: 12px 0; border-bottom: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; }
.continuation-item:first-child { padding-top: 0; }
.continuation-item .muted { font-size: 12px; margin-top: 6px; }
.dialog-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 16px; padding: 12px 24px; border-top: 1px solid var(--line); background: var(--canvas); color: var(--muted); font-size: 12px; }
.noscript { padding: 24px; text-align: center; color: var(--danger); }
@media (max-width: 760px) {
  .header-inner { min-height: 56px; padding: 4px 16px; gap: 12px; }
  .brand { font-size: 15px; gap: 6px; }
  .brand-mark { width: 24px; height: 24px; }
  .account { gap: 4px; }
  #account-name { font-size: 12px; max-width: 112px; }
  #logout { font-size: 13px; padding-inline: 8px; }
  .workspace { padding: 22px 16px 24px; }
  .search-form { margin-top: 16px; gap: 8px; }
  .search-input-wrap svg { left: 12px; width: 18px; }
  #query { padding-left: 36px; height: 50px; }
  .search-form .button-primary { min-width: 64px; padding-inline: 14px; }
  .filter-panel { margin-top: 4px; margin-bottom: 4px; }
  .filters { grid-template-columns: minmax(0, 1fr); gap: 12px; padding-top: 4px; }
  .filters select { width: 100%; }
  .reset-button { justify-self: stretch; border-color: var(--line); }
  .results-toolbar { padding-block: 12px; }
  .result-count { font-size: 12px; margin-left: 6px; }
  #results-table { display: none; }
  .mobile-results:not([hidden]) { display: block; border-top: 1px solid var(--line); }
  .project-card { padding: 12px 0; border-bottom: 1px solid var(--line); min-width: 0; }
  .card-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
  .card-top .record-link { flex: none; font-size: 13px; max-width: 45%; }
  .card-title { flex: 1; min-width: 0; font-size: 14px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .card-content { font-size: 13px; line-height: 1.65; margin-top: 4px; }
  .card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 7px; color: var(--muted); font-size: 12px; }
  .card-manager { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .pagination { flex-direction: column; align-items: stretch; gap: 12px; padding-block: 16px; }
  .page-actions { justify-content: space-between; }
  .data-footer { padding-top: 12px; }
  .inline-notice { align-items: flex-start; flex-direction: column; gap: 2px; }
  .inline-notice .button-quiet { margin-left: -12px; }
  dialog { width: calc(100% - 24px); max-height: calc(100dvh - 24px); border-radius: 8px; }
  .dialog-header { padding: 12px 16px; gap: 8px; }
  .dialog-header h2 { font-size: 18px; }
  .dialog-header button { padding-inline: 8px; font-size: 12px; }
  .dialog-body { padding: 18px 16px; }
  .detail-code { font-size: 19px; }
  .detail-code-line { gap: 12px; }
  .detail-code-line button { font-size: 12px; padding-inline: 10px; }
  .detail-fields { gap: 18px; }
  .dialog-footer { padding: 12px 16px; }
}
@media (max-width: 430px) {
  .detail-fields { grid-template-columns: minmax(0, 1fr); }
  .auth-view { margin-top: 48px; }
}
@media (max-width: 340px) {
  .brand span { display: none; }
  #account-name { max-width: 140px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
