* { box-sizing: border-box; }
:root {
  --bg: #f8fafc;
  --panel: #ffffff;
  --soft: #f1f5f9;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --navy: #0b1f32;
  --brand: #0d9488;
  --brand-dark: #0f766e;
  --blue: #2563eb;
  --purple: #7c3aed;
  --red: #dc2626;
  --amber: #ca8a04;
  --shadow: 0 18px 46px rgba(15, 23, 42, .10);
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, "Microsoft YaHei", sans-serif;
  font-size: 15px;
}
html { scroll-behavior: smooth; }
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 180px;
  background: var(--navy);
  z-index: -1;
}
a { color: var(--blue); text-decoration: none; }
.top {
  height: 76px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 34px;
}
.brand { display: flex; align-items: center; gap: 12px; font-size: 19px; font-weight: 900; }
.brand-mark {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
}
.top nav { display: flex; gap: 10px; }
.top a { color: #e2e8f0; padding: 9px 12px; border-radius: 8px; }
.top a:hover { background: rgba(255,255,255,.10); color: #fff; }
.wrap { max-width: 1320px; margin: 28px auto 48px; padding: 0 22px; overflow-x: hidden; }
.panel, .app-shell {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.panel { padding: 24px; }
.app-shell { display: grid; grid-template-columns: 230px 1fr; min-height: 620px; }
.side { background: var(--navy); color: #cbd5e1; padding: 28px 24px; }
.side-title { color: #fff; font-size: 24px; font-weight: 900; margin-bottom: 26px; }
.side a, .side span {
  display: block;
  color: #cbd5e1;
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 6px;
}
.side a:hover { background: rgba(255,255,255,.08); color: #fff; }
.side .active { background: rgba(13,148,136,.18); color: #fff; border-left: 4px solid var(--brand); }
.content { padding: 28px; min-width: 0; }
h1, h2, h3 { margin-top: 0; letter-spacing: 0; }
h1 { font-size: 28px; margin-bottom: 8px; }
h2 { font-size: 22px; margin-bottom: 16px; }
h3 { font-size: 17px; margin-bottom: 10px; }
.muted { color: var(--muted); line-height: 1.6; }
.employee-page { padding: 0; }
.hero {
  background: #fff;
  color: var(--text);
  padding: 24px 28px;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(320px, 560px);
  gap: 18px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.hero h1 { color: var(--text); margin: 0; }
.hero .muted { color: var(--muted); }
.hero-actions { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; min-width: 0; }
.workspace { padding: 22px; }
.employee-layout { display: grid; grid-template-columns: 280px minmax(0,1fr); gap: 18px; align-items: start; }
.category-rail, .record-board, .upload-box, .table-card, .card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
}
.category-rail { align-self: start; }
.upload-box, .table-card { margin-bottom: 18px; }
.category-pill {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  margin-top: 12px;
  background: #fff;
}
.category-pill.primary { background: #ecfdf5; border-color: #b7efe2; }
.category-pill strong { display: flex; justify-content: space-between; gap: 10px; font-size: 17px; }
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  color: var(--brand-dark);
  background: #dcfce7;
  white-space: nowrap;
}
.badge.blue { color: var(--blue); background: #dbeafe; }
.badge.purple { color: var(--purple); background: #ede9fe; }
.badge.amber { color: var(--amber); background: #fef9c3; }
.badge.red { color: var(--red); background: #fee2e2; }
.toolbar-row, .admin-head, .action-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.admin-head { margin-bottom: 20px; justify-content: flex-start; }
.search-form { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; min-width: 0; }
.search-form input { min-width: 0; }
input, select, textarea {
  width: 100%;
  min-height: 42px;
  padding: 11px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  font-size: 14px;
  background: #f8fafc;
  color: var(--text);
}
input:focus, select:focus, textarea:focus {
  outline: 3px solid rgba(13,148,136,.15);
  border-color: var(--brand);
  background: #fff;
}
input[type="file"] {
  padding: 9px 12px;
  background: #fff;
}
input[type="file"]::file-selector-button {
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  padding: 8px 12px;
  margin-right: 12px;
  font-weight: 800;
  cursor: pointer;
}
textarea { min-height: 130px; resize: vertical; }
label { display: block; font-size: 13px; color: #475569; margin: 13px 0 6px; font-weight: 800; }
button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: var(--brand);
  color: #fff;
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}
button:hover, .btn:hover { background: var(--brand-dark); }
button:disabled { cursor: not-allowed; background: #94a3b8; }
.btn.gray, button.gray { background: #475569; }
.btn.blue, button.blue, .copy-btn { background: var(--blue); }
.btn.red, button.red, .danger-btn, .delete-claim-btn { background: var(--red); }
.btn.light { background: #fff; color: var(--muted); border: 1px solid var(--line); }
.flash {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #047857;
  padding: 13px 15px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-weight: 800;
}
.claim-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.claim-form { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.claim-form .fields { display: grid; grid-template-columns: 1fr; gap: 10px; align-items: end; }
.claim-form button { width: 100%; margin-top: 12px; }
.stock-line { margin: 12px 0; color: var(--muted); }
.stock-line strong { color: var(--brand); font-size: 22px; }
.type-title { font-size: 20px; font-weight: 900; margin-bottom: 8px; }
.record-column + .record-column { margin-top: 0; }
.record-columns { display: grid; gap: 18px; }
.split-columns {
  display: flex;
  flex-direction: row;
  gap: 18px;
  align-items: start;
  width: 100%;
  min-width: 0;
}
.category-panel {
  flex: 1 1 0;
  width: 50%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  background: #fff;
  min-width: 0;
  max-height: 920px;
  display: flex;
  flex-direction: column;
}
.category-panel.primary {
  background: #f0fdf9;
  border-color: #b7efe2;
}
.inline-claim {
  margin: 14px 0 16px;
  background: #f8fafc;
  flex: 0 0 auto;
}
.column-scroll {
  min-height: 180px;
  overflow-y: auto;
  padding-right: 6px;
  flex: 1 1 auto;
}
.column-scroll::-webkit-scrollbar { width: 8px; }
.column-scroll::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 999px; }
.column-scroll::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 999px; }
.column-scroll::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
.column-scroll .record-card:first-child {
  margin-top: 0;
}
.record-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  margin-top: 12px;
  background: #fff;
}
.record-time { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.secret-wrap { display: grid; grid-template-columns: minmax(180px, 1fr) auto auto; gap: 10px; align-items: center; }
.secret {
  font-family: Consolas, "Courier New", monospace;
  background: #eef2f7;
  padding: 11px 12px;
  border-radius: 9px;
  word-break: break-all;
  min-height: 42px;
}
.copied-row { background: #f0fdf4; }
.copied-row .secret { background: #dcfce7; color: #166534; text-decoration: line-through; }
.meta-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; margin-top: 10px; color: #475569; font-size: 13px; }
.record-purpose { color: #475569; font-size: 13px; margin-top: 8px; }
.search-results { border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin-bottom: 18px; background: #fff; }
.result-row { display: grid; grid-template-columns: 110px minmax(220px, 1fr) 170px; gap: 10px 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.result-row:first-of-type { border-top: 0; }
.result-row span { word-break: break-all; font-family: Consolas, "Courier New", monospace; }
.result-row em { color: var(--muted); font-style: normal; }
.result-status {
  grid-column: 2 / 4;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 14px;
  color: #475569;
  font-size: 13px;
}
.result-status span { font-family: Arial, "Microsoft YaHei", sans-serif; }
table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; }
th, td { border-bottom: 1px solid var(--line); padding: 12px; text-align: left; vertical-align: top; }
th { background: #f8fafc; color: #475569; font-weight: 900; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.form-grid { display: grid; grid-template-columns: 180px 220px minmax(260px,1fr); gap: 12px; align-items: end; }
.empty { color: #94a3b8; padding: 18px 0; }
.login { max-width: 430px; margin: 76px auto; }
.sync-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 99;
  padding: 10px 14px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  border: 1px solid #cbd5e1;
  box-shadow: 0 10px 28px rgba(15,23,42,.12);
  font-size: 13px;
  font-weight: 800;
}
.sync-toast.ok { background: #dcfce7; color: #047857; border-color: #86efac; }
.sync-toast.bad { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
@media (max-width: 860px) {
  .top { padding: 0 16px; }
  .wrap { padding: 0 12px; }
  .app-shell, .employee-layout, .form-grid { grid-template-columns: 1fr; }
  .side { display: none; }
  .hero { padding: 20px; grid-template-columns: 1fr; }
  .hero-actions { grid-template-columns: 1fr; }
  .split-columns { flex-direction: column; }
  .category-panel { width: 100%; max-height: none; }
  .column-scroll { max-height: 680px; }
  .search-form, .result-row, .secret-wrap, .claim-form .fields, .result-status { grid-template-columns: 1fr; }
  .result-status { grid-column: 1; }
}
