/* ===== 全局样式 ===== */
:root {
  /* Miku 主色系（初音青） */
  --primary: #39c5bb; /* 主色：按钮/active/描边等大面积填充 */
  --primary-dark: #28a39a; /* hover 深色 */
  --primary-deep: #12857d; /* 小字号文本/链接专用（--primary 压白底对比度不够） */
  --primary-soft: #d9f3f0; /* 淡底 */
  --primary-softer: #eefaf8; /* 更淡底 */
  --focus-ring: rgba(57, 197, 187, 0.22); /* 焦点环 */
  --accent-pink: #ff9ec7; /* 樱花粉点缀（克制使用：logo 渐变 + 背景收尾） */

  /* 中性色（偏青调） */
  --text: #26343c;
  --muted: #7e949c;
  --border: #dbe9e7;

  /* 功能色 */
  --error: #e5484d;
  --success: #2f9e6e;

  /* 阴影（青调） */
  --card-shadow: 0 10px 30px rgba(16, 84, 78, 0.1);
  --shadow-pop: 0 14px 34px rgba(16, 84, 78, 0.16);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

::selection {
  background: rgba(57, 197, 187, 0.3);
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: linear-gradient(135deg, #f1fcfa 0%, #e7f6f3 60%, #fdeef5 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* 顶部导航 */
.navbar {
  width: 100%;
  padding: 18px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.navbar .logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 18px;
  background: linear-gradient(90deg, var(--primary-deep) 0%, var(--primary) 55%, var(--accent-pink) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-decoration: none;
}

/* logo 左侧小图（frontend/img/1.jpg），圆角小方块、不拉伸变形 */
.navbar .logo .logo-img {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.navbar .nav-links a {
  margin-left: 20px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
}

.navbar .nav-links a:hover {
  color: var(--primary-deep);
}

/* ===== 右上角头像菜单 ===== */
.nav-user {
  position: relative;
}

.nav-avatar-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--primary-soft);
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: border-color 0.15s, transform 0.15s;
}

.nav-avatar-btn:hover {
  border-color: var(--primary);
  transform: scale(1.06);
}

.nav-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 头像首字母/占位符（util.js 注入，无图片时显示） */
.nav-avatar-fallback {
  font-weight: 700;
  color: var(--primary-deep);
  line-height: 1;
}

.nav-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 48px;
  min-width: 120px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  padding: 6px;
  z-index: 100;
}

.nav-menu.show {
  display: block;
}

/* 覆盖 .navbar .nav-links a 的外边距，菜单项做成整行可点的条目
   （specificity 相同，靠出现顺序取胜，勿移到导航规则之前） */
.nav-links .nav-menu a {
  display: block;
  margin: 0;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.nav-links .nav-menu a:hover {
  background: var(--primary-softer);
  color: var(--primary-deep);
}

/* 主体居中卡片 */
main {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 16px;
}

.card {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  padding: 36px 32px;
}

.card h1 {
  font-size: 22px;
  margin-bottom: 8px;
  text-align: center;
}

.card .subtitle {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 24px;
}

/* 表单 */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

/* 按钮 */
.btn {
  display: inline-block;
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.12s;
}

.btn:hover:not(:disabled) {
  background: var(--primary-dark);
}

.btn:active:not(:disabled) {
  transform: scale(0.98);
}

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

.btn-secondary {
  background: var(--primary-soft);
  color: var(--text);
}

/* 次级按钮 hover：必须放在 .btn:hover 规则之后（同 specificity 靠顺序取胜），
   否则会被 .btn:hover:not(:disabled) 盖成深色底 */
.btn-secondary:hover:not(:disabled) {
  background: #c9ebe7;
  color: var(--primary-deep);
}

/* 提示消息 */
.message {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 16px;
  display: none;
}

.message.error {
  background: #fdecec;
  color: var(--error);
  display: block;
}

.message.success {
  background: #e7f6ef;
  color: var(--success);
  display: block;
}

/* 底部链接 */
.switch-link {
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  margin-top: 20px;
}

.switch-link a {
  color: var(--primary-deep);
  text-decoration: none;
  font-weight: 600;
}

/* 首页个人信息 */
/* 以下视图默认隐藏，由 profile.js 按加载结果切换显示（JS 的 style.display 赋值会覆盖这里） */
#guest-view,
#user-view,
#error-view,
#modal-overlay {
  display: none;
}

#avatar-img,
#avatar-input {
  display: none;
}

/* 游客视图里的块级链接按钮 */
.guest-actions .btn-link {
  display: block;
  text-align: center;
  text-decoration: none;
}

.guest-actions .btn-link + .btn-link {
  margin-top: 12px;
}

.avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #2fb3c9);
  color: #fff;
  font-size: 30px;
  font-weight: 700;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto 16px;
}

