* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
  color: #1f2a37;
  background: #f4f7fb;
}

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
}

.site-header,
.site-footer {
  background: #ffffff;
  border-bottom: 1px solid #e6ecf5;
}

.site-footer {
  border-top: 1px solid #e6ecf5;
  border-bottom: 0;
  margin-top: 32px;
  padding: 16px 0;
  color: #6b7280;
}

.footer-line {
  margin: 4px 0;
}

.pager-panel {
  padding: 12px 16px;
}

.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pager-btn {
  min-width: 40px;
  text-align: center;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #d6dfec;
  text-decoration: none;
  color: #334155;
  background: #fff;
  font-size: 14px;
  transition: all .2s ease;
}

.pager-btn:hover {
  border-color: #1867c0;
  color: #1867c0;
}

.pager-btn.active {
  background: #1867c0;
  border-color: #1867c0;
  color: #fff;
  cursor: default;
}

.pager-btn.disabled {
  color: #94a3b8;
  background: #f8fafc;
  cursor: not-allowed;
}

.pager-gap {
  color: #94a3b8;
  padding: 0 2px;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #1867c0;
  font-weight: 700;
  font-size: 20px;
}

.logo-image {
  height: 24px;
  width: auto;
  max-width: 160px;
  border-radius: 4px;
  object-fit: contain;
  display: block;
}

.main-nav a {
  margin-left: 14px;
  text-decoration: none;
  color: #3b495e;
  padding: 8px 10px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.main-nav a:hover {
  background: #edf4ff;
  color: #1867c0;
}

.main-nav a.active {
  background: #1867c0;
  color: #fff;
}

.panel {
  background: #fff;
  border: 1px solid #e6ecf5;
  border-radius: 14px;
  padding: 18px;
  margin-top: 16px;
  box-shadow: 0 4px 18px rgba(16, 41, 83, 0.04);
}

.panel > h1,
.panel > h2 {
  margin: 0 0 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  line-height: 1.4;
  font-weight: 600;
  color: #334155;
}

.notice {
  margin-top: 16px;
  padding: 10px 12px;
  border-radius: 8px;
}

.notice.success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.notice.error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.toolbar {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.toolbar input,
.toolbar select,
.toolbar button {
  height: 38px;
  border: 1px solid #d6dfec;
  border-radius: 8px;
  padding: 0 10px;
  background: #fff;
}

.toolbar a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d6dfec;
  border-radius: 8px;
  padding: 0 10px;
  min-height: 36px;
  color: #374151;
  text-decoration: none;
}

.toolbar a.active {
  background: #1867c0;
  border-color: #1867c0;
  color: #fff;
}

.toolbar button {
  background: #1867c0;
  color: #fff;
  border-color: #1867c0;
  cursor: pointer;
}

.toolbar .btn-muted {
  background: #f1f5f9;
  border-color: #d6dfec;
  color: #64748b;
  cursor: pointer;
}

.toolbar input {
  flex: 1;
  min-width: 220px;
}

.chips {
  margin-top: 12px;
}

.chips a {
  display: inline-block;
  margin: 0 8px 8px 0;
  padding: 6px 10px;
  border-radius: 999px;
  background: #edf4ff;
  color: #1867c0;
  text-decoration: none;
  font-size: 13px;
}

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

.chips a.active {
  background: #1867c0;
  color: #fff;
}

.chip-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 10px 10px 0;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid #d6dfec;
  background: #fff;
}

.chip-check input {
  margin: 0;
}

.hot-search-line {
  margin-top: 12px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.hot-label {
  color: #ef4444;
  font-size: 13px;
  font-weight: 600;
}

.hot-search-link {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fff1f2;
  color: #e11d48;
  text-decoration: none;
  font-size: 12px;
}

.notice-inline {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #fde68a;
  background: #fffbeb;
  color: #92400e;
  display: flex;
  gap: 8px;
  align-items: center;
}

.home-top-panel {
  padding-bottom: 14px;
}

.search-history-panel {
  margin-top: 12px;
}

.search-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.search-history-title {
  font-size: 13px;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.search-history-clear {
  height: 30px !important;
  padding: 0 10px !important;
  border-radius: 999px !important;
  font-size: 12px;
}

.search-history-chips {
  margin-top: 10px;
}

.section-title {
  margin: 0 0 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 600;
  color: #334155;
}

.banner-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.banner-card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  display: block;
  min-height: 110px;
  background: #f1f5f9;
}

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

.banner-card span {
  position: absolute;
  left: 10px;
  bottom: 10px;
  color: #fff;
  font-size: 13px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.featured-card {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid #e6ecf5;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 8px 22px rgba(16, 41, 83, 0.06);
}

.featured-cover {
  display: block;
  height: 152px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #e6ecf5;
  background: #edf4ff;
}

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

.featured-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #7c8ea8;
  font-size: 32px;
}

.featured-body h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.4;
}

