/*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ./node_modules/.pnpm/next@15.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[13].oneOf[10].use[2]!./node_modules/.pnpm/next@15.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[13].oneOf[10].use[3]!./app/globals.css ***!
  \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/* 限制 Word/HTML 图片最大宽度，防止溢出内容区 */
.article-content img {
  max-width: 100%;
  height: auto;
  /* display: block; */
  margin: 0.5rem auto;
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system,BlinkMacSystemFont,"Helvetica Neue","PingFang SC","Microsoft YaHei","Source Han Sans SC","Noto Sans CJK SC","WenQuanYi Micro Hei","MiSans L3","Segoe UI",sans-serif;
}

html,
body {
  min-height: 100%;
}

body {
  background: white;
  color: #0a1929;
  overflow: hidden;
}

button {
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: left;
}

/* Navbar */
.navbar {
  background: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(12px);
          backdrop-filter: blur(12px);
  border-bottom: 1px solid #e8eef4;
  padding: 0 1.5rem;
  height: 50px;
  display: flex;
  align-items: center;
  gap: 2rem;
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-brand {
  font-weight: 700;
  font-size: 1rem;
  color: #0a1929;
}

.navbar-links {
  display: flex;
  gap: 0.5rem;
}

.navbar-link {
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
  font-size: 0.85rem;
  color: #4a6580;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.navbar-link:hover {
  background: #f0f5fa;
  color: #1e3a5f;
}

.navbar-link.active {
  background: #e8f2ff;
  color: #0066cc;
  font-weight: 600;
}

/* Homepage */
.home-page {
  /* max-width: 1200px; */
  margin: 0 auto;
  padding: 2rem 15rem;
  background: #F5F5F5;
  height: 100vh;
}

.home-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #0a1929;
  margin-bottom: 1.5rem;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  grid-gap: 1rem;
  gap: 1rem;
}

.card-group {
  margin-bottom: 1.5rem;
}

.card-group-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #0969DA;
  margin-bottom: 0.75rem;
  padding-left: 0.2rem;
}

.card-item {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
  background: #fff;
  border: 1px solid #e8eef4;
  border-radius: 10px;
  text-decoration: none;
  color: #1e3a5f;
  transition: box-shadow 0.2s, transform 0.15s, border-color 0.2s;
}

.card-item:hover {
  box-shadow: 0 4px 16px rgba(0, 80, 160, 0.1);
  transform: translateY(-2px);
  border-color: #c0d8f0;
}

.card-title {
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
}

.page-shell {
  min-height: calc(100vh - 50px);
}

.top-bar {
  background: rgba(255, 255, 255, 0.75);
  -webkit-backdrop-filter: blur(12px);
          backdrop-filter: blur(12px);
  /* border-bottom: 1px solid #e2edf7; */
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.8rem;
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 20;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo {
  font-weight: 700;
  font-size: 1rem;
  /* background: linear-gradient(135deg, #0f2b3d, #1f6392); */
  background-clip: text;
  -webkit-background-clip: text;
}

/* 图片预览弹窗样式 */
.img-preview-modal {
  position: fixed;
  z-index: 9999;
  left: 0; top: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
}
.img-preview-mask {
  position: absolute;
  left: 0; top: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  z-index: 0;
}
.img-preview-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 90vw;
  max-height: 90vh;
  overflow: visible;
}
.img-preview-image {
  max-width: 85vw;
  max-height: 85vh;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  display: block;
  transform-origin: center center;
  will-change: transform;
}
.img-preview-toolbar {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 10px;
}
.img-preview-toolbar button {
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 2px 10px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.2s;
}
.img-preview-toolbar button:hover {
  background: #e0e0e0;
}
.img-preview-close {
  position: fixed;
  top: 24px;
  right: 40px;
  background: none;
  border: none;
  font-size: 2.5rem;
  color: #fff;
  cursor: pointer;
  z-index: 10000;
  line-height: 1;
  padding: 0 8px;
  transition: color 0.2s;
}
.img-preview-close:hover {
  color: #ff5252;
}

.badge-sm {
  background: #eef2ff;
  padding: 0.2rem 0.9rem;
  border-radius: 30px;
  font-size: 0.75rem;
  font-weight: 500;
  color: #1e4a76;
}

.stat-info {
  display: flex;
  gap: 1.2rem;
  font-size: 0.75rem;
  color: #2c5275;
  flex-wrap: wrap;
}

