:root {
  --brand: #2f6bff;
  --brand-dark: #1d4ed8;
  --brand-soft: #eef3ff;
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #fafbfd;
  --border: #e6e9f0;
  --border-strong: #d5dae6;
  --text: #1a2233;
  --text-2: #5b6579;
  --text-3: #8b93a7;
  --green: #0ea472;
  --green-soft: #e7f7f1;
  --amber: #e08c00;
  --amber-soft: #fdf3e0;
  --red: #e5484d;
  --red-soft: #fdeced;
  --slate: #64748b;
  --slate-soft: #eef1f6;
  --blue: #2f6bff;
  --blue-soft: #eef3ff;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(20, 28, 46, 0.06);
  --shadow: 0 6px 24px -8px rgba(20, 28, 46, 0.16);
  --shadow-lg: 0 24px 60px -20px rgba(20, 28, 46, 0.28);
  --sidebar-w: 236px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

a {
  color: var(--brand);
  text-decoration: none;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--slate-soft);
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 12.5px;
}

/* ============================== 登录页 ============================== */
.login-screen {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: hidden;
}

.login-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px 500px at 12% 8%, rgba(47, 107, 255, 0.22), transparent 62%),
    radial-gradient(760px 460px at 92% 92%, rgba(14, 164, 114, 0.18), transparent 60%),
    linear-gradient(160deg, #f7f9ff 0%, #eef2fa 100%);
}

.login-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  padding: 30px 28px 24px;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 24px;
}

.brand h1 {
  font-size: 19px;
}

.brand p {
  font-size: 12.5px;
  color: var(--text-2);
  margin-top: 4px;
  line-height: 1.5;
}

.brand-mark {
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 13px;
  background: linear-gradient(140deg, var(--brand), #7a5cff);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 700;
  box-shadow: 0 8px 20px -8px rgba(47, 107, 255, 0.9);
}

.brand-mark.small {
  width: 36px;
  height: 36px;
  font-size: 16px;
  border-radius: 10px;
}

.field {
  display: block;
  margin-bottom: 14px;
}

.field > span {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
}

.field .hint {
  font-weight: 400;
  color: var(--text-3);
}

input,
select,
textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

textarea {
  min-height: 74px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.14);
}

input::placeholder,
textarea::placeholder {
  color: #a9b0c2;
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' stroke='%238b93a7' stroke-width='2.4' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

.form-error {
  background: var(--red-soft);
  color: #b3282d;
  border: 1px solid #f6c7c9;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 13px;
  margin-bottom: 12px;
}

.login-tip {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--border-strong);
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.7;
}

/* ============================== 按钮 ============================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  background: var(--surface);
  color: var(--text);
  transition: transform 0.06s, background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(140deg, var(--brand), #4f7dff);
  color: #fff;
  box-shadow: 0 8px 18px -10px rgba(47, 107, 255, 0.9);
}

.btn-primary:hover {
  background: linear-gradient(140deg, var(--brand-dark), #3f6ff0);
}

.btn-ghost {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text-2);
}

.btn-ghost:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-soft);
}

.btn-subtle {
  background: var(--slate-soft);
  color: var(--text-2);
}

.btn-subtle:hover {
  background: #e5e9f1;
}

.btn-danger {
  background: var(--red-soft);
  color: #b3282d;
}

.btn-danger:hover {
  background: #fbd9da;
}

.btn-success {
  background: var(--green-soft);
  color: #07734f;
}

.btn-success:hover {
  background: #d7f0e6;
}

.btn-block {
  width: 100%;
}

.btn-lg {
  padding: 11px 16px;
  font-size: 14.5px;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12.5px;
  border-radius: 8px;
}

.icon-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  border-radius: 10px;
  color: var(--text-2);
  cursor: pointer;
}

.icon-btn:hover {
  color: var(--brand);
  border-color: var(--brand);
}

/* ============================== 布局 ============================== */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: #fff;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  z-index: 30;
}

.sidebar-brand {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 4px 8px 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.sidebar-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.35;
}

.sidebar-brand-text strong {
  font-size: 13.5px;
}

.sidebar-brand-text span {
  font-size: 11.5px;
  color: var(--text-3);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  flex: 1;
}

.nav-group {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  letter-spacing: 0.08em;
  padding: 14px 10px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  color: var(--text-2);
  cursor: pointer;
  font-weight: 500;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 13.5px;
  text-align: left;
  width: 100%;
}

.nav-item:hover {
  background: var(--surface-2);
  color: var(--text);
}

.nav-item.active {
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-weight: 600;
}

.nav-item .count {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  border-radius: 999px;
  padding: 1px 7px;
  font-weight: 700;
}

.nav-item.active .count {
  background: var(--brand);
}

.nav-item svg {
  flex: none;
  opacity: 0.85;
}

