:root {
  --green: #1f9d55;
  --green-d: #15803d;
  --green-l: #e8f6ee;
  --bg: #f4f7f5;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --red: #dc2626;
  --amber: #d97706;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.04);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}
a { color: var(--green-d); text-decoration: none; }

/* 顶部导航 */
.topbar {
  background: linear-gradient(120deg, var(--green), var(--green-d));
  color: #fff;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar .brand { font-size: 18px; font-weight: 700; letter-spacing: .5px; }
.topbar .brand small { font-weight: 400; opacity: .85; margin-left: 8px; font-size: 12px; }
.topbar .nav-actions { display: flex; gap: 10px; align-items: center; }
.topbar .who { font-size: 13px; opacity: .95; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; border-radius: 8px; padding: 9px 16px; font-size: 14px; cursor: pointer;
  background: var(--green); color: #fff; transition: .15s; font-weight: 600;
}
.btn:hover { background: var(--green-d); }
.btn.secondary { background: rgba(255,255,255,.18); }
.topbar .btn.secondary { background: rgba(255,255,255,.2); }
.topbar .btn.secondary:hover { background: rgba(255,255,255,.32); }
.btn.ghost { background: #fff; color: var(--green-d); border: 1px solid var(--border); }
.btn.ghost:hover { background: var(--green-l); }
.btn.danger { background: #fff; color: var(--red); border: 1px solid #f3c2c2; }
.btn.danger:hover { background: #fff5f5; }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 6px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* 容器 */
.container { max-width: 1180px; margin: 0 auto; padding: 22px 18px 60px; }
.page-title { font-size: 20px; font-weight: 700; margin: 4px 0 18px; }
.muted { color: var(--muted); font-size: 13px; }

/* 卡片 */
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 18px; box-shadow: var(--shadow);
}
.grid { display: grid; gap: 16px; }
.grid.cols-auto { grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

/* 表单 */
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
input[type=text], input[type=password], input[type=date], input[type=number], textarea, select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: inherit; background: #fff; color: var(--text); transition: .15s;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-l); }
textarea { resize: vertical; min-height: 88px; line-height: 1.55; }

/* 标签 / 段 */
.tag { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; background: var(--green-l); color: var(--green-d); font-weight: 600; }
.tag.amber { background: #fef3e2; color: var(--amber); }
.tag.gray { background: #f1f3f5; color: var(--muted); }

.section-h { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; margin: 0 0 10px; }
.section-h .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.report-block { margin-bottom: 16px; }
.report-block:last-child { margin-bottom: 0; }
.report-block .rb-label { font-size: 13px; font-weight: 700; color: var(--green-d); margin-bottom: 4px; }
.report-block .rb-text { white-space: pre-wrap; word-break: break-word; font-size: 14px; color: #374151; }
.report-block .rb-empty { color: #b8bfc7; font-size: 13px; font-italic: italic; }
.comment-box { background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: 10px 12px; font-size: 13px; color: #92400e; }

/* 表格 */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th, table.data td { border: 1px solid var(--border); padding: 8px 10px; vertical-align: top; text-align: left; }
table.data th { background: var(--green-l); color: var(--green-d); font-weight: 700; white-space: nowrap; }
table.data td textarea { min-height: 60px; font-size: 13px; }

/* 提示 */
.notice { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }
.error-msg { color: var(--red); font-size: 13px; margin-top: 8px; min-height: 18px; }
.ok-msg { color: var(--green-d); font-size: 13px; margin-top: 8px; min-height: 18px; }
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #111827; color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,.25); opacity: 0; transition: .25s; pointer-events: none; z-index: 99;
}
.toast.show { opacity: 1; }

/* 登录 */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-tabs { display: flex; gap: 6px; margin-bottom: 18px; background: #eef2f0; padding: 4px; border-radius: 10px; }
.auth-tabs button { flex: 1; border: none; background: transparent; padding: 9px; border-radius: 7px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--muted); }
.auth-tabs button.active { background: #fff; color: var(--green-d); box-shadow: var(--shadow); }
.logo { text-align: center; margin-bottom: 18px; }
.logo .mark { width: 52px; height: 52px; border-radius: 14px; background: linear-gradient(135deg, var(--green), var(--green-d)); display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 24px; font-weight: 800; }
.logo .name { margin-top: 10px; font-weight: 700; font-size: 16px; }

/* 头部操作条 */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 18px; }
.toolbar .field { margin: 0; }
.toolbar .grow { flex: 1; }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: none; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.modal-mask.show { display: flex; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 420px; padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal h3 { margin: 0 0 16px; font-size: 17px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* 历史列表 */
.history-item { border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin-bottom: 12px; }
.history-item .hi-date { font-weight: 700; margin-bottom: 8px; display: flex; justify-content: space-between; }

/* 响应式 */
@media (max-width: 640px) {
  .toolbar { flex-direction: column; align-items: stretch; }
  .topbar .brand small { display: none; }
}
