:root {
  --bg: #f3f1ec;
  --panel: rgba(255, 255, 255, 0.9);
  --paper: #fffefa;
  --line: #ded8cd;
  --line-soft: #ece7df;
  --text: #181816;
  --muted: #6f716b;
  --black: #111111;
  --blue: #72bdf0;
  --green: #58c49a;
  --amber: #f4bd60;
  --red: #ee6c73;
  --shadow: 0 24px 70px rgba(37, 33, 27, 0.11);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --font: "PingFang SC", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 8%, rgba(114, 189, 240, 0.16), transparent 28%),
    radial-gradient(circle at 90% 12%, rgba(88, 196, 154, 0.12), transparent 30%),
    var(--bg);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0;
}

button,
input,
textarea,
select {
  font: inherit;
  letter-spacing: 0;
}

button { border: 0; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.45; }

.shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 22px;
  min-height: 100vh;
  padding: 28px;
}

.sidebar {
  position: sticky;
  top: 28px;
  height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 34px;
}

.brand img {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  object-fit: cover;
}

.brand strong {
  display: block;
  font-size: 18px;
  font-weight: 520;
}

.brand span,
.version-card small,
.eyebrow,
.muted,
.hint {
  color: var(--muted);
}

.nav {
  display: grid;
  gap: 8px;
}

.nav button {
  height: 48px;
  padding: 0 16px;
  border-radius: 16px;
  color: #33342f;
  background: transparent;
  text-align: left;
  font-weight: 430;
}

.nav button.active {
  color: #fff;
  background: var(--black);
  box-shadow: 0 18px 34px rgba(17, 17, 17, 0.15);
}

.version-card {
  margin-top: auto;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--paper);
}

.version-card span,
.version-card small {
  display: block;
  line-height: 1.5;
}

.version-card strong {
  display: block;
  margin: 4px 0 8px;
  font-size: 26px;
  font-weight: 520;
}

.main { min-width: 0; }

.topbar,
.metric,
.panel,
.card,
.table-card,
.modal-card {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 116px;
  padding: 24px 28px;
  border-radius: var(--radius-xl);
  margin-bottom: 32px;
}

.eyebrow {
  display: block;
  margin-bottom: 4px;
  color: #4f8b55;
  font-size: 12px;
  font-weight: 520;
}

h1,
h2,
h3,
p { margin: 0; }

h1 { font-size: 30px; font-weight: 520; }
h2 { font-size: 22px; font-weight: 520; }
h3 { font-size: 16px; font-weight: 520; }

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(244, 243, 239, 0.78);
}

.top-actions input {
  width: 270px;
  height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 16px;
  outline: none;
  background: #fff;
}

.primary,
.soft,
.danger,
.ghost {
  min-height: 42px;
  padding: 0 17px;
  border-radius: 15px;
  font-weight: 480;
}

