body {
    margin: 0;
    display: flex;
    height: 100vh;
    font-family: 'Arial', sans-serif;
    overflow: hidden;
}




/* 一级工具栏 */
.sidebar-primary {
    width: 200px;
    background-color: #2c3e50;
    color: white;
    padding: 15px 0;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    z-index: 2;
}

.menu-item {
    padding: 20px 10px;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 14px;
}

.menu-item:hover {
    background-color: #3498db;
}

/* 二级工具栏 */
.sidebar-secondary {
    width: 200px;
    background-color: #34495e;
    color: white;
    position: absolute;
    left: 200px; /* 紧贴一级菜单 */
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    padding: 15px 0;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    text-align: center;
    z-index: 1;
}

.sidebar-secondary.active {
    transform: translateX(0);
}

.submenu-item {
    padding: 20px 20px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.submenu-item:hover {
    background-color: #2980b9;
}

/* 内容区 */
.content {
    flex: 1;
    background-color: #ecf0f1;
    padding: 80px;
    overflow-y: auto;
}

.welcome-message {
    text-align: center;
    margin-top: 20%;
    color: #2c3e50;
}

/* 贪吃蛇游戏控件 */
.game-controls {
    margin-top: 15px;
    text-align: center;
}

#startBtn {
    padding: 8px 20px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

#startBtn:hover {
    background-color: #2980b9;
}

#startBtn:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

/* 井字棋新增样式 */
.tictactoe-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

.board {
    display: grid;
    grid-template-columns: repeat(3, 100px);
    gap: 5px;
    margin: 20px 0;
}

.cell {
    width: 100px;
    height: 100px;
    background: white;
    border: 2px solid #2c3e50;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 48px;
    cursor: pointer;
    position: relative; 
}

/* 玩家 X 和 O 的样式 */
.cell.player-x { color: #e74c3c; }
.cell.player-o { color: #2ecc71; }

/* 淡化棋子的样式 */
.cell.faded-chess {
    position: relative;
}

.cell.faded-chess::after {
    content: "";  /* 这里不需要显示文字内容，只需要控制透明度 */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.7);  /* 半透明黑色层，模拟淡化效果 */
    z-index: 1;  /* 确保伪元素位于棋子上面 */
    pointer-events: none; /* 确保伪元素不阻止鼠标点击 */
}

.status {
    font-size: 24px;
    margin: 10px 0;
}

.player-x { color: #e74c3c; }
.player-o { color: #2ecc71; }

.reset-btn {
    padding: 10px 20px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 20px;
    transition: background 0.3s;
}

.reset-btn:hover {
    background: #2980b9;
}


/* 进制转换器样式 */
.converter-wrapper {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.converter-wrapper h2 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
}

.input-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    margin-bottom: 8px;
    font-weight: bold;
    color: #34495e;
}

.input-group input {
    padding: 12px;
    border: 2px solid #ecf0f1;
    border-radius: 6px;
    font-size: 16px;
    transition: border 0.3s;
}

.input-group input:focus {
    border-color: #3498db;
    outline: none;
}

.button-group {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.convert-btn, .clear-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
}

.convert-btn {
    background-color: #3498db;
    color: white;
}

.convert-btn:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

.clear-btn {
    background-color: #e74c3c;
    color: white;
}

.clear-btn:hover {
    background-color: #c0392b;
    transform: translateY(-2px);
}



/* 颜色转换器样式 */
.color-converter {
    max-width: 600px;
    margin: 0 auto;
    padding: 25px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
}

.color-space-group {
    margin-bottom: 25px;
}

.color-space-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
    color: #2c3e50;
    font-size: 16px;
}

.input-row {
    display: flex;
    gap: 10px;
}

.input-row input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s;
}

.input-row input:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52,152,219,0.1);
    outline: none;
}

.button-group {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.convert-btn, .clear-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.convert-btn {
    background-color: #3498db;
    color: white;
}

.convert-btn:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(41,128,185,0.2);
}

.clear-btn {
    background-color: #f1f2f6;
    color: #2c3e50;
}

.clear-btn:hover {
    background-color: #dfe4ea;
    transform: translateY(-2px);
}