/* 星枢 · 应用管控台 —— 深空紫 + 青柠点缀，与冷灰蓝后台明确区分 */
:root {
  --bg: #f5f3fa;
  --card: #ffffff;
  --ink: #1d1931;
  --ink-2: #413b5c;
  --muted: #837d9c;
  --line: #e9e5f2;
  --line-soft: #f1eef7;
  --primary: #6f4cff;
  --primary-deep: #4d2fd6;
  --primary-soft: #efeaff;
  --primary-tint: #f7f4ff;
  --lime: #c9f75a;
  --lime-deep: #79a817;
  --lime-soft: #f2fbdc;
  --green: #12b886;
  --green-soft: #e3f8f0;
  --amber: #f0a020;
  --amber-soft: #fff3df;
  --red: #ef476f;
  --red-soft: #ffe9ef;
  --sidebar: #1a1033;
  --sidebar-2: #2a1a53;
  --shadow-sm: 0 2px 8px rgba(42, 26, 83, .05);
  --shadow-md: 0 10px 30px rgba(42, 26, 83, .09);
  --radius: 16px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { display: block; }

.app-shell { display: flex; min-height: 100vh; }

/* ---------- 侧边栏 ---------- */
.sidebar {
  width: 238px; flex: 0 0 238px; min-height: 100vh; display: flex; flex-direction: column;
  background: linear-gradient(168deg, var(--sidebar-2) 0%, var(--sidebar) 48%, #150d2a 100%);
  color: #e8e2ff; padding: 26px 16px 20px; position: sticky; top: 0; height: 100vh;
  box-shadow: 6px 0 28px rgba(26, 16, 51, .16); z-index: 20;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 12px 26px; }
.brand-mark { width: 38px; height: 38px; color: var(--lime); filter: drop-shadow(0 0 10px rgba(201,247,90,.35)); }
.brand-mark svg { width: 100%; height: 100%; }
.brand-text strong { display: block; font-size: 20px; letter-spacing: 3px; line-height: 1.1; color: #fff; }
.brand-text span { display: block; font-size: 8px; letter-spacing: 1px; color: #9d8fc8; margin-top: 5px; white-space: nowrap; }
.side-label { font-size: 10.5px; letter-spacing: 2px; color: #7f6fae; padding: 14px 14px 9px; text-transform: uppercase; }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 10px;
  color: #bdb2dd; font-size: 13.5px; position: relative; transition: background .18s, color .18s;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: rgba(111,76,255,.28); color: #fff; font-weight: 600; }
.nav-item.active::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--lime); }
.nav-icon { width: 18px; height: 18px; flex: 0 0 18px; display: inline-flex; align-items: center; justify-content: center; color: currentColor; }
.nav-icon svg { width: 100%; height: 100%; }
.nav-icon.small { width: 16px; height: 16px; flex-basis: 16px; }
.nav-icon.light { color: #fff; }
.nav-count { margin-left: auto; font-size: 11px; background: rgba(255,255,255,.1); padding: 1px 7px; border-radius: 20px; color: #cfc5ee; }
.sidebar-bottom { margin-top: auto; padding-top: 18px; }
.env-pill { display: flex; align-items: center; gap: 8px; margin: 0 8px 14px; padding: 9px 12px; border-radius: 10px; background: rgba(201,247,90,.1); border: 1px solid rgba(201,247,90,.2); color: #dcf7a4; font-size: 11.5px; }
.pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 4px rgba(201,247,90,.14); }
.side-user { display: flex; align-items: center; gap: 10px; border-top: 1px solid rgba(255,255,255,.08); padding: 16px 10px 0; }
.avatar { width: 32px; height: 32px; border-radius: 10px; background: linear-gradient(135deg, #8b6bff, #5a35d8); display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px; }
.side-user strong { display: block; color: #fff; font-size: 12.5px; }
.side-user span { display: block; color: #8e80b8; font-size: 10.5px; }
.side-user .nav-icon { margin-left: auto; color: #7f6fae; }

/* ---------- 顶栏 ---------- */
.main-area { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 68px; flex: 0 0 68px; background: rgba(255,255,255,.86); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between;
  padding: 0 30px; position: sticky; top: 0; z-index: 15;
}
.crumb { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--muted); }
.crumb-root { color: var(--primary); font-weight: 700; }
.crumb-sep { color: #cdc7dd; }
#crumb-current { color: var(--ink); font-weight: 600; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.global-search { display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 0 12px; height: 36px; color: var(--muted); transition: border-color .2s; }
.global-search:focus-within { border-color: var(--primary); background: #fff; }
.global-search input { border: 0; outline: 0; background: transparent; width: 180px; font-size: 12.5px; }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); background: #fff; border-radius: 9px; color: var(--muted); transition: all .18s; }
.icon-btn:hover { color: var(--primary); border-color: var(--primary); transform: rotate(25deg); }

/* ---------- 通用组件 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: 9px; padding: 8px 15px; font-size: 12.5px; font-weight: 600; transition: all .18s; white-space: nowrap; }
.btn-primary { background: linear-gradient(135deg, var(--primary), #5b3ae8); color: #fff; box-shadow: 0 5px 14px rgba(111,76,255,.25); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(111,76,255,.34); }
.btn-lime { background: var(--lime); color: #263512; }
.btn-lime:hover { background: #d7ff77; transform: translateY(-1px); }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-soft { background: var(--primary-soft); color: var(--primary-deep); }
.btn-soft:hover { background: #e5dcff; }
.btn-danger { background: var(--red-soft); color: #c82f56; }
.btn-danger:hover { background: #ffd8e2; }
.btn-sm { padding: 5px 10px; font-size: 11.5px; border-radius: 7px; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; box-shadow: none; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.page-root { padding: 26px 30px 40px; flex: 1; animation: pageIn .26s ease; }
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-head h1 { margin: 0; font-size: 22px; letter-spacing: -.3px; }
.page-head p { margin: 5px 0 0; color: var(--muted); font-size: 12.5px; }
.page-head-actions { display: flex; gap: 9px; }
.section-title { font-size: 14px; font-weight: 700; margin: 0 0 14px; display: flex; align-items: center; gap: 8px; }
.section-title .bar { width: 3px; height: 14px; border-radius: 2px; background: var(--primary); }
.muted { color: var(--muted); }
.mono { font-family: "SFMono-Regular", Consolas, monospace; font-size: 12px; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.running { background: var(--green-soft); color: #0b8d68; }
.badge.stopped { background: #f0eef5; color: #7a7490; }
.badge.deploying { background: var(--primary-soft); color: var(--primary-deep); }
.badge.error { background: var(--red-soft); color: #c82f56; }
.badge.success { background: var(--green-soft); color: #0b8d68; }
.badge.failed { background: var(--red-soft); color: #c82f56; }
.badge.type { background: var(--primary-tint); color: var(--primary-deep); }
.badge.lime { background: var(--lime-soft); color: var(--lime-deep); }

/* ---------- 总览 ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: 20px; padding: 26px 30px; margin-bottom: 20px;
  background: linear-gradient(115deg, #2a1a53 0%, #3a2490 58%, #5b3ee0 100%); color: #fff;
  box-shadow: 0 14px 34px rgba(63, 38, 140, .22);
}
.hero::after { content: ""; position: absolute; right: -60px; top: -90px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(201,247,90,.32), transparent 68%); }
.hero::before { content: ""; position: absolute; right: 130px; bottom: -100px; width: 200px; height: 200px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.13), transparent 70%); }
.hero-kicker { font-size: 11px; letter-spacing: 2px; color: var(--lime); font-weight: 700; }
.hero h2 { margin: 7px 0 6px; font-size: 24px; letter-spacing: .3px; }
.hero p { margin: 0; color: #cfc4f5; font-size: 12.5px; max-width: 560px; }
.hero-actions { display: flex; gap: 10px; margin-top: 18px; position: relative; z-index: 1; }
.hero-stat { position: absolute; right: 34px; top: 28px; text-align: right; z-index: 1; }
.hero-stat strong { display: block; font-size: 34px; line-height: 1; color: var(--lime); }
.hero-stat span { font-size: 11px; color: #cfc4f5; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.kpi { padding: 18px 18px 16px; display: flex; flex-direction: column; gap: 8px; position: relative; overflow: hidden; }
.kpi::after { content: ""; position: absolute; width: 80px; height: 80px; border-radius: 50%; right: -32px; top: -32px; background: var(--kpi-soft, var(--primary-soft)); opacity: .65; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi-label { font-size: 12px; color: var(--muted); font-weight: 500; }
.kpi-icon { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--kpi-soft, var(--primary-soft)); color: var(--kpi-color, var(--primary)); }
.kpi-icon .nav-icon { width: 17px; height: 17px; }
.kpi-value { font-size: 27px; font-weight: 750; letter-spacing: -.6px; line-height: 1.1; }
.kpi-foot { font-size: 11px; color: var(--muted); }
.kpi-foot em { font-style: normal; color: var(--kpi-color, var(--primary)); font-weight: 700; }

.overview-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(260px, 1fr); gap: 16px; margin-bottom: 16px; }
.panel { padding: 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.panel-head h3 { margin: 0; font-size: 14px; }
.legend { display: flex; gap: 14px; font-size: 11px; color: var(--muted); }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }
.chart-wrap { width: 100%; }
.chart-wrap svg { width: 100%; height: 190px; overflow: visible; }
.donut-wrap { display: flex; align-items: center; gap: 20px; }
.donut { width: 118px; height: 118px; border-radius: 50%; flex: 0 0 118px; display: grid; place-items: center; position: relative; }
.donut::after { content: ""; position: absolute; inset: 18px; border-radius: 50%; background: #fff; }
.donut-inner { position: relative; z-index: 1; text-align: center; }
.donut-inner strong { display: block; font-size: 22px; line-height: 1; }
.donut-inner span { font-size: 10px; color: var(--muted); }
.donut-legend { display: flex; flex-direction: column; gap: 10px; font-size: 12px; flex: 1; }
.donut-legend div { display: flex; align-items: center; justify-content: space-between; }
.donut-legend b { font-size: 13px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th { text-align: left; font-size: 11px; color: var(--muted); font-weight: 600; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--primary-tint); }
.row-name { font-weight: 600; color: var(--ink); }
.row-sub { font-size: 10.5px; color: var(--muted); margin-top: 2px; }

/* ---------- 应用卡片 ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.search-field { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 0 12px; height: 36px; color: var(--muted); min-width: 230px; }
.search-field input { border: 0; outline: 0; width: 100%; font-size: 12.5px; background: transparent; }
.chips { display: flex; gap: 6px; background: #eeebf5; padding: 3px; border-radius: 9px; }
.chip { border: 0; background: transparent; padding: 6px 12px; border-radius: 7px; font-size: 12px; color: var(--muted); font-weight: 600; }
.chip.active { background: #fff; color: var(--primary); box-shadow: var(--shadow-sm); }
.select-field { height: 36px; border: 1px solid var(--line); border-radius: 9px; background: #fff; padding: 0 10px; font-size: 12.5px; outline: 0; }
.select-field:focus { border-color: var(--primary); }
.toolbar-right { margin-left: auto; color: var(--muted); font-size: 11.5px; }

.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 14px; }
.app-card { padding: 18px; transition: transform .2s, box-shadow .2s, border-color .2s; position: relative; overflow: hidden; display: flex; flex-direction: column; }
.app-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: #d9ceff; }
.app-card-top { display: flex; align-items: center; gap: 13px; margin-bottom: 14px; }
.app-logo { width: 80px; height: 80px; flex: 0 0 80px; border-radius: 20px; display: grid; place-items: center; font-weight: 800; font-size: 26px; color: #fff; background: linear-gradient(135deg, var(--logo-a, #8b6bff), var(--logo-b, #5633d6)); box-shadow: 0 6px 14px rgba(90,53,214,.2); }
.app-card h3 { margin: 0 0 3px; font-size: 14.5px; line-height: 1.35; }
.app-slug { font-size: 11px; color: var(--muted); }
.app-card-top .badge { margin-left: auto; }
.app-desc { font-size: 11.5px; color: var(--muted); min-height: 36px; line-height: 1.6; margin: 0 0 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.app-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 11px 0; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.app-meta div { min-width: 0; }
.app-meta span { display: block; font-size: 10px; color: var(--muted); }
.app-meta strong { display: block; font-size: 11.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-card-foot { display: flex; align-items: center; gap: 6px; padding-top: 12px; flex-wrap: wrap; margin-top: auto; }
.app-card-foot .btn { flex: 1 1 auto; min-width: 78px; justify-content: center; white-space: nowrap; padding-left: 8px; padding-right: 8px; }
.app-card-foot .icon-action { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; color: var(--muted); }
.app-card-foot .icon-action:hover { color: var(--primary); border-color: var(--primary); }
.card-accent { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent, var(--primary)); opacity: .8; }

.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty svg { width: 96px; height: 96px; margin: 0 auto 14px; color: #d9d1f5; }
.empty h3 { margin: 0 0 6px; color: var(--ink-2); font-size: 15px; }
.empty p { margin: 0 0 16px; font-size: 12px; }

/* ---------- 部署中心 ---------- */
.deploy-grid { display: grid; grid-template-columns: minmax(320px, 1fr) minmax(320px, 1.1fr); gap: 16px; }
.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: 11.5px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 10.5px; color: var(--muted); }
.field input, .field select, .field textarea { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; background: #fff; outline: 0; font-size: 12.5px; transition: border-color .18s, box-shadow .18s; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(111,76,255,.1); }
.field textarea { resize: vertical; min-height: 64px; }
.segmented { display: flex; gap: 6px; }
.segmented button { flex: 1; border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 9px 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.segmented button.active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-deep); }
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.toggle-row + .toggle-row { margin-top: 8px; }
.toggle-row strong { display: block; font-size: 12px; }
.toggle-row span { font-size: 10.5px; color: var(--muted); }
.switch { width: 38px; height: 21px; border-radius: 20px; background: #dcd7e8; position: relative; border: 0; transition: background .2s; flex: 0 0 38px; }
.switch::after { content: ""; position: absolute; width: 15px; height: 15px; border-radius: 50%; background: #fff; left: 3px; top: 3px; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch.on { background: var(--primary); }
.switch.on::after { transform: translateX(17px); }
.form-actions { display: flex; gap: 9px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line-soft); }

.pipeline { display: flex; flex-direction: column; gap: 0; margin: 4px 0 16px; }
.pipe-step { display: flex; gap: 12px; position: relative; padding-bottom: 18px; }
.pipe-step:last-child { padding-bottom: 0; }
.pipe-step::before { content: ""; position: absolute; left: 11px; top: 24px; bottom: 0; width: 2px; background: var(--line); }
.pipe-step:last-child::before { display: none; }
.pipe-step.done::before { background: var(--lime); }
.pipe-dot { width: 24px; height: 24px; flex: 0 0 24px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line); background: #fff; color: var(--muted); font-size: 10px; font-weight: 700; z-index: 1; }
.pipe-step.done .pipe-dot { background: var(--lime-soft); border-color: var(--lime); color: var(--lime-deep); }
.pipe-step.active .pipe-dot { border-color: var(--primary); color: var(--primary); animation: pulse 1s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(111,76,255,.12); } }
.pipe-body strong { display: block; font-size: 12.5px; }
.pipe-body span { font-size: 10.5px; color: var(--muted); }
.console { background: #1a1033; border-radius: 12px; padding: 14px; min-height: 156px; max-height: 230px; overflow-y: auto; color: #cfc5ee; font-family: "SFMono-Regular", Consolas, monospace; font-size: 11px; line-height: 1.9; }
.console .line-ok { color: var(--lime); }
.console .line-info { color: #a99ce0; }
.console .line-title { color: #fff; }

/* ---------- 详情页 ---------- */
.detail-head { display: flex; align-items: center; gap: 15px; margin-bottom: 18px; }
.detail-logo { width: 80px; height: 80px; border-radius: 22px; display: grid; place-items: center; font-size: 26px; font-weight: 800; color: #fff; background: linear-gradient(135deg, #8b6bff, #5633d6); }
.detail-head h1 { margin: 0; font-size: 20px; }
.detail-head p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.detail-head .badge { margin-left: 10px; }
.detail-actions { margin-left: auto; display: flex; gap: 8px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tab { border: 0; background: transparent; padding: 10px 16px; font-size: 12.5px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.info-item { padding: 15px; }
.info-item span { display: block; font-size: 10.5px; color: var(--muted); }
.info-item strong { display: block; font-size: 13px; margin-top: 5px; word-break: break-all; }

/* ---------- 资源页 ---------- */
.resource-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-bottom: 20px; }
.resource-card { padding: 18px; position: relative; overflow: hidden; }
.resource-card::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 3px; background: var(--bar, var(--primary)); }
.resource-card h3 { margin: 0 0 4px; font-size: 15px; }
.resource-card .use { font-size: 11px; color: var(--primary); font-weight: 600; }
.resource-card p { font-size: 11.5px; color: var(--muted); margin: 10px 0 14px; min-height: 34px; }
.resource-foot { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line-soft); padding-top: 11px; font-size: 11px; color: var(--muted); }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 11px; background: var(--amber-soft); color: #8a5a10; font-size: 11.5px; margin-top: 16px; }
.notice .nav-icon { flex: 0 0 16px; margin-top: 2px; }

/* ---------- 日志 ---------- */
.log-list { display: flex; flex-direction: column; }
.log-row { display: flex; gap: 13px; padding: 12px 4px; border-bottom: 1px solid var(--line-soft); font-size: 12px; }
.log-row:last-child { border-bottom: 0; }
.log-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-top: 6px; flex: 0 0 8px; }
.log-dot.warn { background: var(--amber); }
.log-dot.error { background: var(--red); }
.log-body { flex: 1; }
.log-body strong { font-weight: 600; }
.log-body span { color: var(--muted); font-size: 11px; margin-left: 8px; }
.log-time { color: var(--muted); font-size: 11px; white-space: nowrap; }

/* ---------- 弹窗 / 提示 ---------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(26,16,51,.55); backdrop-filter: blur(3px); z-index: 50; display: grid; place-items: center; padding: 20px; animation: fade .18s; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal { width: min(520px, 100%); background: #fff; border-radius: 18px; box-shadow: 0 24px 70px rgba(20,10,45,.3); overflow: hidden; }
.modal-head { padding: 20px 22px 14px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line-soft); }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-body { padding: 20px 22px; }
.modal-foot { padding: 14px 22px 20px; display: flex; justify-content: flex-end; gap: 9px; }
.modal-close { width: 28px; height: 28px; border: 0; background: var(--bg); border-radius: 8px; color: var(--muted); font-size: 16px; line-height: 1; }
.toast-root { position: fixed; right: 24px; bottom: 24px; z-index: 80; display: flex; flex-direction: column; gap: 9px; }
.toast { min-width: 240px; max-width: 380px; background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--primary); border-radius: 10px; box-shadow: var(--shadow-md); padding: 11px 14px; font-size: 12.5px; animation: toastIn .22s; }
.toast.ok { border-left-color: var(--green); }
.toast.err { border-left-color: var(--red); }
@keyframes toastIn { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }

/* 应用封面图与部署包上传 */
/* 封面固定正方形：用显式像素尺寸，避免百分比高度在网格里按原图竖版比例撑高 */
.app-logo { overflow: hidden; }
.app-logo img { display: block; width: 80px; height: 80px; aspect-ratio: 1 / 1; border-radius: 20px; object-fit: cover; }
.detail-logo { overflow: hidden; }
.detail-logo img { display: block; width: 80px; height: 80px; aspect-ratio: 1 / 1; border-radius: 22px; object-fit: cover; }

/* 只有一种数据类型时的静态说明，不做成假装可点的按钮 */
.type-static-line { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 12px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 20px; background: #fff; font-size: 11.5px; color: var(--muted); }
.type-static-line b { color: var(--ink-2); }
.upload-row { display: flex; gap: 8px; }
.upload-row input { flex: 1; }
.upload-row label { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; cursor: pointer; }

/* 数据管理与链接弹窗 */
.content-preview { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-panel { display: flex; gap: 18px; align-items: flex-start; }
.link-main { flex: 1; min-width: 0; }
.link-actions { display: flex; gap: 8px; margin-top: 10px; }
.link-qr { flex: 0 0 180px; text-align: center; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--primary-tint); }
.link-qr img { border-radius: 6px; background: #fff; }
@media (max-width: 560px) { .link-panel { flex-direction: column; } .link-qr { width: 100%; } }

@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .overview-grid, .deploy-grid { grid-template-columns: 1fr; }
  .resource-grid { grid-template-columns: 1fr; }
  .hero-stat { display: none; }
}
@media (max-width: 820px) {
  .sidebar { width: 64px; flex-basis: 64px; padding: 20px 8px; }
  .brand-text, .side-label, .nav-item span:not(.nav-icon), .nav-count, .sidebar-bottom { display: none; }
  .nav-item { justify-content: center; padding: 12px; }
  .topbar { padding: 0 14px; }
  .global-search { display: none; }
  .page-root { padding: 18px 14px 30px; }
  .info-grid { grid-template-columns: 1fr 1fr; }
}

/* ===== 客户链接弹窗与业务数据 ===== */
.badge.primary { background: var(--primary-soft); color: var(--primary-deep); }
.badge.warning { background: var(--amber-soft); color: #8a5a10; }
.notice.warn { background: var(--amber-soft); color: #8a5a10; }
.input-field { height: 36px; border: 1px solid var(--line); border-radius: 9px; background: #fff; padding: 0 10px; font-size: 12.5px; outline: 0; }
.input-field:focus { border-color: var(--primary); }
.cust-app-line { font-size:12px; color:var(--ink-2); background:var(--primary-tint); border:1px solid var(--line); border-radius:9px; padding:8px 11px; margin-bottom:12px; }
.cust-app-line b { color:var(--primary-deep); }
.cust-app-line .muted { font-size:11px; margin-left:6px; }
.cust-row { margin-bottom:10px; }
.cust-label { display:block; font-size:12px; font-weight:600; color:var(--ink-2); margin-bottom:6px; }
.cust-inline-options { display:flex; gap:8px; flex-wrap:wrap; }
.cust-pill { flex:1 1 120px; display:flex; align-items:center; gap:7px; padding:8px 10px; border:1px solid var(--line); border-radius:9px; cursor:pointer; font-size:12px; }
.cust-pill:hover { border-color:var(--primary); background:var(--primary-tint); }
.cust-pill input { accent-color:var(--primary); }
.cust-pill span { display:flex; flex-direction:column; }
.cust-pill small { font-size:10.5px; color:var(--muted); margin-top:2px; }
.cust-grid3 { display:grid; grid-template-columns:88px 1fr 1fr; gap:8px; }
.cust-grid2 { display:grid; grid-template-columns:88px 1fr; gap:8px; }
.cust-warning { display:flex; gap:7px; align-items:flex-start; background:var(--amber-soft); color:#8a5a10; border-radius:9px; padding:8px 10px; font-size:11px; line-height:1.5; margin:4px 0 2px; }
.cust-warning .nav-icon { flex:0 0 15px; margin-top:1px; }
.cust-generated { margin-top:12px; border-top:1px solid var(--line); padding-top:10px; }
.cust-gen-head { font-size:12.5px; font-weight:700; color:var(--ink); margin-bottom:8px; }
.cust-link-item { border:1px solid var(--line); border-radius:9px; padding:8px 10px; margin-bottom:6px; background:var(--primary-tint); }
.cli-line1 { display:flex; gap:6px; align-items:center; flex-wrap:wrap; font-size:12px; margin-bottom:5px; }
.cli-line2 { display:flex; gap:10px; align-items:center; flex-wrap:wrap; font-size:10.5px; color:var(--primary-deep); margin-bottom:6px; }
.cli-line2 .muted { color:var(--muted); }
.cli-ops { display:flex; gap:5px; flex-wrap:wrap; align-items:center; }
.cli-meta { font-size:10.5px; color:var(--muted); margin-right:auto; }

/* 自动生成的操作口令 */
.pwd-chip { border:1px dashed #b9a6ff; background:#fff; color:var(--primary-deep); border-radius:6px; padding:1px 7px; font:inherit; font-size:10.5px; cursor:pointer; }
.pwd-chip:hover { background:var(--primary-soft); }
/* 访问量 PV 占比条（替代折线图，仅表格内轻量展示） */
.pv-bar { height:4px; width:100%; max-width:180px; background:#ece8f7; border-radius:99px; margin-top:5px; overflow:hidden; }
.pv-bar i { display:block; height:100%; background:linear-gradient(90deg,#8b6bff,#6f4cff); border-radius:99px; }

/* ---------- 演示数据提示条 ---------- */
.notice-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 18px 30px -2px; padding: 11px 16px; border-radius: 12px;
  background: var(--lime-soft); border: 1px solid #dcf0b0; color: #4d6410; font-size: 12.5px;
}
.notice-bar .nb-text { flex: 1; min-width: 220px; }
.notice-bar b { font-weight: 700; }
.notice-bar .btn { flex: none; }
.notice-bar.is-warn { background: var(--amber-soft); border-color: #f7e2bd; color: #8a5a08; }
.badge.demo { background: #f1eaff; color: #6f4cff; border: 1px dashed #cbb8ff; }

/* ---------- 访问口令 ---------- */
.auth-mask {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center;
  background: radial-gradient(1200px 600px at 20% 0%, #33205f 0%, #1a1033 55%, #120a24 100%);
}
.auth-mask[hidden] { display: none; }
.auth-card {
  width: 360px; max-width: calc(100vw - 36px); padding: 32px 28px 26px;
  border-radius: 20px; background: rgba(255,255,255,.97);
  box-shadow: 0 30px 80px rgba(10, 5, 25, .45); text-align: center;
}
.auth-mark { width: 44px; height: 44px; margin: 0 auto 14px; color: var(--primary); }
.auth-mark svg { width: 100%; height: 100%; filter: drop-shadow(0 4px 12px rgba(111,76,255,.35)); }
.auth-card h2 { margin: 0 0 6px; font-size: 19px; letter-spacing: 1px; }
.auth-sub { margin: 0 0 18px; font-size: 12px; color: var(--muted); line-height: 1.7; }
.auth-card input {
  width: 100%; height: 42px; padding: 0 13px; border-radius: 10px;
  border: 1px solid var(--line); background: #fbfaff; font-size: 13.5px;
}
.auth-card input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(111,76,255,.12); }
.auth-error { min-height: 18px; margin: 8px 0 4px; font-size: 12px; color: var(--red); }
.auth-submit { width: 100%; height: 42px; justify-content: center; }
.sidebar-logout { margin-left: auto; color: #8e80b8; display: grid; place-items: center; }
.sidebar-logout:hover { color: #fff; }

/* ---------- 数据行操作 ---------- */
.row-actions { display: flex; gap: 6px; white-space: nowrap; }
.table-wrap td .btn-sm { padding: 4px 9px; font-size: 11px; }

/* ---------- 链接弹窗里的数据链接 ---------- */
.link-section { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line); }
.link-section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.link-section-head h4 { margin: 0; font-size: 13px; letter-spacing: .3px; }
.data-link-row {
  display: flex; align-items: center; gap: 8px; padding: 9px 11px; border-radius: 10px;
  background: var(--primary-tint); border: 1px solid var(--line-soft); margin-bottom: 8px;
}
.data-link-row .dl-main { flex: 1; min-width: 0; }
.data-link-row .dl-name { font-size: 12.5px; font-weight: 600; }
.data-link-row .dl-url { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- 设置页 ---------- */
.domain-preview {
  margin-top: 6px; padding: 9px 11px; border-radius: 9px; background: var(--primary-tint);
  border: 1px dashed var(--line); font-size: 11.5px; color: var(--ink-2); word-break: break-all;
}
.setting-sep { margin: 18px 0; border-top: 1px dashed var(--line); }

/* 应用卡片标题：状态浮到右上角，标题允许两行，避免长中文名被徽标挤压 */
.app-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.app-title { flex: 1; min-width: 0; }
.app-card h3 { padding-right: 58px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.app-card .status-float { position: absolute; top: 18px; right: 18px; z-index: 2; }
.app-card-top { margin-bottom: 13px; }
.app-card .app-slug { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 业务数据表列多，固定最小宽度并允许横向滚动，避免姓名被压成竖排 */
.data-table { min-width: 1380px; }
.data-table td { white-space: nowrap; }
.data-table td.content-preview { max-width: 220px; }

/* 卡片底部按钮：四列等宽，避免 7 个按钮换行后参差不齐 */
.app-card-foot { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.app-card-foot .btn { min-width: 0; padding: 7px 4px; font-size: 11px; gap: 4px; }
.app-card-foot .btn .nav-icon { width: 13px; height: 13px; flex-basis: 13px; }

/* 操作列固定在最右侧，横向滚动时仍可点到编辑/删除 */
.data-table th:last-child, .data-table td:last-child {
  position: sticky; right: 0; background: #fff; z-index: 1;
  box-shadow: -8px 0 14px rgba(26, 16, 51, .05);
}
.data-table tbody tr:hover td:last-child { background: var(--primary-tint); }
.app-card-foot .btn:last-child:nth-child(5) { grid-column: span 2; }
.notice-bar[hidden] { display: none; }

/* 待确认：用琥珀色和运行态区分，提醒人工核对 */
.badge.pending { background: var(--amber-soft); color: #9a6106; }

/* ---------- 清单同步 ---------- */
.sync-grid { display: grid; grid-template-columns: minmax(320px, .95fr) minmax(420px, 1.15fr); gap: 16px; align-items: start; }
.sync-editor {
  width: 100%; min-height: 300px; resize: vertical; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; background: #fbfaff; font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11.5px; line-height: 1.7; color: var(--ink-2); outline: none;
}
.sync-editor:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(111,76,255,.1); }
.sync-actions { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.sync-summary { display: flex; gap: 8px; flex-wrap: wrap; }
.sync-chip { padding: 4px 11px; border-radius: 20px; font-size: 11.5px; font-weight: 600; }
.sync-chip.add { background: var(--green-soft); color: #0b8d68; }
.sync-chip.upd { background: var(--amber-soft); color: #9a6106; }
.sync-chip.same { background: #f0eef5; color: #7a7490; }
.sync-chip.out { background: var(--primary-soft); color: var(--primary-deep); }
.sync-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
@media (max-width: 1100px) { .sync-grid { grid-template-columns: 1fr; } }
.sync-warn { margin-top: 5px; color: #9a6106; font-size: 10.5px; line-height: 1.6; }

/* 生成客户链接后的结果块：弹窗不关闭，先复制再关 */
.cust-result { border: 1px solid #c9f0dd; background: #f2fcf7; border-radius: 12px; padding: 13px 14px; margin-bottom: 16px; }
.cust-result-head { display: flex; align-items: center; gap: 6px; color: #0b8d68; font-size: 12.5px; font-weight: 700; margin-bottom: 10px; }
.cust-result-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.cust-result-label { flex: 0 0 58px; font-size: 11px; color: var(--muted); }
.cust-result-row .input-field { flex: 1; min-width: 0; height: 34px; font-size: 11.5px; }
.cust-secret { flex: 1; min-width: 0; font-family: "SFMono-Regular", Consolas, monospace; font-size: 14px; letter-spacing: 1px; color: var(--ink); }
.cust-result-hint { margin-top: 9px; font-size: 10.5px; line-height: 1.6; color: #8a6a1f; }
@media (max-width: 560px) { .cust-result-row { flex-wrap: wrap; } .cust-result-label { flex-basis: 100%; } }

/* 工具条下拉：单个控件，不再套一层带边框的容器 */
.toolbar-select { min-width: 150px; padding-right: 26px; }

/* ============================================================================
   站点部署页（#/sites）
   尺寸按需求文档 6.2：列表行高 32、控件高 32、区块间距 16；长域名一律单行截断。
   ============================================================================ */
.st-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.st-stat {
  position: relative; background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 16px; box-shadow: var(--shadow-sm); overflow: hidden;
}
.st-stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: #d9d1f5; }
.st-stat.tone-ok::before { background: var(--green); }
.st-stat.tone-idle::before { background: #b9b2cc; }
.st-stat.tone-warn::before { background: var(--amber); }
.st-stat span { display: block; font-size: 11px; color: var(--muted); letter-spacing: .2px; }
.st-stat strong { display: block; font-size: 22px; line-height: 1.3; letter-spacing: -.4px; margin-top: 2px; }
.st-stat em { display: block; font-style: normal; font-size: 10.5px; color: var(--muted); margin-top: 2px; }

.st-tabs { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.st-tabs-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.st-tabs .chip b { font-weight: 600; opacity: .7; margin-left: 2px; }

.st-table { table-layout: fixed; min-width: 1080px; }
.st-col-act { width: 216px; }
.st-table-sites th:nth-child(3) { width: 84px; }
.st-nowrap { white-space: nowrap; }
.st-check-code { display: inline-block; padding: 0 5px; border-radius: 5px; background: #f1eef7; color: var(--muted); font-size: 10px; }
.st-table th { height: 36px; }
.st-table td { height: 32px; padding-top: 7px; padding-bottom: 7px; line-height: 1.5; }
.st-table td.st-mono { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-addr { min-width: 0; }
.st-trunc { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: 11.5px; }
.st-dim { color: var(--muted); font-size: 11.5px; }
.st-warn-text { color: #b06a00; }
.st-clamp { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-tag {
  display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 6px;
  background: var(--primary-tint); color: var(--primary-deep); font-size: 10.5px; font-weight: 600;
  white-space: nowrap; flex: none;
}
.st-table th, .st-table td { word-break: keep-all; }
.badge.st-badge-ok { background: var(--green-soft); color: #0b7d5c; }
.badge.st-badge-danger { background: var(--red-soft); color: #c82f56; }
.badge.st-badge-trash { background: var(--amber-soft); color: #8a5a08; }
.st-btn-danger { background: #fff; border: 1px solid #f3c6d3; color: #c82f56; }
.st-btn-danger:hover { background: var(--red-soft); }

.st-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.st-dot.is-ok { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.st-dot.is-warn { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }
.st-dot.is-idle { background: #b9b2cc; box-shadow: 0 0 0 3px #f1eef7; }
.st-dot.is-busy { background: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.st-text { font-size: 12px; }
.st-table td .st-dim + .row-sub { font-size: 10px; }

/* 归档统计 */
.st-arch-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.st-arch-stats > div { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.st-arch-stats span { display: block; font-size: 10.5px; color: var(--muted); }
.st-arch-stats strong { display: block; font-size: 16px; margin-top: 1px; }

/* 导入向导 */
.st-import-step { display: flex; align-items: center; gap: 6px; margin-bottom: 16px; }
.st-step {
  flex: 1; display: flex; align-items: center; gap: 7px; height: 32px; padding: 0 10px;
  border-radius: 8px; background: #f7f5fc; color: var(--muted); font-size: 11.5px;
}
.st-step b { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: #e6e1f3; font-size: 10px; }
.st-step.active { background: var(--primary-soft); color: var(--primary-deep); font-weight: 600; }
.st-step.active b { background: var(--primary); color: #fff; }
.st-step.done { background: var(--green-soft); color: #0b7d5c; }
.st-step.done b { background: var(--green); color: #fff; }

.st-drop {
  display: flex; align-items: center; gap: 14px; padding: 16px; border: 1px dashed #d6cdf0;
  border-radius: 12px; background: #fbfaff; transition: border-color .18s, background .18s;
}
.st-drop.is-over { border-color: var(--primary); background: var(--primary-tint); }
.st-drop-icon { width: 38px; height: 38px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; flex: none; }
.st-drop strong { display: block; font-size: 13px; }
.st-drop .btn { margin-left: auto; }

.st-progress { height: 6px; border-radius: 99px; background: #ece8f7; overflow: hidden; margin: 12px 0 4px; }
.st-progress > div { height: 100%; background: linear-gradient(90deg, var(--primary), #8f6bff); transition: width .2s; }

.st-alert { margin-top: 12px; padding: 11px 13px; border-radius: 10px; background: #f7f5fc; font-size: 12px; line-height: 1.75; }
.st-alert.is-ok { background: var(--green-soft); color: #0b6b50; }
.st-alert.is-danger { background: var(--red-soft); color: #a32448; }
.st-alert.is-warn { background: var(--amber-soft); color: #7d5307; }
.st-alert strong { display: block; margin-bottom: 2px; }

.st-precheck { margin-top: 14px; border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; }
.st-precheck-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.st-precheck-head strong { font-size: 13.5px; }
.st-kv { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.st-kv > div { min-width: 0; display: flex; gap: 8px; align-items: baseline; }
.st-kv > div.full { grid-column: 1 / -1; }
.st-kv span { flex: none; width: 74px; font-size: 11px; color: var(--muted); }
.st-kv b { font-weight: 600; font-size: 12px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-kv-detail { margin-bottom: 6px; }
.st-issues { margin: 10px 0 0; padding-left: 18px; font-size: 11.5px; line-height: 1.8; color: #b03050; }
.st-issues.is-warn { color: #8a5a08; }
.st-issues li { margin-bottom: 2px; }

.st-h4 { margin: 18px 0 8px; font-size: 12.5px; letter-spacing: .2px; }
.st-timeline { display: flex; flex-direction: column; gap: 10px; }
.st-tl-item { display: flex; gap: 10px; align-items: flex-start; }
.st-tl-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--green); margin-top: 6px; }
.st-tl-dot.is-bad { background: var(--red); }
.st-tl-item b { font-size: 12px; }
.st-tl-item .st-dim { font-size: 11px; }

.st-maint .form-grid { max-width: 720px; }
.st-maint-foot { display: flex; align-items: center; gap: 12px; margin-top: 14px; }

@media (max-width: 1280px) {
  .st-stats, .st-arch-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 弹窗内的小表格：不继承列表的 1080 最小宽与固定布局 */
.st-table-flat { table-layout: fixed; min-width: 0; }
.st-table-flat th, .st-table-flat td { padding: 7px 8px; font-size: 11.5px; height: auto; }
.st-table-flat th { height: 30px; }
