/* ============================================
   0qpz Document Center Styles
   ============================================ */

/* === Index Layout (document.html) === */
.doc-layout {
  display: flex;
  width: 100%;
  min-height: calc(100vh - 60px);
}

body.announcement-visible .doc-layout {
  min-height: calc(100vh - 102px);
}

/* === Sidebar === */
.doc-layout .doc-sidebar {
  width: 220px;
  flex-shrink: 0;
  border-right: none;
  background: linear-gradient(180deg, #f8f9fc 0%, #f4f6fa 100%);
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
  box-shadow: 1px 0 0 rgba(22,119,255,0.08), 3px 0 16px rgba(22,119,255,0.05), 6px 0 32px rgba(22,119,255,0.03);
}

body.announcement-visible .doc-layout .doc-sidebar {
  top: 102px;
  height: calc(100vh - 102px);
}

.doc-sidebar-head {
  padding: 16px 16px 12px;
}

.doc-sidebar-search {
  position: relative;
}

.doc-sidebar-search .fa-search {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: #c0c8d4;
  pointer-events: none;
}

.doc-sidebar-search input {
  width: 100%;
  height: 30px;
  padding: 0 8px 0 28px;
  border: 1px solid #e4e7ec;
  outline: none;
  font-size: 13px;
  background: #fff;
  color: #333;
  border-radius: 0;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.doc-sidebar-search input:focus {
  border-color: #1677ff;
  box-shadow: 0 0 0 2px rgba(22,119,255,0.08);
}

.doc-sidebar-search input::placeholder {
  color: #c8d0dc;
}

/* === Sidebar Tree === */
.doc-tree {
  list-style: none;
  margin: 0;
  padding: 0 0 32px;
}

.doc-tree-item {
  border-bottom: 1px solid #f2f4f7;
}

.doc-tree-item:last-child {
  border-bottom: none;
}

.doc-tree-node {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  cursor: pointer;
  transition: background 0.15s;
  user-select: none;
  gap: 6px;
}

.doc-tree-node:hover {
  background: rgba(22,119,255,0.04);
}

.doc-tree-name {
  flex: 1;
  font-size: 13px;
  font-weight: 700;
  color: #1a1a2e;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", -apple-system, sans-serif;
}

.doc-tree-count {
  font-size: 11px;
  color: #b8c0cc;
  flex-shrink: 0;
  transition: color 0.15s;
}

.doc-tree-node:hover .doc-tree-count {
  color: #1677ff;
}

.doc-tree-arrow {
  font-size: 10px;
  color: #d0d6e0;
  flex-shrink: 0;
  transition: transform 0.25s, color 0.15s;
}

.doc-tree-item.open > .doc-tree-node .doc-tree-arrow {
  transform: rotate(180deg);
  color: #1677ff;
}

.doc-tree-sublist {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}

.doc-tree-item.open > .doc-tree-sublist {
  max-height: 2000px;
}

.doc-tree-subitem a {
  display: block;
  padding: 5px 16px 5px 32px;
  font-size: 12px;
  color: #666;
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
  position: relative;
}

.doc-tree-subitem a::before {
  content: '';
  position: absolute;
  left: 24px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: #eaecf0;
}

.doc-tree-subitem a:hover {
  color: #1677ff;
  background: rgba(22,119,255,0.03);
}

.doc-tree-subitem a.active {
  color: #1677ff;
  font-weight: 500;
}

.doc-tree-subitem a.active::before {
  background: #1677ff;
}

.doc-tree-item.hidden,
.doc-tree-subitem.hidden {
  display: none;
}

/* === Main Content === */
.doc-main {
  flex: 1;
  padding: 0 0 60px;
  min-width: 0;
  overflow-y: auto;
  border-left: 1px solid #f0f2f7;
}

/* === Doc Hero Header === */
.doc-hero {
  padding: 40px 48px 32px;
  border-bottom: 1px solid #f0f2f7;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.doc-hero-left {
  flex: 1;
  min-width: 0;
}

.doc-hero-title {
  font-size: 24px;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0 0 10px;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", -apple-system, sans-serif;
}

.doc-hero-desc {
  font-size: 14px;
  color: #666;
  line-height: 1.6;
  margin: 0;
}

.doc-hero-search {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #e4e7ec;
  padding: 0 12px;
  width: 320px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 0;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fff;
}

.doc-hero-search:focus-within {
  border-color: #1677ff;
  box-shadow: 0 0 0 2px rgba(22,119,255,0.08);
}

.doc-hero-search .fa-search {
  font-size: 14px;
  color: #c0c8d4;
  flex-shrink: 0;
}

.doc-hero-search input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  color: #333;
  background: transparent;
  padding: 0;
  height: 100%;
}

.doc-hero-search input::placeholder {
  color: #c8d0dc;
}

/* === Floor Section === */
.doc-floors {
  padding: 0 48px 48px;
}

.doc-floor {
  margin-bottom: 36px;
}

.doc-floor:last-child {
  margin-bottom: 0;
}

.doc-floor-title {
  font-size: 18px;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0 0 6px;
  padding-top: 28px;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", -apple-system, sans-serif;
}

.doc-floor-desc {
  font-size: 13px;
  color: #8896b3;
  margin: 0 0 20px;
  line-height: 1.5;
}

/* === Grid Layout === */
.doc-grid {
  display: grid;
  gap: 16px;
}

.doc-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.doc-grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

/* === Text Card === */
.doc-card {
  background: #fff;
  border: 1px solid #e8ecf4;
  border-radius: 8px;
  padding: 20px;
  transition: all 0.2s ease;
  cursor: pointer;
  text-decoration: none;
  display: block;
}

.doc-card:hover {
  border-color: #1677ff;
  box-shadow: 0 4px 16px rgba(22,119,255,0.08);
  transform: translateY(-2px);
}

.doc-card-icon {
  width: 40px;
  height: 40px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f0f5ff 0%, #e8f0fe 100%);
  border-radius: 8px;
  color: #1677ff;
  font-size: 18px;
}

.doc-card-title {
  font-size: 15px;
  font-weight: 600;
  color: #1a1a2e;
  margin: 0 0 8px;
}

.doc-card-desc {
  font-size: 13px;
  color: #666;
  line-height: 1.5;
  margin: 0;
}

.doc-card-link {
  display: inline-block;
  margin-top: 12px;
  font-size: 13px;
  color: #1677ff;
  text-decoration: none;
  transition: color 0.15s;
}

.doc-card-link:hover {
  color: #4096ff;
}

/* === Quick Links (flat list style) === */
.doc-quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.doc-quick-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 13px;
  color: #555;
  text-decoration: none;
  background: #f7f8fa;
  border: 1px solid #e8ecf4;
  border-radius: 6px;
  transition: all 0.15s;
}

