/* ============================================================
   长分秒发布管理平台 · 全站样式 (app.css)
   设计系统：深色侧边栏 + 浅灰内容区 + 品牌金强调
   与企业级电商运营管理后台、长分秒办公系统保持同一设计语言
   ============================================================ */

:root {
  --side: #0f172a;
  --side-2: #16203a;
  --side-3: #1e2a48;
  --side-line: rgba(255, 255, 255, .08);
  --side-text: #94a3b8;
  --side-text-hi: #e2e8f0;

  --gold: #c9a227;
  --gold-bright: #e3bc45;
  --gold-deep: #a8861b;
  --gold-soft: #faf3dd;
  --gold-grad: linear-gradient(135deg, #e3bc45, #c9a227);

  --ink: #0f172a;
  --ink-2: #475569;
  --ink-3: #94a3b8;
  --line: #e2e8f0;
  --line-2: #eef2f7;
  --bg: #f1f5f9;
  --card: #ffffff;

  --ok: #16a34a;
  --ok-bg: #dcfce7;
  --warn: #d97706;
  --warn-bg: #fef3c7;
  --err: #dc2626;
  --err-bg: #fee2e2;
  --info: #2563eb;
  --info-bg: #dbeafe;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --sidebar-w: 232px;
  --topbar-h: 60px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, .1);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, .24);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.55;
  color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.3; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
img, svg { max-width: 100%; display: block; }
ul, ol { margin: 0; padding: 0; list-style: none; }
table { border-collapse: collapse; width: 100%; }
code, pre { font-family: var(--mono); }
::selection { background: rgba(201, 162, 39, .25); }

