/* ============================================================
   水木硅谷 · 运营管理系统样式
   ============================================================ */
:root {
  --blue: #1B3A8F;
  --blue-deep: #0F2B6E;
  --blue-light: #2E6BFF;
  --blue-soft: #EAF1FF;
  --orange: #FF7A1A;
  --gold: #F5B301;
  --ink: #1A2340;
  --gray: #5A6580;
  --line: #E4E9F5;
  --bg: #F5F7FC;
  --danger: #E63946;
  --success: #07A35A;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 14px; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: 14px; width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; outline: none; background: #fff; }
input:focus, select:focus, textarea:focus { border-color: var(--blue-light); box-shadow: 0 0 0 3px var(--blue-soft); }
textarea { resize: vertical; min-height: 70px; }
h3 { font-size: 16px; margin-bottom: 14px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 20px; border-radius: 10px; font-weight: 700; font-size: 14px; transition: .2s; }
.btn-primary { background: linear-gradient(135deg, #FF8A2A, #FF6A00); color: #fff; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(255,122,26,.35); }
.btn-blue { background: var(--blue); color: #fff; }
.btn-blue:hover { background: var(--blue-deep); }
.btn-ghost { border: 1.5px solid var(--line); color: var(--gray); }
.btn-ghost:hover { border-color: var(--blue-light); color: var(--blue-light); }
.btn-danger { background: #fff; color: var(--danger); border: 1.5px solid var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: 5px 12px; font-size: 12.5px; border-radius: 8px; }
.btn-link { color: var(--blue-light); font-weight: 700; font-size: 13px; padding: 5px 6px; }
.btn-link.danger { color: var(--danger); }

/* 登录 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--blue-deep), var(--blue-light)); padding: 20px; }
.login-box { background: #fff; border-radius: 20px; padding: 40px 36px; width: min(400px, 100%); box-shadow: 0 24px 60px rgba(15,43,110,.35); }
.login-logo { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 14px; background: linear-gradient(135deg, var(--blue), var(--blue-light)); color: #fff; display: grid; place-items: center; font-size: 26px; font-weight: 900; box-shadow: 0 8px 20px rgba(27,58,143,.35); }
.login-box h1 { text-align: center; font-size: 21px; margin-bottom: 4px; }
.login-sub { text-align: center; color: var(--gray); font-size: 13px; margin-bottom: 26px; }
.login-box .field { margin-bottom: 14px; }
.login-box label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.login-err { color: var(--danger); font-size: 13px; min-height: 20px; margin-bottom: 6px; text-align: center; }
.login-tip { text-align: center; color: var(--gray); font-size: 12px; margin-top: 16px; line-height: 1.8; }

/* 布局 */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: var(--blue-deep); color: #fff; display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; z-index: 20; }
.side-logo { display: flex; align-items: center; gap: 10px; padding: 20px 18px; font-size: 17px; font-weight: 800; border-bottom: 1px solid rgba(255,255,255,.1); }
.side-mark { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, var(--blue-light), #4D8DFF); display: grid; place-items: center; font-weight: 900; font-size: 16px; }
.side-logo small { display: block; font-size: 11px; font-weight: 400; opacity: .65; }
#side-nav { padding: 14px 10px; flex: 1; }
#side-nav a { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 10px; font-size: 14px; font-weight: 600; color: rgba(255,255,255,.8); margin-bottom: 4px; transition: .2s; }
#side-nav a:hover { background: rgba(255,255,255,.08); }
#side-nav a.active { background: var(--blue-light); color: #fff; }
#side-nav em { margin-left: auto; background: var(--orange); color: #fff; font-style: normal; font-size: 11px; font-weight: 800; padding: 1px 8px; border-radius: 99px; }
.side-foot { padding: 14px; border-top: 1px solid rgba(255,255,255,.1); display: flex; flex-direction: column; gap: 8px; }
.side-foot a, .side-foot button { color: rgba(255,255,255,.75); font-size: 13px; text-align: left; padding: 6px 8px; border-radius: 8px; }
.side-foot a:hover, .side-foot button:hover { background: rgba(255,255,255,.08); color: #fff; }

.main { flex: 1; margin-left: 220px; padding: 0 26px 40px; }
.main-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 0 18px; position: sticky; top: 0; background: var(--bg); z-index: 10; }
.main-head h2 { font-size: 22px; }
.head-right { display: flex; align-items: center; gap: 12px; color: var(--gray); font-size: 13px; }
.admin-chip { background: var(--blue-soft); color: var(--blue); font-weight: 800; padding: 5px 14px; border-radius: 99px; }

/* 卡片 / 面板 */
.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }
.stat-card { background: #fff; border-radius: 16px; padding: 20px; border: 1px solid var(--line); }
.sc-label { font-size: 13px; color: var(--gray); margin-bottom: 6px; }
.sc-num { font-size: 32px; font-weight: 900; color: var(--blue-deep); }
.stat-card:nth-child(2) .sc-num { color: var(--orange); }
.stat-card:nth-child(3) .sc-num { color: var(--success); }
.stat-card:nth-child(4) .sc-num { color: var(--blue-light); }
.sc-sub { font-size: 12px; color: #AAB3C8; margin-top: 4px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 22px; margin-bottom: 18px; }
.bar-list .bar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; font-size: 13px; }
.bar-list .bar-label { width: 90px; flex-shrink: 0; color: var(--gray); }
.bar-list .bar-track { flex: 1; height: 14px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.bar-list .bar-fill { height: 100%; background: linear-gradient(90deg, var(--blue-light), #4D8DFF); border-radius: 99px; transition: width .4s; }
.bar-list .bar-val { width: 60px; text-align: right; font-weight: 800; }
.help-list { color: var(--gray); font-size: 13.5px; line-height: 2; }

/* 工具栏 / 表格 */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 7px 16px; border-radius: 99px; font-size: 13px; font-weight: 700; color: var(--gray); background: #fff; border: 1.5px solid var(--line); }
.chip.active { background: var(--blue); border-color: var(--blue); color: #fff; }
.search { max-width: 260px; }
.table-wrap { background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; min-width: 800px; }
.table th { background: var(--bg); text-align: left; padding: 12px 14px; font-size: 12.5px; color: var(--gray); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 13.5px; vertical-align: top; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: #FAFCFF; }
.empty { padding: 40px; text-align: center; color: var(--gray); }

/* 状态徽标 */
.badge { display: inline-block; padding: 3px 12px; border-radius: 99px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.badge-new { background: #E8F0FE; color: var(--blue-light); }
.badge-contact { background: #FFF3E8; color: var(--orange); }
.badge-trial { background: #EDE9FE; color: #7C3AED; }
.badge-sign { background: #E6F7FF; color: #0891B2; }
.badge-deal { background: #E6F6EE; color: var(--success); }
select.status-select { width: auto; padding: 6px 10px; font-size: 12.5px; font-weight: 700; border-radius: 8px; }

/* 弹窗 */
.modal { position: fixed; inset: 0; background: rgba(15,43,110,.5); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-box { background: #fff; border-radius: 18px; padding: 26px; width: min(560px, 100%); max-height: 88vh; overflow-y: auto; position: relative; }
.modal-close { position: absolute; top: 12px; right: 16px; font-size: 24px; color: var(--gray); }
.modal-box .field { margin-bottom: 12px; }
.modal-box label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 5px; }
.modal-box .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-box .full { grid-column: 1 / -1; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

@media (max-width: 900px) {
  .sidebar { width: 68px; }
  .side-logo { justify-content: center; font-size: 0; }
  .side-logo small { display: none; }
  #side-nav a { justify-content: center; font-size: 0; }
  #side-nav a em { position: absolute; margin-left: 26px; margin-top: -14px; }
  .side-foot a, .side-foot button { font-size: 0; text-align: center; }
  .main { margin-left: 68px; padding: 0 14px 30px; }
  .stat-cards { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .stat-cards { grid-template-columns: 1fr; }
  .modal-box .form-grid { grid-template-columns: 1fr; }
}
