/* 右侧菜单按钮透明度控制 */
.toggle-panel-btn {
    opacity: 0.3;
    transition: opacity 0.2s;
}
.toggle-panel-btn:hover {
    opacity: 1;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: #0a0e27;
    color: #ffffff;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.navbar {
    width: 100%;
    height: 60px;
    background: #1a1a1a;
    border-bottom: 1px solid #444;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.navbar-title {
    font-size: 24px;
    font-weight: bold;
    color: #ffffff;
    letter-spacing: 1px;
}

.navbar-links {
    display: flex;
    gap: 15px;
    align-items: center;
}

.navbar-link {
    color: #ffffff;
    text-decoration: none;
    font-size: 14px;
    padding: 8px 16px;
    border-radius: 4px;
    transition: all 0.3s ease;
    border: 1px solid #ffffff;
}

.navbar-link:hover {
    background: #ffffff;
    color: #000000;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.container {
    display: flex;
    flex: 1;
    margin-top: 60px;
    margin-bottom: 120px;
}

.canvas-area {
    flex: 1;
    background: linear-gradient(135deg, #0a0e27 0%, #16213e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.control-panel {
    width: 320px;
    background: #2a2a2a;
    border-left: 1px solid #444;
    overflow-y: auto;
    padding: 20px;
    color: #ffffff;
}

.control-panel::-webkit-scrollbar {
    width: 8px;
}

.control-panel::-webkit-scrollbar-track {
    background: #0a0e27;
}

.control-panel::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

.panel-section {
    margin-bottom: 30px;
}

.section-title {
    font-size: 14px;
    font-weight: bold;
    color: #ffffff;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #555;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.button-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.btn {
    padding: 10px;
    border: 1px solid #444;
    background: #3a3a3a;
    color: #ffffff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
    text-align: center;
}

.btn:hover {
    background: #454545;
    border-color: #666;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

.btn.active {
    background: #4a90e2;
    color: #ffffff;
    border-color: #4a90e2;
    box-shadow: 0 0 15px rgba(74, 144, 226, 0.3);
}

.slider-container {
    margin-bottom: 20px;
}

.slider-label {
    font-size: 12px;
    color: #cccccc;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
}

input[type="range"] {
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: #444;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #4a90e2;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(74, 144, 226, 0.5);
}

input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #4a90e2;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 5px rgba(74, 144, 226, 0.5);
}

.color-picker {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.color-sample {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.color-sample:hover {
    border-color: #00d4ff;
    transform: scale(1.05);
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 20px;
    cursor: pointer;
    z-index: 1000;
    transition: color 0.3s ease;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
}

.close-btn:hover {
    color: #cccccc;
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.9);
}

.toggle-panel-btn {
    position: absolute;
    top: 20px;
    right: 12px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(0, 0, 0, 0.6);
    color: #ffffff;
    font-size: 18px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 900;
}

.toggle-panel-btn:hover {
    background: rgba(0, 0, 0, 0.6);
    border-color: rgba(0, 0, 0, 0.8);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
}

.container.panel-hidden .control-panel {
    display: none;
}

.container.panel-hidden .canvas-area {
    flex: 1;
}

.container.panel-hidden canvas {
    width: 100%;
}

.fullscreen-btn {
    margin-left: auto;
    padding: 8px 16px;
    background: #4a03a1;
    color: #ffffff;
    border: 1px solid #4a03a1;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.fullscreen-btn:hover {
    background: #4a03a1;
    border-color: #4a03a1;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.3);
}

.info-text {
    font-size: 11px;
    color: #666;
    margin-top: 8px;
}

.toggle-btn {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    background: #3a3a3a;
    border: 1px solid #444;
    color: #ffffff;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-btn:hover {
    background: #454545;
    border-color: #666;
}

.toggle-btn.active {
    background: #4a90e2;
    color: #ffffff;
    border-color: #4a90e2;
}

footer {
    width: 100%;
    background: #000000;
    border-top: 1px solid #444;
    padding: 12px 30px;
    text-align: center;
    color: #ffffff;
    font-size: 12px;
    flex-shrink: 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

footer a {
    color: #ffffff;
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: #cccccc;
    text-decoration: underline;
}

footer p {
    margin: 0;
    line-height: 1;
}

footer p:first-child {
    color: #ffee2f;
}

/* 手机端适配 */
@media (max-width: 768px) {
    .navbar {
        height: 50px;
        padding: 0 15px;
    }

    .navbar-title {
        font-size: 18px;
    }

    .navbar-links {
        gap: 8px;
    }

    .navbar-link {
        font-size: 12px;
        padding: 6px 10px;
    }

    .fullscreen-btn {
        padding: 6px 12px;
        font-size: 12px;
    }

    .container {
        margin-top: 50px;
        margin-bottom: 0;
        height: calc(100vh - 50px - 120px);
    }

    .canvas-area {
        flex: 1;
        min-height: 0;
    }

    .control-panel {
        width: 280px;
        max-height: 100%;
        padding: 15px;
        font-size: 12px;
        overflow-y: auto;
    }

    .close-btn {
        top: 10px;
        right: 10px;
        font-size: 16px;
    }

    footer {
        padding: 8px 15px;
        font-size: 11px;
        gap: 0;
        flex-direction: column;
        align-items: center;
        height: auto;
    }

    footer p {
        margin: 2px 0;
    }

    .section-title {
        font-size: 12px;
    }

    .btn {
        font-size: 11px;
        padding: 8px;
    }

    .toggle-btn {
        padding: 8px;
        font-size: 11px;
    }

    .slider-label {
        font-size: 11px;
    }

    .color-sample {
        width: 36px;
        height: 36px;
    }
}

@media (max-width: 480px) {
    .navbar {
        height: 45px;
        padding: 0 10px;
        flex-wrap: wrap;
    }

    .navbar-title {
        font-size: 16px;
    }

    .navbar-links {
        gap: 5px;
    }

    .navbar-link {
        font-size: 10px;
        padding: 4px 6px;
    }

    .fullscreen-btn {
        padding: 4px 8px;
        font-size: 10px;
    }

    .container {
        margin-top: 45px;
        margin-bottom: 0;
        height: calc(100vh - 45px - 85px);
    }

    .canvas-area {
        flex: 1;
        min-height: 0;
    }

    .control-panel {
        width: 240px;
        max-height: 100%;
        padding: 12px;
        font-size: 11px;
        overflow-y: auto;
    }

    footer {
        padding: 6px 10px;
        font-size: 10px;
        margin-top: auto;
    }

    .color-sample {
        width: 32px;
        height: 32px;
    }

    .button-group {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .toggle-btn {
        padding: 6px;
        font-size: 10px;
        margin-bottom: 5px;
    }

    .section-title {
        font-size: 11px;
        margin-bottom: 8px;
    }

    .btn {
        font-size: 10px;
        padding: 6px;
    }
}