.doc-quick-link:hover {
  color: #1677ff;
  border-color: #1677ff;
  background: #f0f5ff;
}

.doc-quick-link i {
  font-size: 12px;
  color: #1677ff;
}

/* === Floor Content === */
.doc-floor-content {
  font-size: 14px;
  line-height: 1.8;
  color: #555;
}

.doc-floor-content p {
  margin: 0 0 16px;
}

.doc-floor-content p:last-child {
  margin-bottom: 0;
}

/* === Feature List === */
.doc-feature-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.doc-feature {
  display: flex;
  gap: 16px;
  padding: 20px;
  background: #f7f9fc;
  border-radius: 8px;
  border: 1px solid #e8ecf4;
  transition: all 0.2s;
}

.doc-feature:hover {
  border-color: #1677ff;
  box-shadow: 0 2px 12px rgba(22,119,255,0.06);
}

.doc-feature-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1677ff 0%, #4096ff 100%);
  border-radius: 10px;
  color: #fff;
  font-size: 18px;
}

.doc-feature-body h3 {
  font-size: 15px;
  font-weight: 600;
  color: #1a1a2e;
  margin: 0 0 6px;
}

.doc-feature-body p {
  font-size: 13px;
  color: #666;
  line-height: 1.6;
  margin: 0;
}

/* === Empty State === */
.doc-empty {
  text-align: center;
  padding: 60px 20px;
  color: #8896b3;
}

.doc-empty i {
  font-size: 36px;
  margin-bottom: 12px;
  opacity: 0.4;
}

/* === Detail Content === */
.doc-content {
  flex: 1;
  padding: 28px 40px;
  min-width: 0;
}

.doc-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #8896b3;
  margin-bottom: 20px;
}

.doc-breadcrumb a {
  color: #8896b3;
  text-decoration: none;
}

.doc-breadcrumb a:hover {
  color: #1677ff;
}

.doc-breadcrumb .sep {
  color: #d0d5dd;
}

.doc-content-title {
  font-size: 22px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 6px;
}

.doc-content-time {
  font-size: 13px;
  color: #8896b3;
  margin-bottom: 24px;
}

.doc-content-body {
  font-size: 14px;
  line-height: 1.8;
  color: #333;
  padding: 24px 0;
  border-top: 1px solid #f0f2f7;
  border-bottom: 1px solid #f0f2f7;
}

.doc-content-body img {
  max-width: 100%;
  border-radius: 8px;
}