.muted { color: var(--ink-3); }
.strong { font-weight: 700; }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.flex { display: flex; }
.acenter { display: flex; align-items: center; }
.between { display: flex; align-items: center; justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.gap6 { gap: 6px; } .gap8 { gap: 8px; } .gap10 { gap: 10px; } .gap12 { gap: 12px; } .gap16 { gap: 16px; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt20 { margin-top: 20px; }
.mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; } .mb16 { margin-bottom: 16px; }

/* ============================================================
   登录页
   ============================================================ */
.login-body { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; background: var(--bg); }
.login-side {
  position: relative; overflow: hidden;
  background: linear-gradient(160deg, #0f172a 0%, #101d3d 55%, #16213f 100%);
  color: #fff; padding: 54px 56px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.login-side::before {
  content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%;
  background: radial-gradient(circle, rgba(227, 188, 69, .16), transparent 65%);
  top: -180px; right: -140px;
}
.login-side::after {
  content: ""; position: absolute; width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, .14), transparent 65%);
  bottom: -160px; left: -120px;
}
.login-side__inner { position: relative; z-index: 2; }
.login-side h1 { font-size: 32px; line-height: 1.35; margin-bottom: 14px; letter-spacing: 1px; }
.login-side p { color: #b8c2d4; max-width: 430px; line-height: 1.8; }
.login-side__foot { position: relative; z-index: 2; font-size: 12.5px; color: #7c8aa5; }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 42px; }
.login-brand img { width: 44px; height: 44px; filter: drop-shadow(0 3px 10px rgba(201, 162, 39, .45)); }
.login-brand b { display: block; font-size: 15px; color: #f1f5f9; letter-spacing: .5px; }
.login-brand .brand-sub { display: block; font-size: 10.5px; color: var(--gold-bright); letter-spacing: 2px; margin-top: 3px; }

.login-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; position: relative; }
.login-card {
  width: 100%; max-width: 400px; background: var(--card);
  border-radius: var(--radius-lg); padding: 40px 38px 30px;
  box-shadow: var(--shadow-lg); border: 1px solid var(--line-2);
}
.login-card .head { margin-bottom: 24px; }
.login-card .head h2 { font-size: 21px; margin-bottom: 5px; }
.login-card .head p { color: var(--ink-3); font-size: 13px; }
.login-beian { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 16px; }
.login-beian a { display: inline-flex; align-items: center; gap: 5px; color: inherit; text-decoration: none; }
.login-beian a:hover { color: var(--gold-bright); }
.login-beian img { width: 14px; height: 14px; display: block; }
.login-main__beian { display: none; margin-top: 34px; justify-content: center; color: var(--ink-3); font-size: 12.5px; }
.login-main__beian .login-beian a:hover { color: var(--gold-deep); }
.login-feishu-tip { margin-top: 10px; font-size: 12.5px; color: var(--ink-3); text-align: center; }
.login-alert { display: flex; align-items: flex-start; gap: 8px; padding: 11px 13px; margin-bottom: 16px; border: 1px solid #fecaca; border-radius: var(--radius-sm); background: #fef2f2; color: #b91c1c; font-size: 13px; line-height: 1.6; }
.login-alert[hidden] { display: none; }
.login-alert svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }

/* ============================================================
   按钮 / 表单 / 通用组件
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius-sm); font-size: 13.5px;
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  transition: all .15s ease; white-space: nowrap;
}
.btn:hover { border-color: #cbd5e1; color: var(--ink); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn--primary { background: var(--gold-grad); border-color: transparent; color: #fff; font-weight: 600; box-shadow: 0 2px 8px rgba(201, 162, 39, .3); }
.btn--primary:hover { color: #fff; filter: brightness(1.05); }
.btn--feishu { background: #3370ff; border-color: #3370ff; color: #fff; font-weight: 600; }
.btn--feishu:hover { background: #295fe0; color: #fff; }
.btn--danger { color: var(--err); border-color: #fecaca; }
.btn--danger:hover { background: var(--err-bg); color: var(--err); }
.btn--block { width: 100%; padding: 11px 16px; font-size: 14.5px; }
.btn--sm { padding: 4px 10px; font-size: 12.5px; border-radius: 6px; }

.field { margin-bottom: 16px; }
.field__label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; font-weight: 600; }
.field__label .req { color: var(--err); margin-left: 2px; }
.field__tip { font-size: 12px; color: var(--ink-3); margin-top: 5px; line-height: 1.6; }
.input, .select, .textarea {
  width: 100%; padding: 8px 12px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); font-size: 13.5px; background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201, 162, 39, .15);
}
.textarea { resize: vertical; min-height: 80px; line-height: 1.6; }

.tag {
  display: inline-flex; align-items: center; padding: 2px 9px; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 600; line-height: 1.6; white-space: nowrap;
}
.tag--ok { background: var(--ok-bg); color: var(--ok); }
.tag--warn { background: var(--warn-bg); color: var(--warn); }
.tag--err { background: var(--err-bg); color: var(--err); }
.tag--info { background: var(--info-bg); color: var(--info); }
.tag--grey { background: #f1f5f9; color: var(--ink-3); }
.tag--gold { background: var(--gold-soft); color: var(--gold-deep); }

/* 轻提示 */
.ff-toast {
  position: fixed; top: 24px; left: 50%; transform: translate(-50%, -60px);
  background: rgba(15, 23, 42, .92); color: #fff; padding: 10px 20px;
  border-radius: var(--radius-sm); font-size: 13.5px; z-index: 100000;
  transition: transform .25s ease, opacity .25s ease; opacity: 0; pointer-events: none;
  max-width: 70vw; text-align: center;
}
.ff-toast.show { transform: translate(-50%, 0); opacity: 1; }
.ff-toast.err { background: #b91c1c; }
.ff-toast.ok { background: #15803d; }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .5);
  z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 24px;
  backdrop-filter: blur(2px);
}
.modal {
  background: #fff; border-radius: var(--radius-lg); width: 100%; max-width: 560px;
  max-height: 88vh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
  animation: modalIn .18s ease;
}
.modal--lg { max-width: 760px; }
@keyframes modalIn { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 14px; border-bottom: 1px solid var(--line-2); }
.modal__head h3 { font-size: 16px; }
.modal__close { font-size: 20px; color: var(--ink-3); line-height: 1; padding: 2px 6px; border-radius: 6px; }
.modal__close:hover { background: var(--line-2); color: var(--ink); }
.modal__body { padding: 20px 22px; overflow-y: auto; }
.modal__foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px 18px; border-top: 1px solid var(--line-2); }

/* ============================================================
   控制台布局
   ============================================================ */
.admin { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
  background: linear-gradient(180deg, var(--side) 0%, #0b1120 100%);
  color: var(--side-text);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; z-index: 30;
}
.sidebar__brand {
  display: flex; align-items: center; gap: 11px;
  padding: 17px 18px; border-bottom: 1px solid var(--side-line); flex: 0 0 auto;
}
.sidebar__brand img { width: 36px; height: 36px; flex: 0 0 auto; filter: drop-shadow(0 2px 6px rgba(201, 162, 39, .35)); }
.sidebar__brand b { display: block; font-size: 14px; color: #f1f5f9; letter-spacing: .5px; }
.sidebar__brand .brand-sub { display: block; font-size: 10.5px; color: var(--gold-bright); letter-spacing: 1.5px; margin-top: 2px; }

.sidebar__nav { flex: 1 1 auto; overflow-y: auto; padding: 12px 10px 20px; }
.sidebar__nav::-webkit-scrollbar { width: 5px; }
.sidebar__nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .14); border-radius: 3px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 12px; border-radius: var(--radius-sm); margin-bottom: 2px;
  color: var(--side-text); font-size: 13.5px; transition: all .15s; text-align: left;
}
.nav-item svg { width: 17px; height: 17px; flex: 0 0 auto; opacity: .85; }
.nav-item:hover { color: var(--side-text-hi); background: rgba(255, 255, 255, .05); }
.nav-item.active {
  color: var(--gold-bright); background: linear-gradient(90deg, rgba(201, 162, 39, .16), rgba(201, 162, 39, .05));
  font-weight: 600; position: relative;
}
.nav-item.active::before {
  content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px;
  border-radius: 2px; background: var(--gold-grad);
}
.sidebar__foot { padding: 12px 16px; border-top: 1px solid var(--side-line); font-size: 11px; color: #64748b; line-height: 1.8; flex: 0 0 auto; }
.sidebar__foot a { color: inherit; }
.sidebar__foot a:hover { color: var(--gold-bright); }

.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar-h); background: #fff; border-bottom: 1px solid var(--line-2);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; position: sticky; top: 0; z-index: 20;
}
.topbar__title { font-size: 15.5px; font-weight: 700; }
.topbar__right { display: flex; align-items: center; gap: 14px; }
.topbar__user { display: flex; align-items: center; gap: 9px; }
.topbar__user img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: var(--line-2); }
.topbar__user .u-name { font-size: 13.5px; font-weight: 600; }
.topbar__user .u-role { font-size: 11.5px; color: var(--ink-3); }

