/* 关键CSS - 确保页面基本布局在完整CSS加载前可见 */
.tool-content {
    display: none !important;
}
.tool-content.active {
    display: block !important;
}
.tool-button.active {
    background: linear-gradient(135deg, #24C6DC, #514A9D);
    color: white;
    box-shadow: 0 4px 12px rgba(36, 198, 220, 0.2);
}
/* 确保颜色选择器默认显示 */
#picker-tool.active {
    display: block !important;
}

/* 从color.html的<style>标签中复制的样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    background: linear-gradient(135deg, #f6f9fc 0%, #edf1f7 100%);
    color: #333;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: linear-gradient(135deg, #24C6DC, #514A9D);
    padding: 20px 0;
    box-shadow: 0 4px 20px rgba(36, 198, 220, 0.2);
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 45%, rgba(255,255,255,0.1) 50%, transparent 55%);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.header-content {
    text-align: center;
}

.header-content h1 {
    color: white;
    font-size: 2.4em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    letter-spacing: 1px;
}

.back-link {
    position: absolute;
    top: 15px;
    left: 15px;
    display: inline-flex;
    align-items: center;
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 6px;
    font-size: 14px;
    z-index: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.back-link:hover {
    color: #fff;
    transform: translateX(-5px);
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
}

.back-link::before {
    content: '←';
    margin-right: 6px;
    transition: transform 0.3s ease;
    display: inline-block;
    font-size: 14px;
}

.back-link:hover::before {
    transform: translateX(-5px);
}

.tools-nav {
    background: white;
    padding: 12px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.tool-button {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    background: #f8f9fa;
    color: #514A9D;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 15px;
    white-space: nowrap;
    min-width: 100px;
}

.tool-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.tool-content {
    display: none;
    animation: fadeSlideUp 0.5s ease;
    background: #fff;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    max-width: 800px;
    margin: 0 auto;
}

.tool-content:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.color-picker {
    display: flex;
    flex-direction: column;
    gap: 25px;
    padding: 25px;
    max-width: 700px;
    margin: 0 auto;
}

.color-wheel-container {
    position: relative;
    width: 350px;
    height: 350px;
    margin: 0 auto;
    padding: 20px;
}

#colorWheel {
    width: 310px;
    height: 310px;
}

.color-preview {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 180px;
    height: 180px;
    border-radius: 12px;
    border: 3px solid white;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    background-color: #000000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: monospace;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    gap: 8px;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.color-preview:hover {
    transform: translate(-50%, -50%) scale(1.05);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.25);
}

.color-preview .hex-value {
    font-size: 20px;
}

.color-preview .rgb-value {
    font-size: 16px;
}

.color-inputs {
    display: flex;
    gap: 20px;
    padding: 20px;
}

.color-input-group {
    flex: 1;
    max-width: 200px;
}

.color-input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 15px;
    color: #514A9D;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.color-input-group input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-family: monospace;
    font-size: 16px;
    text-align: center;
    transition: all 0.3s ease;
    color: #514A9D;
    background: #f8f9fa;
}

.color-input-group input:hover {
    border-color: #24C6DC;
    background: white;
}

.color-input-group input:focus {
    outline: none;
    border-color: #24C6DC;
    background: white;
    box-shadow: 0 0 0 4px rgba(36, 198, 220, 0.15);
}

/* 调色板生成器样式 */
.palette-generator {
    max-width: 900px;
    margin: 0 auto;
    padding: 25px;
}

.palette-controls {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

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

.palette-color {
    position: relative;
    height: 180px;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.palette-color:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.color-codes {
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    padding: 8px;
    border-radius: 4px;
    font-size: 12px;
    font-family: monospace;
    color: white;
    transition: all 0.3s ease;
}

.palette-color:hover .color-codes {
    padding: 12px;
}

.color-codes div {
    margin: 2px 0;
}

.generate-btn {
    background: linear-gradient(135deg, #24C6DC, #514A9D);
    color: white;
    padding: 15px 35px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 18px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(36, 198, 220, 0.2);
    min-width: 250px;
    text-align: center;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(36, 198, 220, 0.3);
}

.copy-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #24C6DC, #514A9D);
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    display: none;
    animation: slideIn 0.3s ease;
    box-shadow: 0 4px 15px rgba(36, 198, 220, 0.3);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 移除 HSL 输入组 */
#hslInput {
    display: none;
}

/* 修改移动端适配样式 */
@media screen and (max-width: 480px) {
    .container {
        padding: 10px;
    }

    .header-content h1 {
        font-size: 2em;
    }

    .tool-button {
        padding: 10px 15px;
        font-size: 14px;
        min-width: 90px;
    }

    .tool-content {
        padding: 15px;
    }

    .color-picker {
        padding: 15px;
        gap: 15px;
    }

    .color-wheel-container {
        width: 300px;  /* 增加宽度，原来是240px */
        height: 300px;  /* 增加高度，原来是240px */
        padding: 15px;  /* 增加内边距，原来是10px */
    }

    #colorWheel {
        width: 270px;  /* 增加宽度，原来是220px */
        height: 270px;  /* 增加高度，原来是220px */
    }

    .color-preview {
        width: 150px;  /* 增加宽度，原来是120px */
        height: 150px;  /* 增加高度，原来是120px */
    }

    .color-preview .hex-value {
        font-size: 20px;  /* 增加字体大小，原来是18px */
    }

    .color-preview .rgb-value {
        font-size: 16px;  /* 增加字体大小，原来是15px */
    }

    .color-inputs {
        padding: 15px;
        gap: 12px;  /* 增加间距，原来是10px */
    }

    .color-input-group input {
        padding: 15px;  /* 增加内边距，原来是12px */
        font-size: 16px;  /* 增加字体大小，原来是14px */
    }

    .palette-generator {
        padding: 15px;
    }

    .palette-display {
        grid-template-columns: repeat(2, 1fr);  /* 确保移动端显示2列 */
        gap: 12px;
    }

    .palette-color {
        height: 160px;  /* 增加高度，原来是150px */
    }

    .generate-btn {
        padding: 15px 30px;  /* 增加内边距 */
        font-size: 16px;
        min-width: 220px;  /* 增加最小宽度，原来是200px */
    }

    /* 更小屏幕的优化 */
    @media screen and (max-width: 360px) {
        .color-wheel-container {
            width: 260px;  /* 更小屏幕减小尺寸 */
            height: 260px;
        }

        #colorWheel {
            width: 230px;
            height: 230px;
        }

        .color-preview {
            width: 130px;
            height: 130px;
        }
    }
}

/* 页面加载动画 */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s;
}

.page-loader.hidden {
    opacity: 0;
    pointer-events: none;
}