.doc-content-body a { color: #1677ff; }

.doc-nav-prevnext {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
  gap: 20px;
}

.doc-nav-prevnext a {
  text-decoration: none;
  color: #555;
  font-size: 13px;
  transition: color 0.15s;
  max-width: 45%;
}

.doc-nav-prevnext a:hover { color: #1677ff; }

.doc-toc {
  width: 160px;
  flex-shrink: 0;
  padding: 24px 16px;
  border-left: 1px solid #f0f2f7;
}

.doc-toc-title {
  font-size: 12px;
  font-weight: 600;
  color: #8896b3;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 12px;
}

.doc-toc-item {
  display: block;
  padding: 4px 0;
  font-size: 13px;
  color: #666;
  text-decoration: none;
  transition: color 0.15s;
}

.doc-toc-item:hover,
.doc-toc-item.active {
  color: #1677ff;
}

/* === Search Results (document-result.html) === */
.doc-search-header {
  margin-bottom: 24px;
}

.doc-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #e4e7ec;
  padding: 0 12px;
  height: 40px;
  border-radius: 0;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fff;
}

.doc-search-box:focus-within {
  border-color: #1677ff;
  box-shadow: 0 0 0 2px rgba(22,119,255,0.08);
}

.doc-search-box .fa-search {
  font-size: 14px;
  color: #c0c8d4;
  flex-shrink: 0;
}

.doc-search-box input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  color: #333;
  background: transparent;
  padding: 0;
  height: 100%;
}

.doc-search-box input::placeholder {
  color: #c8d0dc;
}

.doc-result-header {
  padding: 0 0 20px;
  border-bottom: 1px solid #f0f2f7;
  margin-bottom: 20px;
}

.doc-result-header .result-count {
  font-size: 14px;
  color: #666;
  margin: 0;
}

.doc-result-header .result-count strong {
  color: #1677ff;
}

.doc-result-item {
  padding: 20px 0;
  border-bottom: 1px solid #f0f2f7;
}

.doc-result-item:first-child {
  padding-top: 0;
}

.doc-result-item:last-child {
  border-bottom: none;
}

.doc-result-item h4 {
  margin: 0 0 8px;
  font-size: 15px;
}

.doc-result-item h4 a {
  color: #1a1a2e;
  text-decoration: none;
  transition: color 0.15s;
}

.doc-result-item h4 a:hover {
  color: #1677ff;
}

.doc-result-item .result-desc {
  font-size: 13px;
  color: #666;
  line-height: 1.6;
  margin: 0;
}

.doc-result-item .result-meta {
  font-size: 12px;
  color: #8896b3;
  margin-top: 8px;
}

.doc-result-item .highlight {
  color: #1677ff;
  font-weight: 600;
}

/* === Overview/View Page (document-view.html) === */
.doc-view-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.doc-view-item {
  border: 1px solid #e8ecf4;
  border-radius: 8px;
  overflow: hidden;
}

.doc-view-head {
  background: #f7f8fa;
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 600;
  color: #1a1a2e;
  border-bottom: 1px solid #e8ecf4;
}

.doc-view-body {
  padding: 16px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.doc-view-body a {
  display: block;
  padding: 5px 10px;
  font-size: 13px;
  color: #555;
  text-decoration: none;
  border-radius: 4px;
  transition: all 0.15s;
}

.doc-view-body a:hover {
  color: #1677ff;
  background: rgba(22,119,255,0.04);
}

/* === Guide/TOC box === */
.doc-guide-box {
  padding-left: 12px;
  border-left: 2px solid #e8ecf4;
}

.doc-guide-box .guide-title {
  font-size: 13px;
  font-weight: 600;
  color: #1a1a2e;
  margin-bottom: 10px;
}

.doc-guide-box a {
  display: block;
  padding: 4px 0;
  font-size: 13px;
  color: #666;
  text-decoration: none;
  transition: color 0.15s;
}

.doc-guide-box a:hover,
.doc-guide-box a.active {
  color: #1677ff;
}

.doc-guide-box a.active {
  font-weight: 500;
}

/* === Responsive === */
@media (max-width: 768px) {
  .doc-layout { flex-direction: column; }
  .doc-layout .doc-sidebar { width: 100%; position: relative; top: 0; height: auto; border-right: none; border-bottom: 1px solid #eaecf0; box-shadow: none; }
  .doc-main { padding: 0 0 40px; }
  .doc-content { padding: 20px 16px; }
  .doc-hero { flex-direction: column; align-items: flex-start; padding: 24px 16px 20px; }
  .doc-hero-title { font-size: 20px; }
  .doc-hero-search { width: 100%; }
  .doc-floors { padding: 0 16px 32px; }
  .doc-floor-title { font-size: 16px; }
  .doc-feature { flex-direction: column; gap: 12px; }
  .doc-feature-icon { width: 36px; height: 36px; font-size: 16px; }
  .doc-content-title { font-size: 18px; }
  .doc-result-header { padding: 20px 0; }
}
