/* ============================================================
   垣鑫谷业务管理系统 v2 - 全站样式
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --primary: #2d6cdf;
  --primary-dark: #1f56b8;
  --primary-light: #eaf1fe;
  --grad: linear-gradient(135deg, #2d6cdf 0%, #5b4bff 100%);
  --bg: #eef1f7;
  --card: #fff;
  --text: #1f2633;
  --text-light: #7a8599;
  --border: #e4e8f0;
  --success: #23a06b;
  --warning: #e6a23c;
  --danger: #e05252;
  --purple: #7b4dff;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(30, 41, 80, .06);
}
html, body { height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}
a { text-decoration: none; color: var(--primary); }
button { font-family: inherit; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #c7cdd9; border-radius: 4px; }

/* ==================== 登录页 ==================== */
.login-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #0a1030 0%, #111b4d 45%, #241240 100%);
}
.login-wrap::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 18% 22%, rgba(64,110,255,.34) 0%, transparent 42%),
    radial-gradient(circle at 82% 18%, rgba(150,90,255,.30) 0%, transparent 40%),
    radial-gradient(circle at 50% 105%, rgba(0,190,220,.16) 0%, transparent 50%);
}
.login-wrap::after {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 54px 54px;
  -webkit-mask-image: radial-gradient(circle at 50% 42%, #000 15%, transparent 72%);
  mask-image: radial-gradient(circle at 50% 42%, #000 15%, transparent 72%);
}
.particle-wrap { position: absolute; inset: 0; z-index: 1; overflow: hidden; }
.particle {
  position: absolute; bottom: -10px; border-radius: 50%;
  background: rgba(255,255,255,.65);
  box-shadow: 0 0 6px rgba(140,170,255,.8);
  animation: floatUp linear infinite; opacity: 0;
}
@keyframes floatUp {
  0% { transform: translateY(0) translateX(0); opacity: 0; }
  8% { opacity: .8; }
  85% { opacity: .5; }
  100% { transform: translateY(-110vh) translateX(20px); opacity: 0; }
}
.login-card {
  position: relative; z-index: 2;
  width: 400px; max-width: 92vw;
  background: rgba(255,255,255,.97);
  border-radius: 18px; padding: 40px 40px 30px;
  box-shadow: 0 24px 70px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.14);
  animation: cardIn .6s ease-out;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(24px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.login-card .logo-badge {
  width: 56px; height: 56px; margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 800; color: #fff;
  background: var(--grad); border-radius: 16px;
  box-shadow: 0 10px 24px rgba(64,110,255,.35);
}
.login-card .logo { text-align: center; font-size: 23px; font-weight: 700; color: #14213d; letter-spacing: 2px; margin-bottom: 8px; }
.login-card .sub { text-align: center; font-size: 10px; letter-spacing: 1.5px; color: #8a97ad; text-transform: uppercase; margin-bottom: 30px; }
.login-card .field { margin-bottom: 18px; }
.login-card label { display: block; margin-bottom: 7px; color: #556; font-size: 13px; font-weight: 600; }
.login-card input {
  width: 100%; height: 44px; border: 1px solid #dfe3ec; border-radius: 10px;
  padding: 0 14px; font-size: 14px; outline: none; background: #f8fafd; transition: all .2s;
}
.login-card input:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(45,108,223,.13); }
.login-card .btn {
  width: 100%; height: 46px; border: none; border-radius: 10px;
  background: var(--grad); color: #fff; font-size: 16px; letter-spacing: 8px;
  cursor: pointer; margin-top: 10px; box-shadow: 0 10px 22px rgba(45,108,223,.30); transition: all .2s;
}
.login-card .btn:hover { transform: translateY(-1px); box-shadow: 0 14px 26px rgba(45,108,223,.42); }
.login-card .btn:disabled { opacity: .6; cursor: not-allowed; }
.login-tip {
  margin-top: 16px; text-align: center; font-size: 12px; color: #6b7890;
  background: #eef2fb; padding: 8px 10px; border-radius: 8px;
}
.login-copy { position: relative; z-index: 2; margin-top: 22px; font-size: 12px; color: rgba(255,255,255,.55); letter-spacing: 1px; }

/* ==================== 主框架 ==================== */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 216px; background: linear-gradient(180deg, #182035 0%, #131a2e 100%);
  color: #9aa7c3; display: flex; flex-direction: column;
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 100;
  transition: transform .25s;
}
.sidebar .brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 16px; color: #fff; border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar .brand .b-logo {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 800; color: #fff; background: var(--grad);
}
.sidebar .brand .b-name { font-size: 14px; font-weight: 700; line-height: 1.2; }
.sidebar .brand small { display: block; font-size: 10px; color: #6c7ba0; font-weight: 400; margin-top: 2px; }
.sidebar nav { flex: 1; overflow-y: auto; padding: 8px 0 20px; }
.sidebar .nav-group { padding: 12px 16px 4px; font-size: 11px; color: #5a6888; letter-spacing: 1px; }
.sidebar nav a {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 18px; color: #9aa7c3; font-size: 13.5px; cursor: pointer;
  border-left: 3px solid transparent; transition: all .15s;
}
.sidebar nav a:hover { background: rgba(255,255,255,.05); color: #fff; }
.sidebar nav a.active {
  background: linear-gradient(90deg, rgba(45,108,223,.28), transparent);
  color: #fff; border-left-color: #4d8bff;
}
.sidebar nav a .ic { width: 17px; text-align: center; flex: none; font-size: 14px; }
.sidebar .userbox {
  padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.08); font-size: 12px;
}
.sidebar .userbox .uname { color: #fff; font-weight: 600; margin-bottom: 6px; display: flex; justify-content: space-between; align-items: center; }
.sidebar .userbox a { color: #7e8db1; cursor: pointer; margin-right: 10px; }
.sidebar .userbox a:hover { color: #fff; }

.main { flex: 1; margin-left: 216px; display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  height: 56px; background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; padding: 0 20px;
  position: sticky; top: 0; z-index: 50;
}
.topbar .menu-btn { display: none; font-size: 22px; cursor: pointer; margin-right: 10px; }
.topbar .page-title { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.topbar .page-title .crumb { color: var(--text-light); font-weight: 400; font-size: 13px; }
.topbar .right { display: flex; align-items: center; gap: 12px; }
.topbar .role-tag {
  background: var(--primary-light); color: var(--primary);
  padding: 3px 12px; border-radius: 20px; font-size: 12px; font-weight: 600;
}
.topbar .btn-exit { color: var(--text-light); cursor: pointer; font-size: 13px; }
.topbar .btn-exit:hover { color: var(--danger); }
.content { flex: 1; padding: 18px; }
.content iframe {
  width: 100%; height: calc(100vh - 56px - 36px); border: none;
  border-radius: 14px; background: #fff; box-shadow: var(--shadow);
}

/* ==================== 通用组件 ==================== */
.page-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.page-toolbar h2 { font-size: 18px; }
.page-toolbar .spacer { flex: 1; }
.month-pick { display: flex; align-items: center; gap: 8px; }
.month-pick input[type=month] {
  height: 34px; border: 1px solid var(--border); border-radius: 8px; padding: 0 10px; font-size: 13px; outline: none;
}
.cards-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi-card {
  background: #fff; border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.kpi-card .k-label { font-size: 12.5px; color: var(--text-light); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.kpi-card .k-value { font-size: 26px; font-weight: 800; line-height: 1.1; }
.kpi-card .k-sub { font-size: 11.5px; color: var(--text-light); margin-top: 7px; }
.kpi-card .k-icon {
  position: absolute; right: 14px; top: 16px; width: 34px; height: 34px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center; font-size: 17px;
}
.kpi-card.blue .k-value, .kpi-card.blue .k-icon { color: var(--primary); }
.kpi-card.blue .k-icon { background: var(--primary-light); }
.kpi-card.green .k-value, .kpi-card.green .k-icon { color: var(--success); }
.kpi-card.green .k-icon { background: #e6f6ef; }
.kpi-card.orange .k-value, .kpi-card.orange .k-icon { color: var(--warning); }
.kpi-card.orange .k-icon { background: #fdf3e2; }
.kpi-card.red .k-value, .kpi-card.red .k-icon { color: var(--danger); }
.kpi-card.red .k-icon { background: #fdeaea; }
.kpi-card.purple .k-value, .kpi-card.purple .k-icon { color: var(--purple); }
.kpi-card.purple .k-icon { background: #efe9ff; }
.kpi-card.mini { grid-column: span 1; padding: 12px 14px; }
.kpi-card.mini .k-value { font-size: 19px; }

.card {
  background: var(--card); border-radius: var(--radius); padding: 18px;
  box-shadow: var(--shadow); margin-bottom: 16px;
}
.card .card-title {
  font-size: 15px; font-weight: 700; margin-bottom: 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}
.card .card-title .t { display: flex; align-items: center; gap: 8px; }
.card .card-title .t::before {
  content: ""; width: 4px; height: 15px; border-radius: 3px; background: var(--grad);
}
.seg {
  display: inline-flex; background: #eef1f6; border-radius: 9px; padding: 3px; gap: 2px;
}
.seg button {
  border: none; background: transparent; padding: 6px 14px; border-radius: 7px;
  font-size: 13px; color: var(--text-light); cursor: pointer; font-weight: 500;
}
.seg button.on { background: #fff; color: var(--primary); font-weight: 700; box-shadow: 0 1px 4px rgba(0,0,0,.08); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: middle; }
th { background: #f7f9fc; color: #5c6a85; font-weight: 600; white-space: nowrap; font-size: 12px; }
tr:hover td { background: #fafbfe; }
.table-wrap { overflow-x: auto; }

.btn {
  display: inline-block; border: none; border-radius: 8px; padding: 8px 18px;
  font-size: 13px; font-weight: 600; cursor: pointer; background: var(--primary); color: #fff;
  transition: all .15s;
}
.btn:hover { opacity: .88; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { padding: 5px 11px; font-size: 12px; border-radius: 6px; }
.btn-green { background: var(--success); }
.btn-orange { background: var(--warning); }
.btn-red { background: var(--danger); }
.btn-gray { background: #9aa4b2; }
.btn-outline { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.btn-outline-gray { background: #fff; color: #5c6a85; border: 1px solid var(--border); }
.btn-grad { background: var(--grad); }

.tag { display: inline-block; padding: 2.5px 10px; border-radius: 20px; font-size: 12px; white-space: nowrap; }
.tag-blue { background: var(--primary-light); color: var(--primary); }
.tag-green { background: #e6f6ef; color: var(--success); }
.tag-orange { background: #fdf3e2; color: var(--warning); }
.tag-red { background: #fdeaea; color: var(--danger); }
.tag-purple { background: #efe9ff; color: var(--purple); }
.tag-gray { background: #f0f1f4; color: #7a8599; }

.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; align-items: center; }
.filter-bar input, .filter-bar select {
  height: 34px; border: 1px solid var(--border); border-radius: 8px; padding: 0 10px;
  font-size: 13px; outline: none; background: #fff; min-width: 110px;
}
.filter-bar input:focus, .filter-bar select:focus { border-color: var(--primary); }
.filter-bar .kw { min-width: 200px; flex: 1; }

/* 进度条 */
.prog { background: #eef1f6; border-radius: 20px; height: 8px; overflow: hidden; min-width: 80px; }
.prog i { display: block; height: 100%; border-radius: 20px; background: var(--grad); }
.prog.green i { background: linear-gradient(90deg, #23a06b, #4cc386); }
.prog.red i { background: linear-gradient(90deg, #e05252, #f0806c); }

/* 表单 */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0 16px; }
.form-item { margin-bottom: 13px; }
.form-item label { display: block; margin-bottom: 6px; color: #4a5568; font-size: 13px; font-weight: 600; }
.form-item label .req { color: var(--danger); }
.form-item input, .form-item select, .form-item textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px;
  font-size: 13px; outline: none; font-family: inherit; background: #fff;
}
.form-item textarea { min-height: 90px; resize: vertical; }
.form-item input:focus, .form-item select:focus, .form-item textarea:focus { border-color: var(--primary); }
.form-item .hint { font-size: 11.5px; color: var(--text-light); margin-top: 4px; }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15, 20, 40, .5);
  display: none; align-items: center; justify-content: center; z-index: 999;
  backdrop-filter: blur(2px);
}
.modal-mask.show { display: flex; }
.modal {
  background: #fff; border-radius: 14px; width: 620px; max-width: 94vw;
  max-height: 90vh; overflow-y: auto; padding: 22px 24px;
  animation: cardIn .2s ease-out;
}
.modal.wide { width: 860px; }
.modal.slim { width: 480px; }
.modal .m-title { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.modal .m-sub { font-size: 12px; color: var(--text-light); margin-bottom: 14px; }
.modal .m-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.modal-close { position: absolute; right: 16px; top: 16px; cursor: pointer; color: var(--text-light); }

/* Toast */
.toast {
  position: fixed; top: 70px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,.8); color: #fff; padding: 10px 22px;
  border-radius: 10px; font-size: 13px; z-index: 9999; display: none;
  box-shadow: 0 8px 20px rgba(0,0,0,.2);
}

/* 文章阅读 */
.article-content { line-height: 1.85; font-size: 14px; color: #2c3547; }
.article-content h1, .article-content h2, .article-content h3 { margin: 14px 0 8px; }
.article-content p { margin: 8px 0; }
.article-content li { margin: 4px 0; }

/* 空状态 */
.empty { text-align: center; color: #9aa4b2; padding: 46px 0; }
.empty .e-ic { font-size: 40px; margin-bottom: 8px; opacity: .5; }

/* 加载 */
.loading { text-align: center; padding: 60px 0; color: #9aa4b2; }

/* ==================== 响应式 ==================== */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .topbar .menu-btn { display: block; }
  .content { padding: 10px; }
  .content iframe { height: calc(100vh - 56px - 20px); }
  .cards-row { grid-template-columns: repeat(2, 1fr); }
  .filter-bar .kw { flex: 1 1 100%; }
}
