/* ============================================================
   翻篇小说 · 组件层
   按钮 / 表单 / 标签 / 书籍卡片 / 列表 / 评分 / 弹层
   纯文字卡片，不使用封面图
   ============================================================ */

/* ---------- 按钮 ---------- */

.fp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: var(--fp-coral);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .02em;
  white-space: nowrap;
  transition: background .2s var(--fp-ease),
    color .2s var(--fp-ease), border-color .2s var(--fp-ease);
}

.fp-btn:hover {
  background: var(--fp-coral-deep);
  color: #fff;
}

.fp-btn:active {
  transform: translateY(0);
}

.fp-btn--ghost {
  background: transparent;
  border-color: var(--fp-line-strong);
  color: var(--fp-ink-2);
}

.fp-btn--ghost:hover {
  border-color: var(--fp-coral);
  background: var(--fp-coral-soft);
  color: var(--fp-coral-deep);
  box-shadow: none;
}

.fp-btn--soft {
  background: var(--fp-mint-soft);
  color: var(--fp-mint-deep);
}

.fp-btn--soft:hover {
  background: #dcefe2;
  color: var(--fp-mint-deep);
  box-shadow: none;
}

.fp-btn--sm {
  min-height: 34px;
  padding: 0 15px;
  font-size: 13px;
}

.fp-btn--block {
  width: 100%;
}

.fp-btn[disabled],
.fp-btn.is-disabled {
  opacity: .5;
  pointer-events: none;
}

.fp-link-btn {
  border: 0;
  background: none;
  padding: 0;
  color: var(--fp-muted);
  font-size: 13px;
  transition: color .2s var(--fp-ease);
}

.fp-link-btn:hover {
  color: var(--fp-coral-deep);
}

/* ---------- 表单 ---------- */

.fp-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.fp-field > label,
.fp-label {
  color: var(--fp-ink-2);
  font-size: 13px;
  font-weight: 500;
}

.fp-input,
.fp-textarea,
.fp-select {
  width: 100%;
  height: 46px;
  padding: 0 16px;
  border: 1px solid var(--fp-line);
  border-radius: 4px;
  background: var(--fp-surface);
  font-size: 14px;
  outline: none;
  transition: border-color .2s var(--fp-ease), box-shadow .2s var(--fp-ease);
}

.fp-textarea {
  height: auto;
  min-height: 120px;
  padding: 13px 16px;
  resize: vertical;
}

.fp-input:focus,
.fp-textarea:focus,
.fp-select:focus {
  border-color: var(--fp-coral);
  box-shadow: 0 0 0 3px rgba(70, 100, 140, .14);
}

.fp-input::placeholder,
.fp-textarea::placeholder {
  color: #bdb49e;
}

.fp-field__hint {
  color: var(--fp-muted);
  font-size: 12px;
}

.fp-field__error {
  color: var(--fp-danger);
  font-size: 12px;
}

.fp-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--fp-ink-2);
  font-size: 13px;
  cursor: pointer;
}

.fp-check input {
  width: 15px;
  height: 15px;
  accent-color: var(--fp-coral);
}

.fp-form-note {
  padding: 12px 15px;
  border-radius: 4px;
  background: var(--fp-mint-soft);
  color: var(--fp-mint-deep);
  font-size: 13px;
}

/* ---------- 搜索框 ---------- */

.fp-search {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 560px;
  height: 52px;
  border: 1px solid var(--fp-line);
  border-radius: 4px;
  background: var(--fp-surface);
  transition: border-color .2s var(--fp-ease), box-shadow .2s var(--fp-ease);
}

.fp-search:focus-within {
  border-color: var(--fp-coral);
  box-shadow: 0 8px 26px rgba(70, 100, 140, .1);
}

.fp-search__icon {
  display: grid;
  place-items: center;
  width: 50px;
  color: var(--fp-muted);
  flex: none;
}

.fp-search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: transparent;
  font-size: 14px;
  outline: none;
}

.fp-search button {
  flex: none;
  margin-right: 6px;
  min-height: 40px;
  padding: 0 20px;
  border: 0;
  border-radius: 4px;
  background: var(--fp-coral);
  color: #fff;
  font-size: 13px;
  transition: background .2s var(--fp-ease);
}

.fp-search button:hover {
  background: var(--fp-coral-deep);
}

/* 搜索联想 */
.fp-suggest {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 30;
  overflow: hidden;
  border: 1px solid var(--fp-line);
  border-radius: 6px;
  background: var(--fp-surface);
  box-shadow: var(--fp-shadow);
}

.fp-suggest a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 16px;
  font-size: 13px;
}

.fp-suggest a:hover {
  background: var(--fp-coral-soft);
}

.fp-suggest small {
  color: var(--fp-muted);
  font-size: 11px;
}

/* ---------- 标签 / 分类 ---------- */

