/* ========== 复制按钮样式 ========== */
.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #2c3e50 !important;  /* 完全不透明的深色背景 */
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
  font-family: monospace;
  font-weight: 500;
  opacity: 1 !important;  /* 完全不透明 */
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.copy-btn:hover {
  background: #42b983 !important;  /* 悬停时高亮为绿色 */
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(66,185,131,0.3);
}

.copy-btn.copied {
  background: #28a745 !important;  /* 复制成功时绿色 */
  opacity: 1 !important;
  transform: scale(0.98);
}

/* 确保代码块容器有正确的定位 */
.markdown-section pre {
  position: relative;
  background-color: #1e1e1e !important;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  margin: 1.2em 0;
}

.markdown-section pre code {
  background-color: #1e1e1e !important;
  color: #d4d4d4 !important;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.5;
  display: block;
  padding: 1em !important;
  overflow-x: auto;
}

/* 行内代码样式 */
.markdown-section code:not(pre code) {
  background-color: #f0f0f0;
  color: #e74c3c;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

/* ========== 侧边栏顶部 header 核心修复 ========== */
.sidebar {
  padding-top: 0 !important;
  overflow-y: auto !important;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid #eaeef2;
  cursor: pointer;
  transition: background 0.2s;
  background-color: #fff;
  position: sticky !important;
  top: 0 !important;
  z-index: 999 !important;
  width: 100%;
  box-sizing: border-box;
}

.sidebar-header:hover {
  background: #f8f9fa;
}

.sidebar-header .logo-img {
  height: 36px;
  width: auto;
  flex-shrink: 0;
  object-fit: contain;
}

.sidebar-header .company-name {
  font-size: 18px;
  font-weight: bold;
  color: #2c3e50;
  margin: 0;
  line-height: 1.2;
  white-space: nowrap;
}

.sidebar .app-name {
  display: none !important;
}

.sidebar .sidebar-nav {
  padding: 10px 0 40px 0 !important;
  margin: 0;
}

.sidebar-nav ul {
  padding-left: 20px;
}

.sidebar-nav li {
  padding: 4px 0;
}

/* ========== 受保护内容区域 ========== */
.docsify-protected-content {
  display: block;
}

body.authenticated .docsify-protected-content {
  display: block;
}

body:not(.authenticated) .docsify-protected-content {
  display: none !important;
}

/* ========== 密码验证浮层样式 ========== */
.password-protect-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.password-card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
  width: 380px;
  max-width: 90%;
  padding: 32px 28px;
  text-align: center;
  animation: fadeInUp 0.3s ease;
}

.password-card .logo img {
  max-width: 80px;
  margin-bottom: 16px;
  border-radius: 12px;
}

.password-card h3 {
  margin: 0 0 8px;
  font-size: 24px;
  color: #1e2a3a;
}

.password-card p {
  color: #5c6b7a;
  margin-bottom: 24px;
  font-size: 14px;
}

.password-card input {
  width: 100%;
  padding: 12px 16px;
  font-size: 16px;
  border: 1px solid #cfdde6;
  border-radius: 40px;
  box-sizing: border-box;
  margin-bottom: 20px;
  outline: none;
  transition: border 0.2s;
}

.password-card input:focus {
  border-color: #42b983;
  box-shadow: 0 0 0 2px rgba(66,185,131,0.2);
}

.password-card button {
  width: 100%;
  background: #42b983;
  border: none;
  padding: 12px;
  border-radius: 40px;
  color: white;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
}

.password-card button:hover {
  background: #359f6e;
}

.error-msg {
  color: #e74c3c;
  font-size: 13px;
  margin-top: -12px;
  margin-bottom: 16px;
  display: none;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}