/* 咕咕书屋 自定义样式 - 近似 txt668 简洁风格 */

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
  font-size: 14px;
  color: #333;
  background: #f5f5f5;
  line-height: 1.6;
}
a { color: #2c6fbb; text-decoration: none; }
a:hover { color: #d4262a; text-decoration: underline; }

/* ============ 顶部导航 ============ */
.gg-header {
  background: #fff;
  border-bottom: 2px solid #d4262a;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.gg-header-inner {
  max-width: 1180px;
  margin: 0 auto;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
}
.gg-logo {
  font-size: 22px;
  font-weight: bold;
  color: #d4262a;
  white-space: nowrap;
}
.gg-logo:hover { text-decoration: none; }
.gg-nav { display: flex; align-items: center; gap: 8px; }
.gg-nav-item {
  padding: 6px 12px;
  cursor: pointer;
  position: relative;
  color: #333;
  font-size: 15px;
}
.gg-nav-item:hover { color: #d4262a; }
.gg-arrow { font-size: 10px; }
.gg-nav-cats:hover .gg-nav-dropdown { display: flex; }
.gg-nav-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 120px;
  background: #fff;
  border: 1px solid #eee;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  flex-direction: column;
  /* 高于 amis 表格固定表头 cxd-Table-fixedTop 的 z-index:900，避免下拉项被遮挡；低于 amis 弹窗 1050 */
  z-index: 1000;
  padding: 4px 0;
}
.gg-nav-dropdown a {
  padding: 6px 14px;
  color: #333;
  font-size: 13px;
  white-space: nowrap;
}
.gg-nav-dropdown a:hover { background: #f5f5f5; color: #d4262a; text-decoration: none; }

.gg-search {
  flex: 1;
  display: flex;
  max-width: 400px;
  margin-left: auto;
}
.gg-search input {
  flex: 1;
  border: 1px solid #ccc;
  border-right: none;
  padding: 6px 10px;
  font-size: 13px;
  outline: none;
}
.gg-search input:focus { border-color: #2c6fbb; }
.gg-search button {
  background: #2c6fbb;
  color: #fff;
  border: none;
  padding: 6px 16px;
  cursor: pointer;
  font-size: 13px;
}
.gg-search button:hover { background: #1a5299; }

.gg-user { display: flex; align-items: center; gap: 10px; }
.gg-user-link { font-size: 13px; color: #2c6fbb; }
.gg-user-link:hover { color: #d4262a; }
.gg-user-name { font-size: 13px; color: #666; }

/* ============ 内容区 ============ */
.gg-content {
  max-width: 1180px;
  margin: 16px auto;
  padding: 0 16px;
  min-height: calc(100vh - 56px - 120px);
}

.gg-error { text-align: center; padding: 60px 0; color: #999; }

/* ============ 底部 ============ */
.gg-footer {
  text-align: center;
  padding: 20px 16px;
  color: #999;
  font-size: 12px;
  border-top: 1px solid #e8e8e8;
  background: #fff;
}

/* ============ 列表/卡片通用（贴近 txt668 极简文本列表风格） ============ */
.gg-list { list-style: none; padding: 0; margin: 0; }
.gg-list li {
  padding: 10px 12px;
  border-bottom: 1px solid #eee;
  line-height: 1.7;
  transition: background 0.15s;
}
.gg-list li:hover { background: #fafafa; }
.gg-list li:last-child { border-bottom: none; }

.gg-book-line {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 2px 0;
  flex-wrap: wrap;
}
.gg-book-line .gg-cat-tag {
  color: #d4262a;
  font-size: 12px;
  white-space: nowrap;
}
/* 用中括号包裹分类标签 —— txt668 风格 */
.gg-cat-tag::before { content: "["; color: #999; }
.gg-cat-tag::after  { content: "]"; color: #999; }

.gg-book-title {
  color: #333;
  font-weight: 600;
  font-size: 14px;
  padding-left: 2px;
}
.gg-book-title::before { content: "\300A"; }  /* 《 */
.gg-book-title::after  { content: "\300B"; }  /* 》 */
.gg-book-title:hover { color: #d4262a; }

.gg-book-meta { color: #999; font-size: 12px; }

/* 书籍条目多行排版 */
.gg-book-entry .gg-row-title { margin-bottom: 2px; }
.gg-book-entry .gg-row-chapter {
  padding-left: 2px;
}
.gg-book-entry .gg-row-chapter a {
  color: #2c6fbb;
  font-size: 13px;
}
.gg-book-entry .gg-row-chapter a:hover { color: #d4262a; text-decoration: none; }
.gg-book-entry .gg-row-info {
  color: #888;
  font-size: 12px;
  display: flex;
  gap: 14px;
  padding-left: 2px;
  flex-wrap: wrap;
}

/* ============ 书籍详情页 ============ */
.gg-book-info {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.gg-book-info td {
  padding: 6px 10px;
  border-bottom: 1px dashed #eee;
  color: #555;
}
.gg-book-info a { color: #2c6fbb; }

/* 隐藏"暂无封面"占位 —— 贴合用户少图偏好 */
.gg-no-cover-placeholder {
  display: none;
}

/* 简介面板 */
.gg-desc-panel {
  color: #444;
  font-size: 13px;
  padding: 6px 4px;
  line-height: 1.9;
}

/* ============ 章节目录网格（按行横向排列） ============ */
.gg-chapter-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  column-gap: 12px;
  padding: 6px 4px 16px;
}
.gg-chapter-item {
  display: block;
  padding: 5px 6px;
  border-bottom: 1px dotted #eee;
  color: #333;
  font-size: 13px;
}
.gg-chapter-item:hover {
  background: #f5f5f5;
  color: #d4262a;
  text-decoration: none;
}
@media (max-width: 960px)  { .gg-chapter-list { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px)  { .gg-chapter-list { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px)  { .gg-chapter-list { grid-template-columns: 1fr; } }

/* ============ 章节阅读页 ============ */
.gg-read-title {
  text-align: center;
  font-size: 22px;
  font-weight: bold;
  margin: 24px auto 18px;
  max-width: 800px;
  color: #222;
  line-height: 1.5;
}
/* amis tpl 实际外层是 inline <span>，真正的阅读容器是模板里的 <div class="gg-read-content"> */
.gg-read-content {
  display: block;
  max-width: 800px;
  margin: 0 auto;
  padding: 28px 32px;
  background: #fff;
  font-size: 17px;
  line-height: 2;
  color: #222;
  border: 1px solid #eee;
  border-radius: 3px;
  box-sizing: border-box;
}
.gg-read-content p {
  margin: 0 0 0.9em;
  text-indent: 2em;
  line-height: 2;
  word-break: break-word;
}
.gg-read-content p:last-child {
  margin-bottom: 0;
}
.gg-read-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  max-width: 800px;
  margin: 24px auto 8px;
}
.gg-read-nav a,
.gg-read-nav .gg-read-disabled {
  display: inline-block;
  padding: 7px 22px;
  border: 1px solid #ccc;
  border-radius: 2px;
  font-size: 13px;
  line-height: 1.4;
  background: #fff;
  color: #2c6fbb;
  text-decoration: none;
  cursor: pointer;
}
.gg-read-nav a:hover {
  background: #f5f5f5;
  color: #d4262a;
  text-decoration: none;
}
.gg-read-nav a:visited { color: #2c6fbb; }
.gg-read-nav .gg-read-disabled {
  color: #bbb;
  background: #f7f7f7;
  border-color: #e5e5e5;
  cursor: not-allowed;
}
@media (max-width: 720px) {
  .gg-read-content { padding: 18px 16px; font-size: 16px; }
  .gg-read-nav a,
  .gg-read-nav .gg-read-disabled { padding: 8px 16px; }
}
.gg-breadcrumb {
  padding: 8px 4px 16px;
  font-size: 12px;
  color: #888;
}
.gg-breadcrumb a { color: #888; }

/* ============ 居中辅助类 ============ */
.gg-btn-center {
  text-align: center;
  padding: 16px 0;
}
.gg-section-wrap {
  max-width: 1180px;
  margin: 0 auto;
}

/* ============ 面板/分区 贴近 txt668 标题风格 ============ */
.gg-content .cxd-Panel {
  border: 1px solid #e8e8e8;
  border-radius: 0;
  background: #fff;
  margin-bottom: 14px;
  box-shadow: none;
}
.gg-content .cxd-Panel-heading {
  background: #fafafa;
  border-bottom: 2px solid #d4262a;
  padding: 8px 14px;
  color: #333;
  font-weight: 600;
}
.gg-content .cxd-Panel-title {
  font-size: 15px;
  color: #222;
}
.gg-content .cxd-Panel-body {
  padding: 6px 14px 10px;
}
.gg-content .cxd-Panel-footer {
  padding: 6px 14px 12px;
}
/* amis service 无 wrapper 边框 */
.gg-content .cxd-Service {
  border: none;
  box-shadow: none;
  padding: 0;
}

/* ============ amis 其他组件微调 ============ */
.gg-content .cxd-Button {
  border-radius: 2px;
  font-size: 13px;
}
.gg-content .cxd-CRUD {
  border: 1px solid #e8e8e8;
  padding: 8px 10px;
  background: #fff;
}
.amis-scope .cxd-Table-content > table {
  font-size: 13px;
}
/* 面包屑样式 */
.gg-content .cxd-Breadcrumb {
  padding: 0 0 10px;
  font-size: 12px;
  color: #888;
}

/* ============ 分页条（< > 与页码按钮样式一致，居中） ============ */
.gg-content .cxd-Pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  padding: 10px 0 4px;
  margin: 0;
}
.gg-content .cxd-Pagination li { margin: 0; }
/* 隐藏原生箭头图标及占位 span，用与页码一致的 < > 符号代替 */
.gg-content .cxd-Pagination-prev .icon-left-arrow,
.gg-content .cxd-Pagination-next .icon-right-arrow,
.gg-content .cxd-Pagination-prev span,
.gg-content .cxd-Pagination-next span { display: none; }
.gg-content .cxd-Pagination-prev::before { content: "<"; }
.gg-content .cxd-Pagination-next::after  { content: ">"; }
/* 尺寸/字号/颜色完全对齐 SDK 页码按钮（32×32、无边框、12px 字号） */
.gg-content .cxd-Pagination-prev,
.gg-content .cxd-Pagination-next {
  display: inline-block;
  padding: 0 8px;
  min-width: 32px;
  font-size: 12px;
  line-height: 32px;
  background: #fff;
  color: #5c5f66;
  border: none;
  border-radius: 0;
  text-align: center;
  cursor: pointer;
  user-select: none;
  box-sizing: border-box;
}
.gg-content .cxd-Pagination-prev:hover,
.gg-content .cxd-Pagination-next:hover {
  background: #f5f5f5;
  color: #d4262a;
  text-decoration: none;
}
/* 禁用态（首页的 < / 末页的 >） */
.gg-content .cxd-Pagination-prev.is-disabled,
.gg-content .cxd-Pagination-next.is-disabled {
  color: #ccc;
  background: #fff;
  cursor: not-allowed;
}
.gg-content .cxd-Pagination-prev.is-disabled:hover,
.gg-content .cxd-Pagination-next.is-disabled:hover {
  background: #fff;
  color: #ccc;
}