.content { padding: 22px 24px 40px; flex: 1 1 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 18px; gap: 12px; flex-wrap: wrap; }
.page-head h2 { font-size: 20px; }
.page-head .desc { color: var(--ink-3); font-size: 12.5px; margin-top: 4px; }

/* ============================================================
   卡片 / 统计 / 表格
   ============================================================ */
.card { background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card__head { display: flex; align-items: center; justify-content: space-between; padding: 15px 18px; border-bottom: 1px solid var(--line-2); }
.card__head h3 { font-size: 14.5px; }
.card__body { padding: 16px 18px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card { background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.stat-card::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--gold-grad); }
.stat-card .s-label { font-size: 12.5px; color: var(--ink-3); }
.stat-card .s-value { font-size: 26px; font-weight: 800; margin-top: 6px; letter-spacing: .5px; }
.stat-card .s-value.em-ok { color: var(--ok); }
.stat-card .s-value.em-err { color: var(--err); }
.stat-card .s-value.em-warn { color: var(--warn); }

.site-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.site-card { background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm); transition: box-shadow .15s; }
.site-card:hover { box-shadow: var(--shadow-md); }
.site-card .sc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.site-card .sc-name { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.site-card .sc-url { font-size: 12px; color: var(--ink-3); word-break: break-all; }
.site-card .sc-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0; }
.site-card .sc-metric { text-align: center; padding: 8px 4px; background: #f8fafc; border-radius: var(--radius-sm); }
.site-card .sc-metric b { display: block; font-size: 15px; }
.site-card .sc-metric span { font-size: 11px; color: var(--ink-3); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.dot--up { background: var(--ok); box-shadow: 0 0 0 3px rgba(22, 163, 74, .18); }
.dot--down { background: var(--err); box-shadow: 0 0 0 3px rgba(220, 38, 38, .18); animation: blink 1.2s infinite; }
.dot--unknown { background: var(--ink-3); }
.dot--paused { background: var(--warn); }
@keyframes blink { 50% { opacity: .45; } }

.table-wrap { overflow-x: auto; }
.tbl { width: 100%; font-size: 13px; }
.tbl th { text-align: left; padding: 10px 12px; background: #f8fafc; color: var(--ink-2); font-weight: 600; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tbody tr:hover { background: #fafbfd; }
.tbl .ops { display: flex; gap: 6px; flex-wrap: wrap; }

.pager { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 12px 18px; font-size: 12.5px; color: var(--ink-3); }
.pager .btn { padding: 4px 12px; font-size: 12.5px; }

.filter-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.filter-bar .select { width: auto; min-width: 130px; padding: 7px 10px; font-size: 13px; }
.filter-bar .input { width: auto; min-width: 160px; padding: 7px 10px; font-size: 13px; }

.empty { text-align: center; color: var(--ink-3); padding: 46px 0; font-size: 13px; }
.loading { text-align: center; color: var(--ink-3); padding: 46px 0; font-size: 13px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.notice-bar { background: var(--gold-soft); border: 1px solid #f0e3b8; color: var(--gold-deep); padding: 10px 16px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 16px; }

.log-box { background: #0f172a; color: #a5f3c0; border-radius: var(--radius-sm); padding: 14px 16px; font-family: var(--mono); font-size: 12px; line-height: 1.8; white-space: pre-wrap; word-break: break-all; max-height: 320px; overflow-y: auto; }

.avatar-sm { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; background: var(--line-2); }

.perm-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.perm-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); font-size: 12.5px; cursor: pointer; transition: all .12s; }
.perm-grid label.perm-item:hover { border-color: var(--gold); }
.perm-item input { accent-color: var(--gold-deep); }
.perm-item.checked { border-color: var(--gold); background: var(--gold-soft); }

.dept-list { max-height: 300px; overflow-y: auto; border: 1px solid var(--line-2); border-radius: var(--radius-sm); }
.dept-item { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-bottom: 1px solid var(--line-2); cursor: pointer; font-size: 13px; }
.dept-item:last-child { border-bottom: 0; }
.dept-item:hover { background: #f8fafc; }
.dept-item input { accent-color: var(--gold-deep); }

.step-flow { display: flex; align-items: center; gap: 0; margin: 4px 0 14px; flex-wrap: wrap; }
.step-flow .step { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-3); }
.step-flow .step .dot-n { width: 20px; height: 20px; border-radius: 50%; background: var(--line-2); color: var(--ink-3); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }
.step-flow .step.on { color: var(--gold-deep); font-weight: 600; }
.step-flow .step.on .dot-n { background: var(--gold-grad); color: #fff; }
.step-flow .step-arrow { width: 34px; height: 1px; background: var(--line); margin: 0 8px; }

.chart-box { width: 100%; }
.chart-box canvas { width: 100%; height: 220px; }

.detail-kv { display: grid; grid-template-columns: 110px 1fr; row-gap: 10px; column-gap: 14px; font-size: 13.5px; }
.detail-kv dt { color: var(--ink-3); }
.detail-kv dd { margin: 0; word-break: break-all; }

.app-foot { text-align: center; color: var(--ink-3); font-size: 12px; padding: 18px 0 6px; }
.app-foot .login-beian { justify-content: center; }
.app-foot a:hover { color: var(--gold-deep); }

/* ============================================================
   响应式（后台以桌面端为主，窄屏简单适配）
   ============================================================ */
@media (max-width: 900px) {
  .login-body { grid-template-columns: 1fr; }
  .login-side { display: none; }
  .login-main__beian { display: flex; }
  .sidebar { position: fixed; left: calc(-1 * var(--sidebar-w)); transition: left .2s; }
  .sidebar.open { left: 0; }
  .grid-2 { grid-template-columns: 1fr; }
  .site-card .sc-metrics { grid-template-columns: repeat(2, 1fr); }
}
