:root {
  --brand: #ff385c;
  --brand-dark: #e31c5f;
  --brand-light: rgba(255, 56, 92, 0.1);
  --text: #222;
  --muted: #717171;
  --border: #e5e5e5;
  --bg: #f7f7f7;
  --card: #fff;
  --radius: 12px;
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--brand); text-decoration: none; }
button, input, select, textarea {
  font: inherit;
}

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

.sidebar {
  width: 220px;
  background: var(--card);
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  flex-shrink: 0;
}

.brand {
  font-size: 20px;
  font-weight: 700;
  color: var(--brand);
  margin-bottom: 32px;
  padding: 0 8px;
}

.nav a {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text);
  margin-bottom: 4px;
}
.nav a:hover { background: var(--bg); }
.nav a.active {
  background: var(--brand-light);
  color: var(--brand);
  font-weight: 600;
}

.main {
  flex: 1;
  padding: 24px 32px;
  overflow: auto;
}

.page-title {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 20px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 20px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
}
.stat {
  background: var(--bg);
  border-radius: 10px;
  padding: 16px;
}
.stat .num {
  font-size: 28px;
  font-weight: 700;
  color: var(--brand);
}
.stat .label {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

.toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  align-items: center;
}

input[type="text"],
input[type="number"],
input[type="password"],
input[type="url"],
select,
textarea {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  min-width: 120px;
}
textarea { width: 100%; min-height: 80px; resize: vertical; }

.btn {
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  cursor: pointer;
  background: var(--bg);
  color: var(--text);
}
.btn:hover { filter: brightness(0.97); }
.btn-primary {
  background: var(--brand);
  color: #fff;
}
.btn-primary:hover { background: var(--brand-dark); }
.btn-danger {
  background: #fff;
  color: #c62828;
  border: 1px solid #ffcdd2;
}
.btn-sm { padding: 4px 10px; font-size: 13px; }
.btn-link {
  background: none;
  border: none;
  color: var(--brand);
  cursor: pointer;
  padding: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; }
tr:hover td { background: #fafafa; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
}
.badge-ok { background: #e8f5e9; color: #2e7d32; }
.badge-off { background: #f5f5f5; color: #757575; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.form-field label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}
.form-field input,
.form-field select,
.form-field textarea { width: 100%; }

.section-title {
  font-size: 16px;
  font-weight: 600;
  margin: 24px 0 12px;
}

.pager {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 16px;
  font-size: 14px;
  color: var(--muted);
}

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #fff5f7, #fff);
}
.login-card {
  width: 360px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
}
.login-card h1 {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 24px;
}
.login-card p {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 14px;
}
.login-card .form-field { margin-bottom: 16px; }
.login-card .btn-primary { width: 100%; margin-top: 8px; }

.toast {
  position: fixed;
  top: 24px;
  right: 24px;
  background: #222;
  color: #fff;
  padding: 12px 20px;
  border-radius: 24px;
  font-size: 14px;
  z-index: 999;
  animation: fadeIn 0.2s;
}
.toast.err { background: #c62828; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-8px); } }

.chip-list { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: var(--brand-light);
  color: var(--brand);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  text-decoration: none;
}

.empty { text-align: center; color: var(--muted); padding: 40px; }

/* ---- 智能导入 · 导入记录卡片 ---- */
.imp-row {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 12px;
  background: #fff;
}
.imp-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.imp-id { color: var(--muted); font-size: 13px; }
.imp-inf { font-weight: 600; }
.imp-store a { font-weight: 600; }
.imp-time { margin-left: auto; color: var(--muted); font-size: 12px; }

.imp-detail { margin-top: 10px; }
.imp-links { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; font-size: 14px; }
.imp-links a { white-space: nowrap; }

.imp-block {
  background: var(--bg);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 8px;
}
.imp-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 6px;
  cursor: default;
}
details.imp-block summary.imp-label { cursor: pointer; }
.imp-reason { font-size: 14px; line-height: 1.6; color: var(--text); }
.imp-quote {
  color: var(--brand);
  font-size: 13px;
  margin-top: 6px;
  font-style: italic;
}
.imp-tip { font-size: 13px; color: var(--muted); margin-top: 8px; line-height: 1.6; }
.imp-line { font-size: 13px; color: var(--text); margin-top: 4px; }
.imp-line b { color: var(--muted); font-weight: 600; }
.imp-transcript {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
  max-height: 220px;
  overflow: auto;
  white-space: pre-wrap;
}

/* ---- 导入记录：进度条 / 待确认 / 删除 ---- */
.imp-row-review {
  border-color: #ffd54f;
  background: #fffdf5;
}
.imp-actions {
  margin-left: 12px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.imp-del {
  color: #c62828;
  font-size: 13px;
}
.badge-review {
  background: #fff3e0;
  color: #e65100;
}
.imp-progress {
  margin-top: 10px;
}
.imp-progress-track {
  height: 8px;
  background: #eee;
  border-radius: 999px;
  overflow: hidden;
}
.imp-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--brand-dark));
  border-radius: 999px;
  transition: width 0.6s ease;
}
.imp-bar.review {
  background: linear-gradient(90deg, #ffb300, #fb8c00);
}
.imp-progress-label {
  font-size: 12px;
  color: var(--muted);
  margin-top: 5px;
}
