:root {
    /* 亮色主题 */
    --bg-color: #f8f9fa;
    --primary: #4361ee;
    --accent: #3a86ff;
    --light: #f1f4f9;
    --dark: #343a40;
    --text: #212529;
    --secondary-text: #6c757d;
    --border: #dee2e6;
    --shadow: rgba(0, 0, 0, 0.1);
    --hover: #e9ecef;
    --sidebar-bg: #ffffff;
    --transition: 0.3s;
    --video-bg: #000000;
    --header-text: #ffffff;
  }
  
  [data-theme="dark"] {
    /* 暗色主题 */
    --bg-color: #121212;
    --primary: #3a86ff;
    --accent: #4361ee;
    --light: #242526;
    --dark: #e9ecef;
    --text: #e9ecef;
    --secondary-text: #adb5bd;
    --border: #343a40;
    --shadow: rgba(0, 0, 0, 0.3);
    --hover: #2d3133;
    --sidebar-bg: #1e1e1e;
    --video-bg: #000000;
    --header-text: #ffffff;
  }
  
  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  
  body {
    font-family: "Segoe UI", Tahoma, sans-serif;
    background: var(--bg-color);
    color: var(--text);
    height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color var(--transition), color var(--transition);
  }
  
  header {
    background: var(--primary);
    color: var(--header-text);
    padding: 1rem;
    box-shadow: 0 2px 8px var(--shadow);
    flex: 0 0 auto;
    z-index: 100;
  }
  
  .header-content {
    width: 100%;
    padding: 0 1rem;
    margin: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  .header-content h1 {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  
  .header-controls {
    display: flex;
    gap: 1rem;
  }
  
  header button {
    background: transparent;
    border: none;
    color: var(--header-text);
    font-size: 1.2rem;
    cursor: pointer;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--transition);
  }
  
  header button:hover {
    background-color: rgba(255, 255, 255, 0.1);
  }
  
  .container {
    flex: 1 1 auto;
    display: flex;
    height: calc(100vh - 66px);
    overflow: hidden;
    width: 100%;
    margin: 0;
    position: relative;
  }
  
  .sidebar {
    flex: 0 0 300px;
    /* 最小宽度改为 280px，避免过窄时遮挡标签 */
    min-width: 280px;
    max-width: 600px;
    background: var(--sidebar-bg);
    border-right: none;
    display: flex;
    flex-direction: column;
    transition: background var(--transition);
    z-index: 10;
  }
  
  .resizer {
    width: 6px;
    cursor: col-resize;
    background: var(--border);
    position: relative;
    z-index: 20;
    transition: background var(--transition);
  }
  
  .resizer:hover,
  .resizer.active {
    background: var(--accent);
  }
  
  .resizer::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    height: 50px;
    width: 2px;
    background: var(--bg-color);
    border-radius: 1px;
    opacity: 0;
    transition: opacity 0.3s;
  }
  
  .resizer:hover::before,
  .resizer.active::before {
    opacity: 1;
  }
  
  .sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
  }
  
  .sidebar h2 {
    padding-bottom: 0.75rem;
    font-size: 1.1rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  
  .search-container {
    position: relative;
    margin-top: 0.5rem;
  }
  
  .search-container input {
    width: 100%;
    padding: 0.6rem 2rem 0.6rem 0.8rem;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: var(--bg-color);
    color: var(--text);
    font-size: 0.9rem;
    transition: border var(--transition), background var(--transition);
  }
  
  .search-container input:focus {
    outline: none;
    border-color: var(--accent);
  }
  
  .search-container i {
    position: absolute;
    right: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--secondary-text);
  }
  
  .sidebar ul {
    list-style: none;
    overflow-y: auto;
    flex: 1 1 auto;
    padding: 0.5rem 0;
  }
  
  .sidebar li {
    border-bottom: 1px solid var(--border);
    transition: background var(--transition), color var(--transition);
  }
  
  .sidebar li:last-child {
    border-bottom: none;
  }
  
  .sidebar li:hover {
    background: var(--hover);
  }
  
  .sidebar li.active {
    background: var(--accent);
    color: white;
  }
  
  .sidebar li a {
    display: flex;
    padding: 0.9rem 1rem;
    text-decoration: none;
    color: inherit;
    align-items: center;
    gap: 0.5rem;
    word-break: break-word;
  }
  
  .sidebar li a i {
    font-size: 1.1rem;
    flex-shrink: 0;
  }
  
  .content {
    flex: 1 1 auto;
    height: 100%;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    background: var(--bg-color);
    padding: 0;
    overflow-y: auto;
  }
  
  .player-container {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
  }
  
  .video-info {
    width: 100%;
    margin-bottom: 0;
  }
  
  .video-info h2 {
    display: none;  /* 隐藏视频标题 */
  }
  
  .video-meta {
    color: var(--secondary-text);
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
    padding: 0.75rem;
    background: var(--light);
    border-radius: 0;
    max-height: none;
    overflow-y: auto;
    transition: max-height 0.3s;
  }
  
  .video-meta:hover {
    max-height: none;
  }
  
  .video-meta i {
    color: var(--accent);
    margin-right: 0.5rem;
  }
  
  /* 视频播放器控件样式 */
  .video-wrapper {
    width: 100%;
    flex: 1;
    position: relative;
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
    background: var(--video-bg);
  }
  
  .player-container video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
  }
  
  /* 控制按钮覆盖层 */
  .player-controls-overlay {
    position: absolute;
    right: 15px;
    bottom: 55px; /* 位于原生控件上方 */
    z-index: 10;
    display: none; /* 修改：隐藏自定义控制按钮覆盖层 */
    gap: 10px;
    opacity: 0;
    transition: opacity 0.3s;
  }
  
  .video-wrapper:hover .player-controls-overlay {
    opacity: 0; /* 修改：即使悬停也不显示 */
  }
  
  /* 视频控制按钮 */
  .control-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
    transition: transform 0.2s, background-color 0.2s;
  }
  
  .control-button:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
  }
  
  /* 全屏样式修正 */
  video:fullscreen {
    background: black;
  }
  
  video:-webkit-full-screen {
    background: black;
  }
  
  video:-moz-full-screen {
    background: black;
  }
  
  /* 确保全屏时控件可见 */
  video:fullscreen + .player-controls-overlay,
  video:-webkit-full-screen + .player-controls-overlay,
  video:-moz-full-screen + .player-controls-overlay {
    bottom: 70px; /* 全屏时稍微调整位置 */
  }
  
  .mobile-only {
    display: none;
  }
  
  /* 响应式优化 */
  @media (max-width: 900px) {
    .resizer {
        display: none;
    }
    
    .container {
      flex-direction: column;
      height: auto;
    }
    
    .sidebar {
      position: fixed;
      top: 66px;
      left: 0;
      bottom: 0;
      width: 280px;
      transform: translateX(-100%);
      box-shadow: 2px 0 10px var(--shadow);
      z-index: 100;
      min-width: unset;
      max-width: unset;
    }
    
    .sidebar.open {
      transform: translateX(0);
    }
    
    .mobile-only {
      display: block;
    }
    
    .content {
      padding: 1rem;
    }
  
    .video-wrapper {
      aspect-ratio: 16/9;
      height: auto;
    }
    
    .player-controls-overlay {
      bottom: 45px;
    }
    
    .control-button {
      width: 35px;
      height: 35px;
      font-size: 0.9rem;
    }
  }
  
  @media (max-width: 600px) {
    .header-content h1 {
      font-size: 1.2rem;
    }
    
    .video-info h2 {
      font-size: 1.2rem;
    }
    
    .player-container {
      padding: 0;
    }
    
    .content {
      padding: 0.5rem;
    }
    
    .player-controls-overlay {
      bottom: 40px;
      right: 10px;
    }
    
    .control-button {
      width: 32px;
      height: 32px;
      font-size: 0.8rem;
    }
  }
  
  /* 添加动效与过渡 */
  @keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }
  
  .sidebar li, .video-wrapper {
    animation: fadeIn 0.4s ease-out;
  }
  
  .sidebar li a {
    transition: transform 0.2s;
  }
  
  .sidebar li:hover a {
    transform: translateX(5px);
  }
  
  /* 自定义滚动条 */
  ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }
  
  ::-webkit-scrollbar-track {
    background: var(--light);
    border-radius: 4px;
  }
  
  ::-webkit-scrollbar-thumb {
    background: var(--secondary-text);
    border-radius: 4px;
  }
  
  ::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
  }
  
  /* 特殊情况下的消息样式 */
  .sidebar li.empty {
    padding: 1.5rem 1rem;
    text-align: center;
    color: var(--secondary-text);
  }
  
  .sidebar li.empty a {
    justify-content: center;
  }
  
  .sidebar li.empty i {
    margin-right: 0.5rem;
  }
  
  /* 焦点状态样式 */
  button:focus, a:focus, input:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
  }
  
  /* 确保键盘可访问性 */
  button:focus:not(:focus-visible), 
  a:focus:not(:focus-visible),
  input:focus:not(:focus-visible) {
    outline: none;
  }
  
  button:focus-visible,
  a:focus-visible,
  input:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
  }
  
  /* 密码验证层样式 */
  .password-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
  }
  
  .password-container {
    background: var(--sidebar-bg);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--shadow);
    width: 90%;
    max-width: 400px;
    text-align: center;
  }
  
  .password-container h2 {
    margin-bottom: 1.5rem;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
  }
  
  .password-container input {
    width: 100%;
    padding: 0.8rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-color);
    color: var(--text);
    font-size: 1rem;
  }
  
  .password-container button {
    width: 100%;
    padding: 0.8rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: background-color 0.3s;
  }
  
  .password-container button:hover {
    background: var(--accent);
  }
  
  .password-error {
    color: #dc3545;
    margin-top: 1rem;
    font-size: 0.9rem;
    min-height: 1.2em;
  }
  
  .password-overlay.hidden {
    display: none;
  }
  
  /* 添加标签页样式 */
  .tab-container {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0 0.5rem;
  }
  
  .tab-button {
    flex: 1;
    padding: 0.75rem;
    border: none;
    border-radius: 4px;
    background: var(--light);
    color: var(--text);
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s;
  }
  
  .tab-button i {
    font-size: 1rem;
  }
  
  .tab-button:hover {
    background: var(--hover);
  }
  
  .tab-button.active {
    background: var(--primary);
    color: white;
  }
  
  /* 证书容器样式 */
  .certificate-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
  }
  
  .certificate-container.hidden {
    display: none;
  }
  
  .certificate-info {
    background: var(--light);
    color: var(--secondary-text);
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
    padding: 0.75rem;
    border-radius: 0;
    max-height: none;
    overflow-y: auto;
    transition: max-height 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  
  .certificate-info h2 {
    font-size: inherit;
    color: inherit;
    font-weight: 400;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  
  .certificate-info i {
    color: var(--accent);
    margin-right: 0.5rem;
  }
  
  .certificate-wrapper {
    flex: 1;
    background: var(--bg-color);
    position: relative;
    overflow: hidden;
  }
  
  .certificate-wrapper embed {
    border: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
  }
  
  /* 内容容器样式 */
  .content-container {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
  }
  
  /* 响应式调整 */
  @media (max-width: 900px) {
    .certificate-wrapper {
      min-height: 400px;
    }
  }
  
  @media (max-width: 600px) {
    .tab-button {
      padding: 0.5rem;
      font-size: 0.8rem;
    }
    
    .certificate-wrapper {
      min-height: 300px;
    }
  }
  
  .player-container.hidden,
  .certificate-container.hidden {
    display: none !important;
  }
  
  /* PDF查看器后备内容样式 */
  .pdf-fallback {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    padding: 2rem;
    background: var(--light);
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--shadow);
  }
  
  .pdf-fallback p {
    margin: 0;
    color: var(--text);
    font-size: 1rem;
    line-height: 1.5;
  }
  
  .pdf-fallback a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
  }
  
  .pdf-fallback a:hover {
    text-decoration: underline;
  }
  
  /* 确保PDF查看器容器样式正确 */
  .certificate-wrapper object {
    border: none;
    background: var(--bg-color);
  }
  
  /* PDF加载提示样式 */
  .pdf-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    padding: 2rem;
    background: var(--light);
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--shadow);
    color: var(--text);
    font-size: 1rem;
    z-index: 10;
  }
  
  .pdf-loading i {
    margin-right: 0.5rem;
    color: var(--primary);
  }
  
  /* 确保PDF查看器容器样式正确 */
  .certificate-wrapper {
    position: relative;
    background: var(--bg-color);
  }
  
  .certificate-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    background: var(--bg-color);
  }
  
  /* PDF预览样式 */
  .pdf-preview {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-color);
  }
  
  .pdf-preview .preview-content {
    text-align: center;
    padding: 2rem;
    background: var(--light);
    border-radius: 12px;
    box-shadow: 0 4px 12px var(--shadow);
    max-width: 90%;
  }
  
  .pdf-preview .preview-content i.fa-file-pdf {
    font-size: 4rem;
    color: var(--primary);
    margin-bottom: 1rem;
  }
  
  .pdf-preview .preview-content h3 {
    margin: 1rem 0;
    color: var(--text);
    font-size: 1.2rem;
    word-break: break-word;
  }
  
  .pdf-preview .preview-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
  }
  
  .pdf-preview .preview-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    text-decoration: none;
    transition: background-color 0.3s, transform 0.2s;
  }
  
  .pdf-preview .preview-button:hover {
    background: var(--accent);
    transform: translateY(-2px);
  }
  
  .pdf-preview .preview-button i {
    font-size: 1.1rem;
  }
  
  @media (max-width: 600px) {
    .pdf-preview .preview-content {
      padding: 1.5rem;
    }
    
    .pdf-preview .preview-content i.fa-file-pdf {
      font-size: 3rem;
    }
    
    .pdf-preview .preview-button {
      padding: 0.7rem 1.2rem;
      font-size: 0.9rem;
    }
  }
  
  /* 移除旧的Safari特定样式 */
  .safari-pdf-preview {
    display: none;
  }
  
  /* 论文专利容器样式 */
  .paper-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
  }
  
  .paper-container.hidden {
    display: none;
  }
  
  .paper-info {
    background: var(--light);
    color: var(--secondary-text);
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
    padding: 0.75rem;
    border-radius: 0;
    max-height: none;
    overflow-y: auto;
    transition: max-height 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  
  .paper-info h2 {
    font-size: inherit;
    color: inherit;
    font-weight: 400;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  
  .paper-info i {
    color: var(--accent);
    margin-right: 0.5rem;
  }
  
  .paper-wrapper {
    flex: 1;
    background: var(--bg-color);
    position: relative;
    overflow: hidden;
  }
  
  .paper-wrapper embed {
    border: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
  }
  
  /* 响应式调整 */
  @media (max-width: 900px) {
    .paper-wrapper {
      min-height: 400px;
    }
  }
  
  @media (max-width: 600px) {
    .paper-info h2 {
      font-size: 1.3rem;
    }
    .paper-wrapper {
      min-height: 300px;
    }
  }
  
  .player-container.hidden,
  .certificate-container.hidden,
  .paper-container.hidden {
    display: none !important;
  }
  
  /* 论文链接样式 */
  .paper-link {
    display: inline-flex;
    align-items: center;
    margin-left: 1rem;
    padding: 0.3rem 0.8rem;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: all 0.3s;
  }
  
  .paper-link:hover {
    background: var(--accent);
    transform: translateY(-1px);
  }
  
  .paper-link i {
    margin-right: 0.4rem;
  }
  
  @media (max-width: 600px) {
    .paper-link {
      display: block;
      margin: 0.5rem 0 0 0;
      text-align: center;
    }
  }
  
  /* 视频预览样式 */
  .video-preview {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-color);
  }
  
  .video-preview .preview-content {
    text-align: center;
    padding: 2rem;
    background: var(--light);
    border-radius: 12px;
    box-shadow: 0 4px 12px var(--shadow);
    max-width: 90%;
  }
  
  .video-preview .preview-content i.fa-video {
    font-size: 4rem;
    color: var(--primary);
    margin-bottom: 1rem;
  }
  
  .video-preview .preview-content h3 {
    margin: 1rem 0;
    color: var(--text);
    font-size: 1.2rem;
    word-break: break-word;
  }
  
  .video-preview .preview-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
  }
  
  .video-preview .preview-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    text-decoration: none;
    transition: background-color 0.3s, transform 0.2s;
  }
  
  .video-preview .preview-button:hover {
    background: var(--accent);
    transform: translateY(-2px);
  }
  
  .video-preview .preview-button i {
    font-size: 1.1rem;
  }
  
  @media (max-width: 600px) {
    .video-preview .preview-content {
      padding: 1.5rem;
    }
    
    .video-preview .preview-content i.fa-video {
      font-size: 3rem;
    }
    
    .video-preview .preview-button {
      padding: 0.7rem 1.2rem;
      font-size: 0.9rem;
    }
  }
  
  /* 移除不需要的视频播放器样式 */
  .player-container video {
    display: none;
  }