.featured-body h3 a {
  color: #0f172a;
  text-decoration: none;
}

.featured-desc {
  margin: 8px 0 10px;
  color: #475569;
  font-size: 13px;
  line-height: 1.65;
  min-height: 42px;
}

.featured-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
  color: #64748b;
  font-size: 12px;
}

.featured-meta span i {
  margin-right: 3px;
}

.featured-action {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 6px 10px;
  border-radius: 8px;
  background: #1867c0;
  color: #fff !important;
  text-decoration: none;
  font-size: 12px;
}

.content-platform-grid {
  gap: 16px;
}

.content-platform-card {
  background: #fff;
  border: 1px solid #e8eef7;
  box-shadow: 0 2px 10px rgba(2, 6, 23, 0.04);
  transition: box-shadow .2s ease, transform .2s ease;
}

.content-platform-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.1);
}

.content-platform-card .featured-cover {
  height: 138px;
}

.content-platform-card .featured-body h3 a {
  color: #0b1220;
}

.content-platform-card .featured-desc {
  min-height: 60px;
  color: #3b4a60;
}

.content-platform-card .featured-meta {
  gap: 8px;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid #e7edf6;
  background: #f8fbff;
  color: #5b6b82;
  font-size: 12px;
}

.featured-readmore {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  text-decoration: none;
  color: #1867c0;
  font-size: 13px;
  font-weight: 500;
}

.compact-featured-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.compact-featured-card {
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  align-items: start;
}

.compact-featured-card .featured-cover {
  height: 114px;
}

.compact-featured-card .featured-body h3 {
  font-size: 15px;
  line-height: 1.4;
}

.compact-featured-card .featured-body h3 a {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.compact-featured-card .featured-meta {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.compact-featured-card .meta-chip {
  width: auto;
  max-width: 100%;
  justify-content: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.no-cover-featured-card {
  grid-template-columns: 1fr;
  padding: 9px 10px;
}

.no-cover-featured-card .featured-body h3 {
  font-size: 14px;
}

.no-cover-featured-card .featured-meta {
  margin-top: 4px;
  gap: 5px;
}

.no-cover-featured-card .meta-chip {
  padding: 2px 7px;
  font-size: 11px;
}

.card,
.empty {
  background: #fff;
  border: 1px solid #e6ecf5;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 4px 18px rgba(16, 41, 83, 0.04);
}

.card h2 {
  margin: 0 0 8px;
  font-size: 16px;
  line-height: 1.45;
}

.card h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.card a {
  color: #111827;
  text-decoration: none;
}

.doc-list-card {
  border-color: #e8eef7;
  box-shadow: 0 2px 10px rgba(2, 6, 23, 0.04);
  transition: box-shadow .2s ease, transform .2s ease;
}

.doc-list-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.1);
}

.doc-card-title {
  margin: 0 0 8px;
  font-size: 16px;
  line-height: 1.45;
}

.doc-card-title a {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}

.doc-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.list-favorite-btn {
  margin-top: 8px;
  height: 32px;
  border: 1px solid #d6dfec;
  border-radius: 999px;
  background: #fff;
  color: #475569;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all .2s ease;
}

.list-favorite-btn:hover {
  border-color: #1867c0;
  color: #1867c0;
  background: #edf4ff;
}

.list-favorite-btn.is-active {
  border-color: #ef476f;
  color: #ef476f;
  background: #fff1f2;
}

.list-favorite-btn:disabled {
  opacity: .7;
  cursor: not-allowed;
}

.meta {
  color: #63758d;
  font-size: 13px;
  margin: 6px 0;
}

.desc {
  line-height: 1.7;
  white-space: pre-wrap;
  color: #334155;
}

.doc-cover {
  width: 100%;
  height: 150px;
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #e6ecf5;
  margin-bottom: 10px;
  background: #f8fbff;
}

.cover-favorite-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  margin-top: 0;
  padding: 0;
  gap: 0;
  border-radius: 999px;
  border: 1px solid rgba(226, 236, 245, 0.95);
  background: rgba(255, 255, 255, 0.92);
  color: #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  z-index: 2;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.12);
  transition: all .2s ease;
}

