:root {
  --navy: #1b365d;
  --navy-dark: #142a49;
  --navy-soft: #eef3f9;
  --ink: #1f2937;
  --muted: #5b6b7f;
  --line: #dce3ec;
  --bg: #f7f9fc;
  --card: #ffffff;
  --danger: #b3261e;
  --warn-bg: #fbf3e4;
  --warn-fg: #7a5a17;
  --warn-line: #efdfc0;
  --radius: 14px;
  --wrap: 1120px;
  --shadow: 0 1px 2px rgba(27, 54, 93, 0.06), 0 8px 24px rgba(27, 54, 93, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB',
    'Microsoft YaHei', 'Noto Sans CJK SC', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

h1 {
  margin: 0 0 12px;
  font-size: clamp(22px, 3.4vw, 30px);
  line-height: 1.3;
  color: var(--navy);
}

h2 {
  font-size: 18px;
}

:focus-visible {
  outline: 2px solid #2e6bb8;
  outline-offset: 2px;
}

.wrap {
  width: min(var(--wrap), 100% - 32px);
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 10;
  padding: 10px 16px;
  background: var(--card);
  color: var(--navy);
  border-radius: 0 0 8px 0;
}

.skip-link:focus {
  left: 0;
}

/* 演示模式提示：始终可见 */
.demo-banner {
  margin: 0;
  padding: 10px 16px;
  background: var(--warn-bg);
  color: var(--warn-fg);
  border-bottom: 1px solid var(--warn-line);
  font-size: 13px;
  text-align: center;
}

.site-header {
  background: var(--navy);
  color: #fff;
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
}

/* 登录用户区（只在联调模式、且已登录时出现） */
.user-area {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.user-area[hidden] {
  display: none;
}

.user-name {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.user-note {
  color: var(--warn-bg);
  font-size: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  font-size: 18px;
  font-weight: 700;
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-company {
  font-size: 16px;
  font-weight: 600;
}

.brand-entry {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
}

.site-nav a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.site-nav a[aria-current='page'] {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-weight: 600;
}

#main {
  padding: 28px 0 8px;
}

#main:focus {
  outline: none;
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.page-head h1 {
  margin: 0;
}

/* 按钮：点击区不小于 44px */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 10px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

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

.btn-primary:hover {
  background: var(--navy-dark);
}

.btn-secondary {
  background: var(--card);
  color: var(--navy);
  border-color: #c9d6e6;
}

.btn-secondary:hover {
  background: var(--navy-soft);
  border-color: var(--navy);
}

.btn-ghost,
.btn:disabled {
  background: #eff3f8;
  color: #93a1b3;
  border-color: #e2e8f0;
  cursor: not-allowed;
}

/* 首页 */
.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-bottom: 28px;
}

@media (min-width: 900px) {
  .hero {
    grid-template-columns: 1.25fr 0.75fr;
  }
}

.hero-main {
  padding: 28px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.12em;
}

.lead {
  margin: 0 0 20px;
  color: var(--muted);
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-card {
  padding: 24px;
  background: linear-gradient(160deg, var(--navy), var(--navy-dark));
  border-radius: var(--radius);
  color: #fff;
  box-shadow: var(--shadow);
}

.hero-card .card-title {
  margin-top: 0;
  color: #fff;
}

.hero-card .plain-list {
  color: rgba(255, 255, 255, 0.86);
}

.plain-list {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
  font-size: 14px;
  line-height: 1.7;
}

.section {
  margin-bottom: 28px;
}

.section-title {
  margin: 0 0 14px;
  color: var(--navy);
}

.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 720px) {
  .card-grid {
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  }
}

.card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.card.is-disabled {
  background: #fbfcfe;
}

.card-title {
  margin: 0;
  color: var(--navy);
  font-size: 16px;
}

.card-desc {
  flex: 1;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

/* 状态：颜色之外还有文字，色觉差异下同样可读 */
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.status::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.status[data-status='待处理'] {
  background: #fff6e5;
  color: #8a5a00;
  border-color: #f0dfb8;
}

.status[data-status='需补充信息'] {
  background: #eaf1fa;
  color: #1b4b8a;
  border-color: #c9dbf0;
}

.status[data-status='已出结论'] {
  background: #e8f5ee;
  color: #1e6b4f;
  border-color: #c4e3d3;
}

/* 列表 */
.record-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.record-item {
  display: block;
  min-width: 0;
  padding: 16px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--navy);
  border-radius: 12px;
  color: inherit;
  text-decoration: none;
}

.record-item:hover {
  border-color: #b9c9dd;
  box-shadow: var(--shadow);
}

.record-title {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 16px;
  overflow-wrap: anywhere;
}

.record-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.record-date {
  color: var(--muted);
  font-size: 13px;
}

.record-summary {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

/* 详情 */
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.panel {
  margin-bottom: 16px;
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.panel-title {
  margin: 0 0 10px;
  color: var(--navy);
  font-size: 15px;
}

.panel-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.panel-actions {
  margin-top: 14px;
}

.prose {
  margin: 0;
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.empty-text {
  margin: 0;
  color: var(--muted);
}

.record-context {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.callout {
  margin: 0 0 18px;
  padding: 12px 16px;
  background: var(--navy-soft);
  border-left: 3px solid var(--navy);
  border-radius: 10px;
  color: #33506f;
  font-size: 14px;
  line-height: 1.65;
}

.callout-warn {
  background: var(--warn-bg);
  border-left-color: #c08a2e;
  color: var(--warn-fg);
}

.link-back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-bottom: 4px;
  color: var(--navy);
  font-size: 14px;
  text-decoration: none;
}

.link-back:hover {
  text-decoration: underline;
}

/* 表单 */
.form {
  max-width: 760px;
  padding: 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.field-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.field label {
  font-size: 14px;
  font-weight: 600;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 44px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid #c9d6e6;
  border-radius: 10px;
  color: var(--ink);
  font: inherit;
}

.field textarea {
  min-height: 160px;
  line-height: 1.7;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid var(--navy);
  outline-offset: 1px;
  border-color: var(--navy);
}

.field [aria-invalid='true'] {
  background: #fff8f7;
  border-color: var(--danger);
}

.counter {
  color: var(--muted);
  font-size: 12px;
}

.field-hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.field-error {
  margin: 0;
  color: var(--danger);
  font-size: 13px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* 空态与不存在页 */
.empty-state {
  display: grid;
  gap: 12px;
  justify-items: center;
  padding: 40px 24px;
  background: var(--card);
  border: 1px dashed #c9d6e6;
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.empty-state h1,
.empty-state p {
  margin: 0;
}

.empty-state .hero-actions {
  justify-content: center;
}

.site-footer {
  margin-top: 32px;
  padding: 20px 0 36px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}