.primary { color: #fff; background: var(--black); }
.soft { color: #222; background: #ecece7; }
.ghost { color: #222; background: transparent; border: 1px solid var(--line); }
.danger { color: #fff; background: var(--red); }

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 0 0 32px 0;
}

.metric {
  position: relative;
  min-height: 130px;
  padding: 22px;
  border-radius: var(--radius-lg);
}

.metric::before {
  content: "";
  display: block;
  width: 38px;
  height: 5px;
  margin-bottom: 16px;
  border-radius: 99px;
  background: var(--blue);
}

.metric:nth-child(2)::before { background: var(--green); }
.metric:nth-child(3)::before { background: var(--amber); }
.metric:nth-child(4)::before { background: #9b86ff; }

.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 430;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 32px;
  font-weight: 520;
}

.metric small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.5;
}

.view { display: none; }
.view.active { display: block; }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.panel {
  padding: 24px;
  border-radius: var(--radius-xl);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.card {
  padding: 20px;
  border-radius: var(--radius-lg);
}

.project-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-height: 190px;
}
.project-card-body { flex: 1 1 auto; min-width: 0; }
.project-card .project-logo { flex: 0 0 auto; }

.project-entry {
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.project-entry:hover,
.project-entry:focus {
  transform: translateY(-2px);
  border-color: #c7bdaa;
  outline: none;
  box-shadow: 0 18px 36px rgba(20, 20, 18, 0.08);
}

.project-card-body {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 8px;
}

.project-percent {
  font-size: 28px;
  font-weight: 520;
  white-space: nowrap;
}

.project-progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.project-progress-row .progress {
  flex: 1;
}

.code {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid #cfdfe8;
  border-radius: 14px;
  color: #4a6a80;
  background: #f5fbff;
  font-weight: 520;
}

/* 项目图标：项目卡占位 / 备份卡标题旁 / 后台卡顶部 */
.project-logo {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid var(--line-soft);
}
.project-logo-sm {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  object-fit: cover;
}
.project-logo-md {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
  margin-bottom: 6px;
}

/* 编辑表单里的当前图标预览 */
.logo-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}
.logo-preview img {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid var(--line);
}
.logo-preview button { min-height: 32px; padding: 0 12px; font-size: 12px; }

.card-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.card-title h3 { line-height: 1.35; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  color: #37513e;
  background: #e9f8ee;
  font-size: 12px;
  font-weight: 480;
  white-space: nowrap;
}

.chip.warn { color: #754b06; background: #fff1d7; }
.chip.red { color: #8f2931; background: #ffe6e8; }
.chip.blue { color: #23618f; background: #e4f3ff; }
.chip.gray { color: #60615d; background: #ecece7; }

.progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #ecece8;
}

.progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--blue));
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.backup-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.backup-card {
  display: grid;
  gap: 10px;
  padding: 16px;
}
.backup-card .card-title h3 { font-size: 14.5px; line-height: 1.35; }
.backup-card .repo-meta-grid { gap: 8px; }
.backup-card .repo-meta { padding: 8px 10px; }
.backup-card .repo-meta span { font-size: 11px; }
.backup-card .repo-meta strong { font-size: 12px; }
.backup-card pre { font-size: 11px; padding: 10px 40px 10px 10px; max-height: 220px; }
.backup-card .copy-icon { width: 28px; height: 28px; font-size: 14px; }
.backup-card .repo-actions { gap: 6px; }

@media (max-width: 1180px) {
  .backup-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .backup-grid { grid-template-columns: 1fr; }
}

.repo-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.repo-meta {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.64);
}

.repo-meta span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

.repo-meta strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 520;
}

.repo-empty {
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.58);
}

.repo-info-block {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fbfaf6;
}

.repo-info-block pre {
  margin: 0;
  max-height: 360px;
  overflow: auto;
  padding: 18px 54px 18px 18px;
  white-space: pre-wrap;
  word-break: break-word;
  font: 12px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.copy-icon {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 10px;
  font-size: 18px;
  line-height: 1;
}

.repo-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.more-menu {
  position: relative;
  margin-left: auto;
}

.more-trigger {
  width: 38px;
  min-height: 38px;
  padding: 0;
  font-size: 18px;
  letter-spacing: 2px;
  line-height: 1;
  border-radius: 12px;
}

.more-dropdown {
  position: absolute;
  right: 0;
  bottom: calc(100% + 6px);
  z-index: 5;
  display: grid;
  gap: 4px;
  min-width: 140px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: 0 18px 36px rgba(20, 20, 18, 0.14);
}
.more-dropdown[hidden] { display: none; }

.more-dropdown button {
  width: 100%;
  min-height: 36px;
  padding: 0 12px;
  text-align: left;
  font-size: 13px;
  border-radius: 10px;
}

.table-card {
  overflow: hidden;
  border-radius: var(--radius-xl);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 520;
}

td { line-height: 1.45; }

tr:last-child td { border-bottom: 0; }

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: #ecece7;
  color: #333;
  font-weight: 460;
}

.pill.active {
  color: #fff;
  background: var(--black);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
}

