* {
  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;
}

.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;
}

.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);
}

.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: flex-start;
}

.home-top-panel {
  padding-bottom: 14px;
}

.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;
}

.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;
}

.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;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #e6ecf5;
  margin-bottom: 10px;
  background: #f8fbff;
}

.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;
}

.qr-wrap {
  margin-top: 12px;
}

.profile-form {
  display: grid;
  gap: 8px;
}

.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;
}

.ai-chat {
  margin-top: 8px;
}

.ai-chat-messages {
  border: 1px solid #e6ecf5;
  border-radius: 10px;
  background: #f8fbff;
  min-height: 140px;
  max-height: 320px;
  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-user {
  background: #e8f2ff;
  margin-left: 36px;
}

.ai-msg-assistant {
  background: #ffffff;
  border: 1px solid #e6ecf5;
  margin-right: 36px;
}

.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-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;
}

@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;
  }
}