.fp-tag {
  display: inline-flex;
  align-items: center;
  height: 25px;
  padding: 0 10px;
  border-radius: 4px;
  background: var(--fp-mint-soft);
  color: var(--fp-mint-deep);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .02em;
  white-space: nowrap;
}

.fp-tag--blush { background: var(--fp-coral-soft); color: var(--fp-coral-deep); }
.fp-tag--mist  { background: var(--fp-sky-soft);  color: #5f8494; }
.fp-tag--sand  { background: var(--fp-butter-soft); color: #96793f; }
.fp-tag--line  { background: transparent; border: 1px solid var(--fp-line-strong); color: var(--fp-muted); }

.fp-tag--static {
  pointer-events: none;
}

.fp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.fp-chip {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 16px;
  border: 1px solid var(--fp-line);
  border-radius: 4px;
  background: transparent;
  color: var(--fp-ink-2);
  font-size: 13px;
  transition: background .2s var(--fp-ease), border-color .2s var(--fp-ease), color .2s var(--fp-ease);
}

.fp-chip:hover {
  border-color: var(--fp-coral);
  background: var(--fp-coral-soft);
  color: var(--fp-coral-deep);
}

.fp-chip.is-active {
  border-color: var(--fp-coral);
  background: var(--fp-coral);
  color: #fff;
}

/* 眉题：小贴纸感 */
.fp-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px;
  border-radius: 4px;
  background: var(--fp-coral-soft);
  color: var(--fp-coral-deep);
  font-size: 12px;
  font-weight: 500;
}

.fp-eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--fp-coral);
}

/* ---------- 区块标题 ---------- */

.fp-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.fp-section-head h2 {
  position: relative;
  padding-left: 13px;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: .04em;
}

/* 标题左侧的竖线眉标 */
.fp-section-head h2::after {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 3px;
  background: var(--fp-coral);
}

.fp-section-head p {
  margin-top: 12px;
  color: var(--fp-muted);
  font-size: 13px;
}

.fp-section-head__more {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--fp-muted);
  font-size: 13px;
  flex: none;
  padding-bottom: 2px;
}

.fp-section-head__more:hover {
  color: var(--fp-coral-deep);
}

/* ---------- 书籍文字卡片（无封面） ---------- */

.fp-book-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.fp-book-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
  padding: 15px 18px 17px;
  border: 1px solid var(--fp-line);
  border-top: 2px solid var(--fp-ink);
  border-radius: 0;
  background: var(--fp-surface);
  transition: border-color .25s var(--fp-ease);
}

.fp-book-card:hover {
  border-color: var(--fp-coral);
  border-top-color: var(--fp-coral);
  color: inherit;
}

.fp-book-card__title {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
}

.fp-book-card__title a:hover {
  color: var(--fp-coral-deep);
}

.fp-book-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--fp-muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
}

.fp-book-card__meta span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.fp-book-card__intro {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--fp-ink-2);
  font-size: 12px;
  line-height: 1.75;
}

/* ---------- 书籍横列 ---------- */

.fp-book-row {
  display: flex;
  gap: 14px;
  align-items: center;
  min-width: 0;
  padding: 16px 6px;
  border-bottom: 1px solid var(--fp-line);
}

.fp-book-row:last-child {
  border-bottom: 0;
}

.fp-book-row__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  min-width: 0;
}

.fp-book-row__title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 600;
}

.fp-book-row__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--fp-muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
}

.fp-book-row__desc {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--fp-muted);
  font-size: 12px;
}

.fp-book-row__rank {
  display: grid;
  place-items: center;
  width: 26px;
  flex: none;
  color: var(--fp-line-strong);
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.fp-book-row__rank.is-top {
  color: var(--fp-coral);
}

/* ---------- 列表 / 分页 ---------- */

.fp-list {
  display: flex;
  flex-direction: column;
}

.fp-list__item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 0;
  border-bottom: 1px solid var(--fp-line);
}

.fp-list__item:last-child {
  border-bottom: 0;
}

.fp-list__main {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.fp-list__main a {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fp-list__time {
  flex: none;
  color: var(--fp-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.fp-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 42px;
}

.fp-pager a,
.fp-pager span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--fp-line);
  border-radius: 4px;
  color: var(--fp-ink-2);
  font-size: 13px;
  transition: border-color .2s var(--fp-ease), background .2s var(--fp-ease), color .2s var(--fp-ease);
}

.fp-pager a:hover {
  border-color: var(--fp-coral);
  background: var(--fp-coral-soft);
  color: var(--fp-coral-deep);
}

.fp-pager .is-current {
  border-color: var(--fp-coral);
  background: var(--fp-coral);
  color: #fff;
}

.fp-pager .is-disabled {
  opacity: .45;
  pointer-events: none;
}

/* ---------- 空状态 ---------- */

.fp-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 70px 20px;
  border: 1px solid var(--fp-line-strong);
  border-radius: 6px;
  background: rgba(255, 255, 255, .7);
  text-align: center;
}

