/* 中华古籍数字阅览平台 - 默认琴谱UI样式表 (CSS3 响应式设计) */
:root {
  --bg-main: #f6f2e9;
  --bg-card: #ffffff;
  --primary-color: #8c2425;
  --primary-hover: #a62b2c;
  --text-main: #2b2621;
  --text-muted: #736b63;
  --border-color: #e2d9cc;
  --shadow: 0 4px 20px rgba(70, 50, 30, 0.08);
  --radius: 8px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Header Navbar */
.site-header {
  background: #ffffff;
  border-bottom: 2px solid var(--primary-color);
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: bold;
  color: var(--primary-color);
  white-space: nowrap;
}

.mobile-menu-toggle {
  display: none;
  background: #fbf9f5;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--primary-color);
  transition: all 0.2s ease;
}

.mobile-menu-toggle:hover {
  background: rgba(140, 36, 37, 0.08);
}

.nav-wrapper {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-links {
  display: flex;
  gap: 16px;
  list-style: none;
  align-items: center;
}

.nav-links a {
  font-size: 15px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 4px;
  color: var(--text-main);
  transition: all 0.25s ease;
  white-space: nowrap;
}

.nav-links a:hover, .nav-links a.active {
  background: rgba(140, 36, 37, 0.08);
  color: var(--primary-color);
  font-weight: 600;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-primary {
  background: var(--primary-color);
  color: #fff;
  padding: 8px 18px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.3s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

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

.btn-outline {
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
  padding: 7px 16px;
  border-radius: var(--radius);
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Hero Section */
.hero-banner {
  background: linear-gradient(135deg, #2b2621 0%, #4a3e35 100%);
  color: #f6f2e9;
  padding: 60px 20px;
  text-align: center;
}

.hero-banner h1 {
  font-size: 36px;
  margin-bottom: 12px;
  letter-spacing: 2px;
}

.hero-banner p {
  font-size: 16px;
  opacity: 0.85;
  max-width: 600px;
  margin: 0 auto 25px auto;
}

.search-form {
  display: flex;
  justify-content: center;
  max-width: 500px;
  margin: 0 auto;
}

.search-form input {
  flex: 1;
  padding: 12px 18px;
  border-radius: 6px 0 0 6px;
  border: none;
  font-size: 15px;
  outline: none;
}

.search-form button {
  border-radius: 0 6px 6px 0;
}

/* Layout Containers */
.container {
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 20px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 25px;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 10px;
}

.section-title {
  font-size: 24px;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-more {
  font-size: 14px;
  color: var(--text-muted);
}

/* Grid & Cards */
.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 25px;
}

.book-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
}

.book-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(70, 50, 30, 0.15);
}

.book-cover {
  height: 220px;
  background: #eae2d3;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.book-cover img {
  max-height: 90%;
  max-width: 90%;
  object-fit: contain;
  box-shadow: 2px 4px 10px rgba(0,0,0,0.2);
}

.book-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--primary-color);
  color: #fff;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 3px;
}

.book-info {
  padding: 16px;
}

.book-title {
  font-size: 17px;
  font-weight: bold;
  margin-bottom: 8px;
  color: var(--text-main);
}

.book-meta {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}

/* Forms & Modals */
.form-box {
  background: #ffffff;
  max-width: 420px;
  margin: 60px auto;
  padding: 35px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 14px;
}

.captcha-box {
  display: flex;
  gap: 10px;
}

.captcha-img {
  height: 40px;
  cursor: pointer;
  border-radius: 4px;
}

/* Pagination */
.pagination-box {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 35px;
}

.page-item {
  padding: 8px 14px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-main);
  font-size: 14px;
}

.page-item.active {
  background: var(--primary-color);
  color: #ffffff;
  border-color: var(--primary-color);
}

/* Footer */
.site-footer {
  background: #231f1a;
  color: #a09589;
  padding: 40px 20px;
  margin-top: 60px;
  text-align: center;
  font-size: 14px;
}

/* Responsive Media Queries (< 768px) */
@media (max-width: 768px) {
  .header-container {
    height: 56px;
    padding: 0 16px;
  }

  .site-logo {
    font-size: 17px;
    max-width: calc(100% - 50px);
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  .nav-wrapper {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border-bottom: 2px solid var(--primary-color);
    box-shadow: 0 12px 30px rgba(0,0,0,0.12);
    padding: 16px 20px 20px;
    flex-direction: column;
    gap: 16px;
    z-index: 1001;
  }

  .nav-wrapper.active {
    display: flex;
    animation: qinpuNavFadeIn 0.25s ease-out;
  }

  @keyframes qinpuNavFadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
  }

  .nav-links {
    flex-direction: column;
    width: 100%;
    gap: 4px;
  }

  .nav-links li {
    width: 100%;
  }

  .nav-links a {
    display: block;
    width: 100%;
    padding: 10px 14px;
    font-size: 15px;
    border-radius: 6px;
    text-align: left;
  }

  .header-user {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid #f1e9d8;
  }

  .header-user .btn-outline, .header-user .btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 9px 0;
    font-size: 14px;
    text-align: center;
  }

  .container {
    margin: 20px auto;
    padding: 0 16px;
  }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .book-cover {
    height: 170px;
  }

  .user-layout {
    flex-direction: column;
  }

  .user-sidebar {
    width: 100%;
  }
}

