:root {
  --navy: #1f3864;
  --navy-soft: #e8eef7;
  --line: #d9dde5;
  --text: #22252b;
  --muted: #6b7280;
  --bg: #f4f6f9;
  --ok: #1a7f4b;
  --warn: #b45309;
  --danger: #b3261e;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

button, input, select, textarea { font: inherit; color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 3px solid #7aa7e8;
  outline-offset: 2px;
}

.topbar {
  background: var(--navy);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.topbar h1 { font-size: 17px; margin: 0; font-weight: 600; }
.topbar .sub { font-size: 12px; opacity: .8; }

.wrap { max-width: 720px; margin: 0 auto; padding: 16px; }
.wrap.wide { max-width: 1240px; }

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 14px;
}
.overview-fold { padding: 0 16px 16px; }
.overview-fold summary { cursor: pointer; list-style: none; font-size: 15px; font-weight: 600; padding: 16px 0 10px; color: var(--navy); }
.overview-fold summary::-webkit-details-marker { display: none; }
.overview-fold summary::before { content: "＋"; display: inline-block; width: 24px; color: var(--muted); }
.overview-fold[open] summary::before { content: "－"; }

h2.section { font-size: 15px; margin: 0 0 10px; font-weight: 600; }
.hint { color: var(--muted); font-size: 13px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 9px 14px;
  cursor: pointer;
  font-size: 14px;
}
.btn:hover { background: #f7f9fc; }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.primary:hover { background: #172b4d; }
.btn.block { width: 100%; padding: 13px; font-size: 16px; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--navy); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; }
label.field > span .req { color: var(--danger); }

input[type="text"], input[type="tel"], input[type="password"], select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}
textarea { min-height: 84px; resize: vertical; }

.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.cat {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 12px 10px;
  text-align: left;
  cursor: pointer;
  font-size: 14px;
}
.cat.on { border-color: var(--navy); background: var(--navy-soft); color: var(--navy); font-weight: 600; }

.faq-item { border-bottom: 1px solid var(--line); }
.faq-item:last-child { border-bottom: 0; }
.faq-q {
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  padding: 12px 0;
  cursor: pointer;
  font-size: 15px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.faq-a { padding: 0 0 12px; color: #444; font-size: 14px; display: none; }
.faq-item.open .faq-a { display: block; }
.faq-a .btn { margin-top: 8px; }

.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row > .grow { min-width: 0; }
.row.end { justify-content: flex-end; }
.grow { flex: 1; }

.tag {
  display: inline-block;
  font-size: 12px;
  border-radius: 999px;
  padding: 2px 9px;
  background: var(--navy-soft);
  color: var(--navy);
}
.tag.new { background: #fff4e5; color: var(--warn); }
.tag.processing { background: #e8f1fd; color: #17529b; }
.tag.pending { background: #fff4e5; color: var(--warn); }
.tag.hold { background: #eef0f3; color: #4b5563; }
.tag.closed { background: #e7f5ec; color: var(--ok); }

.list-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 12px 14px;
  margin-bottom: 10px;
  cursor: pointer;
}
.list-item:hover { border-color: #b9c4d6; }
.list-item .no { font-size: 12px; color: var(--muted); }
.list-item .title { font-weight: 600; margin: 2px 0 4px; }
.list-item .meta { font-size: 12px; color: var(--muted); }

.timeline { border-left: 2px solid var(--line); margin-left: 6px; padding-left: 14px; }
.timeline .rec { margin-bottom: 12px; }
.timeline .rec .who { font-size: 12px; color: var(--muted); }
.timeline .rec .txt { white-space: pre-wrap; }
.timeline .rec.internal .txt { color: var(--warn); }

.alert { border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; font-size: 14px; }
.alert.error { background: #fdeceb; color: var(--danger); }
.alert.ok { background: #e7f5ec; color: var(--ok); }
.alert.info { background: var(--navy-soft); color: var(--navy); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tabs button {
  border: 0;
  background: none;
  padding: 10px 14px;
  cursor: pointer;
  color: var(--muted);
  border-bottom: 2px solid transparent;
}
.tabs button.on { color: var(--navy); border-bottom-color: var(--navy); font-weight: 600; }

table.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
table.grid th, table.grid td { border-bottom: 1px solid var(--line); padding: 9px 10px; text-align: left; vertical-align: middle; }
table.grid th { background: var(--navy); color: #fff; font-weight: 600; font-size: 13px; }
table.grid tr:nth-child(even) td { background: #fafbfd; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.stat { display: flex; gap: 18px; flex-wrap: wrap; }
.stat div { min-width: 96px; }
.stat b { display: block; font-size: 22px; color: var(--navy); }
.stat span { font-size: 12px; color: var(--muted); }

.login-box { max-width: 340px; margin: 60px auto; }

.split { display: flex; gap: 16px; align-items: flex-start; }
.split .left { flex: 1 1 420px; min-width: 320px; }
.split .right { flex: 1 1 460px; min-width: 320px; }

@media (max-width: 900px) {
  .split { flex-direction: column; }
  .split .left, .split .right { width: 100%; min-width: 0; }
}

@media (max-width: 520px) {
  .topbar { align-items: flex-start; }
  .topbar .btn { min-height: 40px; }
  .wrap { padding: 10px; }
  .card { padding: 13px; margin-bottom: 10px; }
  .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mobile-actions { position: sticky; bottom: 0; z-index: 5; padding: 10px; margin: 0 -10px; background: rgba(244,246,249,.96); border-top: 1px solid var(--line); }
  .mobile-actions .btn { min-height: 44px; }
}
