:root {
  --brand-ink: #1f2a44;
  --brand-orange: #f7941e;
  --brand-orange-dark: #d97706;
  --bg: #f4f6fa;
  --card: #ffffff;
  --line: #e6eaf2;
  --text: #1f2a44;
  --muted: #6b7688;
  --radius: 10px;
  --shadow: 0 2px 10px rgba(31, 42, 68, 0.06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

#app { height: 100%; }

/* ---------------- 登录页 ---------------- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(1100px 520px at 12% -10%, rgba(247, 148, 30, 0.16), transparent 60%),
    radial-gradient(900px 480px at 96% 106%, rgba(31, 42, 68, 0.14), transparent 62%),
    #f7f8fb;
  padding: 24px;
}

.login-card {
  width: 420px;
  max-width: 100%;
  background: var(--card);
  border-radius: 16px;
  box-shadow: 0 18px 48px rgba(31, 42, 68, 0.14);
  padding: 36px 34px 30px;
  border: 1px solid rgba(31, 42, 68, 0.05);
}

.login-logo { display: block; width: 260px; max-width: 100%; margin: 0 auto 6px; }
.login-title { text-align: center; font-size: 17px; font-weight: 600; letter-spacing: .5px; margin: 14px 0 2px; }
.login-sub { text-align: center; color: var(--muted); font-size: 12.5px; margin-bottom: 26px; letter-spacing: .3px; }
.login-tip { margin-top: 18px; font-size: 12px; color: var(--muted); line-height: 1.7; text-align: center; }
.login-foot { margin-top: 22px; text-align: center; font-size: 12px; color: #9aa4b5; }

/* ---------------- 主框架 ---------------- */
.shell { display: flex; height: 100vh; overflow: hidden; }

.aside {
  width: 222px;
  flex: 0 0 222px;
  background: linear-gradient(180deg, #1f2a44 0%, #162033 100%);
  color: #dfe5f1;
  display: flex;
  flex-direction: column;
}

.aside-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.aside-brand img { width: 34px; height: 34px; }
.aside-brand .name { font-size: 13px; font-weight: 600; line-height: 1.25; color: #fff; }
.aside-brand .sub { font-size: 11px; color: #93a1bb; letter-spacing: .4px; }

.aside-menu { padding: 10px 8px; flex: 1; overflow-y: auto; }
.aside-menu .item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 12px; margin-bottom: 2px;
  border-radius: 8px; cursor: pointer;
  font-size: 13.5px; color: #c3cddf;
  transition: background .15s, color .15s;
}
.aside-menu .item:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.aside-menu .item.active { background: rgba(247, 148, 30, 0.18); color: #ffd7a1; font-weight: 600; }
.aside-menu .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .6; }
.aside-menu .badge {
  margin-left: auto; background: var(--brand-orange); color: #fff;
  border-radius: 9px; font-size: 11px; padding: 0 6px; line-height: 17px;
}

.aside-foot { padding: 12px 16px 16px; font-size: 11px; color: #7b88a1; border-top: 1px solid rgba(255,255,255,.07); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 58px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center;
  padding: 0 20px; gap: 14px;
  flex: 0 0 58px;
}
.topbar h2 { font-size: 16px; margin: 0; font-weight: 600; }
.topbar .spacer { flex: 1; }
.topbar .user { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-orange), #ffb545);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}

.content { flex: 1; overflow-y: auto; padding: 18px 20px 40px; }

/* ---------------- 卡片与图表 ---------------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 18px; margin-bottom: 16px;
}
.card-head { display: flex; align-items: center; margin-bottom: 14px; }
.card-head h3 { margin: 0; font-size: 14.5px; font-weight: 600; }
.card-head .spacer { flex: 1; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.stat::after {
  content: ""; position: absolute; right: -18px; top: -18px;
  width: 54px; height: 54px; border-radius: 50%; background: rgba(247, 148, 30, 0.1);
}
.stat .label { font-size: 12.5px; color: var(--muted); }
.stat .value { font-size: 25px; font-weight: 700; margin-top: 6px; letter-spacing: .5px; }
.stat .unit { font-size: 12px; color: var(--muted); margin-left: 3px; font-weight: 400; }
.stat.warn .value { color: var(--brand-orange-dark); }
.stat.ok .value { color: #15803d; }
.stat.mute .value { color: #94a3b8; }
.stat.mute::after { background: rgba(148, 163, 184, 0.12); }

.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filters .el-input, .filters .el-select { width: 168px; }

.table-actions { display: flex; gap: 4px; flex-wrap: wrap; }

/* 工单详情 */
.detail-section { margin-bottom: 18px; }
.detail-section h4 {
  font-size: 13px; margin: 0 0 10px; color: var(--muted); font-weight: 600;
  display: flex; align-items: center; gap: 6px;
}
.detail-section h4::before { content: ""; width: 3px; height: 13px; background: var(--brand-orange); border-radius: 2px; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 6px 18px; font-size: 13px; }
.kv .k { color: var(--muted); }
.kv .row { display: flex; gap: 8px; padding: 4px 0; border-bottom: 1px dashed #eef1f6; }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.photo-grid figure { margin: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fafbfd; }
.photo-grid img { width: 100%; height: 96px; object-fit: cover; display: block; }
.photo-grid figcaption { padding: 4px 6px; font-size: 11.5px; color: var(--muted); display: flex; justify-content: space-between; }
.photo-grid .tag-gps { color: #15803d; }

.empty { color: var(--muted); font-size: 13px; padding: 14px 0; text-align: center; }

.import-drop {
  border: 1.5px dashed #c9d3e4; border-radius: 12px;
  padding: 26px; text-align: center; color: var(--muted);
  background: #fbfcfe; cursor: pointer; transition: border-color .15s, background .15s;
}
.import-drop:hover { border-color: var(--brand-orange); background: #fff9f1; }

.mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: 12px; }
.text-muted { color: var(--muted); }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.flex { display: flex; align-items: center; gap: 8px; }

/* 工单表单：两列栅格，跨列用 .span-2 */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 16px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 14px; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .el-form-item { margin-bottom: 12px; }
.form-grid.cols-3 > .flex { margin-bottom: 6px; }
.field-label { width: 96px; font-size: 12.5px; color: var(--muted); flex: none; }
.sub-title { font-size: 13px; color: #6b7688; margin: 14px 0 8px; font-weight: 600; }

/* 权限勾选面板 */
.perm-group { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; }
.perm-group.compact { padding: 8px 10px; margin-bottom: 8px; }
.perm-group-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.perm-group-head strong { font-size: 13px; color: var(--brand-ink); }
.perm-group .el-checkbox { margin-right: 14px; }

@media (max-width: 900px) {
  .aside { position: fixed; left: -224px; top: 0; bottom: 0; z-index: 20; transition: left .2s; }
  .aside.open { left: 0; }
  .content { padding: 14px 12px 36px; }
}
