:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --line: #dbe1ea;
  --text: #172033;
  --muted: #667085;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --danger: #dc2626;
  --ok: #16a34a;
  --warn: #d97706;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Microsoft YaHei", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}
button, input, select, textarea {
  font: inherit;
}
button {
  border: 0;
  border-radius: 6px;
  background: var(--primary);
  color: white;
  padding: 8px 12px;
  cursor: pointer;
}
button:hover { background: var(--primary-dark); }
button.secondary { background: #eef2f7; color: var(--text); }
button.danger { background: var(--danger); }
button.small { padding: 5px 8px; font-size: 12px; }
button:disabled { opacity: .5; cursor: not-allowed; }
.hidden { display: none !important; }
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #eef2ff, #f8fafc);
}
.login-panel {
  width: min(420px, calc(100vw - 32px));
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, .12);
}
.login-panel h1 { margin: 0 0 6px; font-size: 26px; }
.login-panel p { margin: 0 0 20px; color: var(--muted); }
label { display: grid; gap: 6px; margin: 10px 0; color: #344054; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  background: white;
  color: var(--text);
}
textarea { min-height: 84px; resize: vertical; }
.login-panel button { width: 100%; margin-top: 12px; }
.hint { color: var(--muted); font-size: 12px; margin-top: 12px; }
.app { min-height: 100vh; display: grid; grid-template-columns: 220px 1fr; }
.sidebar {
  background: #111827;
  color: white;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
}
.brand { padding: 18px 16px; font-weight: 700; border-bottom: 1px solid rgba(255,255,255,.1); }
#nav { padding: 10px; display: grid; gap: 4px; align-content: start; }
.nav-item {
  text-align: left;
  background: transparent;
  color: #d1d5db;
  border-radius: 6px;
}
.nav-item.active, .nav-item:hover { background: #263244; color: white; }
.userbar {
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,.1);
  display: grid;
  gap: 8px;
  color: #d1d5db;
  font-size: 13px;
}
.userbar button { background: #374151; }
.main { min-width: 0; }
.topbar {
  height: 64px;
  background: white;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}
.topbar h2 { margin: 0; font-size: 22px; }
.content { padding: 20px; display: grid; gap: 16px; }
.grid { display: grid; gap: 12px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}
.card h3 { margin: 0 0 12px; font-size: 17px; }
.metric .label { color: var(--muted); font-size: 13px; }
.metric .value { margin-top: 6px; font-size: 26px; font-weight: 700; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
th, td {
  text-align: left;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th { background: #f8fafc; color: #475467; font-weight: 600; }
tr:last-child td { border-bottom: 0; }
.tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  background: #eef2f7;
  color: #344054;
}
.tag.ok { background: #dcfce7; color: #166534; }
.tag.warn { background: #fef3c7; color: #92400e; }
.tag.danger { background: #fee2e2; color: #991b1b; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.form-grid .wide { grid-column: 1 / -1; }
.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .45);
  display: grid;
  place-items: start center;
  padding: 48px 18px;
  overflow: auto;
}
.modal-card {
  width: min(880px, 100%);
  background: white;
  border-radius: 8px;
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(15, 23, 42, .22);
}
.modal-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-head h3 { margin: 0; }
#modalBody { padding: 16px; }
#modalClose { background: #eef2f7; color: var(--text); }
.template {
  background: #111827;
  color: #e5e7eb;
  border-radius: 6px;
  padding: 10px;
  white-space: pre-wrap;
  font-family: Consolas, monospace;
  font-size: 12px;
}
.thumbs { display: flex; gap: 10px; flex-wrap: wrap; }
.thumbs img { width: 130px; height: 96px; object-fit: cover; border: 1px solid var(--line); border-radius: 6px; }
.muted { color: var(--muted); }
.notice { padding: 10px 12px; background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 6px; color: #1e40af; }
.detail-hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  background: #111827;
  color: white;
  border-radius: 8px;
  padding: 18px;
}
.detail-hero h3 { margin: 0 0 8px; font-size: 24px; }
.detail-hero p { margin: 4px 0; color: #d1d5db; }
.detail-section {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.detail-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
}
.detail-section-body { padding: 14px; }
.info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.info-item {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: #fcfcfd;
}
.info-label { display: block; color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.info-value { font-weight: 600; word-break: break-word; }
.price-value { color: var(--primary); font-size: 18px; }
.detail-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}
.detail-tab {
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  border-right: 1px solid var(--line);
}
.detail-tab.active {
  color: var(--primary);
  background: white;
}
.detail-pane { display: none; padding: 14px; }
.detail-pane.active { display: block; }
.screenshot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.screenshot-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #f8fafc;
}
.screenshot-card img {
  display: block;
  width: 100%;
  height: 110px;
  object-fit: cover;
}
.upload-box {
  border: 1px dashed #94a3b8;
  border-radius: 6px;
  padding: 18px;
  display: grid;
  gap: 8px;
  place-items: center;
  min-height: 110px;
  background: #f8fafc;
}
.log-list { display: grid; gap: 8px; }
.log-row {
  display: grid;
  grid-template-columns: 170px 120px 1fr;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.click-link {
  color: var(--primary);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { min-height: auto; }
  .grid.cols-2, .grid.cols-3, .grid.cols-4, .form-grid, .info-grid, .log-row { grid-template-columns: 1fr; }
  .topbar { height: auto; gap: 10px; align-items: flex-start; padding: 14px; flex-direction: column; }
}
