/* 通知管理中心 - 样式（移动端优先，响应式） */
:root {
  --bg: #f5f7fa;
  --card: #ffffff;
  --ink: #1f2937;
  --ink-2: #6b7280;
  --line: #e5e7eb;
  --brand: #2563eb;
  --brand-ink: #ffffff;
  --danger: #dc2626;
  --ok: #16a34a;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
}

.topbar {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 16px 16px 12px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar h1 { margin: 0; font-size: 18px; }

.topbar-hint { font-size: 12px; color: var(--ink-2); }

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px;
}

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

.view-head h2 { margin: 0; font-size: 17px; }

.hidden { display: none !important; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 14px;
}

.card label,
.card label.row {
  display: flex;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}

input[type="text"],
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  margin-bottom: 4px;
}

input[type="text"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

textarea { resize: vertical; min-height: 120px; }

.field-hint { font-size: 12px; color: var(--ink-2); margin: 2px 0 12px; }

label.row {
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  margin-bottom: 0;
  padding: 6px 0;
}

label.row span { display: flex; flex-direction: column; }

label.row small { font-weight: 400; color: var(--ink-2); font-size: 12px; }

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}

.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: #1d4ed8; }

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}
.btn-ghost:hover { background: #f3f4f6; }

.btn-sm { padding: 6px 12px; font-size: 13px; }

/* 产品列表 */
.product-list { display: flex; flex-direction: column; gap: 10px; }

.product-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
}

.product-info { min-width: 0; }

.product-name { margin: 0 0 2px; font-size: 15px; }

.product-meta { margin: 0 0 4px; }

.product-meta code {
  font-size: 12px;
  background: #f3f4f6;
  border-radius: 4px;
  padding: 1px 6px;
  color: var(--ink-2);
}

.product-status { margin: 0; font-size: 12px; }
.product-status.enabled { color: var(--ok); }
.product-status.disabled { color: var(--ink-2); }

.empty { color: var(--ink-2); text-align: center; padding: 24px 0; }

/* 开关 */
.switch {
  appearance: none;
  width: 46px;
  height: 26px;
  border-radius: 13px;
  background: #d1d5db;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s;
}

.switch:checked { background: var(--brand); }
.switch:checked::after { transform: translateX(20px); }

/* 链接卡片 */
.link-card label { margin-bottom: 8px; }

.link-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.link-row code {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  word-break: break-all;
  background: #f3f4f6;
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--ink);
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: rgba(17, 24, 39, 0.92);
  color: #fff;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 14px;
  max-width: 88vw;
  z-index: 100;
}

.toast.error { background: rgba(220, 38, 38, 0.92); }

/* 桌面端微调 */
@media (min-width: 640px) {
  .topbar { padding: 18px 24px; }
  .topbar h1 { font-size: 20px; }
  .container { padding: 24px; }
  .card { padding: 20px; }
  .view-head h2 { font-size: 18px; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111827;
    --card: #1f2937;
    --ink: #f3f4f6;
    --ink-2: #9ca3af;
    --line: #374151;
  }
  .product-meta code, .link-row code { background: #374151; }
  .btn-ghost:hover { background: #374151; }
  .switch { background: #4b5563; }
  .toast { background: rgba(0, 0, 0, 0.85); }
}