/* ==========================================================================
   /feedback —— 独立意见反馈页（方案 A：双栏工作台）
   作用域 .fb-page，令牌取自 theme-xiaoyi.css 的黑白体系
   ========================================================================== */

.fb-page {
  --fb-card: #FFFFFF;
  --fb-soft: #F5F5F5;
  --fb-soft-2: #E8E8E8;
  --fb-gap: 16px;
  display: flex;
  flex-direction: column;
  gap: var(--fb-gap);
  min-width: 0;
}

:root[data-theme="dark"] .fb-page {
  --fb-card: #161616;
  --fb-soft: #1E1E1E;
  --fb-soft-2: #333333;
}

/* ---------- 页头 ---------- */
.fb-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 16px 20px;
  border: 0;
  border-radius: var(--r-card);
  background: var(--fb-card);
}
.fb-head__kicker {
  display: block;
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.fb-head h1 {
  margin: 4px 0 8px;
  color: var(--ink);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.01em;
}
.fb-head__lead {
  margin: 0;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.55;
}
.fb-head__stats {
  display: grid;
  grid-template-columns: repeat(2, 96px);
  gap: 8px;
  flex: none;
}
.fb-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 96px;
  min-width: 0;
  padding: 12px 16px;
  border-radius: var(--r-ctl);
  background: var(--fb-soft);
  text-align: center;
}
.fb-stat b {
  color: var(--ink);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.fb-stat span { color: var(--ink-2); font-size: 12px; line-height: 1.4; }

/* ---------- 通用卡片 / 标题 ---------- */
.fb-card {
  border: 0;
  box-shadow: none;
  border-radius: var(--r-card);
  background: var(--fb-card);
}
.fb-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
}
.fb-title::before {
  content: "";
  display: block;
  width: 4px;
  height: 14px;
  border-radius: 2px;
  background: var(--ink);
  flex: none;
}
.fb-title .fb-count { color: var(--ink-3); font-size: 12px; font-weight: 400; }

/* ---------- 按钮（压过 .shell button { color: inherit }） ---------- */
.fb-page .fb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--r-ctl);
  background: var(--fb-soft);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
}
.fb-page .fb-btn:hover { background: var(--fb-soft-2); }
.fb-page .fb-btn:disabled { opacity: .45; cursor: default; }
.fb-page .fb-btn--primary {
  background: var(--select-solid);
  color: var(--select-solid-ink);
}
.fb-page .fb-btn--primary:hover { background: var(--select-solid-hover); }
.fb-page .fb-btn--sm { height: 28px; padding: 0 11px; font-size: 12px; }
.fb-page .fb-btn .icon { width: 14px; height: 14px; }

