:root {
  --bg: #faf9f5;
  --sidebar: #f0eee6;
  --surface: #ffffff;
  --surface-2: #f7f4ed;
  --border: #e6e1d5;
  --text: #1f1e1d;
  --muted: #6f6a61;
  --accent: #c96442;
  --accent-soft: #e8e2d3;
  --ok: #3d8b4f;
  --warn: #b26b1f;
  --script: #7a4fb0;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

.layout { display: flex; min-height: 100vh; }

/* ---- 左侧导航 ---- */
.sidebar {
  width: 232px;
  flex-shrink: 0;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 20px; }
.brand-dot {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--accent);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .35);
}
.brand-title { font-weight: 700; font-size: 16px; line-height: 1.2; }
.brand-sub { font-size: 12px; color: var(--muted); }

.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 9px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
}
.nav-item:hover { background: #e6e1d2; text-decoration: none; }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.coming-badge {
  font-size: 10px;
  color: var(--muted);
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  padding: 2px 8px;
}

.sidebar-foot { padding: 12px 8px 0; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }

/* ---- 主区域 ---- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 26px 28px 16px;
}

.topbar h1 { margin: 0; font-size: 24px; }
.subtitle { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.stats {
  font-size: 13px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px;
  white-space: nowrap;
}

.controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 4px 28px 18px;
}

input, select {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
}
input:focus, select:focus { outline: 2px solid rgba(201, 100, 66, .25); border-color: var(--accent); }
input#search { flex: 1 1 240px; }

/* ---- 表格 ---- */
.table-wrap { overflow-x: auto; padding: 0 28px 24px; }

.table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(31, 30, 29, .05);
}

.table th {
  text-align: left;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  background: var(--surface-2);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.table td {
  padding: 11px 14px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  vertical-align: middle;
}

.table tbody tr { cursor: pointer; }
.table tbody tr:hover { background: #f7f3ea; }

.cell-name { font-weight: 600; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.cell-path { color: var(--muted); font-size: 11px; margin-top: 2px; }
.desc-cell {
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}
.num-cell { text-align: right; font-variant-numeric: tabular-nums; }

.badge {
  font-size: 11px;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: var(--surface-2);
  white-space: nowrap;
  display: inline-block;
}
.b-version { color: var(--accent); border-color: #e4c8bb; background: #fbf2ed; }
.b-ok { color: var(--ok); border-color: #cfe3d3; background: #f1f8f2; }
.b-off { color: var(--warn); border-color: #ecd9bd; background: #fbf4e8; }
.b-script { color: var(--script); border-color: #dfd1ee; background: #f7f3fb; }
.b-asset { color: #2f7d5f; border-color: #cfe5da; background: #f1f8f4; }
.b-license { color: var(--muted); }
.b-file { color: var(--muted); }

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

footer {
  margin-top: auto;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 16px;
  border-top: 1px solid var(--border);
}

.hidden { display: none !important; }

/* ---- 详情弹窗 ---- */
.modal { position: fixed; inset: 0; z-index: 50; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(31, 30, 29, .45);
}
.modal-panel {
  position: relative;
  max-width: 720px;
  max-height: 82vh;
  margin: 8vh auto 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 26px 28px;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(31, 30, 29, .18);
}
.modal-close {
  position: absolute;
  top: 14px;
  right: 18px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 26px;
  cursor: pointer;
}
.modal-close:hover { color: var(--accent); }
.modal-panel h2 {
  margin: 0 0 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  word-break: break-all;
  padding-right: 36px;
  font-size: 20px;
}
.modal-path { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.modal-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.modal-desc { line-height: 1.6; font-size: 14px; }
.modal-panel h3 { margin: 20px 0 8px; font-size: 13px; color: var(--muted); }
.modal-files {
  margin: 0;
  padding-left: 20px;
  font-size: 12px;
  color: var(--muted);
  max-height: 260px;
  overflow-y: auto;
}
.modal-files li { margin: 3px 0; }
.modal-files .more { list-style: none; margin-left: -20px; color: var(--accent); }
