/* ============================================================
   坤能智维 · 分布式光伏电站运维平台
   极简风 Design Tokens
   ============================================================ */
:root {
  --bg: #ffffff;
  --bg-soft: #fafafa;
  --bg-hover: #f6f6f7;
  --line: #ebebee;
  --line-2: #dedee2;
  --ink: #101014;
  --ink-2: #3a3a44;
  --muted: #6f6f7a;
  --faint: #9b9ba5;

  /* 品牌橙（取自 LOGO 主色 #E87524） */
  --accent: #e87524;
  --accent-600: #c25a12;
  --accent-soft: #fdf0e6;
  --accent-line: #f6d2b6;

  --ok: #0d7a5a;
  --ok-bg: #eef7f3;
  --warn: #a3610a;
  --warn-bg: #fdf5e9;
  --err: #b42318;
  --err-bg: #fdf1ef;
  --info: #c25a12;
  --info-bg: #fdf0e6;
  --idle: #6b6b76;
  --idle-bg: #f3f3f5;

  --r-sm: 6px;
  --r: 8px;
  --r-lg: 12px;

  --sidebar-w: 176px;
  --logo-h: 24px;
  --logo-w: 93px;              /* logo 按 24px 高度渲染后的宽度 */
  --nav-inset: calc((var(--sidebar-w) - var(--logo-w)) / 2);
  --shadow-pop: 0 12px 32px -8px rgba(16, 16, 20, .16), 0 2px 6px rgba(16, 16, 20, .05);
}

* { box-sizing: border-box; }

/* 整页固定：文档本身永不滚动，滚动只发生在明确的可滚动容器里 */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
               "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button { font-family: inherit; cursor: pointer; }
input, select { font-family: inherit; }
a { color: inherit; text-decoration: none; }

.mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* =========================== Layout =========================== */
.app {
  display: flex;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

/* =========================== Sidebar =========================== */
.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  border-right: 1px solid var(--line);
  background: #ffffff;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 58px;
  flex: 0 0 58px;
  padding: 0 10px;
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: background .12s;
}
a.brand:hover { background: var(--bg-hover); }
a.brand:focus-visible { outline: 2px solid var(--accent-line); outline-offset: -2px; }

.brand-logo {
  height: var(--logo-h);
  width: auto;
  display: block;
}

.nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 8px 16px var(--nav-inset);
}

/* 板块主标题 */
.nav-label {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 15.5px;
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -.01em;
  /* 右侧多留出「图标 + 间距」的宽度，使文字本身对准中线，图标自然悬在左侧 */
  padding: 10px 30px 8px 8px;
  margin: 0 -8px 4px calc(-1 * var(--nav-inset));
  border-radius: 0;
  cursor: pointer;
  user-select: none;
  transition: background .12s;
}
.nav-label:hover { background: #f2f2f4; }
/* 展开时标题与子项之间留出呼吸 */
.nav-label.is-open + .nav-item { margin-top: 2px; }
/* 分组之间拉开距离 */
.nav-item + .nav-label { margin-top: 14px; }
.nav-label-ic {
  display: inline-flex;
  flex: 0 0 auto;
  color: inherit;
}
.nav-label-ic svg { width: 15px; height: 15px; display: block; }
.nav-label .nav-caret {
  position: absolute;
  right: 8px;
  top: 50%;
  margin-top: -6px;
  width: 12px; height: 12px;
  color: var(--faint);
  transition: transform .16s;
}
.nav-label.is-open .nav-caret { transform: rotate(90deg); }
.nav-label.has-active { color: var(--ink); }

.nav-item {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  margin-left: calc(-1 * var(--nav-inset));
  margin-right: -8px;
  border-radius: 0;
  color: var(--ink-2);
  font-size: 14.5px;
  position: relative;
  margin-bottom: 1px;
  transition: background .12s, color .12s;
  cursor: pointer;
  user-select: none;
}
.nav-item:hover { background: #f2f2f4; color: var(--ink); }
.nav-item > span:first-child { flex: 0 1 auto; }
.nav-item.is-active {
  background: var(--accent-soft);
  color: var(--accent-600);
  font-weight: 550;
}


/* =========================== Topbar =========================== */
.main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  height: 58px;
  flex: 0 0 58px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: rgba(255,255,255,.85);
  backdrop-filter: saturate(180%) blur(8px);
  position: relative;
  z-index: 30;
}

.crumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--muted);
}
.crumb-sep { color: var(--faint); }
.crumb-cur { color: var(--ink); font-weight: 550; }

/* =========================== View =========================== */
/* 主内容区：固定高度，内部不再整体滚动，列表靠分页翻页 */
.view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 26px 28px 24px;
  width: 100%;
  overflow: hidden;
  animation: fadeUp .28s ease both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

/* 列表页铺满可视区：表头常驻、翻页条贴底、表格自身承担溢出 */
.view > .page-head { flex: 0 0 auto; }
.view > .empty-block { flex: 0 0 auto; }
.view > .panel-list {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.view > .panel-list > * { flex: 0 0 auto; }
.view > .panel-list > .panel-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.table-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}
.view > .panel-list > .panel-body > .pager { flex: 0 0 auto; }

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
}
.page-title {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -.01em;
  margin: 0;
  display: flex; align-items: center; gap: 9px;
}
.page-desc {
  font-size: 13px;
  color: var(--muted);
  margin-top: 5px;
  max-width: 640px;
}
.head-actions { display: flex; gap: 8px; flex: 0 0 auto; padding-top: 2px; }