.cover-favorite-btn:hover {
  border-color: #1867c0;
  color: #1867c0;
  background: #edf4ff;
}

.cover-favorite-btn i {
  font-size: 17px;
  line-height: 1;
}

.cover-favorite-link {
  cursor: pointer;
}

.cover-favorite-btn .favorite-btn-text {
  display: none;
}

.cover-favorite-btn.is-active {
  border-color: #ef476f;
  color: #ef476f;
  background: #fff1f2;
}

.cover-favorite-btn:disabled {
  opacity: .78;
  cursor: not-allowed;
}

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

.doc-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  color: #9aa8bb;
}

.doc-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 8px;
}

.doc-list {
  margin: 0;
  padding-left: 18px;
}

.code-box {
  margin-top: 12px;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 8px;
  padding: 12px;
  white-space: pre-wrap;
  word-break: break-all;
}

.pay-session-status {
  margin-top: 10px;
  color: #475569;
}

.pay-user-alert {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  border: 1px solid #facc15;
  background: #fffbeb;
  color: #92400e;
  border-radius: 10px;
  padding: 10px 12px;
  line-height: 1.6;
}

.pay-user-alert i {
  font-size: 18px;
  margin-top: 2px;
}

.qr-wrap {
  margin-top: 12px;
}

.login-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
}

.login-modal.is-open {
  display: block;
}

.login-modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.52);
}

.login-modal-card {
  position: relative;
  z-index: 1;
  width: min(420px, calc(100vw - 28px));
  margin: 9vh auto 0;
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e5eaf3;
  box-shadow: 0 20px 48px rgba(2, 6, 23, 0.24);
  padding: 18px 18px 16px;
}

.login-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border: 1px solid #d6dfec;
  border-radius: 999px;
  background: #fff;
  color: #334155;
  cursor: pointer;
}