/* 个人中心统一双栏布局与侧边栏样式 */
.user-layout {
  display: flex;
  gap: 30px;
  align-items: flex-start;
  margin-top: 10px;
}

.user-sidebar {
  width: 260px;
  background: #ffffff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  flex-shrink: 0;
  border: 1px solid var(--border-color);
}

.user-sidebar-profile {
  text-align: center;
  padding-bottom: 20px;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 15px;
}

.user-sidebar-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #f8fafc;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  margin-bottom: 10px;
  background: #f8fafc;
}

.user-sidebar-name {
  color: var(--primary-color);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 2px;
}

.user-sidebar-account {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 8px;
}

.user-sidebar-badge {
  display: inline-block;
  background: #fdf6ec;
  color: #b45309;
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid #fde68a;
}

.user-sidebar-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.user-sidebar-menu li {
  margin-bottom: 6px;
}

.user-sidebar-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 6px;
  color: #334155;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.user-sidebar-menu a:hover {
  background: #f8fafc;
  color: var(--primary-color);
}

.user-sidebar-menu a.active {
  background: var(--primary-color);
  color: #ffffff;
  font-weight: 600;
}

.user-sidebar-menu a.menu-logout {
  color: #ef4444;
}

.user-sidebar-menu a.menu-logout:hover {
  background: #fef2f2;
}

.user-content {
  flex: 1;
  min-width: 0;
}

.user-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  text-align: center;
}