.sidebar-foot {
  border-top: 1px solid var(--border);
  padding: 12px 10px 4px;
  font-size: 11.5px;
  color: var(--text-3);
  line-height: 1.6;
}

.next-run strong {
  color: var(--brand-dark);
  font-weight: 600;
}

.sidebar-mask {
  display: none;
}

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 22px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.menu-btn {
  display: none;
}

.topbar-title h2 {
  font-size: 17px;
}

.topbar-title p {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--brand), #7a5cff);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 12.5px;
  font-weight: 700;
}

.user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.user-meta strong {
  font-size: 12.5px;
}

.user-meta small {
  font-size: 10.5px;
  color: var(--text-3);
}

.menu-wrap {
  position: relative;
}

.dropdown {
  position: absolute;
  right: 0;
  top: 42px;
  min-width: 168px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 6px;
  z-index: 40;
}

.dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  font: inherit;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-2);
}

.dropdown button:hover {
  background: var(--surface-2);
  color: var(--text);
}

.dropdown button.danger:hover {
  background: var(--red-soft);
  color: #b3282d;
}

.view {
  padding: 20px 22px 60px;
  max-width: 1320px;
  width: 100%;
}

/* ============================== 卡片 / 统计 ============================== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.card + .card {
  margin-top: 16px;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.card-head h3 {
  font-size: 14.5px;
}

.card-head .sub {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
}

.card-head .right {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.card-body {
  padding: 16px 18px;
}

.card-body.tight {
  padding: 10px 12px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  right: -28px;
  top: -28px;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--blue-soft);
  opacity: 0.75;
}

.stat-card.amber::after {
  background: var(--amber-soft);
}

.stat-card.red::after {
  background: var(--red-soft);
}

.stat-card.green::after {
  background: var(--green-soft);
}

.stat-card.slate::after {
  background: var(--slate-soft);
}

.stat-card .label {
  font-size: 12.5px;
  color: var(--text-2);
  position: relative;
}

.stat-card .value {
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 4px;
  position: relative;
}

.stat-card .value small {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-3);
  margin-left: 3px;
}

.stat-card .foot {
  font-size: 11.5px;
  color: var(--text-3);
  margin-top: 4px;
  position: relative;
}

/* ============================== 表格 ============================== */
.table-wrap {
  overflow-x: auto;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

table.data-table th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  padding: 10px 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

table.data-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

table.data-table tbody tr:last-child td {
  border-bottom: none;
}

table.data-table tbody tr:hover {
  background: #fbfcfe;
}

.cell-main {
  font-weight: 600;
}

.cell-sub {
  font-size: 11.5px;
  color: var(--text-3);
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
}

.nowrap {
  white-space: nowrap;
}

/* ============================== 徽标 ============================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--slate-soft);
  color: var(--slate);
  white-space: nowrap;
}

.badge.amber {
  background: var(--amber-soft);
  color: #a36500;
}

.badge.red {
  background: var(--red-soft);
  color: #b3282d;
}

.badge.green {
  background: var(--green-soft);
  color: #07734f;
}

.badge.blue {
  background: var(--blue-soft);
  color: var(--brand-dark);
}

.badge.slate {
  background: var(--slate-soft);
  color: var(--slate);
}

/* ============================== 工具栏 ============================== */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
}

.toolbar .grow {
  flex: 1;
  min-width: 180px;
}

.toolbar select,
.toolbar input {
  width: auto;
  min-width: 132px;
}

.seg {
  display: inline-flex;
  background: var(--slate-soft);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
  flex-wrap: wrap;
}

.seg button {
  border: none;
  background: none;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.seg button.active {
  background: #fff;
  color: var(--brand-dark);
  box-shadow: var(--shadow-sm);
}

/* ============================== 任务卡片 ============================== */
.task-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.task-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow 0.15s, border-color 0.15s;
}

.task-card:hover {
  box-shadow: var(--shadow);
}

.task-card.is-done {
  opacity: 0.72;
}

.task-card .task-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  flex-wrap: wrap;
}

.task-card .task-top .name {
  font-weight: 700;
  font-size: 14.5px;
}

.task-card .task-top .spacer {
  flex: 1;
}

.task-body {
  padding: 12px 16px 14px;
}

.kv {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px 18px;
  font-size: 12.5px;
}

.kv .k {
  color: var(--text-3);
  margin-right: 5px;
}

.kv .v {
  color: var(--text);
  font-weight: 500;
  word-break: break-all;
}

.script-box {
  position: relative;
  margin-top: 12px;
  background: linear-gradient(180deg, #f7f9ff, #f4f7ff);
  border: 1px dashed #c9d8ff;
  border-radius: var(--radius-sm);
  padding: 12px 14px 12px;
  font-size: 13px;
  color: #23325a;
  line-height: 1.75;
  white-space: pre-wrap;
}

.script-label {
  position: absolute;
  top: -9px;
  left: 12px;
  background: #fff;
  border: 1px solid #c9d8ff;
  color: var(--brand-dark);
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 8px;
}

.task-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 12px;
}