.stat-info span strong {
  color: #005e99;
}

.dashboard {
  display: flex;
  height: calc(100vh - 50px);
  overflow: hidden;
}

.tree-sidebar,
.outline-sidebar,
.content-main {
  background: white;
}

.tree-sidebar,
.outline-sidebar {
  width: 300px;
  padding: 10px 6px;
  overflow-y: auto;
}

.tree-sidebar {
  position: relative;
  border-right: 1px solid #e6ecf5;
  box-shadow: 2px 0 10px rgba(57, 84, 116, 0.06);
  transition: width 0.2s ease;
  display: flex;
  flex-direction: column;
}

.tree-sidebar.collapsed {
  width: 0px;
  min-width: 0px;
  overflow: visible;
  padding: 0;
}
.tree-wrapper { 
  overflow-y: auto;
  flex: 1 1 
}

.tree-sidebar.collapsed .tree-wrapper {
  display: none;
}

.sidebar-toggle-wrapper {
  position: absolute;
  top: 100px;
  left: 306px;
  transform: translateX(-50%);
  z-index: 5;
  cursor: pointer
}

.sidebar-toggle-wrapper.collapsed {
  left: 6px;
}

.sidebar-toggle-btn {
  width: 14px;
  height: 34px;
  font-size: 0.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: left;
  border-radius: 0 6px 6px 0;
  background: #ffffff;
  border: 1px solid #dfe7ef;
  color: #1e3250;
  box-shadow: 0 8px 18px rgba(15, 77, 168, 0.12);
  transition: transform 0.2s ease, background 0.2s ease;
}

.sidebar-toggle-btn:hover {
  background: #eef5ff;
}

.tree-sidebar h4 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 1rem 0.5rem;
}

.tree-nav,
.outline-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.tree-node {
  position: relative;
  /* margin: 0.35rem 0; */
  /* padding-left: 0.8rem; */
}

.tree-node::before {
  content: '';
  position: absolute;
  top: 0.65rem;
  left: 0.15rem;
  width: 1px;
  height: calc(100% - 0.65rem);
  /* background: #dfe7ef; */
}

.node-content,
.folder-toggle,
.file-item {
  display: flex;
  align-items: center;
  /* gap: 0.65rem; */
  width: 100%;
  padding: 0.5rem 0.5rem;
  border-radius: 14px;
  /* transition: all 0.18s ease; */
  font-size: 0.9rem;
  /* color: #1e3250; */
  background: transparent;
  border: 1px solid transparent;
}

.node-content:hover,
.file-item:hover,
.outline-item:hover {
  background: #eef5ff;
}

.tree-node.active > .node-content,
.tree-node.active > .file-item {
  background: #f5f8ff;
  border-left: none;
  position: relative;
}

.tree-node.active > .node-content::before,
.tree-node.active > .file-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.6rem;
  bottom: 0.6rem;
  width: 4px;
  border-radius: 999px;
  background: #3b82f6;
}

.node-content span:first-child,
.file-item span:first-child,
.file-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 8px;
  /* background: #eef4ff; */
  color: #1f4f8a;
  font-size: 0.95rem;
}

.file-icon svg,
.toggle-icon {
  width: 1em;
  height: 1em;
}

.toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 8px;
  background: #eef4ff;
  color: #4f6275;
  transition: transform 0.2s ease;
}

.node-title {
  flex: 1 1;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1em;
  height: 1em;
  transition: transform 0.2s ease;
}

.toggle-icon.expanded {
  transform: rotate(90deg);
}

.children {
  margin-left: 1.2rem;
  transition: all 0.2s ease;
}

.children.collapsed {
  display: none;
}

.content-main {
  flex: 1 1;
  overflow-y: auto;
  padding: 1.8rem 2rem;
  /* background: #fafcff; */
  scroll-behavior: smooth;
}

.article-wrapper {
  max-width: 880px;
  margin: 0 auto;
}

.article-header {
  margin-bottom: 2rem;
  border-bottom: 2px solid #e9eff5;
  padding-bottom: 1rem;
}

.article-header h1 {
  font-size: clamp(1.75rem, 2.5vw, 2.25rem);
  font-weight: 700;
  /* background: linear-gradient(120deg, #124072, #2a6b9e); */
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}

.article-meta {
  font-size: 0.8rem;
  color: #6f8fbb;
  margin-top: 0.5rem;
}

