/* ===================================================================
   运营中控台 · 样式
   暗色为主，可切浅色。只依赖 index.html 里引入的 Element Plus。
   =================================================================== */

:root {
  --bg: #f5f6f9;
  --panel: #ffffff;
  --panel-2: #f2f4f8;
  --panel-3: #e9edf3;
  --line: #e4e8ef;
  --line-2: #eef1f5;
  --text: #1a1f2b;
  --text-2: #414a5c;
  --muted: #6f798c;
  --dim: #98a1b3;
  --brand: #3b76f6;
  --brand-2: #6b9bff;
  --brand-soft: rgba(59, 118, 246, .10);
  --red: #e0453f;
  --red-soft: rgba(224, 69, 63, .10);
  --green: #0f9159;
  --green-soft: rgba(15, 145, 89, .10);
  --amber: #b97a06;
  --amber-soft: rgba(185, 122, 6, .12);
  --shadow: 0 1px 2px rgba(18, 26, 44, .05), 0 10px 26px -14px rgba(18, 26, 44, .20);
  --shadow-lg: 0 20px 50px -24px rgba(18, 26, 44, .35);
  --radius: 14px;
  --radius-sm: 10px;
  --el-color-primary: #3b76f6;
}

html.dark {
  --bg: #0b0d11;
  --panel: #12151b;
  --panel-2: #171b23;
  --panel-3: #1e232d;
  --line: #232936;
  --line-2: #1b202a;
  --text: #e7eaf1;
  --text-2: #c2c9d6;
  --muted: #868fa2;
  --dim: #6a7385;
  --brand: #5b8cff;
  --brand-2: #8db0ff;
  --brand-soft: rgba(91, 140, 255, .14);
  --red: #ff6259;
  --red-soft: rgba(255, 98, 89, .14);
  --green: #37c07c;
  --green-soft: rgba(55, 192, 124, .14);
  --amber: #f2a93b;
  --amber-soft: rgba(242, 169, 59, .15);
  --shadow: 0 1px 0 rgba(255, 255, 255, .025) inset, 0 14px 34px -20px rgba(0, 0, 0, .9);
  --shadow-lg: 0 24px 60px -24px rgba(0, 0, 0, .95);
  --el-color-primary: #5b8cff;

  --el-bg-color: #12151b;
  --el-bg-color-overlay: #171b23;
  --el-bg-color-page: #0b0d11;
  --el-fill-color-blank: #12151b;
  --el-fill-color: #1e232d;
  --el-fill-color-light: #191e26;
  --el-fill-color-lighter: #161a21;
  --el-text-color-primary: #e7eaf1;
  --el-text-color-regular: #c2c9d6;
  --el-text-color-secondary: #868fa2;
  --el-border-color: #262d3a;
  --el-border-color-light: #232936;
  --el-border-color-lighter: #1e242e;
  --el-mask-color: rgba(6, 8, 12, .78);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

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

html.dark body {
  background:
    radial-gradient(1200px 520px at 10% -10%, rgba(91, 140, 255, .10), transparent 62%),
    radial-gradient(900px 420px at 95% 0%, rgba(55, 192, 124, .055), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}

code, .num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--panel-3); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--dim); background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------- 骨架 ---------------- */
.shell { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 18px;
  height: 62px;
  padding: 0 26px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
html.dark .topbar { background: rgba(18, 21, 27, .86); backdrop-filter: blur(14px) saturate(1.2); }

.brand { display: flex; align-items: center; gap: 10px; padding-right: 6px; flex: 0 0 auto; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 9px;
  background: linear-gradient(140deg, var(--brand), var(--brand-2));
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px;
  box-shadow: 0 6px 16px -8px var(--brand);
}
.brand-name { font-weight: 650; letter-spacing: .2px; font-size: 15px; }
.brand-day { font-size: 12px; color: var(--dim); margin-left: 2px; }

.nav { display: flex; gap: 4px; align-items: center; flex: 1 1 auto; margin-left: 10px; }
.nav-item {
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 13px; border-radius: 9px;
  color: var(--muted); font-size: 13.5px; cursor: pointer; user-select: none;
  border: 1px solid transparent; transition: .16s ease; white-space: nowrap;
}
.nav-item:hover { color: var(--text); background: var(--panel-2); }
.nav-item.active {
  color: var(--text);
  background: var(--panel-2);
  border-color: var(--line);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .12);
}
.nav-item .el-icon { font-size: 15px; }
.nav-badge {
  min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px;
  background: var(--red); color: #fff; font-size: 11px; line-height: 17px; text-align: center;
}