/* =========================== Buttons =========================== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px;
  padding: 0 13px;
  border-radius: var(--r);
  border: 1px solid var(--line-2);
  background: #fff;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: background .14s, border-color .14s, transform .06s;
}
.btn:hover { background: var(--bg-hover); }
.btn:active { transform: translateY(.5px); }
.btn svg { width: 14px; height: 14px; }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-600); border-color: var(--accent-600); }

.btn-accent {
  background: #fff;
  border-color: var(--accent-line);
  color: var(--accent-600);
}
.btn-accent:hover { background: var(--accent-soft); border-color: #f0bf9a; }

.btn-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--ink-2);
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--ink); }

.btn-sm { height: 28px; padding: 0 9px; font-size: 12px; border-radius: var(--r-sm); }

.link-btn {
  border: 0; background: none; padding: 0;
  color: var(--accent-600);
  font-size: 13px;
  font-weight: 500;
  border-bottom: 1px solid transparent;
  transition: border-color .14s, color .14s;
}
.link-btn:hover { border-bottom-color: var(--accent-600); }
.link-btn.muted { color: var(--muted); font-weight: 400; }
.link-btn.muted:hover { color: var(--ink); border-bottom-color: var(--line-2); }

/* =========================== Panel / Table =========================== */
.panel {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: #fff;
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}
.panel-title {
  font-size: 12.5px;
  font-weight: 600;
  display: flex; align-items: center; gap: 7px;
}
.panel-title .count {
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.search-box {
  display: flex; align-items: center; gap: 7px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #fff;
  width: 232px;
}
.search-box svg { width: 14px; height: 14px; color: var(--faint); flex: 0 0 auto; }
.search-box input {
  border: 0; outline: 0; width: 100%;
  font-size: 13px; background: transparent; color: var(--ink);
}
.search-box input::placeholder { color: var(--faint); }

.chips { display: flex; gap: 4px; }
.chip {
  height: 28px;
  padding: 0 10px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: var(--r-sm);
  font-size: 12.5px;
  color: var(--muted);
  transition: all .14s;
  white-space: nowrap;
}
.chip:hover { background: var(--bg-hover); color: var(--ink); }
.chip.is-active {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--accent-600);
  font-weight: 500;
}

.select {
  height: 32px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #fff;
  color: var(--ink-2);
  font-size: 12.5px;
  padding: 0 26px 0 9px;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b8b95' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 7px center;
  background-size: 12px;
  cursor: pointer;
}
.select:hover { border-color: var(--line-2); }
.search-box:focus-within {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px rgba(232,117,36,.08);
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
thead th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: .01em;
  padding: 10px 14px;
  background: #f7f7f9;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
/* 表头列之间加细分隔，区分字段边界 */
thead th + th { border-left: 1px solid var(--line); }
tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  color: var(--ink-2);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .1s; }
tbody tr:hover { background: #fef8f2; }
tbody tr.is-clickable { cursor: pointer; }
tbody td.num { font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
td .cell-sub {
  font-size: 11px;
  color: var(--faint);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.cell-name { display: flex; flex-direction: column; }

td .row-actions { display: flex; gap: 12px; justify-content: flex-end; white-space: nowrap; }

/* =========================== Pager =========================== */
.pager {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 16px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}
.pager-nums { display: flex; align-items: center; gap: 3px; }
.pg {
  min-width: 26px; height: 26px;
  padding: 0 6px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: var(--r-sm);
  font-size: 12px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.pg:hover:not(:disabled) { background: var(--bg-hover); }
.pg.is-active { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-600); font-weight: 550; }
.pg:disabled { color: var(--faint); cursor: default; }

/* =========================== Empty =========================== */
/* =========================== Overlay / Drawer =========================== */
.overlay {
  position: fixed; inset: 0;
  background: rgba(16,16,20,.28);
  backdrop-filter: blur(1px);
  opacity: 0; pointer-events: none;
  transition: opacity .22s;
  z-index: 60;
}
.overlay.is-open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 480px;
  max-width: 92vw;
  background: #fff;
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-pop);
  transform: translateX(100%);
  transition: transform .28s cubic-bezier(.32,.72,0,1);
  z-index: 70;
  display: flex;
  flex-direction: column;
}
.drawer.is-open { transform: none; }

.drawer-head {
  padding: 18px 22px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.drawer-title { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.drawer-sub {
  font-size: 11.5px; color: var(--muted); margin-top: 4px;
  display: flex; align-items: center; gap: 8px;
  font-variant-numeric: tabular-nums;
}
.drawer-body { flex: 1; overflow-y: auto; padding: 20px 22px 24px; }
.drawer-foot {
  border-top: 1px solid var(--line);
  padding: 13px 22px;
  display: flex; justify-content: flex-end; gap: 8px;
  background: #fcfcfd;
}
.x-btn {
  width: 28px; height: 28px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: var(--r-sm);
  display: grid; place-items: center;
  color: var(--muted);
  flex: 0 0 auto;
}
.x-btn:hover { background: var(--bg-hover); color: var(--ink); }
.x-btn svg { width: 13px; height: 13px; }

.sec + .sec { margin-top: 22px; }

.kv-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
.kv {
  background: #fff;
  padding: 10px 12px;
}
.kv-k { font-size: 11.5px; color: var(--muted); margin-bottom: 3px; }
.kv-v { font-size: 13.5px; color: var(--ink); font-weight: 500; }
.kv-v.num { font-variant-numeric: tabular-nums; }

.mini-chart {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 12px 12px 6px;
}
.mini-chart svg { width: 100%; height: 88px; display: block; }
.chart-legend {
  display: flex; justify-content: space-between;
  font-size: 10.5px; color: var(--faint);
  padding: 4px 2px 6px;
  font-variant-numeric: tabular-nums;
}

/* =========================== Modal =========================== */
.modal-wrap {
  position: fixed; inset: 0;
  z-index: 80;
  display: grid; place-items: center;
  background: rgba(16,16,20,.3);
  opacity: 0; pointer-events: none;
  transition: opacity .18s;
  padding: 24px;
}
.modal-wrap.is-open { opacity: 1; pointer-events: auto; }
.modal {
  width: 520px;
  max-width: 100%;
  background: #fff;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-pop);
  overflow: hidden;
  transform: translateY(6px) scale(.995);
  transition: transform .2s cubic-bezier(.32,.72,0,1);
}
.modal-wrap.is-open .modal { transform: none; }
.modal-head {
  padding: 16px 20px 14px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.modal-title { font-size: 14.5px; font-weight: 600; }
.modal-desc { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.modal-body { padding: 18px 20px; max-height: calc(100vh - 168px); overflow-y: auto; }
.modal-foot {
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  background: #fcfcfd;
  display: flex; justify-content: flex-end; gap: 8px;
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.field label .req { color: var(--err); margin-left: 2px; }
.sec-title .req { color: var(--err); margin-left: 2px; }
.input {
  height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 0 10px;
  font-size: 13.5px;
  color: var(--ink);
  outline: none;
  background: #fff;
  transition: border-color .14s, box-shadow .14s;
  width: 100%;
}
.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232,117,36,.12);
}
.input::placeholder { color: var(--faint); }
/* 多行输入按 rows 撑开，不再被单行输入框的固定高度压扁 */
textarea.input {
  height: auto;
  min-height: 88px;
  padding: 8px 10px;
  line-height: 1.6;
  resize: vertical;
}

/* =========================== 下拉选择 =========================== */
.sel { position: relative; display: flex; width: 100%; min-width: 0; }
.toolbar > .sel,
.topbar-right > .sel,
.stats-bar > .sel { width: auto; flex: 0 0 auto; }
.sel-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; text-align: left; cursor: pointer; padding-right: 9px;
}
.sel-value { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sel-caret { display: inline-flex; flex: 0 0 auto; width: 12px; height: 12px; color: var(--faint); transition: transform .16s; }
.sel-caret svg { width: 12px; height: 12px; display: block; }
.sel.is-open .sel-caret { transform: rotate(180deg); }
.sel.is-open .sel-btn { border-color: var(--accent-line); }
.sel-panel {
  position: fixed; z-index: 95; max-height: 240px; overflow-y: auto; padding: 4px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow-pop);
  animation: selIn .12s ease both;
}
@keyframes selIn {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: none; }
}
.sel-item {
  display: block; width: 100%; padding: 7px 10px;
  border: 0; border-radius: 7px; background: none;
  font-size: 13px; color: var(--ink-2); text-align: left;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sel-item:hover { background: var(--bg-hover); color: var(--ink); }
.sel-item.is-active { background: var(--accent-soft); color: var(--accent-600); font-weight: 550; }

/* 面板内搜索：吸顶，列表滚动时保持可见 */
.sel-search,
.cas-search {
  position: sticky; top: -4px; z-index: 1; display: block;
  box-sizing: border-box; width: 100%; margin: 0 0 4px; padding: 6px 9px;
  border: 1px solid var(--line); border-radius: 7px; background: #fff;
  font-family: inherit; font-size: 13px; color: var(--ink);
}
.sel-search:focus,
.cas-search:focus { outline: none; border-color: var(--accent-line); }
/* =========================== Toast =========================== */
.toast-wrap {
  position: fixed;
  left: 50%; bottom: 28px;
  transform: translateX(-50%);
  z-index: 100;
  display: flex; flex-direction: column; gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 8px;
  max-width: min(560px, calc(100vw - 32px));
  box-sizing: border-box;
  background: #17171c;
  color: #fff;
  font-size: 13px;
  padding: 9px 14px;
  border-radius: 20px;
  box-shadow: 0 8px 24px -6px rgba(0,0,0,.28);
  animation: toastIn .24s cubic-bezier(.32,.72,0,1) both;
}
.toast span { min-width: 0; overflow-wrap: anywhere; }
.toast svg { width: 13px; height: 13px; opacity: .85; }
.toast.out { animation: toastOut .2s ease forwards; }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px) scale(.97); }
  to { opacity: 1; transform: none; }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateY(4px); }
}