/* 真实头像图片（与 .avatar 同尺寸，二者显示其一） */
.avatar-img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin: 0 auto 16px;
}

.username {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}

.meta {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 20px;
}

/* 记住我复选框 */
.remember-group .checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  margin: 0;
}

.remember-group .checkbox input {
  width: auto;
  accent-color: var(--primary);
}

/* 设置区域 */
.section {
  text-align: center;
}

.section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  text-align: left;
}

.hint {
  color: var(--muted);
  font-size: 12px;
  margin-top: 10px;
}

.card hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

/* ===== 个人主页：左栏 + 中间 双栏布局 ===== */
.profile-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 20px;
  width: 100%;
  max-width: 920px;
  align-items: start;
}

.sidebar {
  padding: 28px 24px;
}

.sidebar-profile {
  text-align: center;
}

.sidebar .btn {
  margin-top: 4px;
}

.content {
  padding: 28px;
  min-height: 320px;
}

.content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.content-header h2 {
  font-size: 18px;
}

.btn-edit {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--primary-deep);
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.btn-edit:hover {
  border-color: var(--primary);
  background: var(--primary-softer);
}

.bio {
  color: var(--text);
  font-size: 15px;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
}

.bio.empty {
  color: var(--muted);
}

/* 窄屏时上下堆叠 */
@media (max-width: 720px) {
  .profile-layout {
    grid-template-columns: 1fr;
  }
}

/* ===== 修改简介弹窗 ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(14, 51, 48, 0.45);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  padding: 16px;
}

.modal {
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 480px;
  padding: 22px 24px;
  box-shadow: 0 20px 60px rgba(14, 60, 55, 0.25);
  animation: modal-pop 0.18s ease;
}

@keyframes modal-pop {
  from {
    transform: scale(0.95);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.modal-header h3 {
  font-size: 16px;
}

.modal-close {
  border: none;
  background: none;
  font-size: 24px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
}

.modal-close:hover {
  color: var(--text);
}

#bio-input {
  width: 100%;
  min-height: 140px;
  resize: vertical;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
}

#bio-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
}

.char-count {
  font-size: 12px;
  color: var(--muted);
}

.modal-btn {
  width: auto;
  display: inline-block;
  padding: 9px 18px;
  margin-left: 8px;
  font-size: 14px;
}

/* ===== 首页告示弹窗 ===== */
#notice-overlay { display: none; } /* 默认隐藏，进页面由 search.js 切换为 flex */

.notice-modal {
  max-width: 420px;
  max-height: calc(100vh - 32px); /* 矮屏时弹窗内部滚动，不顶破遮罩 */
  overflow-y: auto;
  text-align: center;
}

.notice-img {
  width: 100%;
  border-radius: 10px;
}

.notice-text {
  margin: 14px 0 16px;
  font-size: 14px;
  line-height: 1.9;
  text-align: left;
  word-break: break-word;
}

/* GitHub 链接较长，允许任意位置断行 */
.notice-text a {
  color: var(--primary-deep);
  word-break: break-all;
}

/* 覆盖 .btn 默认全宽，“我已知晓”居中 */
.notice-ok {
  width: auto;
  display: inline-block;
  padding: 9px 26px;
}

/* ===== 资源搜索页 ===== */
.search-main {
  align-items: flex-start;
}

.search-wrap {
  width: 100%;
  max-width: 920px;
}

.search-bar {
  display: flex;
  gap: 10px;
  padding: 16px;
  margin-bottom: 18px;
}

/* 搜索页左右两侧装饰图：fixed 贴屏左右、垂直居中，正好卡在 920px 内容列两侧的留白里。
   图片源约定 frontend/img/side-left.png、side-right.png；alt 留空（纯装饰）。 */