.field.full { grid-column: 1 / -1; }

.field span,
.field label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 12px 14px;
  color: var(--text);
  background: #fff;
  outline: none;
}

.field textarea {
  min-height: 110px;
  resize: vertical;
}

.check-row {
  display: grid;
  grid-template-columns: 28px 1.15fr 0.85fr 0.85fr 1fr;
  gap: 10px;
  align-items: center;
}

.check-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.checklist-view {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

/* 分组标题 */
.check-group-head {
  margin: 16px 0 2px;
  padding: 0 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.check-group-head:first-child { margin-top: 4px; }

.check-item {
  display: grid;
  grid-template-columns: 22px 22px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  transition: opacity 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

/* 勾选完成：淡绿底 + 名称略灰 */
.check-item.checked {
  background: #f1faf4;
  border-color: #cdeede;
}
.check-item.checked .check-heading strong { color: var(--muted); }

.check-box {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  cursor: pointer;
  accent-color: var(--green);
}

.check-handle {
  display: grid;
  place-items: center;
  align-self: start;
  margin-top: 2px;
  height: 20px;
  color: var(--muted);
  font-size: 18px;
  letter-spacing: -3px;
  cursor: grab;
  user-select: none;
  -webkit-user-drag: none;
}
.check-handle:active { cursor: grabbing; }

.check-item.dragging { opacity: 0.35; }
.check-item.drop-above { box-shadow: inset 0 3px 0 var(--blue); }
.check-item.drop-below { box-shadow: inset 0 -3px 0 var(--blue); }

.check-main {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.check-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.check-heading strong {
  font-weight: 520;
}

.check-control input,
.check-note {
  width: 100%;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  outline: none;
}

.check-note {
  color: var(--muted);
}

.check-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.check-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.check-edit {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  transition: background 0.12s ease, color 0.12s ease, transform 0.12s ease;
}
.check-edit:hover { background: #ecece7; color: var(--text); }
.check-edit:active { transform: scale(0.94); }

.check-add {
  display: block;
  width: 100%;
  margin-top: 10px;
  min-height: 46px;
  border-radius: 16px;
  border: 1.5px dashed var(--line);
  background: transparent;
  color: var(--muted);
  font-weight: 480;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.check-add:hover { background: rgba(255,255,255,0.7); color: var(--text); border-color: #c7bdaa; }

/* 系统设置里只读字段（点编辑前的展示态） */
.readonly-field {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.64);
}
.readonly-field > span {
  color: var(--muted);
  font-size: 12px;
}
.readonly-field > strong {
  font-size: 14px;
  font-weight: 480;
  color: var(--text);
  word-break: break-all;
}

/* 在 panel header 里放 ✎ 按钮时，给点视觉重量 */
.section-head .check-edit {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 16px;
}

/* 通用卡片：网格 + 内容直显 + 底部宽复制按钮 */
.content-card {
  display: flex;
  flex-direction: column;
  min-height: 220px;
}

.content-card .card-actions-inline {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

.content-card .card-note {
  margin-top: 6px;
  font-size: 13px;
}

.card-content {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: #fbfaf6;
  max-height: 240px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--text);
  flex: 1 1 auto;
}

.card-copy-btn {
  width: 100%;
  min-height: 42px;
  margin-top: auto;
}

/* 应用后台：竖向长方形卡片，上半显示名称，下半三个动作按钮 */
.backend-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 1180px) {
  .backend-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .backend-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.backend-card {
  position: relative;
  padding: 0;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.backend-card-head {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 14px 12px;
  text-align: center;
}

.backend-name {
  font-size: 15px;
  font-weight: 520;
  color: var(--text);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.backend-card-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  border-top: 1px solid var(--line-soft);
}

.backend-action {
  width: 100%;
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: #ecece7;
  color: #222;
  font-size: 12px;
  font-weight: 460;
  cursor: pointer;
  text-align: center;
  transition: background 0.12s ease, color 0.12s ease, transform 0.08s ease;
}
.backend-action:hover:not(:disabled) { background: #ded8cd; }
.backend-action:active:not(:disabled) { transform: scale(0.97); background: #c7bdaa; }
.backend-action:disabled {
  background: transparent;
  border: 1px dashed var(--line);
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.6;
}
.backend-action.copied { background: var(--green) !important; color: #fff !important; }

.backend-edit-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  background: transparent;
  border: 0;
  width: 28px;
  height: 28px;
  color: var(--muted);
}
.backend-edit-btn:hover { background: #ecece7; border: 1px solid var(--line); color: var(--text); }

/* 左上角小项目代号，区分这个后台属于哪个项目 */
.backend-code {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 10px;
  font-weight: 520;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.04);
  padding: 3px 7px;
  border-radius: 6px;
  letter-spacing: 0.4px;
}

/* 输入框右侧 inline 操作图标（密码显示/复制等） */
.input-with-action {
  position: relative;
  display: block;
}
.input-with-action input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 12px 14px;
  padding-right: 84px;  /* 给 2 个图标留位 */
  color: var(--text);
  background: #fff;
  outline: none;
}
.input-with-action .inline-action {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 15px;
  cursor: pointer;
  color: var(--muted);
  border-radius: 8px;
}
.input-with-action .inline-action:hover { background: #ecece7; color: var(--text); }
.input-with-action .inline-action:nth-of-type(1) { right: 8px; }
.input-with-action .inline-action:nth-of-type(2) { right: 44px; }

/* 复制成功时的按钮反馈：临时变绿 */
.copied,
button.copied {
  background: var(--green) !important;
  color: #fff !important;
  border-color: var(--green) !important;
  transition: background 0.12s ease, color 0.12s ease;
}

/* 项目卡：平台 chip + 简介 */
.project-meta-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 2px;
}
.project-intro {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.check-toggle input {
  width: 18px;
  height: 18px;
}

.template-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.35fr) minmax(110px, 0.55fr) minmax(140px, 0.75fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid var(--line-soft);
}

.template-row:last-child {
  border-bottom: 0;
}

.mini-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  white-space: nowrap;
}

.modal[hidden],
.toast[hidden] { display: none; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(24, 24, 22, 0.36);
  backdrop-filter: blur(5px);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(980px, calc(100vw - 42px));
  max-height: calc(100vh - 42px);
  overflow: auto;
  margin: 21px auto;
  padding: 28px;
  border-radius: 28px;
  background: var(--paper);
}

.icon-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: #ecece7;
  font-size: 24px;
}

#modalTitle { padding-right: 42px; margin-bottom: 18px; }
#modalFooter {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.toast {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 30;
  max-width: 420px;
  padding: 14px 18px;
  border-radius: 16px;
  color: #fff;
  background: var(--black);
  box-shadow: var(--shadow);
}

.empty {
  display: grid;
  place-items: center;
  min-height: 210px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.58);
  text-align: center;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.copy-block {
  white-space: pre-wrap;
  word-break: break-word;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8f6f1;
  line-height: 1.55;
}

@media (max-width: 1180px) {
  .metrics,
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .check-row { grid-template-columns: 28px 1fr; }
  .template-row { grid-template-columns: 1fr 130px 1fr auto auto; }
}

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; padding: 16px; }
  .sidebar { position: static; height: auto; }
  .topbar,
  .top-actions { flex-direction: column; align-items: stretch; }
  .top-actions input { width: 100%; }
  .metrics,
  .card-grid,
  .form-grid { grid-template-columns: 1fr; }
  .check-item { grid-template-columns: 22px 22px minmax(0, 1fr); }
  .template-row { grid-template-columns: 1fr; }
}

/* ============ 手机版（≤ 760px）：底部 tab bar + 单列 + 弹窗近全屏 ============ */
@media (max-width: 760px) {
  body { padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }

  .shell {
    display: block;
    padding: 10px 10px 0;
    gap: 0;
  }

  /* 侧边栏改成 fixed 底部 tab bar；隐藏 brand 和 version-card */
  .sidebar .brand,
  .sidebar .version-card { display: none; }
  .sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    height: auto;
    margin: 0;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 10;
    box-shadow: 0 -8px 24px rgba(20, 20, 18, 0.06);
  }
  .nav {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
  }
  .nav button {
    height: 52px;
    padding: 6px 4px;
    border-radius: 12px;
    font-size: 10px;
    text-align: center;
    line-height: 1.2;
    background: transparent;
    color: var(--muted);
    font-weight: 460;
    box-shadow: none;
  }
  .nav button.active {
    color: var(--text);
    background: rgba(0, 0, 0, 0.06);
    box-shadow: none;
  }

  /* topbar 紧凑：标题 + 按钮一行；搜索独占第二行 */
  .topbar {
    flex-direction: column;
    align-items: stretch;
    min-height: 0;
    padding: 14px 16px;
    margin-bottom: 16px;
    gap: 12px;
  }
  .topbar > div:first-child {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  .topbar h1 { font-size: 22px; }
  .topbar .eyebrow { font-size: 11px; margin-bottom: 0; }
  .top-actions {
    flex-direction: row;
    flex-wrap: wrap;
    padding: 6px;
    gap: 6px;
  }
  .top-actions input {
    flex: 1 1 100%;
    width: 100%;
    height: 40px;
    padding: 0 14px;
  }
  .top-actions button {
    flex: 1 1 0;
    min-height: 40px;
    padding: 0 12px;
    font-size: 13px;
  }

  /* 卡片网格：单列 / 双列 */
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
  .metric { min-height: 90px; padding: 14px; }
  .metric strong { font-size: 22px; }
  .card-grid,
  .backup-grid,
  .form-grid { grid-template-columns: 1fr !important; }
  .backend-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

  /* 项目卡精简 */
  .project-card { min-height: auto; }
  .project-percent { font-size: 22px; }

  /* 备份卡精简 */
  .backup-card { padding: 14px; }
  .backup-card .repo-meta-grid { grid-template-columns: 1fr 1fr; }

  /* 通用卡片 */
  .content-card { min-height: 200px; }
  .card-content { max-height: 180px; }

  /* 弹窗近全屏 */
  .modal-card {
    width: calc(100vw - 12px);
    max-width: 100vw;
    max-height: calc(100vh - 12px);
    margin: 6px;
    padding: 20px;
    border-radius: 22px;
  }
  #modalTitle { font-size: 18px; padding-right: 40px; margin-bottom: 14px; }
  .icon-close { top: 14px; right: 14px; }

  /* 检查项更紧凑 */
  .check-item { padding: 12px; gap: 10px; }
  .check-handle { font-size: 16px; }
  .check-index { width: 36px; height: 36px; font-size: 13px; }

  /* readonly-field 字号 */
  .readonly-field { padding: 10px 12px; }
  .readonly-field > strong { font-size: 13px; }
}

/* ---------- 工作日志（备忘录式：文本块 + 待办块）---------- */
.log-list { display: flex; flex-direction: column; gap: 18px; max-width: 760px; }
.log-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 20px 22px; box-shadow: 0 14px 40px rgba(37, 33, 27, 0.06); }
.log-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.log-date { font-size: 16px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 10px; }
.log-prog { font-size: 12px; font-weight: 600; color: #2c9d76; background: #eef9f3; border: 1px solid #cdeede; padding: 2px 9px; border-radius: 999px; }
.log-del-btn { border: none; background: transparent; cursor: pointer; font-size: 15px; opacity: .5; padding: 4px 7px; border-radius: 8px; }
.log-del-btn:hover { opacity: 1; background: #faecec; }
.log-blocks { display: flex; flex-direction: column; gap: 2px; }
.log-block { display: flex; align-items: flex-start; gap: 8px; padding: 3px 6px; border-radius: 9px; }
.log-block:hover { background: #faf8f3; }
.log-block .block-del { margin-left: auto; align-self: center; border: none; background: transparent; cursor: pointer;
  color: var(--muted); font-size: 12px; opacity: 0; padding: 2px 7px; border-radius: 6px; }
.log-block:hover .block-del { opacity: .55; }
.log-block .block-del:hover { opacity: 1; color: var(--red); }
.log-block.text textarea { flex: 1; min-width: 0; border: none; background: transparent; resize: none; overflow: hidden;
  font: inherit; font-size: 15px; line-height: 1.65; color: var(--text); padding: 4px 4px; }
.log-block.text textarea:focus { outline: none; }
.log-block.text textarea::placeholder, .log-block .todo-text::placeholder { color: #b3aea3; }
.log-block.todo { align-items: center; }
.log-block.todo input[type="checkbox"] { width: 19px; height: 19px; accent-color: var(--green); cursor: pointer; flex: 0 0 auto; }
.log-block .todo-text { flex: 1; min-width: 0; border: none; background: transparent; font: inherit; font-size: 15px; color: var(--text); padding: 4px 4px; }
.log-block .todo-text:focus { outline: none; }
.log-block.todo.is-done .todo-text { text-decoration: line-through; color: var(--muted); }
.log-add { display: flex; gap: 10px; margin-top: 12px; padding-top: 14px; border-top: 1px dashed var(--line-soft); }
.log-add .soft { min-height: 34px; padding: 0 14px; font-size: 13px; }

/* ---------- 通用管理：卡片附件 ---------- */
.card-atts { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
.att-chip { display: inline-flex; align-items: center; max-width: 100%; gap: 2px; font-size: 12.5px; color: var(--text);
  background: #f3f1ea; border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; transition: background .15s; }
.att-chip:hover { background: #ece8df; }
.att-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
/* 编辑弹窗里的附件区 */
.att-field .att-list { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 12px; }
.att-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.att-link { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1; color: var(--text); font-size: 14px; }
.att-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-link em { flex: 0 0 auto; margin-left: auto; color: var(--muted); font-style: normal; font-size: 12px; }
.att-del { flex: 0 0 auto; width: 28px; height: 28px; border: none; background: transparent; color: var(--muted); cursor: pointer; border-radius: 8px; font-size: 13px; }
.att-del:hover { background: #faecec; color: var(--red); }
.att-empty { font-size: 13px; padding: 6px 2px; }
.att-add { display: inline-flex; align-items: center; cursor: pointer; }
.att-add input[type="file"] { display: none; }
.att-add span { display: inline-flex; align-items: center; min-height: 38px; padding: 0 16px; border-radius: 11px;
  background: #ecece7; color: #222; font-size: 13px; font-weight: 500; transition: background .15s; }
.att-add span:hover { background: #e2e1da; }
.att-hint { font-size: 12px; margin-top: 8px; }

/* ---------- 资产管理：硬件 / 软件 / 账号手工台账 ---------- */
.asset-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.asset-tabs .pill span {
  margin-left: 6px;
  opacity: .72;
  font-size: 12px;
}
.asset-type-fields {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.asset-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.asset-card {
  min-height: 250px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.asset-card .card-title h3 {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.35;
  word-break: break-word;
}
.asset-icon {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  color: #275a76;
  background: #e4f3ff;
  font-size: 14px;
  font-weight: 600;
}
.asset-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.asset-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.asset-meta div {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  background: rgba(255,255,255,.62);
}
.asset-meta span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
}
.asset-meta strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 12.5px;
  font-weight: 480;
}
.asset-note {
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  background: #fbfaf6;
  color: var(--muted);
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.asset-link {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: 12px;
  color: #222;
  background: #ecece7;
  font-weight: 480;
}
.asset-link:hover { background: #e2e1da; }

@media (max-width: 1180px) {
  .asset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .asset-grid,
  .asset-meta,
  .asset-type-fields { grid-template-columns: 1fr; }
}