.fp-empty__mark {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 6px;
  background: var(--fp-coral-soft);
  color: var(--fp-coral-deep);
  font-size: 20px;
  font-weight: 600;
}

.fp-empty h3 {
  font-size: 16px;
}

.fp-empty p {
  max-width: 360px;
  color: var(--fp-muted);
  font-size: 13px;
}

/* ---------- 评分 ---------- */

.fp-rating {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.fp-rating__star {
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--fp-line-strong);
  transition: color .15s var(--fp-ease), transform .15s var(--fp-ease);
}

.fp-rating__star:hover {
  transform: scale(1.12);
}

.fp-rating__star.is-on {
  color: #dca64c;
}

.fp-rating__text {
  margin-left: 8px;
  color: var(--fp-muted);
  font-size: 12px;
}

.fp-vote-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.fp-vote-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--fp-line-strong);
  border-radius: 4px;
  background: var(--fp-surface);
  color: var(--fp-ink-2);
  font-size: 13px;
  transition: border-color .2s var(--fp-ease), background .2s var(--fp-ease), color .2s var(--fp-ease);
}

.fp-vote-btn:hover {
  border-color: var(--fp-coral);
  background: var(--fp-coral-soft);
  color: var(--fp-coral-deep);
}

.fp-vote-btn.is-on,
.fp-vote-btn[aria-pressed="true"] {
  border-color: var(--fp-coral);
  background: var(--fp-coral);
  color: #fff;
}

.fp-vote-btn:disabled {
  cursor: default;
  opacity: .75;
}

.fp-vote-count {
  padding: 0 7px;
  border-radius: 4px;
  background: rgba(0, 0, 0, .05);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.fp-vote-btn.is-on .fp-vote-count,
.fp-vote-btn[aria-pressed="true"] .fp-vote-count {
  background: rgba(255, 255, 255, .2);
}

.fp-rating-note {
  margin-top: 12px;
  color: var(--fp-muted);
  font-size: 12px;
  min-height: 18px;
}

/* ---------- 面包屑 ---------- */

.fp-crumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 24px;
  color: var(--fp-muted);
  font-size: 12px;
}

.fp-crumb a:hover {
  color: var(--fp-coral-deep);
}

.fp-crumb span {
  color: var(--fp-line-strong);
}

/* ---------- 弹层 / 提示 ---------- */

.fp-modal {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(34, 41, 46, .3);
  opacity: 0;
  transition: opacity .2s var(--fp-ease);
}

.fp-modal.is-open {
  opacity: 1;
}

.fp-modal__panel {
  width: 100%;
  max-width: 420px;
  padding: 28px;
  border-radius: var(--fp-radius-lg);
  background: var(--fp-surface);
  box-shadow: 0 30px 80px rgba(34, 41, 46, .2);
  transform: translateY(10px);
  transition: transform .25s var(--fp-ease);
}

.fp-modal.is-open .fp-modal__panel {
  transform: translateY(0);
}

.fp-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.fp-modal__head h3 {
  font-size: 18px;
}

.fp-modal__close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: var(--fp-bg-soft);
  color: var(--fp-muted);
}

.fp-modal__body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.fp-modal__foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.fp-toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  z-index: 180;
  max-width: calc(100vw - 40px);
  padding: 11px 20px;
  border-radius: 4px;
  background: rgba(34, 41, 46, .92);
  color: #fff;
  font-size: 13px;
  box-shadow: 0 10px 30px rgba(34, 41, 46, .2);
  opacity: 0;
  transform: translate(-50%, 10px);
  pointer-events: none;
  transition: opacity .22s var(--fp-ease), transform .22s var(--fp-ease);
}

.fp-toast.is-show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- 头像 ---------- */

.fp-avatar {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 6px;
  background: var(--fp-mint-soft);
  color: var(--fp-mint-deep);
  font-size: 22px;
  font-weight: 600;
  flex: none;
}

.fp-avatar--sm {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  font-size: 15px;
}

/* ---------- 响应式 ---------- */

@media (max-width: 1024px) {
  .fp-book-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .fp-book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .fp-section-head { align-items: center; }
  .fp-section-head h2 { font-size: 20px; }
  .fp-section-head p { display: none; }
}

@media (max-width: 480px) {
  .fp-search { height: 48px; }
  .fp-search button { padding: 0 15px; }
  .fp-book-grid { gap: 12px; }
  .fp-book-card { padding: 16px 16px 18px; }
  .fp-book-card__intro { display: none; }
  .fp-pager { gap: 5px; }
  .fp-pager a,
  .fp-pager span { min-width: 34px; height: 34px; padding: 0 9px; font-size: 12px; }
}