.login-qr-wrap {
  margin-top: 12px;
  min-height: 236px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-qr-wrap img {
  width: 220px;
  height: 220px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  display: block;
}

.login-status {
  margin-top: 10px;
}

.profile-form {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.profile-form input {
  height: 36px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 0 10px;
}

.profile-form button {
  width: 120px;
  height: 36px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #111827;
  color: #fff;
}

.account-panel h1 {
  margin-bottom: 12px;
}

.vip-page-title {
  font-size: 1.35rem;
  margin: 0 0 10px;
  color: #0f172a;
}

.vip-context-banner {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  margin-bottom: 10px;
  font-size: 14px;
  line-height: 1.55;
  color: #334155;
}

.vip-context-banner > i {
  font-size: 22px;
  color: #64748b;
  flex-shrink: 0;
  margin-top: 2px;
}

.vip-context-banner--active {
  border-color: #fcd34d;
  background: linear-gradient(135deg, #fffbeb 0%, #fff7ed 100%);
}

.vip-context-banner--active > i {
  color: #d97706;
}

.vip-context-banner--warn {
  border-color: #fecaca;
  background: #fef2f2;
}

.vip-context-banner--warn > i {
  color: #dc2626;
}

.vip-summary {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.vip-summary--active {
  border-color: #fcd34d;
  background: linear-gradient(135deg, #fffbeb 0%, #fff7ed 100%);
}

.vip-summary--expired {
  border-color: #fecaca;
  background: #fef2f2;
}

.vip-summary--none {
  background: #f8fafc;
}

.vip-summary-head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  min-width: 0;
  flex: 1;
}

.vip-summary-head > i {
  font-size: 26px;
  color: #d97706;
  flex-shrink: 0;
}

.vip-summary--expired .vip-summary-head > i {
  color: #9ca3af;
}

.vip-summary--none .vip-summary-head > i {
  color: #94a3b8;
}

.vip-summary-title {
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 4px;
}

.vip-summary-meta {
  margin: 0;
  font-size: 13px;
  color: #475569;
  line-height: 1.5;
}

.vip-summary-warn {
  margin: 6px 0 0;
  font-size: 13px;
  color: #b45309;
}

.vip-summary-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: 8px;
  background: #111827;
  color: #fff !important;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

.vip-summary-cta:hover {
  background: #1f2937;
}

.account-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.stat-item {
  border: 1px solid #e6ecf5;
  border-radius: 10px;
  padding: 10px 12px;
  background: #f8fbff;
}

.stat-item .label {
  display: block;
  color: #6b7280;
  font-size: 12px;
  margin-bottom: 4px;
}

.stat-item strong {
  font-size: 16px;
  color: #0f172a;
}

.quick-links {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

.quick-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #dce6f4;
  background: #fff;
  color: #1f334d;
  text-decoration: none;
}

.quick-links a:hover {
  border-color: #1867c0;
  color: #1867c0;
}

.logout-form {
  margin-top: 14px;
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  border: 1px solid #ef4444;
  border-radius: 8px;
  padding: 0 14px;
  background: #ef4444;
  color: #fff;
  cursor: pointer;
}

.btn-danger:hover {
  background: #dc2626;
  border-color: #dc2626;
}

.clean-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  border: 1px solid #e6ecf5;
  border-radius: 10px;
  overflow: hidden;
}

.clean-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid #eef2f8;
}

.clean-list li:last-child {
  border-bottom: 0;
}

.clean-list li a {
  color: #0f172a;
  text-decoration: none;
}

.clean-list li i {
  color: #94a3b8;
}

.clean-list .empty-row {
  color: #64748b;
}

.ai-chat {
  margin-top: 8px;
}

.ai-chat-messages {
  border: 1px solid #e6ecf5;
  border-radius: 10px;
  background: #f8fbff;
  min-height: 140px;
  max-height: 420px;
  overflow-y: auto;
  padding: 10px;
}

.ai-msg {
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 8px;
  white-space: pre-wrap;
  line-height: 1.6;
}

.ai-msg-stream-status {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 6px;
}

.ai-msg-user {
  background: #e8f2ff;
  margin-left: 36px;
}

.ai-msg-assistant {
  background: #ffffff;
  border: 1px solid #e6ecf5;
  margin-right: 36px;
  white-space: normal;
}

.ai-msg-assistant .ai-markdown-body {
  white-space: normal;
}

.ai-markdown-body {
  font-size: 14px;
  color: #1e293b;
}

.ai-markdown-body p {
  margin: 0 0 0.65em;
}

.ai-markdown-body p:last-child {
  margin-bottom: 0;
}

.ai-markdown-body h1,
.ai-markdown-body h2,
.ai-markdown-body h3,
.ai-markdown-body h4 {
  margin: 0.85em 0 0.45em;
  line-height: 1.35;
  font-weight: 600;
  color: #0f172a;
}

.ai-markdown-body h1:first-child,
.ai-markdown-body h2:first-child,
.ai-markdown-body h3:first-child {
  margin-top: 0;
}

.ai-markdown-body ul,
.ai-markdown-body ol {
  margin: 0 0 0.65em 1.15em;
  padding: 0;
}

.ai-markdown-body li {
  margin-bottom: 0.25em;
}

.ai-markdown-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9em;
  background: #f1f5f9;
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.ai-markdown-body pre {
  margin: 0.65em 0;
  padding: 10px 12px;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.45;
}

.ai-markdown-body pre code {
  background: transparent;
  padding: 0;
  color: inherit;
}

.ai-markdown-body blockquote {
  margin: 0.65em 0;
  padding: 6px 12px;
  border-left: 3px solid #94a3b8;
  background: #f8fafc;
  color: #475569;
}

.ai-markdown-body a {
  color: #1867c0;
  word-break: break-all;
}

.ai-markdown-body table {
  border-collapse: collapse;
  width: 100%;
  margin: 0.65em 0;
  font-size: 13px;
}

.ai-markdown-body th,
.ai-markdown-body td {
  border: 1px solid #e2e8f0;
  padding: 6px 8px;
  text-align: left;
}

.ai-msg-system {
  background: #f1f5f9;
  color: #475569;
}

.ai-msg-error {
  background: #fef2f2;
  color: #b91c1c;
}

.ai-chat-input {
  margin-top: 10px;
  display: flex;
  gap: 8px;
}

.ai-chat-input textarea {
  flex: 1;
  min-height: 76px;
  border: 1px solid #d6dfec;
  border-radius: 8px;
  padding: 10px;
  resize: vertical;
}

.ai-chat-input button {
  min-width: 90px;
  border: 1px solid #1867c0;
  background: #1867c0;
  color: #fff;
  border-radius: 8px;
  cursor: pointer;
}

.doc-preview-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.doc-preview-status {
  min-height: 20px;
  color: #64748b;
}

.doc-preview-html {
  margin-top: 12px;
  line-height: 1.8;
  color: #334155;
}

.doc-preview-html .epub-preview-chapter {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px dashed #dbe4f0;
}

.doc-preview-html .epub-preview-chapter:last-child {
  margin-bottom: 0;
  border-bottom: none;
}

.doc-preview-card {
  border: 1px solid #e6ecf5;
  border-radius: 10px;
  background: #fff;
  padding: 8px;
  cursor: zoom-in;
  transition: transform .18s ease, box-shadow .18s ease;
}

.doc-preview-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.08);
}