.article-content {
  font-size: 0.95rem;
  line-height: 1.75;
}
.article-content h1 {
  font-size: 1.5rem;
}
.article-content h2 {
  font-size: 1.2rem;
  margin-top: 1.8rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid #e4edf5;
  scroll-margin-top: 80px;
}

.article-content h3 {
  font-size: 1.2rem;
  margin-top: 1.4rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
  scroll-margin-top: 80px;
}

.article-content p {
  margin-bottom: 0.3rem;
  line-height: 2;
}
.article-content a{
  text-decoration: none;
  color: #0969DA;
}

.article-content ul,
.article-content ol {
  margin: 0.75rem 0 0.75rem 1.5rem;
}

.article-content ul li,
.article-content ol li{
  line-height: 2rem;
}

.article-content code {
  background: #ecf3fa;
  padding: 0.2rem 0.4rem;
  border-radius: 8px;
  font-size: 0.85rem;
  color: #e83e8c;
}

.article-content pre {
  /* background: #1e2c3a; */
  /* color: #e2e8f0; */
  padding: 1rem;
  border-radius: 16px;
  border: 1px solid #dfe7ef;
  overflow-x: auto;
}
.article-content pre code {
  background: transparent;
  padding: 0;
  border-radius: 0;
}

.article-content table {
  border-collapse: collapse;
  margin: 1rem 0;
  width: auto;
  border-radius: 16px;
  border: 1px solid #e4e4e4;
  border-collapse: separate;
  border-spacing: 0;
}

.article-content table th,
.article-content table td {
  padding: 0.5rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid #e4e4e4;
  /* border: 1px solid #e4e4e4;  */
}

.article-content table th {
  font-weight: 600;
  /* background: #fafafa; */
  border-bottom: 2px solid #d0d0d0;
}

.article-content table tr:last-child td {
  border-bottom: none;
}

.outline-sidebar {
  /* border-left: 1px solid #dee8f2; */
}

.outline-header {
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #5d718b;
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.outline-list {
  display: flex;
  flex-direction: column;
}

.outline-item {
  padding: 0.5rem 0.5rem;
  border-radius: 8px;
  color: #2c4c6e;
  transition: all 0.15s ease;
  text-align: left;
  font-size: 0.9rem;
}

.outline-item.h2 {
  /* font-weight: 600; */
}

.outline-item.h3 {
  padding-left: 1.4rem;
  font-size: 0.9rem;
}

.empty-outline {
  font-size: 0.8rem;
  color: #8aa0bc;
  text-align: center;
  margin-top: 2rem;
}

.node-content,
.file-item,
.outline-item {
  cursor: pointer;
}

@media (max-width: 1100px) {
  .dashboard {
    flex-direction: column;
    height: auto;
  }

  .tree-sidebar,
  .outline-sidebar {
    width: 100%;
    max-height: 220px;
    border: none;
  }

  .content-main {
    padding: 1.2rem;
    min-height: 60vh;
  }

  body {
    overflow: auto;
    height: auto;
  }
}

@media (max-width: 700px) {
  .top-bar {
    padding: 1rem;
  }

  .stat-info {
    gap: 0.7rem;
    font-size: 0.7rem;
  }

  .article-header h1 {
    font-size: 1.6rem;
  }

  .article-content {
    font-size: 0.9rem;
  }
}
.search-box {
  padding: 0 1rem;
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  background: white;
  z-index: 10;
  margin-bottom: 10px;
  background: white;
}

.search-input {
  width: 100%;
  padding: 0.4rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.8rem;
}

.search-input:focus {
  outline: none;
  border-color: #007acc;
  box-shadow: 0 0 0 2px rgba(0, 122, 204, 0.2);
}


/* 设置滚动条样式 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(140, 155, 173, 0.4);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(140, 155, 173, 0.6);
}

/* 搜索结果面板 */
.search-results-panel {
  flex: 1 1;
  overflow-y: auto;
  padding: 0 0.5rem;
}

.search-result-item {
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  border-bottom: 1px solid #f0f4f8;
  transition: background 0.15s ease;
}

.search-result-item:hover {
  background: #eef5ff;
}

.search-result-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #1e3250;
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-snippet {
  font-size: 0.78rem;
  color: #5d718b;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-highlight {
  background: #fef08a;
  color: inherit;
  padding: 0 1px;
  border-radius: 2px;
}

.search-no-results {
  text-align: center;
  color: #8aa0bc;
  font-size: 0.82rem;
  padding: 2rem 1rem;
}