/* 📱 个人中心移动端自适应 (< 768px) */
@media (max-width: 768px) {
  .user-layout {
    flex-direction: column !important;
    gap: 16px !important;
    width: 100% !important;
  }

  .user-sidebar {
    width: 100% !important;
    flex-shrink: 0 !important;
    padding: 16px !important;
    margin-bottom: 0 !important;
  }

  .user-sidebar-profile {
    display: flex !important;
    align-items: center !important;
    text-align: left !important;
    gap: 14px !important;
    padding-bottom: 14px !important;
    margin-bottom: 12px !important;
  }

  .user-sidebar-avatar {
    width: 54px !important;
    height: 54px !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
  }

  .user-sidebar-name {
    font-size: 16px !important;
    margin-bottom: 2px !important;
  }

  .user-sidebar-account {
    font-size: 12px !important;
    margin-bottom: 4px !important;
  }

  .user-sidebar-menu {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 6px !important;
  }

  .user-sidebar-menu li {
    margin-bottom: 0 !important;
  }

  .user-sidebar-menu a {
    padding: 8px 10px !important;
    font-size: 13px !important;
    border-radius: 6px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .user-content {
    width: 100% !important;
    flex: none !important;
  }

  .user-stats-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .user-content > div {
    padding: 18px 16px !important;
  }

  .user-content table {
    display: block !important;
    width: 100% !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch;
  }
}

/* 书籍详情页 responsive 改进 */
.detail-main-card {
  background: #ffffff;
  padding: 35px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  gap: 35px;
  flex-wrap: wrap;
}

.detail-thumb-box {
  width: 240px;
  text-align: center;
  flex-shrink: 0;
}

.detail-thumb-img {
  max-width: 100%;
  border-radius: 6px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.detail-info-box {
  flex: 1;
  min-width: 280px;
}

.detail-title {
  color: var(--primary-color);
  font-size: 26px;
  margin-bottom: 12px;
  line-height: 1.3;
}

.detail-meta-text {
  font-size: 14.5px;
  color: #666;
  margin-bottom: 16px;
}

.detail-stats-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 22px;
}

.stat-pill {
  background: #fdfbf7;
  border: 1px solid #f3e8d7;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 13.5px;
  color: #554e47;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.stat-pill strong {
  color: var(--primary-color);
  margin-left: 4px;
}

.detail-siku-row, .detail-tags-row {
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.detail-label {
  font-size: 13px;
  color: #736b63;
  font-weight: bold;
}

.detail-siku-chip {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 13px;
  text-decoration: none;
  font-weight: bold;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.detail-tag-chip {
  background: #fef2f2;
  color: #8b1d1d;
  border: 1px solid #fecaca;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  text-decoration: none;
  font-weight: bold;
}

.detail-action-bar {
  display: flex;
  gap: 15px;
  margin-top: 20px;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .detail-main-card {
    padding: 20px 16px !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 16px !important;
  }

  .detail-thumb-box {
    width: 160px !important;
  }

  .detail-title {
    font-size: 20px !important;
    text-align: center !important;
    margin-bottom: 8px !important;
  }

  .detail-meta-text {
    text-align: center !important;
    font-size: 13px !important;
    margin-bottom: 14px !important;
  }

  .detail-stats-bar {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    width: 100% !important;
    margin-bottom: 16px !important;
  }

  .stat-pill {
    padding: 8px 10px !important;
    font-size: 12.5px !important;
    justify-content: center !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .detail-siku-row, .detail-tags-row {
    justify-content: center !important;
  }

  .detail-action-bar {
    flex-direction: column !important;
    width: 100% !important;
    gap: 10px !important;
  }

  .detail-action-bar .btn-primary, .detail-action-bar .btn-outline {
    width: 100% !important;
    text-align: center !important;
    padding: 10px 0 !important;
    font-size: 15px !important;
  }
}

/* 专题广场与单专题详情 Responsive 组件 CSS */
.topic-detail-banner {
  background: #ffffff;
  padding: 30px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 30px;
  display: flex;
  gap: 24px;
  align-items: center;
}

.topic-detail-img {
  width: 220px;
  height: 140px;
  border-radius: 6px;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  flex-shrink: 0;
}

.topic-detail-badge {
  font-size: 13px;
  color: var(--primary-color);
  font-weight: bold;
  margin-bottom: 4px;
}

.topic-detail-title {
  color: var(--primary-color);
  margin-bottom: 10px;
  font-size: 26px;
}

.topic-detail-desc {
  font-size: 15px;
  color: #555;
  line-height: 1.6;
}

.topic-list-container {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.topic-card {
  background: #ffffff;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.topic-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 14px;
  gap: 20px;
}

.topic-info-wrap {
  display: flex;
  align-items: center;
  gap: 15px;
  flex: 1;
  min-width: 0;
}

.topic-cover-img {
  width: 100px;
  height: 65px;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  flex-shrink: 0;
}

.topic-text-box {
  flex: 1;
  min-width: 0;
}

.topic-title {
  font-size: 20px;
  color: var(--primary-color);
  margin-bottom: 4px;
  font-weight: bold;
  line-height: 1.3;
}

.topic-desc {
  font-size: 14px;
  color: #64748b;
  line-height: 1.5;
}

.topic-header-btn {
  font-size: 14px;
  padding: 8px 18px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  flex-shrink: 0;
}

.topic-sub-card {
  box-shadow: none !important;
  border: 1px solid #e2e8f0 !important;
}

.topic-sub-cover {
  height: 150px;
}

.topic-sub-info {
  padding: 10px;
}

.topic-sub-title {
  font-size: 14px;
}

.topic-sub-meta {
  font-size: 12px;
  margin: 0;
}

.topic-card-footer {
  margin-top: 4px;
}

.btn-topic-full {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px 16px;
  background: #fdfbf7;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--primary-color);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-topic-full:hover {
  background: var(--primary-color);
  color: #ffffff;
  border-color: var(--primary-color);
}

@media (max-width: 768px) {
  .topic-detail-banner {
    padding: 20px 16px !important;
    flex-direction: column !important;
    text-align: center !important;
    gap: 16px !important;
  }

  .topic-detail-img {
    width: 100% !important;
    max-width: 260px !important;
    height: 150px !important;
  }

  .topic-detail-title {
    font-size: 20px !important;
  }

  .topic-detail-desc {
    font-size: 13.5px !important;
  }

  .topic-list-container {
    gap: 20px !important;
  }

  .topic-card {
    padding: 16px !important;
    gap: 14px !important;
  }

  .topic-card-header {
    border-bottom: none !important;
    padding-bottom: 0 !important;
    gap: 12px !important;
  }

  .topic-header-btn {
    display: none !important;
  }

  .topic-info-wrap {
    display: flex !important;
    align-items: flex-start !important;
    gap: 12px !important;
    width: 100% !important;
  }

  .topic-cover-img {
    width: 72px !important;
    height: 52px !important;
  }

  .topic-title {
    font-size: 17px !important;
    margin-bottom: 4px !important;
    word-break: break-word !important;
  }

  .topic-desc {
    font-size: 13px !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    line-height: 1.45 !important;
  }

  .topic-books-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }

  .topic-sub-cover {
    height: 130px !important;
  }

  .topic-card-footer .btn-topic-full {
    background: var(--primary-color) !important;
    color: #ffffff !important;
    border: none !important;
    padding: 11px 0 !important;
    font-size: 14px !important;
    border-radius: 6px !important;
  }
}

/* 文章详情页 (Article Detail) Responsive 组件 CSS */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 30px;
  align-items: flex-start;
}

.article-card {
  background: #ffffff;
  padding: 36px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
}

.article-title {
  font-size: 26px;
  color: var(--primary-color);
  margin-bottom: 16px;
  line-height: 1.4;
  font-family: 'Noto Serif SC', serif;
}

.article-meta-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
  font-size: 13px;
  color: #736b63;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 16px;
  margin-bottom: 24px;
}

.article-meta-items {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

.article-tags-wrap {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-left: auto;
  flex-wrap: wrap;
}

.article-tag-chip {
  background: #fef2f2;
  color: #8b1d1d;
  border: 1px solid #fecaca;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  text-decoration: none;
  font-weight: bold;
}

.article-summary-box {
  background: #fcf8f2;
  border-left: 4px solid var(--primary-color);
  padding: 14px 18px;
  margin-bottom: 24px;
  border-radius: 0 6px 6px 0;
  font-size: 14px;
  color: #5c4b37;
  line-height: 1.6;
}

.article-summary-title {
  display: block;
  margin-bottom: 4px;
  color: var(--primary-color);
}

.article-body {
  font-size: 16px;
  line-height: 1.8;
  color: #2c2c2c;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.article-body img {
  max-width: 100% !important;
  height: auto !important;
  border-radius: 6px;
  margin: 12px 0;
}

.article-related-box {
  background: #ffffff;
  padding: 25px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
  margin-top: 24px;
}

.article-section-title {
  font-size: 16px;
  color: var(--primary-color);
  margin-top: 0;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  gap: 8px;
}

.article-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 15px;
}

.article-related-card {
  border: 1px solid #eee !important;
  border-radius: 6px !important;
  overflow: hidden !important;
  box-shadow: none !important;
}

.article-related-cover {
  height: 140px;
}

.article-related-info {
  padding: 8px;
}

.article-related-title {
  font-size: 12px;
  font-weight: bold;
  height: 32px;
  overflow: hidden;
  line-height: 1.3;
}

.article-comments-box {
  background: #ffffff;
  padding: 30px;
  border-radius: var(--radius);
  margin-top: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
}

.article-comments-title {
  color: var(--primary-color);
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.comment-form-wrap {
  margin-bottom: 30px;
}

.reply-tip-box {
  background: #f1f5f9;
  padding: 6px 12px;
  border-radius: 4px;
  margin-bottom: 8px;
  font-size: 12px;
  color: #475569;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-cancel-reply {
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-size: 12px;
}

.comment-form-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.comment-login-tip {
  background: #fdf6ec;
  padding: 12px 16px;
  border-radius: 6px;
  color: #e6a23c;
  margin-bottom: 20px;
  font-size: 14px;
}

.article-sidebar-card {
  background: #ffffff;
  padding: 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
}

.article-sidebar-title {
  font-size: 16px;
  color: var(--primary-color);
  margin-top: 0;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  gap: 8px;
}

.article-sidebar-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.article-sidebar-item {
  text-decoration: none;
  display: flex;
  gap: 10px;
  align-items: center;
  color: inherit;
  padding-bottom: 10px;
  border-bottom: 1px dashed #f1f5f9;
}

.article-sidebar-img {
  width: 60px;
  height: 45px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.article-sidebar-item-title {
  font-size: 13px;
  font-weight: 600;
  color: #333;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-sidebar-item-date {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 4px;
}

/* 📱 移动端自适应规则 (< 768px) */
@media (max-width: 768px) {
  .article-layout {
    display: flex !important;
    flex-direction: column !important;
    gap: 20px !important;
    width: 100% !important;
  }

  .article-main-col {
    width: 100% !important;
  }

  .article-card {
    padding: 20px 16px !important;
  }

  .article-title {
    font-size: 20px !important;
    line-height: 1.35 !important;
    margin-bottom: 12px !important;
    word-break: break-word !important;
  }

  .article-meta-bar {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
    padding-bottom: 12px !important;
    margin-bottom: 18px !important;
  }

  .article-meta-items {
    gap: 10px !important;
    font-size: 12px !important;
  }

  .article-tags-wrap {
    margin-left: 0 !important;
    margin-top: 4px !important;
    width: 100% !important;
  }

  .article-summary-box {
    padding: 12px 14px !important;
    margin-bottom: 18px !important;
    font-size: 13px !important;
  }

  .article-body {
    font-size: 15px !important;
    line-height: 1.75 !important;
  }

  .article-related-box {
    padding: 16px !important;
  }

  .article-related-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  .article-related-cover {
    height: 130px !important;
  }

  .article-comments-box {
    padding: 20px 16px !important;
  }

  .comment-form-actions {
    width: 100% !important;
    display: flex !important;
    gap: 8px !important;
  }

  .comment-form-actions .btn-primary {
    flex: 1 !important;
  }

  .article-sidebar-col {
    width: 100% !important;
  }

  .article-sidebar-card {
    padding: 16px !important;
  }

  /* 📓 会员中心笔记/卡片/弹窗 移动端适配 */
  .note-item-card > div:first-child {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
    padding: 12px 14px !important;
  }

  .note-item-card > div:first-child > div {
    flex-wrap: wrap !important;
    width: 100% !important;
  }

  #book-cloud-body {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
}

/* 📝 考据笔记详情页 (Note Detail) Layout & Components */
.note-detail-container {
  max-width: 960px;
  margin: 30px auto;
  padding: 0 20px;
}

.note-breadcrumb {
  font-size: 14px;
  color: #64748b;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.note-breadcrumb a {
  color: #64748b;
  text-decoration: none;
}

.note-breadcrumb .active-crumb {
  color: #1e293b;
  font-weight: 600;
}

.note-detail-card {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
  border: 1px solid var(--border-color, #e2d7c3);
  padding: 40px;
  margin-bottom: 30px;
  position: relative;
}

.note-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 20px;
  border-bottom: 1px solid #f1e9d8;
  margin-bottom: 24px;
  gap: 14px;
  flex-wrap: wrap;
}

.note-author-box {
  display: flex;
  align-items: center;
  gap: 14px;
}

.note-author-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary-color, #8b1d1d);
  flex-shrink: 0;
}

.note-author-name {
  font-weight: 700;
  color: #1e293b;
  font-size: 16px;
}

.note-author-meta {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}

.note-badge-wrap {
  flex-shrink: 0;
}

.badge-note-pub {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 600;
  white-space: nowrap;
  display: inline-block;
}

.badge-note-priv {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 600;
  white-space: nowrap;
  display: inline-block;
}

.note-title-wrap {
  margin-bottom: 20px;
}

.note-tag-badge {
  background: var(--primary-color, #8b1d1d);
  color: #ffffff;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 4px;
  font-weight: 600;
  margin-right: 10px;
  display: inline-block;
  vertical-align: middle;
}

.note-detail-title {
  display: inline;
  font-size: 24px;
  font-weight: 700;
  color: #231f1a;
  font-family: 'Noto Serif SC', serif;
  line-height: 1.4;
  vertical-align: middle;
  word-break: break-word;
}

.note-content-box {
  font-size: 16px;
  line-height: 1.9;
  color: #334155;
  white-space: pre-wrap;
  margin-bottom: 24px;
  background: #fcfbf8;
  padding: 24px;
  border-radius: 10px;
  border-left: 4px solid var(--primary-color, #8b1d1d);
  font-family: 'Noto Serif SC', serif;
  word-break: break-word;
}

.note-crop-box {
  margin-bottom: 30px;
  background: #f8fafc;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  text-align: center;
}

.note-crop-label {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 10px;
  font-weight: 600;
}

.note-crop-img {
  max-width: 100%;
  max-height: 480px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  border: 1px solid #ddd;
}

.note-read-cta {
  background: #fdf6ec;
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  gap: 14px;
}

.note-read-cta-text {
  color: #b45309;
  font-size: 14px;
  font-weight: 500;
}

.note-read-cta-btn {
  text-decoration: none;
  padding: 8px 18px;
  font-size: 13px;
  border-radius: 6px;
  background: var(--primary-color, #8b1d1d);
  color: #fff;
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.note-footer-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  border-top: 1px solid #f1e9d8;
  font-size: 14px;
  color: #64748b;
  gap: 14px;
}

.note-footer-stats {
  display: flex;
  align-items: center;
  gap: 20px;
  white-space: nowrap;
}

.note-footer-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-note-like {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 20px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  cursor: pointer;
  font-size: 14px;
  color: #334155;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-note-share {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  border-radius: 20px;
  border: 1px solid var(--primary-color, #8b1d1d);
  background: var(--primary-color, #8b1d1d);
  color: #ffffff;
  cursor: pointer;
  font-size: 14px;
  white-space: nowrap;
}

.note-comment-section {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
  border: 1px solid var(--border-color, #e2d7c3);
  padding: 35px;
  margin-bottom: 40px;
}

/* 📱 笔记详情页移动端自适应 (< 768px) */
@media (max-width: 768px) {
  .note-detail-container {
    margin: 16px auto !important;
    padding: 0 12px !important;
  }

  .note-detail-card {
    padding: 20px 16px !important;
    border-radius: 12px !important;
    margin-bottom: 20px !important;
  }

  .note-detail-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
    padding-bottom: 14px !important;
    margin-bottom: 18px !important;
  }

  .note-author-meta {
    font-size: 11px !important;
  }

  .note-detail-title {
    font-size: 18px !important;
  }

  .note-content-box {
    font-size: 14.5px !important;
    padding: 16px !important;
    margin-bottom: 18px !important;
  }

  .note-read-cta {
    flex-direction: column !important;
    align-items: stretch !important;
    text-align: center !important;
    padding: 14px 16px !important;
    gap: 12px !important;
  }

  .note-read-cta-text {
    font-size: 13px !important;
    line-height: 1.4 !important;
  }

  .note-read-cta-btn {
    width: 100% !important;
    padding: 10px 0 !important;
    font-size: 14px !important;
    text-align: center !important;
  }

  .note-footer-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 14px !important;
    padding-top: 16px !important;
  }

  .note-footer-stats {
    justify-content: space-around !important;
    width: 100% !important;
    font-size: 13px !important;
    border-bottom: 1px dashed #f1e9d8 !important;
    padding-bottom: 12px !important;
  }

  .note-footer-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    width: 100% !important;
  }

  .btn-note-like, .btn-note-share {
    width: 100% !important;
    padding: 9px 0 !important;
    font-size: 13.5px !important;
    justify-content: center !important;
  }

  .note-comment-section {
    padding: 20px 16px !important;
    border-radius: 12px !important;
  }
}