.doc-preview-image-wrap {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #edf2f7;
  background: #f8fbff;
}

.doc-preview-image-wrap img {
  width: 100%;
  display: block;
  height: auto;
}

.preview-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(2, 8, 23, 0.88);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.preview-lightbox.is-open {
  display: flex;
}

.preview-stage {
  max-width: min(1100px, 84vw);
  max-height: 88vh;
  text-align: center;
}

.preview-stage img {
  max-width: 100%;
  max-height: calc(88vh - 42px);
  border-radius: 10px;
  background: #fff;
}

.preview-stage p {
  margin: 8px 0 0;
  color: #e2e8f0;
}

.preview-close,
.preview-nav {
  position: absolute;
  border: 1px solid rgba(226, 232, 240, 0.35);
  background: rgba(15, 23, 42, 0.45);
  color: #fff;
  border-radius: 999px;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.preview-close {
  top: 20px;
  right: 20px;
}

.preview-prev {
  left: 22px;
}

.preview-next {
  right: 22px;
}

.footer-split {
  margin: 0 6px;
}

.plan-card {
  position: relative;
}

.plan-card .badge {
  position: absolute;
  right: 12px;
  top: 12px;
  background: #ff5a5f;
  color: #fff;
  border-radius: 999px;
  font-size: 12px;
  padding: 2px 8px;
}

.plan-price {
  margin: 10px 0;
  color: #1867c0;
  font-weight: 700;
  font-size: 28px;
  line-height: 1.2;
}

.plan-price .symbol {
  font-size: 16px;
  margin-right: 2px;
}

.createPaySessionBtn {
  margin-top: 8px;
  width: 100%;
  height: 38px;
  border: 1px solid #1867c0;
  border-radius: 10px;
  background: #1867c0;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, transform .15s ease;
}

.createPaySessionBtn:hover {
  background: #14539b;
  border-color: #14539b;
  transform: translateY(-1px);
}

.createPaySessionBtn:disabled {
  background: #9db8d8;
  border-color: #9db8d8;
  cursor: not-allowed;
  transform: none;
}

@media (max-width: 1024px) {
  .container {
    padding: 0 14px;
  }
}

@media (max-width: 768px) {
  .site-header .container {
    flex-direction: column;
    align-items: flex-start;
    padding-top: 8px;
    padding-bottom: 8px;
    gap: 8px;
  }

  .main-nav a {
    margin-left: 0;
    margin-right: 6px;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .featured-grid {
    grid-template-columns: 1fr;
  }

  .featured-card {
    grid-template-columns: 1fr;
  }

  .compact-featured-card {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .no-cover-featured-card {
    grid-template-columns: 1fr;
  }

  .featured-cover {
    height: 172px;
  }

  .compact-featured-card .featured-cover {
    height: 110px;
  }

  .compact-featured-grid {
    grid-template-columns: 1fr;
  }

  .account-stats {
    grid-template-columns: 1fr;
  }
}
