/* ========== 基础 ========== */
:root {
  --primary: #3f74ff;
  --primary-soft: #eef2ff;
  --primary-line: #dbe4ff;
  --bg: #f4f6f9;
  --card: #ffffff;
  --line: #e6e9f0;
  --text: #24292f;
  --muted: #8a94a6;
  --danger: #d33;
  --radius: 10px;
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}
.hidden { display: none !important; }
.ipt {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  font-size: 14px;
  color: var(--text);
  background: #fafbfc;
  resize: none;
  outline: none;
  font-family: inherit;
  line-height: 1.5;
}
.ipt:focus {
  border-color: var(--primary);
  background: #fff;
}
.btn {
  border: none;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  padding: 10px 0;
  transition: opacity .15s;
  font-family: inherit;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--primary); color: #fff; }
.btn.ghost { background: var(--primary-soft); color: var(--primary); border: 1px solid var(--primary-line); }
.toast {
  position: fixed;
  left: 50%;
  bottom: 90px;
  transform: translateX(-50%);
  background: rgba(20, 26, 40, .88);
  color: #fff;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  max-width: 82%;
  text-align: center;
  z-index: 99;
  line-height: 1.5;
}
.toast.err { background: rgba(200, 48, 48, .92); }

/* ========== 侧边栏应用 ========== */
.app { display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  position: sticky;
  top: 0;
  background: #fff;
  border-bottom: 1px solid var(--line);
  z-index: 10;
}
.tabs { display: flex; }
.tab {
  flex: 1;
  padding: 13px 0 12px;
  text-align: center;
  background: none;
  border: none;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  position: relative;
  font-family: inherit;
  white-space: nowrap;
}
.tab.active { color: var(--primary); font-weight: 600; }
.tab.active::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 30px;
  height: 3px;
  border-radius: 2px;
  background: var(--primary);
}
.banner {
  margin: 10px 12px 0;
  padding: 8px 12px;
  border-radius: 8px;
  background: #fff7e6;
  border: 1px solid #ffe1a8;
  color: #a26b00;
  font-size: 12px;
  line-height: 1.6;
}
.content {
  flex: 1;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
}
.field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.field-label { font-size: 13px; font-weight: 600; }
.field-sub { font-size: 12px; color: var(--muted); }
.input-row { display: flex; gap: 8px; align-items: stretch; }
.input-row .grow { flex: 1; }
.btn.mini {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  padding: 0 10px;
  font-size: 13px;
  line-height: 1.4;
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid var(--primary-line);
}
.actionbar {
  position: sticky;
  bottom: 0;
  background: #fff;
  border-top: 1px solid var(--line);
  padding: 10px 12px 12px;
}
.bar-group { display: flex; gap: 10px; }
.bar-group .ghost { flex: 1; }
.bar-group .primary { flex: 1.4; }

/* ========== 后台管理 ========== */
.admin-body { background: var(--bg); }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card {
  width: 320px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px;
  text-align: center;
}
.login-card h1 { font-size: 18px; margin-bottom: 18px; }
.login-card .ipt { margin-bottom: 12px; text-align: left; }
.tip { font-size: 12px; color: var(--muted); margin-top: 12px; line-height: 1.6; }
.block-btn { width: 100%; }

.admin-wrap { display: flex; min-height: 100vh; }
.side {
  width: 180px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 16px 0;
}
.logo {
  font-size: 15px;
  font-weight: 700;
  padding: 0 18px 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}
.nav-item {
  display: block;
  padding: 11px 18px;
  font-size: 14px;
  color: #4b5563;
  cursor: pointer;
  text-decoration: none;
}
.nav-item:hover { background: #f5f7fb; }
.nav-item.active { color: var(--primary); background: var(--primary-soft); font-weight: 600; }
.nav-item.quit { color: var(--danger); margin-top: 10px; border-top: 1px solid var(--line); }
.main { flex: 1; padding: 24px; max-width: 860px; }
.view h2 { font-size: 18px; margin-bottom: 16px; }
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}
.panel h3 { font-size: 14px; margin-bottom: 12px; color: #111827; }
.panel label { display: block; font-size: 13px; color: #4b5563; margin-bottom: 10px; }
.panel .ipt { margin-top: 5px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.check { display: flex !important; align-items: center; gap: 6px; }
.check input { width: 16px; height: 16px; }
.small-btn { padding: 8px 18px; width: auto; }
.wide-btn { width: 100%; padding: 12px; }
.row-btns { display: flex; gap: 10px; }
.result-text { font-size: 12px; color: #16a34a; margin-left: 10px; }
.result-text.err { color: var(--danger); }
.list { display: flex; flex-direction: column; gap: 10px; }
.list-item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.li-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.li-head b { font-size: 14px; }
.li-ops a { font-size: 13px; color: var(--primary); cursor: pointer; margin-left: 12px; }
.li-ops a.danger { color: var(--danger); }
.li-body {
  font-size: 13px;
  color: #4b5563;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
}
.li-tag { font-size: 12px; color: var(--muted); margin-left: 8px; font-weight: 400; }
.empty { text-align: center; color: var(--muted); font-size: 13px; padding: 30px 0; }
.help ol { padding-left: 20px; font-size: 13px; color: #4b5563; line-height: 1.9; }
.help code {
  background: #f1f3f7;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
}
.help b { color: #111827; }

/* ========== 新增组件样式 ========== */
.bar-hint {
  flex: 1;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  padding: 8px 0;
}
.product-list { display: flex; flex-direction: column; gap: 8px; }
.product-item {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.product-item:hover {
  background: var(--primary-soft);
  border-color: var(--primary-line);
}
.pi-name { font-size: 14px; font-weight: 600; color: var(--text); }
.pi-name::before {
  content: "📋 ";
  margin-right: 4px;
}
.ticket-result {
  font-size: 14px;
  line-height: 1.8;
}
.tr-row {
  display: flex;
  gap: 8px;
  padding: 4px 0;
}
.tr-row span { color: var(--muted); min-width: 70px; }
.tr-row b { color: var(--text); font-weight: 500; }
.tag-done {
  background: #e6f7ed;
  color: #16a34a;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}
.tag-pending {
  background: #fff4e6;
  color: #d97706;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

@media (max-width: 720px) {
  .admin-wrap { flex-direction: column; }
  .side { width: 100%; border-right: none; border-bottom: 1px solid var(--line); padding: 0; }
  .side nav { display: flex; overflow-x: auto; }
  .logo { border-bottom: none; padding: 12px 16px 6px; }
  .nav-item { white-space: nowrap; }
  .nav-item.quit { border-top: none; margin: 0; }
  .main { padding: 14px; }
  .grid2 { grid-template-columns: 1fr; }
}