.top-right { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.top-stat {
  display: flex; align-items: baseline; gap: 6px;
  padding: 5px 12px; border-radius: 9px; background: var(--panel-2); border: 1px solid var(--line);
}
.top-stat b { font-size: 14px; font-variant-numeric: tabular-nums; }
.top-stat span { font-size: 11.5px; color: var(--muted); }

.icon-btn {
  width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--muted); display: grid; place-items: center;
  cursor: pointer; transition: .16s;
}
.icon-btn:hover { color: var(--text); border-color: var(--dim); }

.content { width: 100%; max-width: 1440px; margin: 0 auto; padding: 22px 26px 64px; }

/* ---------------- 通用面板 ---------------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel-head {
  display: flex; align-items: center; gap: 10px;
  padding: 15px 18px; border-bottom: 1px solid var(--line-2);
}
.panel-title { font-weight: 620; font-size: 14.5px; letter-spacing: .2px; }
.panel-sub { font-size: 12px; color: var(--dim); }
.panel-body { padding: 16px 18px; }
.spacer { flex: 1 1 auto; }

.section-title {
  display: flex; align-items: center; gap: 9px;
  margin: 26px 0 12px; font-size: 13px; color: var(--muted); font-weight: 560; letter-spacing: .4px;
}
.section-title .line { flex: 1; height: 1px; background: var(--line-2); }

.muted { color: var(--muted); }
.dim { color: var(--dim); }
.mini { font-size: 12px; }
.mono { font-variant-numeric: tabular-nums; }
.red { color: var(--red); }
.green { color: var(--green); }
.amber { color: var(--amber); }

/* ---------------- 顶部统计卡 ---------------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat {
  position: relative; padding: 16px 18px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow);
  overflow: hidden;
}
.stat::after {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, var(--brand), transparent 70%); opacity: .8;
}
.stat.is-primary { background: linear-gradient(160deg, rgba(91, 140, 255, .13), var(--panel) 58%); }
.stat.is-primary::after { background: linear-gradient(90deg, var(--brand), var(--brand-2)); }
.stat-label { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat-value { font-size: 29px; font-weight: 660; letter-spacing: -.6px; margin-top: 6px; font-variant-numeric: tabular-nums; line-height: 1.15; }
.stat-value small { font-size: 15px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.stat-foot { margin-top: 7px; font-size: 12px; color: var(--dim); display: flex; align-items: center; gap: 6px; }
.delta { font-weight: 600; font-variant-numeric: tabular-nums; }
.delta.up { color: var(--red); }
.delta.down { color: var(--green); }

/* ---------------- 项目卡片 ---------------- */
.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }

.pcard {
  position: relative; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; transition: .18s ease;
}
.pcard:hover { border-color: var(--dim); transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.pcard::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--p-color, var(--brand)); opacity: .9;
}
.pcard.paused { opacity: .62; }

.pcard-head { display: flex; align-items: flex-start; gap: 10px; padding: 15px 16px 0 19px; }
.pcard-title { font-weight: 620; font-size: 15px; line-height: 1.3; }
.pcard-rev { text-align: right; margin-left: auto; }
.pcard-rev b { font-size: 16px; font-weight: 660; font-variant-numeric: tabular-nums; }
.pcard-rev span { display: block; font-size: 11px; color: var(--dim); }