/* ---------- 双栏 ---------- */
.fb-grid {
  display: grid;
  grid-template-columns: minmax(0, 400px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

/* ---------- 提交表单 ---------- */
.fb-form { padding: 16px 20px 18px; }
.fb-form__lead {
  margin: 8px 0 14px;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.6;
}
.fb-cats { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.fb-page .fb-cat {
  height: 30px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--fb-soft);
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
}
.fb-page .fb-cat:hover { background: var(--fb-soft-2); color: var(--ink); }
.fb-page .fb-cat[aria-pressed="true"] {
  background: var(--select-solid);
  color: var(--select-solid-ink);
  font-weight: 600;
}
.fb-page .fb-cat[aria-pressed="true"]:hover {
  background: var(--select-solid);
  color: var(--select-solid-ink);
}

.fb-fields { display: flex; flex-direction: column; gap: 10px; }
.fb-field {
  position: relative;
  border-radius: var(--r-ctl);
  background: var(--fb-soft);
}
.fb-field:focus-within { box-shadow: inset 0 0 0 1.5px var(--ink); }
.fb-page .fb-field input,
.fb-page .fb-field textarea {
  width: 100%;
  margin: 0;
  border: 0;
  border-radius: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.6;
  padding: 9px 12px;
}
.fb-page .fb-field input::placeholder,
.fb-page .fb-field textarea::placeholder { color: var(--ink-3); }
.fb-page .fb-field textarea { min-height: 108px; resize: vertical; display: block; }
.fb-field__count {
  position: absolute;
  right: 12px;
  bottom: 6px;
  color: var(--ink-3);
  font-size: 11px;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.fb-field--counted textarea { padding-bottom: 22px; }

.fb-form__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.fb-form__hint { color: var(--ink-3); font-size: 11.5px; line-height: 1.5; }
.fb-form__msg {
  margin: 10px 0 0;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}
.fb-form__msg[hidden] { display: none; }

/* ---------- 记录列表 ---------- */
.fb-listwrap { padding: 16px 20px 18px; }
.fb-listhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.fb-seg {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: var(--r-ctl);
  background: var(--fb-soft);
}
.fb-page .fb-seg button {
  height: 28px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--r-micro, 6px);
  background: transparent;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
}
.fb-page .fb-seg button:hover { background: var(--fb-soft-2); color: var(--ink); }
.fb-page .fb-seg button[aria-pressed="true"] {
  background: var(--select-solid);
  color: var(--select-solid-ink);
  font-weight: 600;
}
.fb-page .fb-seg button[aria-pressed="true"]:hover {
  background: var(--select-solid);
  color: var(--select-solid-ink);
}

.fb-item { padding: 14px 0; }
.fb-item + .fb-item { margin-top: 14px; }
.fb-item__top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.fb-item__title {
  margin: 0;
  min-width: 0;
  flex: 1;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fb-item.is-closed .fb-item__title { color: var(--ink-2); font-weight: 500; }
.fb-badge {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 9px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}
.fb-badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.fb-badge--pending { background: var(--fb-soft); color: var(--ink); }
.fb-badge--replied { background: var(--select-solid); color: var(--select-solid-ink); }
.fb-badge--closed { background: var(--fb-soft); color: var(--ink-3); }

.fb-item__meta {
  margin: 5px 0 0;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.5;
}
.fb-item__body {
  margin: 8px 0 0;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.fb-thread { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.fb-msg {
  padding: 8px 12px;
  border-radius: var(--r-micro, 6px);
  background: var(--fb-soft);
}
.fb-msg.is-admin { background: var(--fb-soft-2); }
.fb-msg__who {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.4;
}
.fb-msg__who b { color: var(--ink); font-weight: 600; }
.fb-msg__tx { margin: 3px 0 0; color: var(--ink-2); font-size: 12.5px; line-height: 1.6; }
.fb-item__foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.fb-append { display: flex; gap: 8px; margin-top: 10px; }
.fb-append .fb-field { flex: 1; }
.fb-page .fb-append .fb-field textarea { min-height: 64px; }

/* ---------- 空态 / 加载 ---------- */
.fb-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 40px 20px;
  text-align: center;
}
.fb-empty__ico {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-ctl);
  background: var(--fb-soft);
  color: var(--ink-2);
}
.fb-empty__ico .icon { width: 20px; height: 20px; }
.fb-empty h3 { margin: 4px 0 0; color: var(--ink); font-size: 13.5px; font-weight: 600; }
.fb-empty p { margin: 0; color: var(--ink-2); font-size: 12px; line-height: 1.6; }

.fb-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 40px 20px;
  color: var(--ink-2);
  font-size: 12.5px;
}
.fb-loading__bar {
  width: 120px;
  height: 3px;
  border-radius: 999px;
  background: var(--fb-soft);
  overflow: hidden;
}
.fb-loading__bar::after {
  content: "";
  display: block;
  width: 40%;
  height: 100%;
  background: var(--ink);
  animation: fb-bar 1.1s infinite ease-in-out;
}
@keyframes fb-bar {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

/* ---------- 归档条 / 分页 ---------- */
.fb-archive {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--r-ctl);
  background: var(--fb-soft);
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.5;
}
.fb-archive .icon { width: 14px; height: 14px; flex: none; }
.fb-archive .fb-btn { margin-left: auto; }

.fb-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.fb-pager__info { color: var(--ink-2); font-size: 12px; line-height: 1.4; }
.fb-pager__btns { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fb-page .fb-pager__btns button {
  height: 28px;
  min-width: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--r-micro, 6px);
  background: var(--fb-soft);
  color: var(--ink-2);
  font-size: 12px;
  cursor: pointer;
}
.fb-page .fb-pager__btns button:hover { background: var(--fb-soft-2); color: var(--ink); }
.fb-page .fb-pager__btns button[aria-current="page"] {
  background: var(--select-solid);
  color: var(--select-solid-ink);
  font-weight: 600;
}
.fb-page .fb-pager__btns button:disabled { opacity: .45; cursor: default; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .fb-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 560px) {
  .fb-head { align-items: flex-start; padding: 14px; }
  .fb-head__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .fb-stat { width: auto; }
  .fb-form { padding: 14px; }
  .fb-listwrap { padding: 14px; }
  .fb-item__title { white-space: normal; }
  .fb-append { flex-wrap: wrap; }
  .fb-append .fb-btn { width: 100%; }
  .fb-seg { width: 100%; }
  .fb-page .fb-seg button { flex: 1; padding: 0 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .fb-loading__bar::after { animation: none; }
}