:root {
  --pri: #185FA5; --pri-dark: #0C447C; --pri-bg: #E6F1FB;
  --bg: #F2F6FB; --card: #ffffff; --text: #212121; --muted: #616161;
  --border: #C5CDD8; --ok: #2E7D32; --ok-bg: #EAF3DE; --warn: #B26A00; --warn-bg: #FAEEDA;
  --err: #C62828; --err-bg: #FCEBEB; --teal: #0F6E56; --teal-bg: #E1F5EE;
  --radius: 12px; --radius-sm: 8px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.7 -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif; color: var(--text); background: var(--bg); }
a { color: var(--pri); text-decoration: none; }
h1, h2, h3 { line-height: 1.4; }
img { max-width: 100%; }

.top { background: var(--card); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.top-inner { max-width: 1080px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.brand { font-weight: 600; color: var(--pri-dark); font-size: 17px; white-space: nowrap; }
.brand small { color: var(--muted); font-weight: 400; font-size: 12px; display: block; }
.spacer { flex: 1; }

.container { max-width: 1080px; margin: 0 auto; padding: 20px 16px 60px; }
.container.narrow { max-width: 640px; }

.btn { display: inline-block; border: 1px solid var(--pri); background: var(--pri); color: #fff; border-radius: var(--radius-sm);
  padding: 9px 18px; font-size: 15px; cursor: pointer; line-height: 1.4; transition: opacity .15s; }
.btn:hover { opacity: .9; }
.btn.block { display: block; width: 100%; text-align: center; }
.btn.ghost { background: transparent; color: var(--pri); }
.btn.small { padding: 5px 12px; font-size: 13px; }
.btn.danger { border-color: var(--err); background: var(--err); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.link-btn { background: none; border: none; color: var(--pri); cursor: pointer; font-size: 14px; padding: 0; }
.lang-toggle { background: none; border: 1px solid var(--border); border-radius: 20px; padding: 3px 12px; cursor: pointer; font-size: 13px; color: var(--muted); }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.card h2 { margin: 0 0 12px; font-size: 17px; color: var(--pri-dark); }
.card h3 { margin: 0 0 8px; font-size: 15px; }
.muted { color: var(--muted); font-size: 13px; }
.center { text-align: center; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 14px; margin-bottom: 6px; font-weight: 500; }
.field label .req { color: var(--err); margin-left: 2px; }
.field input[type=text], .field input[type=password], .field input[type=tel], .field input[type=email],
.field input[type=date], .field input[type=number], .field select, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 15px; background: #fff; color: var(--text); font-family: inherit;
}
.field textarea { min-height: 96px; resize: vertical; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--border); border-radius: 20px; padding: 6px 14px; cursor: pointer; font-size: 14px; background: #fff; }
.chip.on { border-color: var(--pri); background: var(--pri-bg); color: var(--pri-dark); font-weight: 500; }
.chip input { display: none; }

.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.check-item { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; font-size: 13px; cursor: pointer; background: #fff; display: flex; gap: 6px; align-items: flex-start; }
.check-item.on { border-color: var(--pri); background: var(--pri-bg); }

.badge { display: inline-block; border-radius: 20px; padding: 2px 10px; font-size: 12px; font-weight: 500; background: #eee; color: var(--muted); white-space: nowrap; }
.badge.st-pending_accept { background: #eee; color: #555; }
.badge.st-graded { background: var(--pri-bg); color: var(--pri-dark); }
.badge.st-transferred { background: var(--pri-bg); color: var(--pri-dark); }
.badge.st-taken { background: var(--pri-bg); color: var(--pri-dark); }
.badge.st-schedule_confirm { background: var(--warn-bg); color: var(--warn); }
.badge.st-constructing { background: var(--teal-bg); color: var(--teal); }
.badge.st-pending_check { background: var(--warn-bg); color: var(--warn); }
.badge.st-closed { background: var(--ok-bg); color: var(--ok); }
.badge.st-returned { background: var(--err-bg); color: var(--err); }
.badge.st-suspended, .badge.st-voided { background: #eee; color: var(--muted); }
.badge.cat { background: var(--pri-bg); color: var(--pri-dark); }
.badge.urgent { background: var(--err-bg); color: var(--err); }

.list-item { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; display: block; color: var(--text); cursor: pointer; }
.list-item:hover { border-color: var(--pri); }
.list-item .row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.list-item .row b { font-size: 15px; }
.list-item .desc { color: var(--muted); font-size: 13px; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--border); }
.timeline li { position: relative; padding: 0 0 16px 14px; }
.timeline li::before { content: ""; position: absolute; left: -24px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--pri); }
.timeline li.muted::before { background: var(--border); }
.timeline .t-title { font-weight: 500; font-size: 14px; }
.timeline .t-meta { font-size: 12px; color: var(--muted); }
.timeline .t-note { font-size: 13px; color: var(--text); margin-top: 2px; white-space: pre-wrap; }

table.data { width: 100%; border-collapse: collapse; background: var(--card); font-size: 14px; }
table.data th, table.data td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; vertical-align: top; }
table.data th { background: var(--pri); color: #fff; font-weight: 500; white-space: nowrap; }
table.data tr:nth-child(even) td { background: var(--bg); }
.table-wrap { overflow-x: auto; border-radius: var(--radius); }

.kanban { display: flex; gap: 14px; overflow-x: auto; align-items: flex-start; padding-bottom: 10px; }
.kanban .col { min-width: 240px; flex: 1; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; }
.kanban .col h3 { margin: 2px 4px 10px; font-size: 14px; color: var(--pri-dark); display: flex; justify-content: space-between; }
.kanban .col .cnt { background: var(--pri-bg); border-radius: 12px; padding: 0 10px; color: var(--pri-dark); font-size: 13px; }
.kanban .kcard { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; margin-bottom: 8px; font-size: 13px; cursor: pointer; background: #fff; }
.kanban .kcard:hover { border-color: var(--pri); }
.kanban .kcard .no { font-weight: 600; color: var(--pri-dark); }
.kanban .kcard .d { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.upload-zone { display: block; border: 2px dashed var(--border); border-radius: var(--radius-sm); padding: 18px; text-align: center; color: var(--muted); cursor: pointer; background: #fff; }
.upload-zone strong { display: block; font-size: 14px; color: var(--pri); }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.thumbs .thumb { position: relative; width: 76px; height: 76px; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); }
.thumbs .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumbs .thumb .file-type { display: flex; align-items: center; justify-content: center; height: 100%; font-size: 11px; color: var(--muted); }
.thumbs .thumb .del { position: absolute; right: 2px; top: 2px; background: rgba(0,0,0,.55); color: #fff; border: none; border-radius: 50%; width: 20px; height: 20px; cursor: pointer; font-size: 12px; line-height: 1; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 32px; background: rgba(20,20,20,.92); color: #fff; border-radius: var(--radius-sm); padding: 10px 20px; font-size: 14px; z-index: 100; max-width: 86vw; }
.toast.err { background: var(--err); }

.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 20px; }
.tabs button { background: none; border: none; padding: 10px 18px; font-size: 15px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -2px; }
.tabs button.on { color: var(--pri-dark); border-bottom-color: var(--pri); font-weight: 500; }

.alert { border-left: 4px solid var(--pri); background: var(--pri-bg); padding: 10px 14px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 14px; }
.alert.warn { border-color: var(--warn); background: var(--warn-bg); }
.alert.err { border-color: var(--err); background: var(--err-bg); }

.stars { display: flex; gap: 4px; font-size: 24px; cursor: pointer; user-select: none; }
.stars span { color: #ccc; }
.stars span.on { color: #F5A623; }

.kv { width: 100%; border-collapse: collapse; font-size: 14px; }
.kv td { padding: 6px 4px; vertical-align: top; }
.kv td.k { color: var(--muted); width: 110px; white-space: nowrap; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.filters select, .filters input { padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 14px; background: #fff; }
.pager { display: flex; gap: 10px; justify-content: center; margin-top: 16px; align-items: center; }

@media (max-width: 640px) {
  .field-row { flex-direction: column; gap: 0; }
  .container { padding: 14px 12px 50px; }
  table.data { font-size: 13px; }
}