.pill {
  display: inline-flex; align-items: center; gap: 4px;
  height: 19px; padding: 0 7px; border-radius: 6px; font-size: 11px; font-weight: 600;
  background: var(--panel-2); color: var(--muted); border: 1px solid var(--line);
}
.pill.p0 { color: #fff; background: var(--red); border-color: transparent; }
.pill.p1 { color: var(--amber); background: var(--amber-soft); border-color: transparent; }
.pill.p2 { color: var(--brand); background: var(--brand-soft); border-color: transparent; }
.pill.warn { color: var(--red); background: var(--red-soft); border-color: transparent; }
.pill.ok { color: var(--green); background: var(--green-soft); border-color: transparent; }

.pcard-body { padding: 12px 16px 0 19px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.pmeta { display: flex; flex-wrap: wrap; gap: 6px; }
.pmeta .k { font-size: 11.5px; color: var(--dim); }

.tlist { display: flex; flex-direction: column; gap: 5px; min-height: 26px; }
.trow { display: flex; align-items: center; gap: 8px; font-size: 12.8px; color: var(--text-2); }
.trow .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--dim); flex: 0 0 auto; }
.trow .time { margin-left: auto; font-size: 11.5px; color: var(--dim); font-variant-numeric: tabular-nums; white-space: nowrap; }
.trow.overdue { color: var(--red); }
.trow.overdue .dot { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.trow.overdue .time { color: var(--red); }
.trow.done { color: var(--dim); text-decoration: line-through; }

.pcard-actions {
  display: flex; gap: 6px; padding: 12px 16px 14px 19px; margin-top: 10px;
  border-top: 1px dashed var(--line-2);
}
.qbtn {
  flex: 1; height: 29px; padding: 0 8px; border-radius: 8px; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text-2);
  font-size: 12.2px; display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  transition: .15s; font-family: inherit; white-space: nowrap;
}
.qbtn:hover { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.qbtn.ghost:hover { background: var(--amber-soft); color: var(--amber); }

/* ---------------- 今日待办 ---------------- */
.todo-grid { display: grid; grid-template-columns: minmax(0, 1.62fr) minmax(0, 1fr); gap: 14px; align-items: start; }

.todo-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 8px 10px 4px;
  border-bottom: 1px solid var(--line-2); border-radius: 8px; position: relative;
}
.todo-row:last-child { border-bottom: none; }
.todo-row:hover { background: var(--panel-2); }
.todo-row.overdue { background: linear-gradient(90deg, var(--red-soft), transparent 70%); }
.todo-row.overdue::before {
  content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 2px;
  background: var(--red); border-radius: 2px;
}
.todo-main { flex: 1; min-width: 0; }
.todo-title { font-size: 13.4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo-meta { font-size: 11.5px; color: var(--dim); display: flex; gap: 8px; margin-top: 2px; flex-wrap: wrap; }
.todo-time { font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 12px; color: var(--muted); }
.todo-time.overdue { color: var(--red); font-weight: 600; }

.check {
  width: 19px; height: 19px; border-radius: 50%; border: 1.6px solid var(--dim);
  display: grid; place-items: center; cursor: pointer; flex: 0 0 auto; transition: .15s;
  background: transparent; padding: 0; color: transparent;
}
.check:hover { border-color: var(--green); color: var(--green); }
.check.on { background: var(--green); border-color: var(--green); color: #fff; }

/* ---------------- 柱状图 ---------------- */
.chart { display: flex; align-items: flex-end; gap: 6px; height: 132px; padding-top: 16px; }
.chart .col { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.chart .bar-wrap { width: 100%; flex: 1; display: flex; align-items: flex-end; }
.chart .bar {
  width: 100%; border-radius: 5px 5px 2px 2px; min-height: 2px;
  background: linear-gradient(180deg, var(--brand-2), var(--brand));
  opacity: .82; transition: .2s;
}
.chart .col:hover .bar { opacity: 1; }
.chart .col.zero .bar { background: var(--panel-3); }
.chart .col.today .bar { background: linear-gradient(180deg, #8fe0b7, var(--green)); opacity: 1; }
.chart .x { font-size: 10.5px; color: var(--dim); white-space: nowrap; font-variant-numeric: tabular-nums; }
.chart .col.hi .x { color: var(--text-2); }

/* ---------------- 空状态 ---------------- */
.empty { text-align: center; padding: 34px 16px; color: var(--dim); }
.empty .ico { font-size: 26px; opacity: .5; margin-bottom: 8px; }
.empty .t { font-size: 13px; margin-bottom: 12px; }

/* ---------------- 登录页 ---------------- */
.gate {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
}
html.dark .gate {
  background:
    radial-gradient(760px 420px at 50% 0%, rgba(91, 140, 255, .16), transparent 62%),
    radial-gradient(600px 320px at 85% 90%, rgba(55, 192, 124, .07), transparent 60%);
}
.gate-card {
  width: 100%; max-width: 372px; padding: 30px 28px 26px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow-lg);
}
.gate-mark {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(140deg, var(--brand), var(--brand-2)); color: #fff;
  font-weight: 700; font-size: 17px; box-shadow: 0 10px 24px -12px var(--brand); margin-bottom: 16px;
}
.gate h1 { font-size: 19px; margin: 0 0 6px; font-weight: 660; letter-spacing: -.2px; }
.gate p.sub { margin: 0 0 22px; color: var(--muted); font-size: 12.8px; line-height: 1.6; }
.gate .el-input { margin-bottom: 12px; }
.gate .el-button { width: 100%; height: 40px; font-size: 14px; border-radius: 10px; }
.gate-foot { margin-top: 16px; font-size: 11.5px; color: var(--dim); text-align: center; }

/* ---------------- 表格页通用 ---------------- */
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h2 { margin: 0; font-size: 19px; font-weight: 660; letter-spacing: -.3px; }
.page-head .sub { color: var(--dim); font-size: 12.5px; }

.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 14px; border-bottom: 1px solid var(--line-2); }

.seg { display: inline-flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; padding: 2px; }
.seg button {
  border: 0; background: transparent; color: var(--muted); font-size: 12.5px; font-family: inherit;
  height: 26px; padding: 0 11px; border-radius: 7px; cursor: pointer; white-space: nowrap;
}
.seg button.on { background: var(--panel); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .14); }

/* ---------------- 明细列表（营收/文案用） ---------------- */
.rrow { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-bottom: 1px solid var(--line-2); }
.rrow:last-child { border-bottom: none; }
.rrow:hover { background: var(--panel-2); }
.ravatar {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand); font-size: 12px; font-weight: 600; flex: 0 0 auto;
}
.r-amount { font-weight: 650; font-variant-numeric: tabular-nums; margin-left: auto; white-space: nowrap; }
.r-del { opacity: 0; transition: .15s; }
.rrow:hover .r-del { opacity: 1; }

/* ---------------- Element Plus 微调 ---------------- */
.el-card, .el-dialog, .el-table { --el-border-radius-base: 10px; }
.el-dialog { border-radius: 16px !important; }
html.dark .el-dialog { border: 1px solid var(--line); }
.el-table { --el-table-border-color: var(--line-2); --el-table-header-bg-color: var(--panel-2); background: transparent; }
.el-table th.el-table__cell { font-weight: 560; font-size: 12.5px; color: var(--muted); }
.el-table td.el-table__cell { font-size: 13px; }
.el-table tr { background: transparent; }
.el-table--enable-row-hover .el-table__body tr:hover > td.el-table__cell { background: var(--panel-2) !important; }
.el-table__inner-wrapper::before { display: none; }
.el-input__wrapper, .el-select__wrapper, .el-textarea__inner { border-radius: 9px; }
.el-button { font-weight: 520; }
.el-form-item__label { font-size: 12.5px; color: var(--muted); }
.el-tag { border-radius: 6px; font-weight: 550; }
.el-dialog__header { margin-right: 0 !important; padding-bottom: 8px; }
.el-dialog__title { font-size: 15.5px; font-weight: 620; }
.el-message { border-radius: 10px; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1120px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .todo-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .topbar { height: auto; flex-wrap: wrap; padding: 10px 14px; gap: 10px; }
  .nav { order: 3; width: 100%; margin: 0; overflow-x: auto; padding-bottom: 2px; }
  .nav::-webkit-scrollbar { height: 0; }
  .content { padding: 16px 14px 48px; }
  .stats { grid-template-columns: minmax(0, 1fr); }
  .projects { grid-template-columns: minmax(0, 1fr); }
  .brand-day, .top-stat { display: none; }
  .stat-value { font-size: 25px; }
}

/* ---------------- 首页补充：告警条 / 弹层任务 / 文案行 ---------------- */
.latebar {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; margin-bottom: 14px; border-radius: 12px;
  background: var(--red-soft); border: 1px solid rgba(255, 98, 89, .35);
  color: var(--red); font-size: 13px;
}
.latebar b { font-variant-numeric: tabular-nums; }
.latebar .el-icon { font-size: 15px; }

.flex { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.tt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pop-row {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 8px; border-radius: 8px; cursor: pointer; font-size: 13px;
}
.pop-row:hover { background: var(--panel-2); }
.pop-row .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--dim); flex: 0 0 auto; }
.pop-row .dot.on { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.pop-row .pop-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pop-row .time { font-size: 11.5px; color: var(--dim); }

.crow { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--line-2); }
.crow:last-child { border-bottom: none; }
.crow-main { flex: 1; min-width: 0; }

.ys-pop.el-popover { border-radius: 12px; padding: 8px; }

/* 表格行状态 */
.el-table .row-overdue td.el-table__cell { background: var(--red-soft) !important; }
.el-table .row-done td.el-table__cell .cell { opacity: .55; }