.side-img {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  height: min(72vh, 720px);   /* 左右等高、整体拉长（右侧图原生偏矮，拉齐） */
  width: auto;
  max-width: calc(50vw - 484px); /* 不许挤进内容列（留 24px 间隙）；超出用 cover 居中裁边 */
  object-fit: cover;
  object-position: center;
  z-index: 0;
  pointer-events: none; /* 不挡搜索栏/卡片点击 */
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.12));
}

/* 外缘锚定在内容列（920px）两侧留白：右侧图贴内容列右缘往右 24px，
   左侧图贴内容列左缘往左 24px——图再宽也进不了内容列 */
.side-left {
  right: calc(50% + 460px + 24px);
}

.side-right {
  left: calc(50% + 460px + 24px);
}

/* 视口不够宽（两侧留白 < 图宽+间距，约 1400px 以下）时藏掉 */
@media (max-width: 1399px) {
  .side-img {
    display: none;
  }
}

.search-input {
  flex: 1;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  outline: none;
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.type-select {
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  background: #fff;
  outline: none;
  cursor: pointer;
}

.type-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.search-btn {
  width: auto;
  padding: 11px 26px;
}

.search-status {
  margin-bottom: 12px;
}

.loading-tip,
.empty-tip {
  text-align: center;
  color: var(--muted);
  padding: 40px 16px;
  font-size: 15px;
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--card-shadow);
}

.empty-tip.error {
  color: var(--error);
}

/* 结果卡片 */
.result-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.res-card {
  padding: 18px 20px;
}

.res-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.res-type {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--primary-soft);
  color: var(--primary-deep);
  font-weight: 600;
}

.res-date {
  font-size: 12px;
  color: var(--muted);
}

.res-title {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  word-break: break-word;
  margin-bottom: 12px;
}

.res-meta {
  display: flex;
  gap: 18px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.res-actions {
  display: flex;
  gap: 10px;
}

.res-actions .btn {
  width: auto;
  padding: 9px 18px;
  font-size: 14px;
  text-decoration: none;
  display: inline-block;
}

/* 分页 */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 22px;
}

.page-btn {
  width: auto;
  padding: 9px 20px;
}

.page-info {
  font-size: 14px;
  color: var(--muted);
}

/* 轻提示 toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%) translateY(20px);
  background: #1e3d3a;
  color: #fff;
  padding: 12px 22px;
  border-radius: 10px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 200;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.error {
  background: var(--error);
}

@media (max-width: 640px) {
  .search-bar {
    flex-direction: column;
  }
  .search-btn {
    width: 100%;
  }
}

/* ===== 番剧卡片网格 ===== */
.anime-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr); /* 固定一行五列 */
  gap: 18px;
}

/* 窄屏递减列数，避免卡片过挤 */
@media (max-width: 720px) {
  .anime-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 480px) {
  .anime-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.anime-card {
  display: block;
  padding: 10px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.18s, box-shadow 0.18s;
  overflow: hidden;
}

.anime-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-pop);
}

.cover-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 10px;
  overflow: hidden;
  background: var(--primary-soft);
}

.anime-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

/* hover 时封面微缩放（.cover-wrap 已 overflow:hidden，不会溢出） */
.anime-card:hover .anime-cover {
  transform: scale(1.05);
}

.cover-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 40px;
  font-weight: 700;
  color: var(--primary);
  background: linear-gradient(135deg, var(--primary-softer), #cdeeea);
}

.anime-info {
  padding: 10px 2px 2px;
}

.anime-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 39px;
}

.anime-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

/* ===== 番剧详情页头部 ===== */
.back-link {
  display: inline-block;
  color: var(--primary-deep);
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 14px;
}

.anime-header {
  display: flex;
  gap: 20px;
  padding: 22px;
  margin-bottom: 18px;
  align-items: flex-start;
}

.header-cover {
  flex: 0 0 150px;
  width: 150px;
}

.header-info {
  flex: 1;
  min-width: 0;
}

.header-title {
  font-size: 22px;
  margin-bottom: 10px;
  word-break: break-word;
}

.header-sub {
  font-size: 14px;
  color: var(--primary-deep);
  font-weight: 600;
  margin-bottom: 6px;
}

.header-native {
  font-size: 13px;
  color: var(--muted);
  word-break: break-word;
}

.section-label {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin: 6px 2px 12px;
}

@media (max-width: 560px) {
  .anime-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .header-cover {
    width: 160px;
  }
}

