@charset "utf-8";

/* === Reset === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  color: #333;
  background: #fff;
  height: 100vh;
  overflow: hidden;
}
html { overflow: hidden; }
a { text-decoration: none; color: #555; outline: none; }
a:hover { color: #2589ff; }
ul, ol { list-style: none; }
img { border: 0; max-width: 100%; }
p { line-height: 1.8em; }
b, strong { font-weight: bold; }
table { border-collapse: collapse; border-spacing: 0; border: 1px solid #ddd; }
table tr:hover { background: #f9f9f9; }
table th { padding: 6px 8px; text-align: center; font-weight: bold; border: 1px solid #ddd; background: #f5f5f5; }
table td { padding: 6px 8px; text-align: left; border: 1px solid #ddd; }
input { padding: 4px; border: 1px solid #ddd; border-radius: 3px; outline: none; font-size: 14px; }
input:focus { border-color: #2589ff; }

/* === Scrollbar === */
@media screen and (min-width: 768px) {
  *::-webkit-scrollbar { width: 5px; height: 5px; }
  *::-webkit-scrollbar-thumb { border-radius: 10px; background: #ddd; }
  *::-webkit-scrollbar-track { background: #f9f9f9; }
}

/* === Layout === */
.page_main { display: flex; flex-direction: column; height: 100vh; }

/* --- Header --- */
.header_wrap {
  height: 50px;
  border-bottom: 1px solid #e8e8e8;
  display: flex;
  align-items: center;
  padding: 0 15px;
  background: #fafafa;
  flex-shrink: 0;
}
.header_wrap .WebLogo {
  font-size: 20px;
  font-weight: bold;
  color: #333;
  display: flex;
  align-items: center;
  white-space: nowrap;
}
.header_wrap .WebLogo img {
  width: 36px;
  height: 36px;
  vertical-align: middle;
  margin-right: 6px;
}
.header_wrap .navlist {
  display: flex;
  align-items: center;
  margin-left: auto;
  gap: 15px;
}
.header_wrap .navlist li a {
  display: flex;
  align-items: center;
  font-size: 14px;
  color: #555;
}
.header_wrap .navlist li a img { height: 14px; margin-right: 4px; }
.header_wrap .navlist li a:hover { color: #2589ff; }
.header_wrap .navlist li.separator { padding: 0 8px; color: #ddd; }
.header_wrap .HeaderText { margin-left: 15px; color: #888; font-size: 13px; white-space: nowrap; overflow: hidden; }

/* Settings dropdown */
.settings-btn {
  position: relative;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
}
.collapse-btn {
  position: relative;
  cursor: pointer;
  width: 36px;
  max-width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
}
.settings-btn:hover { background: #eee; }
.settings-btn svg { width: 18px; height: 18px; fill: #666; }
.settings-panel {
  display: none;
  position: absolute;
  top: 40px;
  right: 0;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  padding: 12px 16px;
  z-index: 1000;
  min-width: 180px;
}
.settings-panel.show { display: block; }
.settings-panel label { display: block; font-size: 12px; color: #888; margin-bottom: 6px; }
.settings-panel .setting-row { margin-bottom: 12px; }
.settings-panel .setting-row:last-child { margin-bottom: 0; }
.settings-panel .btn-group {
  display: flex;
  gap: 4px;
}
.settings-panel .btn-group button {
  flex: 1;
  padding: 4px 8px;
  border: 1px solid #ddd;
  border-radius: 3px;
  background: #fff;
  cursor: pointer;
  font-size: 12px;
  color: #555;
  transition: all .2s;
}
.settings-panel .btn-group button:hover { border-color: #2589ff; color: #2589ff; }
.settings-panel .btn-group button.active { background: #2589ff; color: #fff; border-color: #2589ff; }

/* --- Body (sidebar + content) --- */
.body_wrap {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* --- Sidebar --- */
.left_wrap {
  width: 280px;
  min-width: 0;
  border-right: 1px solid #e8e8e8;
  background: #fafafa;
  display: flex;
  flex-direction: column;
  transition: width .3s ease;
  overflow: hidden;
  flex-shrink: 0;
}
.left_wrap.collapsed { width: 0; border-right: none; }
.left_wrap .tabbar {
  display: flex;
  border-bottom: 1px solid #e8e8e8;
  flex-shrink: 0;
}
.left_wrap .tabbar li {
  flex: 1;
  height: 36px;
  line-height: 36px;
  text-align: center;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: #fff;
  transition: background .2s;
  box-shadow: inset 0 -2px 0 #2589ff;
}
.left_wrap .tabbar li.collapse-btn {
  flex: 0 0 36px !important;
  width: 36px !important;
  min-width: 36px;
  max-width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 0;
  box-shadow: none;
}
.left_wrap .tabbar li.collapse-btn:hover { background: #eee; }
.left_wrap .tabbar li.collapse-btn img { height: 16px; }
.left_wrap .tabbar li.settings-btn {
  flex: 0 0 36px;
  margin-left: auto;
  width: 36px;
  border-left: 1px solid #e8e8e8;
  box-shadow: none;
}
.left_wrap .tabbar li + li { border-left: 1px solid #e8e8e8; }
.left_wrap .tabbar li.on { background: #fafafa; font-weight: bold; box-shadow: none; }
.left_wrap .tabbar li:active { background: #e8e8e8; }
.left_wrap .tabbar li img { height: 14px; }

.left_wrap .subchannellist { flex: 1; overflow: hidden; display: flex; flex-direction: column; }
.left_wrap .subchannel { flex: 1; overflow-y: auto; overflow-x: hidden; }
.left_wrap .subchannel.hide { display: none; }
.left_wrap .search_wrap { display: none; flex: 1; flex-direction: column; overflow: hidden; }
.left_wrap .search_wrap.show { display: flex; }
.left_wrap .search {
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid #e8e8e8;
  flex-shrink: 0;
}
.left_wrap .search input { flex: 1; height: 30px; border: 1px solid #ddd; border-radius: 3px; padding: 0 8px; }
.left_wrap .search img { height: 16px; cursor: pointer; opacity: 0.6; }
.left_wrap .search img:hover { opacity: 1; }
.left_wrap .serchChannel { flex: 1; overflow-y: auto; }
.left_wrap .resultlist li { padding: 8px 12px; cursor: pointer; font-size: 13px; border-bottom: 1px solid #f0f0f0; }
.left_wrap .resultlist li:hover { background: #e8f4ff; color: #2589ff; }
.left_wrap .resultlist li.on { background: #e8f4ff; color: #2589ff; }
.left_wrap .resultlist li.n1 { color: #999; cursor: default; }

/* Tree */
.filetree a {
  display: block;
  padding: 7px 10px 7px 22px;
  cursor: pointer;
  color: #555;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
  transition: all .15s;
}
.filetree a:hover { color: #2589ff; background: #e8f4ff; }
.filetree a.current { color: #2589ff; background: #e8f4ff; font-weight: bold; }
.filetree li.on > span { background: #e8f4ff; }
.filetree li span { display: block; position: relative; }
.filetree li.n1 > span { padding-left: 0; }
.filetree li.n2 > span { padding-left: 20px; }
.filetree li.n3 > span { padding-left: 40px; }
.filetree li.n4 > span { padding-left: 60px; }
.filetree li.n5 > span { padding-left: 80px; }

/* Tree toggle arrow - larger click area */
.filetree li > span.folder { cursor: pointer; }
.filetree li > span.folder::before {
  content: '';
  display: block;
  width: 20px;
  height: 20px;
  position: absolute;
  left: 2px;
  top: 50%;
  transform: translateY(-50%);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M6 3l5 5-5 5' fill='none' stroke='%23999' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") center/10px no-repeat;
  transition: transform .2s;
  border-radius: 3px;
}
.filetree li > span.folder::before:hover { background-color: #eee; }
.filetree li.n2 > span.folder::before { left: 22px; }
.filetree li.n3 > span.folder::before { left: 42px; }
.filetree li.n4 > span.folder::before { left: 62px; }
.filetree li.open > span.folder::before { transform: translateY(-50%) rotate(90deg); }
.filetree li > ul { display: none; }
.filetree li.open > ul { display: block; }

/* --- Content area --- */
.right_wrap {
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.right_wrap .right_title {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
  padding: 8px 15px;
  display: flex;
  align-items: center;
  min-height: 40px;
  flex-shrink: 0;
}
.right_wrap .right_title .shownavbtn {
  width: 20px;
  height: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  margin-right: 12px;
  flex-shrink: 0;
}
.right_wrap .right_title .shownavbtn span {
  display: block;
  height: 2px;
  background: #666;
  border-radius: 1px;
}
.right_wrap .right_title h2 {
  font-size: 16px;
  font-weight: bold;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.right_container {
  flex: 1;
  min-width: 370px;
  padding: 20px 40px;
}
.right_wrap .table_wrap { overflow-x: auto; }
.right_wrap .FooterText { padding: 20px 0; border-top: 1px solid #f0f0f0; margin-top: 30px; color: #888; font-size: 13px; }

/* Content styles */
.ChannelContent { padding: 0; }
.ChannelContent, .ChannelContent p { line-height: 1.8em; font-size: 16px; margin-bottom: 10px; }
.ChannelContent h5 { font-size: 14px; color: #2589ff; font-weight: bold; }
.ChannelName, .ChannelName h1 { font-weight: bold; line-height: 40px; font-size: 20px; display: none; }

/* Loading */
.loading {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255,255,255,0.8);
  z-index: 50;
  align-items: center;
  justify-content: center;
}
.loading img { width: 32px; height: 32px; }

/* Category Navigation */
.category-container {
  background: #f9f9f9;
  border: 1px solid #e8e8e8;
  border-radius: 4px;
  padding: 15px;
  margin-bottom: 20px;
}
.category-title {
  font-size: 14px;
  font-weight: bold;
  color: #333;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
}
.category-title img {
  height: 14px;
  margin-right: 6px;
}
.category-item {
  padding: 6px 10px;
  margin: 4px 0;
  cursor: pointer;
  color: #555;
  border-radius: 3px;
  transition: all 0.2s;
}
.category-item:hover {
  background: #2589ff;
  color: #fff;
}

/* Slidelist - Floating Navigation */
.slidelist {
  position: fixed;
  right: 20px;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 6px;
  padding: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
  z-index: 100;
  min-width: 180px;
  max-width: 280px;
  max-height: 60vh;
  overflow-y: auto;
}
.slidelist .category-title {
  font-size: 13px;
  margin-bottom: 8px;
  color: #333;
}
.slidelist .category-item {
  padding: 5px 8px;
  font-size: 13px;
  margin: 2px 0;
  cursor: pointer;
  color: #666;
  border-radius: 3px;
  transition: all 0.2s;
}
.slidelist .category-item:hover {
  background: #f5f5f5;
  color: #2589ff;
}

/* === Responsive === */
@media screen and (max-width: 768px) {
  .header_wrap { display: none; }
  .left_wrap { position: fixed; left: 0; top: 0; bottom: 0; z-index: 200; width: 280px; }
  .left_wrap.collapsed { width: 0; }
  .right_container { padding: 10px; min-width: auto; }
  .right_wrap .right_title .language { display: block; }
}
@media screen and (min-width: 769px) and (max-width: 1200px) {
  .right_container { padding: 15px 20px; }
}

/* === Dark Mode === */
body.dark-mode { background: #1e1e1e; color: #d4d4d4; }
.dark-mode .header_wrap { background: #252526; border-bottom-color: #333; }
.dark-mode .header_wrap .WebLogo { color: #e0e0e0; }
.dark-mode .header_wrap .navlist li a { color: #ccc; }
.dark-mode .header_wrap .HeaderText { color: #888; }
.dark-mode .settings-btn svg { fill: #ccc; }
.dark-mode .settings-panel { background: #2d2d2d; border-color: #444; }
.dark-mode .settings-panel label { color: #aaa; }
.dark-mode .settings-panel .btn-group button { background: #333; border-color: #555; color: #ccc; }
.dark-mode .settings-panel .btn-group button.active { background: #2589ff; color: #fff; border-color: #2589ff; }
.dark-mode .left_wrap { background: #252526; border-right-color: #333; }
.dark-mode .left_wrap .tabbar { border-bottom-color: #333; }
.dark-mode .left_wrap .tabbar li { background: #2d2d2d; color: #ccc; }
.dark-mode .left_wrap .tabbar li + li { border-left-color: #333; }
.dark-mode .left_wrap .tabbar li.on { background: #252526; box-shadow: none; }
.dark-mode .left_wrap .search { border-bottom-color: #333; }
.dark-mode .left_wrap .search input { background: #333; border-color: #555; color: #ddd; }
.dark-mode .filetree a { color: #ccc; }
.dark-mode .filetree a:hover { color: #6cb6ff; background: #2a2d2e; }
.dark-mode .filetree a.current { color: #6cb6ff; background: #2a2d2e; }
.dark-mode .filetree li.on > span { background: #2a2d2e; }
.dark-mode .filetree li > span.folder::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M6 3l5 5-5 5' fill='none' stroke='%23888' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E"); }
.dark-mode .resultlist li { color: #ccc; border-bottom-color: #333; }
.dark-mode .resultlist li:hover { background: #2a2d2e; color: #6cb6ff; }
.dark-mode .right_wrap { background: #1e1e1e; }
.dark-mode .right_wrap .right_title { background: #1e1e1e; border-bottom-color: #333; }
.dark-mode .right_wrap .right_title h2 { color: #e0e0e0; }
.dark-mode .right_wrap .right_title .shownavbtn span { background: #ccc; }
.dark-mode .right_wrap .FooterText { border-top-color: #333; color: #888; }
.dark-mode .ChannelContent a { color: #6cb6ff; }
.dark-mode .ChannelContent h2 { color: #6cb6ff; border-bottom-color: #444; }
.dark-mode .loading { background: rgba(30,30,30,0.8); }
.dark-mode table { border-color: #444; }
.dark-mode table th { background: #2d2d2d; border-color: #444; color: #ddd; }
.dark-mode table td { border-color: #444; color: #ccc; }
.dark-mode .category-container { background: #252526; border-color: #3a3a3a; }
.dark-mode .category-title { color: #e0e0e0; }
.dark-mode .category-item { color: #b0b0b0; }
.dark-mode .category-item:hover { background: #1f6feb; color: #fff; }
.dark-mode .slidelist { background: #1e1e1e; border-color: #3a3a3a; box-shadow: 0 2px 12px rgba(0,0,0,0.5); }
.dark-mode .slidelist .category-title { color: #e0e0e0; }
.dark-mode .slidelist .category-item { color: #b0b0b0; }
.dark-mode .slidelist .category-item:hover { background: #2d2d2d; color: #58a6ff; }
.dark-mode table tr:hover { background: #2a2d2e; }