.task-actions .grow {
  flex: 1;
  min-width: 160px;
}

.task-actions input {
  padding: 7px 10px;
  font-size: 13px;
}

/* ============================== 空状态 / 加载 ============================== */
.empty {
  text-align: center;
  padding: 46px 20px;
  color: var(--text-3);
}

.empty .icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--slate-soft);
  display: grid;
  place-items: center;
  font-size: 24px;
}

.empty h4 {
  color: var(--text-2);
  font-size: 14px;
  margin-bottom: 4px;
}

.empty p {
  font-size: 12.5px;
}

.skeleton {
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, #eef1f6 25%, #f6f8fb 37%, #eef1f6 63%);
  background-size: 400% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
  height: 14px;
  margin-bottom: 10px;
}

@keyframes shimmer {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}

.spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

.spinner.dark {
  border-color: rgba(47, 107, 255, 0.25);
  border-top-color: var(--brand);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ============================== 弹窗 ============================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  background: rgba(17, 24, 39, 0.42);
  overflow-y: auto;
  animation: fade 0.14s ease;
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

.modal-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 660px;
  animation: pop 0.16s ease;
}

@keyframes pop {
  from {
    transform: translateY(8px) scale(0.99);
    opacity: 0.6;
  }
}

.modal-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-head h3 {
  font-size: 15.5px;
}

.modal-head .close {
  margin-left: auto;
  border: none;
  background: none;
  font-size: 20px;
  line-height: 1;
  color: var(--text-3);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 8px;
}

.modal-head .close:hover {
  background: var(--slate-soft);
  color: var(--text);
}

.modal-body {
  padding: 18px 20px;
  max-height: 66vh;
  overflow-y: auto;
}

.modal-foot {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 0 0 16px 16px;
  flex-wrap: wrap;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
}

.form-grid .full {
  grid-column: 1 / -1;
}

/* ============================== Toast ============================== */
.toast-root {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}

.toast {
  background: #1f2937;
  color: #fff;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 13px;
  box-shadow: var(--shadow);
  animation: slideDown 0.18s ease;
  max-width: 90vw;
}

.toast.success {
  background: #06805a;
}

.toast.error {
  background: #c0343a;
}

@keyframes slideDown {
  from {
    transform: translateY(-10px);
    opacity: 0;
  }
}

/* ============================== 提示条 ============================== */
.notice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  line-height: 1.7;
  background: var(--brand-soft);
  border: 1px solid #ccdaff;
  color: #23325a;
  margin-bottom: 14px;
}

.notice.warn {
  background: var(--amber-soft);
  border-color: #f5dcae;
  color: #7c4d00;
}

.notice.ok {
  background: var(--green-soft);
  border-color: #bfe8d8;
  color: #086c4d;
}

.notice strong {
  font-weight: 700;
}

.upload-zone {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 32px 20px;
  text-align: center;
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.upload-zone .big {
  font-size: 26px;
  margin-bottom: 8px;
}

.upload-zone h4 {
  font-size: 14px;
  margin-bottom: 4px;
}

.upload-zone p {
  font-size: 12.5px;
  color: var(--text-3);
}

.pager {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-2);
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chart-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chart-row {
  display: grid;
  grid-template-columns: 96px 1fr 64px;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
}

.chart-track {
  height: 9px;
  background: var(--slate-soft);
  border-radius: 999px;
  overflow: hidden;
}

.chart-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), #7a5cff);
}

/* ============================== 响应式 ============================== */
@media (max-width: 1080px) {
  :root {
    --sidebar-w: 212px;
  }
  .view {
    padding: 16px 16px 56px;
  }
}

@media (max-width: 880px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 250px;
    transform: translateX(-102%);
    transition: transform 0.22s ease;
    box-shadow: var(--shadow-lg);
  }

  .app.nav-open .sidebar {
    transform: none;
  }

  .app.nav-open .sidebar-mask {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.4);
    z-index: 25;
  }

  .menu-btn {
    display: grid;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    padding: 10px 14px;
  }

  .user-meta {
    display: none;
  }

  .user-chip {
    padding: 2px;
    border: none;
  }

  .stat-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }

  .view {
    padding: 14px 12px 56px;
  }

  /* 表格在手机上转成卡片式 */
  table.data-table thead {
    display: none;
  }

  table.data-table,
  table.data-table tbody,
  table.data-table tr,
  table.data-table td {
    display: block;
    width: 100%;
  }

  table.data-table tr {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    padding: 6px 4px;
    background: #fff;
  }

  table.data-table td {
    border: none;
    padding: 6px 10px;
    display: flex;
    gap: 10px;
    align-items: baseline;
  }

  table.data-table td::before {
    content: attr(data-label);
    flex: none;
    width: 78px;
    color: var(--text-3);
    font-size: 12px;
  }
}
