:root {
  --green: #07c160;
  --green-dark: #06ad56;
  --green-light: #e8f8ee;
  --bg: #ededed;
  --card: #fff;
  --text: #191919;
  --text-2: #7f7f7f;
  --text-3: #b2b2b2;
  --line: #e5e5e5;
  --red: #fa5151;
  --blue: #576b95;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

.hidden { display: none !important; }

/* 登录 */
.login-mask {
  position: fixed; inset: 0;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
.login-box { width: 360px; padding: 24px; text-align: center; }
.login-logo { width: 240px; display: block; margin: 0 auto 12px; }
.login-title { font-size: 20px; font-weight: 600; }
.login-sub { color: var(--text-2); font-size: 13px; margin-bottom: 24px; }
.login-error { color: var(--red); font-size: 13px; margin-top: 12px; min-height: 20px; }

.input {
  width: 100%; height: 44px;
  padding: 0 12px; margin-bottom: 12px;
  border: 1rpx solid var(--line); border: 1px solid var(--line);
  border-radius: 6px; font-size: 14px; outline: none; background: #fff;
}
.input:focus { border-color: var(--green); }
textarea.input { height: auto; padding: 10px 12px; resize: vertical; }
select.input { height: 44px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 40px; padding: 0 20px;
  border: none; border-radius: 6px;
  font-size: 14px; cursor: pointer; background: #f2f2f2; color: var(--text);
}
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-dark); }
.btn-default { background: #fff; border: 1px solid var(--line); }
.btn-danger { background: #fff; color: var(--red); border: 1px solid #f0c8c8; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-block { display: flex; width: 100%; }
.btn + .btn { margin-left: 8px; }

/* 布局 */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 200px; flex-shrink: 0; background: #fff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 16px 0;
}
.brand { padding: 8px 20px 20px; border-bottom: 1px solid var(--line); }
.brand-logo { width: 140px; display: block; }
.nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.nav-item {
  padding: 10px 20px; color: var(--text); cursor: pointer; font-size: 14px;
  border-left: 3px solid transparent;
}
.nav-item:hover { background: #f7f7f7; }
.nav-item.active { color: var(--green); background: var(--green-light); border-left-color: var(--green); }
.side-foot { padding: 12px 20px; border-top: 1px solid var(--line); }
.me-name { font-size: 14px; font-weight: 600; }
.me-role { color: var(--text-2); font-size: 12px; margin-bottom: 8px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 56px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; padding: 0 24px;
}
.topbar h1 { font-size: 17px; font-weight: 600; margin: 0; }
.hint { color: var(--text-3); font-size: 12px; }
.view { padding: 20px 24px 40px; overflow-x: auto; }

/* 卡片 */
.card { background: #fff; border-radius: 8px; margin-bottom: 16px; overflow: hidden; }
.card-head {
  padding: 14px 20px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
}
.card-title { font-size: 15px; font-weight: 600; }
.card-body { padding: 16px 20px; }

.stat-row { display: flex; gap: 16px; flex-wrap: wrap; }
.stat {
  flex: 1; min-width: 150px; background: #fff; border-radius: 8px; padding: 16px 20px;
}
.stat-label { color: var(--text-2); font-size: 13px; }
.stat-num { font-size: 24px; font-weight: 600; margin-top: 4px; }
.stat-num.green { color: var(--green); }

/* 表格 */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: #fafafa; color: var(--text-2); font-weight: 500; }
tbody tr:hover { background: #fafafa; }
td.wrap { white-space: normal; }

.tag {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 1px 8px; border-radius: 4px; font-size: 12px; margin-right: 6px;
  background: #f2f2f2; color: var(--text-2);
}
.tag-green { background: var(--green-light); color: var(--green); }
.tag-red { background: #fdecec; color: var(--red); }
.tag-blue { background: #eaf2fd; color: var(--blue); }
.tag-orange { background: #fff4e5; color: #ff9f0a; }

.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .input { width: auto; min-width: 140px; margin-bottom: 0; height: 36px; }
.toolbar .btn { height: 36px; }
.spacer { flex: 1; }

.empty { padding: 40px; text-align: center; color: var(--text-3); }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center; z-index: 200; padding: 24px;
}
.modal {
  width: 640px; max-width: 100%; max-height: 86vh; background: #fff; border-radius: 10px;
  display: flex; flex-direction: column; overflow: hidden;
}
.modal-head {
  padding: 14px 20px; border-bottom: 1px solid var(--line); font-size: 15px; font-weight: 600;
  display: flex; align-items: center; justify-content: space-between;
}
.modal-close { border: none; background: none; font-size: 22px; cursor: pointer; color: var(--text-2); }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; }

.form-row { display: flex; gap: 12px; margin-bottom: 12px; }
.form-item { flex: 1; min-width: 0; }
.form-item label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 4px; }
.form-item .input { margin-bottom: 0; width: 100%; }

.tabs { display: flex; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tab { padding: 8px 16px; cursor: pointer; color: var(--text-2); border-bottom: 2px solid transparent; }
.tab.active { color: var(--green); border-bottom-color: var(--green); }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 16px 18px; border-left: 2px solid var(--line); }
.timeline li:last-child { border-left-color: transparent; }
.timeline li::before {
  content: ''; position: absolute; left: -7px; top: 6px;
  width: 10px; height: 10px; border-radius: 50%; background: var(--green);
}
.tl-title { font-size: 13px; }
.tl-meta { color: var(--text-3); font-size: 12px; }

.toast {
  position: fixed; left: 50%; top: 24px; transform: translateX(-50%);
  background: rgba(0,0,0,0.8); color: #fff; padding: 10px 20px; border-radius: 6px; z-index: 300; font-size: 13px;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
  .sidebar { width: 150px; }
}