/* =========================== Misc =========================== */
.hint-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.hint {
  font-size: 11.5px;
  color: var(--faint);
  display: flex; align-items: center; gap: 6px;
}
.hint svg { width: 13px; height: 13px; }

::selection { background: #f8d6bc; color: var(--ink); }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb {
  background: #dcdce0;
  border-radius: 6px;
  border: 3px solid #fff;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: #c4c4ca; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* =========================== 电站档案 · 缩略图 =========================== */
/* 列表里的长字段换行显示，不省略：用户缩放比例不同，列宽能容纳的字符数不可预期 */
.cell-ellipsis {
  display: block;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
  line-height: 1.45;
}
.cell-inline { display: flex; align-items: center; gap: 6px; min-width: 0; }
.cell-inline .cell-ellipsis { flex: 0 1 auto; min-width: 0; }
/* 已停用账号：整行降一级，账号名保持可读 */
.row-disabled td { color: var(--muted); }
.badge.off { background: #f2f2f4; color: var(--muted); }

/* =========================== 表单分区 =========================== */
.form-sec + .form-sec { margin-top: 26px; }

.form-grid.three { grid-template-columns: repeat(3, 1fr); }
.form-grid.contact { grid-template-columns: 1.7fr 1fr 1fr; }
.form-grid.two { grid-template-columns: 1fr 1fr; }

/* =========================== 上传 =========================== */
.upload-bar { display: flex; align-items: center; gap: 10px; }
.upload-btn {
  display: inline-flex; align-items: center; gap: 5px;
  height: 30px; padding: 0 10px;
  border: 1px dashed var(--line-2);
  border-radius: var(--r-sm);
  font-size: 13px; color: var(--ink-2);
  background: #fff; cursor: pointer;
  transition: all .14s;
}
.upload-btn:hover { border-color: var(--accent-line); color: var(--accent-600); background: #fef7f1; }
.upload-btn svg { width: 12px; height: 12px; }
.upload-hint { font-size: 11px; color: var(--faint); }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, 92px); gap: 8px; margin-top: 10px; }
.photo-grid:empty { display: none; }
.photo-item {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  display: block;
}
.photo-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-open {
  display: block; width: 100%; height: 100%; padding: 0; border: 0;
  background: none; cursor: zoom-in;
}
.photo-open img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-del {
  position: absolute; top: 4px; right: 4px;
  width: 19px; height: 19px; border-radius: 50%;
  border: 0; background: rgba(16,16,20,.55); color: #fff;
  display: grid; place-items: center;
  backdrop-filter: blur(2px);
}
.photo-del:hover { background: rgba(16,16,20,.78); }
.photo-del svg { width: 10px; height: 10px; }
.photo-empty {
  border: 1px dashed var(--line-2);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  font-size: 13px;
  color: var(--faint);
}
.drawer .photo-empty { padding: 22px; }
.drawer .photo-grid { grid-template-columns: repeat(2, 1fr); }

/* 图纸列表 */
.file-list { display: flex; flex-direction: column; gap: 7px; margin-top: 10px; }
.file-list:empty { display: none; }
.file-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.file-ext {
  flex: 0 0 auto;
  font-size: 9px; font-weight: 600; letter-spacing: .04em;
  color: var(--accent-600);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: 4px;
  padding: 2px 5px;
  min-width: 34px;
  text-align: center;
}
.file-meta { flex: 1; min-width: 0; }
.file-name { font-size: 12px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-size { font-size: 10.5px; color: var(--faint); margin-top: 1px; font-variant-numeric: tabular-nums; }

button.photo-item { padding: 0; width: 100%; cursor: zoom-in; }
.file-preview { display: block; width: 100%; border: 0; background: none; padding: 0; text-align: left; cursor: pointer; }
.file-preview:hover { color: var(--accent-600); }
.file-download {
  display: inline-grid; place-items: center; flex: 0 0 28px;
  width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 4px;
  color: var(--muted); background: #fff; text-decoration: none;
}
.file-download:hover { color: var(--accent-600); border-color: var(--accent-line); }
.file-download svg { width: 15px; height: 15px; }
.attachment-preview {
  width: min(1120px, calc(100vw - 64px)); height: min(840px, calc(100vh - 64px));
  max-width: none; max-height: none; padding: 0; margin: auto;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
  color: var(--ink); box-shadow: var(--shadow-pop); overflow: hidden;
}
.attachment-preview[open] { display: flex; flex-direction: column; }
.attachment-preview::backdrop { background: rgba(16,16,20,.5); }
.attachment-head { display: flex; align-items: center; gap: 16px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.attachment-heading { flex: 1; min-width: 0; }
.attachment-title { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; max-height: 64px; overflow: auto; }
.attachment-count { font-size: 12px; color: var(--muted); margin-top: 3px; }
.attachment-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.attachment-body { flex: 1; min-height: 0; display: grid; place-items: center; background: #f5f5f7; overflow: auto; }
.attachment-image { display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.attachment-image[hidden], .attachment-error[hidden] { display: none; }
.attachment-pdf { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
.attachment-error, .attachment-unavailable { padding: 32px; font-size: 13px; color: var(--muted); text-align: center; }
.attachment-nav { display: flex; justify-content: center; gap: 12px; padding: 10px; border-top: 1px solid var(--line); }
.preview-previous svg { transform: rotate(180deg); }
.attachment-nav button:disabled { opacity: .35; cursor: default; }

/* 详情三列 / 跨列 */
.kv-grid.three { grid-template-columns: repeat(3, 1fr); }
.kv.span2 { grid-column: span 2; }


/* =========================== 区域级联选择 =========================== */
.cascader { position: relative; }
.cascader .input { padding-right: 28px; cursor: pointer; }
.cascader-arrow {
  position: absolute; right: 10px; top: 50%;
  transform: translateY(-50%);
  width: 13px; height: 13px;
  color: var(--faint);
  pointer-events: none;
}
.cascader-arrow svg { width: 13px; height: 13px; display: block; }

.cas-panel {
  position: absolute;
  z-index: 6;
  top: calc(100% + 6px);
  left: 0; right: 0;
  display: flex;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-pop);
  overflow: hidden;
}
.cas-panel[hidden] { display: none; }
.cas-col {
  flex: 1 1 0;
  min-width: 0;
  max-height: 236px;
  overflow-y: auto;
  padding: 4px;
  border-right: 1px solid var(--line);
}
.cas-col:last-child { border-right: 0; }
.cas-item {
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cas-item:hover { background: var(--bg-hover); color: var(--ink); }
.cas-item.is-active { background: var(--accent-soft); color: var(--accent-600); font-weight: 550; }
.cas-empty { display: grid; place-items: center; height: 100%; min-height: 110px; padding: 12px 8px; font-size: 11.5px; color: var(--faint); text-align: center; }

/* 操作按钮语义色 */
.link-btn.danger { color: var(--err); }
.link-btn.danger:hover { border-bottom-color: var(--err); }
.link-btn.ok { color: var(--ok); }
.link-btn.ok:hover { border-bottom-color: var(--ok); }

.btn-danger {
  background: var(--err);
  border-color: var(--err);
  color: #fff;
}
.btn-danger:hover { background: #9d1d13; border-color: #9d1d13; }

/* 空值占位 */
.cell-empty { color: var(--faint); }

/* 搜索无结果（仅标题，无副文案） */
.empty-row {
  padding: 48px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--ink-2);
}

/* 筛选标签内的计数 */
.chip-num {
  margin-left: 5px;
  font-size: 11px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.chip.is-active .chip-num { color: var(--accent-600); opacity: .75; }

/* =========================== 接入账号表单 =========================== */
/* 标签后的提示符号：圆圈内感叹号，悬停显示说明 */
.tip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 13px;
  height: 13px;
  margin-left: 5px;
  border: 1px solid var(--faint);
  border-radius: 50%;
  font-size: 9.5px;
  font-weight: 700;
  line-height: 1;
  color: var(--faint);
  cursor: help;
  position: relative;
  vertical-align: 1px;
  transition: color .14s, border-color .14s, background .14s;
}
.tip-icon:hover, .tip-icon:focus-visible {
  color: var(--accent-600);
  border-color: var(--accent-line);
  background: var(--accent-soft);
  outline: none;
}
.tip-icon::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  top: calc(100% + 7px);
  transform: translate(-50%, -3px);
  padding: 5px 8px;
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.3;
  white-space: nowrap;
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .14s, transform .14s;
  z-index: 9;
}
.tip-icon:hover::after, .tip-icon:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* 未选品牌时的 API 区占位 */
.api-empty {
  padding: 22px 12px;
  border: 1px dashed var(--line);
  border-radius: var(--r);
  text-align: center;
  font-size: 13px;
  color: var(--faint);
}

/* 弹窗底栏左侧操作（如测试连接） */
.modal-foot-left { margin-right: auto; }

/* 单选面板（单列，无空值行） */
.cas-panel.one {
  display: block;
  position: fixed;
  left: auto; right: auto; top: auto;
  width: auto;
  padding: 4px;
  max-height: 236px;
  overflow-y: auto;
}
.cas-panel.one[hidden] { display: none; }

/* 选择器输入框聚焦时不加环，避免点击时视觉抖动 */
.cascader .input:focus {
  box-shadow: none;
  border-color: var(--accent-line);
}

/* 侧栏分组（可折叠） */
.nav-parent .nav-caret {
  position: absolute;
  right: 8px;
  top: 50%;
  margin-top: -6px;
  width: 12px; height: 12px;
  color: var(--faint);
  transition: transform .16s;
}
.nav-parent.is-open .nav-caret { transform: rotate(90deg); }
.nav-child {
  font-size: 14px;
  color: var(--muted);
}
.nav-child.is-active { color: var(--accent-600); }

/* 子项选中时，父级只强调文字，不叠加选中底色 */
.nav-parent.has-active { color: var(--ink); font-weight: 500; }
.nav-parent.has-active .nav-caret { color: var(--accent); }

/* 列表页筛选器（面板-head 右侧） */
.flt { width: 208px; flex: 0 0 auto; }
.flt .input {
  height: 32px;
  font-size: 13px;
  cursor: pointer;
  text-overflow: ellipsis;
}

/* 表头单位（第二行小字） */
.th-unit {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--faint);
  letter-spacing: 0;
  margin-top: 1px;
}
/* 密集表格：收紧左右内边距，容纳更多列 */
.table-dense thead th { padding: 9px 9px; }
.table-dense tbody td { padding: 11px 9px; }
/* 状态徽标 */
.badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 11px;
  font-size: 12px;
  white-space: nowrap;
}
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.alarm { background: var(--err-bg); color: var(--err); }
.badge.offline { background: var(--warn-bg); color: var(--warn); }
.badge.failed { background: var(--idle-bg); color: var(--idle); }
.collection-warning {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 16px;
  white-space: nowrap;
}

/* 监控表格：按内容自适应列宽，内容不截断；窗口不足时横向滚动 */
.table-auto { table-layout: auto; }
.table-auto th, .table-auto td { white-space: nowrap; }
.table-dense.table-auto thead th { padding: 9px 7px; }
.table-dense.table-auto tbody td { padding: 11px 7px; }


/* 电站详情：附件小标题（带数量） */
.sec-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 表格内可点击进入详情的字段：用主题色标出来，不加下划线 */
.cell-link {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-weight: 500;
  color: var(--accent-600);
  cursor: pointer;
  text-align: left;
  transition: color .14s;
}
.cell-link:hover { color: var(--ink); }

/* 表单标签后的补充说明（如「（手机号）」） */
.field label .label-hint {
  font-weight: 400;
  color: var(--muted);
}

/* 页头只剩操作按钮时右对齐（如接入管理） */
.page-head.is-actions { justify-content: flex-end; }

/* 电站监控详情：宽版抽屉 + 标签页 */
.drawer.is-wide { width: 1120px; max-width: 96vw; }
.wo-detail { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; align-items: start; }
.wo-detail-main { min-width: 0; }
.wo-detail-side { position: sticky; top: 0; padding-left: 20px; border-left: 1px solid var(--line); }
@media (max-width: 900px) {
  .wo-detail { grid-template-columns: 1fr; }
  .wo-detail-side {
    position: static; padding: 14px 0 0; border-left: 0; border-top: 1px solid var(--line);
  }
}
.drawer-head-main { min-width: 0; }
.drawer-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.tabs {
  display: flex;
  gap: 0;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.tab {
  position: relative;
  height: 44px;
  padding: 0 2px;
  margin-right: 26px;
  background: none;
  border: 0;
  font: inherit;
  font-size: 13.5px;
  color: var(--muted);
  cursor: pointer;
  transition: color .12s;
}
.tab:hover { color: var(--ink-2); }
.tab.is-active { color: var(--ink); font-weight: 600; }
.tab.is-active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
}

/* 电站详情 · 天气信息板块 */
.weather-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: #f2f4f7;
  color: #6f7a8a;
}
.weather-icon svg { width: 19px; height: 19px; }
.weather-icon.is-lg { width: 64px; height: 64px; }
.weather-icon.is-lg svg { width: 38px; height: 38px; }
.weather-icon.is-xs { width: 20px; height: 20px; }
.weather-icon.is-xs svg { width: 13px; height: 13px; }
.weather-icon.is-sun { background: #fdf4e5; color: #c9831f; }
.weather-icon.is-moon { background: #eef1f8; color: #5f6f92; }
.weather-icon.is-partly,
.weather-icon.is-partlyNight { background: #f3f5f8; color: #68788f; }
.weather-icon.is-fog { background: #f3f4f6; color: #7d8592; }
.weather-icon.is-rain { background: #eef4f9; color: #4d7fa3; }
.weather-icon.is-snow { background: #f2f6fa; color: #6d91ac; }
.weather-icon.is-storm { background: #faf3e6; color: #a56a1a; }

.wx { display: grid; gap: 16px; }
.wx-updated {
  text-align: right;
  font-size: 11px;
  color: var(--faint);
  margin-bottom: -4px;
  font-variant-numeric: tabular-nums;
}
.wx-hero {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, #fbfcfe, #fff);
  padding: 18px 20px;
}
.wx-hero-top {
  display: flex;
  align-items: center;
  gap: 18px;
}
.wx-now {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.wx-cond {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -.01em;
  line-height: 1.2;
}
.wx-live {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--accent-600);
  background: var(--accent-soft);
  border-radius: 4px;
  padding: 1px 5px;
  line-height: 1.6;
}
.wx-today-line {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.wx-today-line b { font-weight: 500; color: var(--ink-2); }
.wx-sun {
  margin-left: auto;
  display: flex;
  gap: 28px;
  text-align: right;
}
.wx-sun span {
  display: block;
  font-size: 11px;
  color: var(--faint);
  line-height: 1.5;
}
.wx-sun b {
  display: block;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-2);
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
.wx-panel {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: #fff;
  padding: 16px 20px;
}
.wx-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.wx-panel-title { font-size: 13px; font-weight: 600; }
.wx-panel-note { font-size: 11px; color: var(--faint); }
.wx-hours {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
}
.wx-hour {
  background: #fafbfc;
  border-radius: var(--r);
  padding: 10px 6px;
  text-align: center;
}
.wx-hour-time {
  font-size: 11px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.wx-hour .weather-icon {
  width: 28px;
  height: 28px;
  margin: 7px auto 5px;
}
.wx-hour .weather-icon svg { width: 18px; height: 18px; }
.wx-hour-temp {
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.wx-hour-sub {
  font-size: 10.5px;
  color: var(--muted);
  line-height: 1.6;
  white-space: nowrap;
}
.wx-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}
.wx-day {
  background: #fafbfc;
  border-radius: var(--r);
  padding: 10px 8px;
  text-align: center;
}
.wx-day-name { font-size: 12px; font-weight: 500; }
.wx-day-date {
  font-size: 10.5px;
  color: var(--faint);
  margin-top: 1px;
  font-variant-numeric: tabular-nums;
}
.wx-day .weather-icon {
  width: 28px;
  height: 28px;
  margin: 7px auto 5px;
}
.wx-day .weather-icon svg { width: 18px; height: 18px; }
.wx-day-cond {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
}
.wx-day-temp {
  font-size: 12.5px;
  font-weight: 500;
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.wx-day-rain {
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 1px;
  white-space: nowrap;
}

.badge.idle { background: #f2f2f4; color: var(--muted); }

/* 区域筛选：三列级联面板（省份 / 城市 / 区县） */
.cas-panel.multi {
  position: fixed;
  left: auto; right: auto; top: auto;
  width: 428px;
  padding: 4px;
}
.cas-panel.multi .cas-col { flex: 1 1 0; min-width: 0; }

/* 抽屉内的占位区块（内容待补充） */
.empty-block {
  border: 1px dashed var(--line);
  border-radius: var(--r);
  padding: 36px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--faint);
  background: #fcfcfd;
}

/* =========================== 发电统计 =========================== */
.stats-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.seg { display: inline-flex; background: #f4f4f6; border-radius: 8px; padding: 2px; }
.seg-item {
  border: 0; background: none; font: inherit;
  font-size: 12.5px; color: var(--muted);
  padding: 5px 12px; border-radius: 6px;
  cursor: pointer; transition: background .12s, color .12s;
}
.seg-item:hover { color: var(--ink-2); }
.seg-item.is-active {
  background: #fff; color: var(--ink);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(20, 20, 25, .08);
}
.stats-scope { font-size: 12px; color: var(--faint); }

.chart-block + .chart-block { margin-top: 24px; }
.chart-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin-bottom: 8px;
  font-size: 12.5px; color: var(--ink-2);
}
.chart-head .u { font-size: 11px; color: var(--faint); margin-left: 5px; }
.chart-sum { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chart-sum b { font-size: 14px; color: var(--ink); font-weight: 600; margin: 0 2px; }

.chart-svg { display: block; width: 100%; height: auto; margin-top: 2px; }
.chart-svg rect:hover { filter: brightness(1.06); }

/* 图例：柱 = 发电量，线 = 满发小时数 */
.legend { display: flex; align-items: center; gap: 18px; }
.legend .lg { display: inline-flex; align-items: center; gap: 6px; }
.legend .u { font-size: 11px; color: var(--faint); margin-left: -2px; }
.sw-bar { width: 10px; height: 10px; border-radius: 2px; background: var(--accent); }
.sw-line { position: relative; width: 16px; height: 2px; background: #5b6b82; }
.sw-line::after {
  content: "";
  position: absolute; left: 5.5px; top: -2.6px;
  width: 5px; height: 5px; border-radius: 50%;
  background: #fff; border: 1.6px solid #5b6b82;
}

/* 发电统计的时间选择器 */
.stats-sel { height: 30px; width: 148px; font-size: 12.5px; padding: 0 8px; }
input.stats-sel::-webkit-calendar-picker-indicator { opacity: .55; cursor: pointer; }
select.stats-sel { appearance: auto; }

/* 图表悬停热区 */
.chart-svg .hit:hover { fill: rgba(20, 20, 25, .035); }

/* =========================== 运维工单 =========================== */
.topbar-right { display: flex; align-items: center; gap: 8px; }
.screen-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--ink-2);
  text-decoration: none;
  transition: background .12s, border-color .12s, color .12s;
}
.screen-btn:hover { background: var(--bg-hover); border-color: var(--line); color: var(--accent); }
.screen-btn:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 2px; }
.screen-btn svg { width: 18px; height: 18px; display: block; }

/* 只读演示账号：隐藏所有业务写操作入口，服务端同时拒绝非 GET 请求 */
body.is-viewer :is(
  [data-act="iv-add"], [data-act="iv-edit"], [data-act="iv-del"],
  [data-act="st-add"], [data-act="st-edit"], [data-act="st-del"],
  [data-act="dev-add"], [data-act="dev-edit"], [data-act="dev-del"],
  [data-act="ac-add"], [data-act="ac-edit"], [data-act="ac-del"], [data-act="ac-test"],
  [data-act="acct-add"], [data-act="acct-edit"], [data-act="acct-disable"],
  [data-act="acct-enable"], [data-act="acct-reset"],
  [data-act="wo-add"], [data-act="wo-act"], [data-act="wo-cancel"], [data-act="wo-save"],
  [data-act="wo-reject"], [data-act="wo-pick-type"], [data-act="wo-reselect-type"],
  [data-act="wo-assignee-toggle"], [data-act="ck-add"], [data-act="ck-del"], [data-act="ck-photo-del"],
  [data-act="file-del"], [data-act="wo-report-del"]
) { display: none !important; }
.actor-hint { font-size: 12px; color: var(--muted); }
.actor-name { font-size: 13px; font-weight: 600; color: var(--ink); }

/* 账号：姓名按钮 + 下拉菜单 */
.account-btn {
  display: flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 10px;
  border: 1px solid transparent; border-radius: 999px;
  background: transparent; color: var(--ink);
  transition: background .12s, border-color .12s;
}
.account-btn:hover { background: var(--bg-hover); }
.account-btn[aria-expanded="true"] { background: var(--bg-hover); border-color: var(--line); }
.account-btn-name {
  font-size: 13px; font-weight: 600; max-width: 160px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.account-caret {
  display: inline-flex; width: 12px; height: 12px; color: var(--faint);
  transition: transform .16s;
}
.account-caret svg { width: 12px; height: 12px; display: block; }
.account-btn[aria-expanded="true"] .account-caret { transform: rotate(180deg); }

.account-menu {
  position: fixed; z-index: 90; width: 248px; padding: 6px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 20px 42px -16px rgba(16, 16, 20, .28), 0 2px 8px rgba(16, 16, 20, .05);
  transform-origin: top right;
  animation: accountIn .15s cubic-bezier(.32, .72, 0, 1) both;
}
@keyframes accountIn {
  from { opacity: 0; transform: translateY(-4px) scale(.98); }
  to { opacity: 1; transform: none; }
}
.account-menu-head {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 6px 8px; padding: 9px 10px 10px;
  border-bottom: 1px solid var(--line);
}
.account-menu-name {
  flex: 1 1 auto; min-width: 0;
  font-size: 13.5px; font-weight: 600; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.account-menu-role {
  flex: 0 0 auto;
  height: 20px; padding: 0 7px; border-radius: 6px;
  font-size: 11px; font-weight: 500;
}
.account-menu-name + .account-menu-role { margin-left: auto; }
/* 姓名与角色同名（如管理员）时，只显示一枚稍大的身份标签 */
.account-menu-head.is-sole .account-menu-role {
  height: 24px; padding: 0 9px; border-radius: 7px;
  font-size: 12.5px; font-weight: 600;
}
.account-menu-head.is-sole .account-menu-user { flex: 0 1 auto; margin-left: auto; text-align: right; }
.account-menu-user {
  flex: 0 0 100%;
  font-size: 11.5px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.account-menu-list { padding-top: 6px; }
.account-menu-item {
  display: flex; align-items: center; gap: 9px;
  width: 100%; height: 36px; padding: 0 11px;
  border: 0; border-radius: 9px; background: none;
  font-size: 13px; color: var(--ink-2); text-align: left;
  transition: background .12s, color .12s;
}
.account-menu-item svg { width: 15px; height: 15px; color: var(--muted); flex: 0 0 auto; }
.account-menu-item:hover { background: var(--bg-hover); color: var(--ink); }
.account-menu-item.danger { color: var(--err); }
.account-menu-item.danger svg { color: var(--err); opacity: .85; }
.account-menu-item.danger:hover { background: var(--err-bg); }

.actor-select {
  height: 32px; min-width: 190px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--ink); font-size: 13px;
}
.actor-select:focus { outline: 2px solid var(--accent-soft, rgba(194, 90, 18, .18)); }

.badge.role-desk { background: #eef4ff; color: #2b5fb3; }
.badge.role-engineer { background: var(--warn-bg); color: var(--warn); }
.badge.role-supervisor { background: #f3eeff; color: #6a4bb3; }
.badge.role-admin { background: var(--accent-soft); color: var(--accent-600); }
.badge.role-viewer { background: #f2f2f4; color: var(--muted); }

.wo-filter { height: 34px; min-width: 118px; max-width: 190px; font-size: 12.5px; }

/* 工单类型选择面板 */
.wo-type-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.wo-type-card {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 9px;
  padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff;
  text-align: left; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.wo-type-card:hover {
  border-color: var(--accent-line); box-shadow: 0 4px 14px rgba(16, 16, 20, .06); transform: translateY(-1px);
}
.wo-type-icon {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px;
  background: var(--accent-soft); color: var(--accent-600); flex: 0 0 auto;
}
.wo-type-icon svg { width: 17px; height: 17px; }
.wo-type-card-text { display: grid; gap: 2px; }
.wo-type-card-text b { font-size: 13px; font-weight: 600; color: var(--ink); }
.wo-type-go {
  position: absolute; right: 10px; bottom: 10px; color: var(--accent-600);
  opacity: 0; transition: opacity .15s;
}
.wo-type-go svg { width: 14px; height: 14px; }
.wo-type-card:hover .wo-type-go { opacity: 1; }

/* 表单里已选中的类型 */
.wo-type-chosen {
  display: flex; align-items: center; gap: 9px; height: 36px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 8px; background: #fafafb;
}
.wo-type-chosen .wo-type-icon { width: 24px; height: 24px; border-radius: 6px; }
.wo-type-chosen .wo-type-icon svg { width: 14px; height: 14px; }
.wo-type-chosen-text { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.wo-type-chosen-text b { font-size: 13px; font-weight: 600; white-space: nowrap; }
.wo-type-chosen .link-btn { margin-left: auto; white-space: nowrap; }

/* 多选下拉（运维工程师） */
.ms { position: relative; }
.ms-control { display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; cursor: pointer; }
.ms-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-value.is-empty { color: var(--faint); }
.ms-caret { display: inline-flex; align-items: center; color: var(--muted); flex: 0 0 auto; }
.ms-caret svg { width: 14px; height: 14px; }
.ms-panel {
  position: absolute; z-index: 40; top: calc(100% + 4px); left: 0; width: 100%; max-width: 360px;
  max-height: 220px; overflow-y: auto; padding: 6px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-pop);
}
/* 展开时改为 fixed 悬浮，不参与表单布局，避免撑出滚动条或让内容上下跳 */
.ms-panel.is-floating { position: fixed; z-index: 120; }
.ms-option { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 7px; cursor: pointer; }
.ms-option:hover { background: var(--bg-hover); }
.ms-option input { margin: 0; accent-color: var(--accent); }
.ms-option small { margin-left: auto; font-size: 11px; color: var(--faint); }
.ms-empty { padding: 10px; font-size: 12px; color: var(--faint); text-align: center; }

/* 巡检表 */
.ck-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.ck-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 12.5px; }
.ck-table th, .ck-table td { padding: 8px; border-bottom: 1px solid var(--line); text-align: center; vertical-align: middle; }
.ck-table .ck-select { text-align: center; }
.ck-table th { background: #fafafb; font-weight: 600; white-space: nowrap; color: var(--ink-2); }
.ck-table tbody tr:last-child td { border-bottom: 0; }
.ck-table .ck-group {
  color: var(--ink-2); font-weight: 600; white-space: normal; word-break: break-word;
  vertical-align: middle; background: #fcfcfd; border-right: 1px solid var(--line);
}
.ck-item-cell { white-space: normal; word-break: break-word; vertical-align: middle; font-weight: 500; border-right: 1px solid var(--line); }
.ck-ops { width: 1%; white-space: nowrap; vertical-align: middle; padding-left: 4px; padding-right: 4px; }
.ck-note-cell { min-width: 160px; white-space: pre-wrap; word-break: break-word; }
.ck-mini {
  width: 20px; height: 20px; padding: 0; border: 1px solid var(--line); border-radius: 5px;
  background: #fff; color: var(--muted); display: inline-grid; place-items: center;
}
.ck-mini:hover { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-600); }
.ck-mini-del:hover { border-color: #f1c4c4; background: var(--err-bg); color: var(--err); }
.ck-mini svg { width: 12px; height: 12px; }
.ck-select { height: 30px; min-width: 0; padding: 0 6px; font-size: 12.5px; }
/* 覆盖通用 textarea.input 的 88px 最小高度，空行保持一行高 */
textarea.ck-note {
  height: auto; min-height: 34px; padding: 5px 8px; width: 100%;
  font-size: 12.5px; line-height: 1.55; resize: vertical; overflow: hidden;
}
.ck-photos { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
.ck-thumb {
  position: relative; width: 38px; height: 38px; border: 1px solid var(--line);
  border-radius: 6px; overflow: hidden; background: var(--bg-soft); display: grid; place-items: center;
}
.ck-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
button.ck-thumb { padding: 0; cursor: zoom-in; }
.ck-thumb-open {
  display: block; width: 100%; height: 100%; padding: 0; border: 0;
  background: none; cursor: zoom-in;
}
.ck-thumb-open img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ck-thumb-x {
  position: absolute; top: 0; right: 0; width: 15px; height: 15px; border: 0; padding: 0;
  border-radius: 0 0 0 5px; background: rgba(16, 16, 20, .6); color: #fff; display: grid; place-items: center;
}
.ck-thumb-x svg { width: 8px; height: 8px; }
.ck-thumb-add { border-style: dashed; color: var(--muted); cursor: pointer; }
.ck-thumb-add:hover { color: var(--accent-600); border-color: var(--accent-line); }
.ck-thumb-add svg { width: 14px; height: 14px; }
.ck-muted { color: var(--faint); }

@media (max-width: 720px) {
  .wo-type-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.wo-badge {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px;
  border-radius: 999px; font-size: 12px; font-weight: 550; white-space: nowrap;
}
.wo-badge.pending { background: #fff4e5; color: #b26a00; }
.wo-badge.processing { background: #eaf2ff; color: #2b5fb3; }
.wo-badge.review { background: #f3eeff; color: #6a4bb3; }
.wo-badge.done { background: var(--ok-bg); color: var(--ok); }
.wo-badge.cancelled { background: #f2f2f4; color: var(--muted); }

.wo-note-block {
  margin-top: 6px; padding: 10px 12px; border-radius: 8px;
  background: #f7f7f9; font-size: 13px; line-height: 1.65; white-space: pre-wrap;
}
.wo-note-block.is-reject { background: var(--err-bg); border-left: 3px solid var(--err); }

.wo-timeline { list-style: none; margin: 8px 0 0; padding: 0; }
.wo-timeline li { display: flex; gap: 10px; position: relative; padding-bottom: 16px; }
.wo-timeline li:not(:last-child)::before {
  content: ""; position: absolute; left: 3.5px; top: 14px; bottom: 0;
  width: 1px; background: var(--line);
}
.wo-dot {
  flex: 0 0 auto; width: 8px; height: 8px; margin-top: 6px;
  border-radius: 50%; background: var(--accent);
}
.wo-tl-main { min-width: 0; }
.wo-tl-main b { font-weight: 600; margin-right: 6px; }
.wo-tl-time { margin-top: 2px; font-size: 11.5px; color: var(--faint); }
.wo-tl-note { margin-top: 5px; font-size: 12.5px; color: var(--ink-2); white-space: pre-wrap; }

.wo-action {
  margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line);
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
}
.wo-action.wo-handle { display: block; }
.wo-action-btns { display: flex; gap: 10px; margin-top: 12px; }
.wo-handle .field { margin-bottom: 10px; }
.wo-action .upload-bar { margin: 4px 0 8px; }
.muted { color: var(--muted); font-size: 12px; }
.field[hidden], .wo-extra[hidden] { display: none; }
.form-grid[hidden] { display: none; }
.field .label-hint { font-size: 11.5px; color: var(--faint); font-weight: 400; }

.wo-setup {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 4px 0 12px; padding: 12px 14px; border-radius: 10px;
  background: var(--warn-bg); color: var(--ink-2); font-size: 13px;
}
.wo-setup b { color: var(--ink); }
.wo-setup span { color: var(--muted); }

/* =========================== 登录 =========================== */
.login-wrap {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  background: #f4f3f1;
  padding: 24px;
}
.login-wrap[hidden] { display: none; }
.login-card {
  width: 360px; max-width: 100%;
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  padding: 30px 28px 26px; box-shadow: 0 24px 60px rgba(20, 20, 25, .08);
}
.login-brand { display: flex; justify-content: center; }
.login-brand img { height: 64px; display: block; }
.login-title {
  margin: 18px 0 22px;
  font-size: 20px; font-weight: 650; letter-spacing: .5px;
  text-align: center;
}
.login-card .field { margin-bottom: 14px; }
.login-error { min-height: 18px; font-size: 12.5px; color: var(--err); margin: 2px 0 8px; }
.login-btn { width: 100%; height: 40px; justify-content: center; }


