:root {
    --primary-color: #93b5cf;
    --sidebar-category-bg: #2bae85;
    --sidebar-width: 200px;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-top: 30px; /* 与顶部栏高度匹配 */
    background: #deecf1;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
}

/* PC端布局 */

.sidebar {
    width: var(--sidebar-width);
    background: #f8f9fa;
    padding: 20px;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
}

.main-content {
    flex: 1;
    padding: 30px;
    margin-left: var(--sidebar-width);
    background: #deecf1;
    min-height: 100vh
}

.category-list {
    list-style: none;
}

.category-item {
    padding: 12px;
    margin: 8px 0;
    border-radius: 6px;
    cursor: pointer;
    background: var(--sidebar-category-bg);
    color: white;
    transition: all 0.2s;
    text-align: center; /* 新增居中属性 */
}

.category-item:hover {
    background: #2bae85;
    transform: translateX(5px);
}

.category-item.active {
    background: #134857;
    font-weight: bold;
}

.website-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
}

.website-card {
    background: var(--primary-color);
    border-radius: 12px;
    padding: 20px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 110px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow:  7px 9px 7px #346c9c;
}

/* PC端悬浮提示 */
.website-card::after {
    content: attr(data-description);
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: 100%;
    background: white;
    padding: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    border-radius: 8px;
    z-index: 110;
}

.website-card:hover::after {
    opacity: 1;
}

.card-categories {
    position: absolute;
    bottom: 10px;
    right: 10px;
    display: flex;
    gap: 5px;
}

.category-tag {
    background: rgba(255,255,255,0.9);
    padding: 2px 3px;
    border-radius: 15px;
    font-size: 0.85em;
    color: #666;
}

/* 响应式布局修正 */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    
  
  .loader-wrapper {
    max-width: 90vw;
    left: 50%;
    transform: translateX(-50%);
  }


  .category-list::-webkit-scrollbar {
    display: none;
  }

  .container {
    max-width: 100vw;
    padding: 0 15px;
  }

    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        box-shadow: none;
        border-bottom: 1px solid #ddd;
        padding: 10px 0 !important;
    }

    .main-content {
        margin-left: 0;
        padding: 15px;
        background: #deecf1;
    }

    .website-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .website-card {
        min-height: 100px;
        margin: 8px;
    }

    /* 移动端隐藏悬浮提示 */
    .website-card::after {
        display: none;
    }

     .category-item {
        padding: 8px 12px;    /* 减小按钮内边距 */
        margin: 6px 0;        /* 减小按钮间距 */
        font-size: 0.9em;     /* 缩小字体 */
        min-width: 24%;     /* 设置最小宽度 */
        width: auto;          /* 自动宽度 */
        display: inline-block; /* 行内块排列 */
        text-align: center; /* 保持移动端居中 */
    }
    
    .category-list {
        flex-direction: row;  /* 横向排列 */
        flex-wrap: wrap;       /* 允许换行 */
        gap: 8px;             /* 按钮间距 */
        justify-content: center; /* 居中显示 */
        padding: 0 15px;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-out;
        max-height: 500px;
  overflow-x: auto;
    }

    .category-list.collapsed {
        max-height: 0 !important;
        transition: max-height 0.3s ease-in;
    }

    .category-list:not(.collapsed) {
        max-height: 500px; /* 根据实际内容高度调整 */
    }

    /* 标题优化 */
    .sidebar h2 {
        font-size: 1.2em;
        margin-bottom: 12px;
        text-align: center;
        margin: 0 15px 8px;
        padding-bottom: 5px;
        border-bottom: 1px solid #ddd;
    }

    .mobile-toggle {
        display: block;
        margin: 0 15px 10px !important;
        width: calc(100% - 30px) !important;
        padding: 8px;
        background: #2bae85;
        color: white;
        border: none;
        border-radius: 4px;
        text-align: center;
        font-size: 0.95em;
    }
    
    .category-list.collapsed {
        display: none;
    }

    .site-footer {
        padding: 15px;
    }
    
}





@media (min-width: 769px) {
    .mobile-toggle {
        display: none !important;
    }
}



.main {
    flex: 1; /* 占据剩余空间 */
}

/* 弹窗样式 */
.mobile-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: #f5f5f5; /* 更改为浅灰色背景 */
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    position: relative;
    padding: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}



@keyframes modalSlide {
    from { transform: translateY(20%); }
    to { transform: translateY(0); }
}

.modal-title {
    font-size: 1.4em;
    margin-bottom: 15px;
    color: #2d3436;
    text-align: center;
    margin-bottom: 0.8em;
}

.modal-description {
    font-size: 1em;
    line-height: 1.6;
    color: #666;
    margin-bottom: 20px;
    padding: 0 15px;
}

.modal-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 25px;
    padding: 0 15px;
}

/* 新增分割线样式 */
.modal-divider {
    border: none;
    border-top: 2px solid #ddd;
    margin: 1em 0;
}

/* 按钮容器样式 */
.modal-action {
    margin-top: 1.5em;
    text-align: center;
}

.modal-link {
    text-decoration: none;
    display: inline-block;
}

.link-button {
    background: #5d655f;
    color: white;
    padding: 12px 30px;
    border-radius: 25px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.link-button:hover {
    background: #847c74;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* 页尾样式 */
.site-footer {
    background: #f8f9fa;
    padding: 20px;
    text-align: center;
    border-top: 1px solid #e9ecef;
    margin-top: auto; /* 用于粘性页脚 */
}


.copyright {
    color: #6c757d;
    font-size: 0.9em;
}



/* 弹窗样式 */
.custom-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 9999;
}

.modal-dialog {
  position: relative;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 500px;
  width: 90%;
  background: white;
  border-radius: 12px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}



.modal-header {
  border-bottom: 1px solid #eee;
  padding-bottom: 15px;
  margin-bottom: 15px;
}

.modal-header h3 {
  margin: 0;
  color: #333;
  font-size: 1.5em;
}

.modal-body p {
  line-height: 1.6;
  color: #666;
}

.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

.modal-btn {
  padding: 10px 25px;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s;
}

.accept {
  background: #4CAF50;
  color: white;
}

.decline {
  background: #f0f0f0;
  color: #666;
}

.modal-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}



/* 添加到CSS中 */
.header-bar {
  border-bottom: 2px solid #66a9c9;
  padding: 2px 0;
  z-index: 100;
    position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: #eef7f2;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.top-nav {
  top: 0;
  width: 100%;
  font-weight: 600;
  position: relative;
  z-index: 1000; /* 确保高于内容卡片的z-index */
text-align: center;
}


.content-card-container {
  position: relative;
  z-index: 1; /* 数值必须小于顶部栏的z-index */
  margin-top: 80px; /* 补偿顶部栏高度 */
}

.container {
  margin: 0 auto;
  padding: 0 5px;
  display: flex;
    flex-direction: column;
    min-height: 5px;
      max-width: 100vw; /* 视口宽度限制 */
  overflow-x: hidden; /* 横向溢出控制 */
}


body {
  overflow-x: hidden; /* 临时解决方案 */
  width: 100vw; /* 视口宽度约束 */
}

.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* 自动适应列宽 */
  gap: 1rem;
}


.site-title {
  font-size: 26px;
  color: #333;
  margin: 0;
  font-weight: 500;
}