/* ===== 番剧详情页：左播放 / 右磁力 两栏 ===== */
.detail-wrap {
  width: 100%;
  max-width: 1280px;
}

.detail-layout {
  display: grid;
  grid-template-columns: 2fr 1fr; /* 播放器约 2/3、磁力列表约 1/3（即 1/2 屏 : 1/4 屏的比例） */
  gap: 20px;
  align-items: start;
}

/* 解开全局 .card 的 max-width:380px 枷锁（详情页宽卡片）。
   .res-card 必须作用域限定在 .detail-wrap 内：index.html 的兜底直搜列表
   复用同一模板，全局放开会连累它。 */
.anime-header {
  max-width: none;
}

.player-card {
  max-width: none;
  padding: 20px;
}

.detail-wrap .res-card {
  max-width: none;
}

#player {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 10px;
  display: block;
}

.player-empty {
  text-align: center;
  color: var(--muted);
  padding: 60px 16px;
  font-size: 14px;
}

.player-now {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary-deep);
  margin-top: 12px;
}

.player-tip {
  display: none;
  color: var(--error);
  font-size: 13px;
  margin-top: 8px;
}

.ep-label {
  margin: 16px 0 10px;
  font-size: 14px;
  font-weight: 700;
}

.ep-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
  gap: 8px;
  max-height: 264px; /* 超长番选集可滚动 */
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(57, 197, 187, 0.4) transparent;
}

.ep-grid::-webkit-scrollbar {
  width: 6px;
}

.ep-grid::-webkit-scrollbar-thumb {
  background: rgba(57, 197, 187, 0.4);
  border-radius: 3px;
}

.ep-grid::-webkit-scrollbar-track {
  background: transparent;
}

.ep-btn {
  padding: 8px 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.ep-btn:hover {
  border-color: var(--primary);
  color: var(--primary-deep);
}

.ep-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

@media (max-width: 900px) {
  .detail-layout {
    grid-template-columns: 1fr;
  }
}

/* ===== 收藏：卡片封面右上角 ♥ 角标 ===== */
.fav-badge {
  position: absolute;               /* .cover-wrap 已是 position:relative */
  top: 8px;
  right: 8px;
  z-index: 2;                       /* 盖在封面图与 .cover-fallback 之上 */
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(20, 45, 42, 0.35);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  user-select: none;
  transition: transform 0.15s, background 0.15s, color 0.15s;
}

.fav-badge:hover {
  transform: scale(1.12);
}

.fav-badge.on {
  color: var(--error);
  background: #fff;
  text-shadow: none;
}

.fav-badge.busy {
  pointer-events: none;
  opacity: 0.6;
}

/* ===== 收藏：详情页头部收藏按钮（白底描边 → active 实底，同 .ep-btn 模式；
   独立成类不基于 .btn，躲开 .btn 的 width:100% 与 hover 顺序坑） ===== */
.fav-btn {
  margin-top: 14px;
  padding: 8px 22px;
  border: 1px solid var(--primary);
  border-radius: 20px;
  background: #fff;
  color: var(--primary-deep);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.fav-btn:hover:not(:disabled) {
  background: var(--primary-softer);
}

.fav-btn.on {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.fav-btn.on:hover:not(:disabled) {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

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

/* ===== 收藏：个人主页「我的收藏」区块 ===== */
/* 右列容器：简介 + 收藏纵向堆叠，收藏紧贴简介下方。
   不能把两个 section 直接作为 .profile-layout 的 grid 子元素——第三个子元素
   会被自动布局排到侧边栏正下方，且第一行行高被高侧边栏撑开，收藏会离简介很远 */
.profile-main {
  display: flex;
  flex-direction: column;
  align-items: start;
  gap: 20px;
}

/* 覆盖 .content 的 min-height:320px（收藏可能为空）。
   宽度沿用全局 .card 的 380px 上限，与上方简介卡片等宽、视觉一致。 */
.fav-section {
  min-height: 0;
}

.fav-count {
  font-size: 14px;
  color: var(--muted);
  font-weight: 400;
}

.fav-empty {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  padding: 28px 0;
}

.fav-empty.error {
  color: var(--error);
}

/* 收藏区块与简介卡片同宽（~324px 内容宽），2 列合适、3 列过窄；
   写在 .anime-grid 的媒体查询之后，各断点下都保持 2 列 */
.fav-grid {
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
