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

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    background-color: #f5f5f5;
}

/* 导航栏样式 */
.header {
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
}

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

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.nav-logo a {
    color: #333;
    font-size: 20px;
    font-weight: bold;
    text-decoration: none;
}

.nav-menu ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu ul li {
    margin: 0 15px;
}

.nav-menu ul li a {
    color: #333;
    text-decoration: none;
    font-size: 15px;
}

.nav-right {
    display: flex;
    align-items: center;
}

.login-btn, .register-btn {
    padding: 6px 20px;
    border-radius: 4px;
    text-decoration: none;
    margin-left: 10px;
}

.login-btn {
    color: #333;
    border: 1px solid #ddd;
}

.register-btn {
    background: #007bff;
    color: #fff;
}

/* 主要内容区新样式 */
main {
    max-width: 1200px;
    margin: 80px auto 140px;
    padding: 0 20px;
}

h1 {
    text-align: center;
    color: #333;
    font-size: 32px;
    margin-bottom: 10px;
}

.usage-count {
    text-align: center;
    margin-bottom: 30px;
    color: #666;
}

.usage-number {
    color: #007bff;
    font-weight: bold;
}

/* 工具容器 */
.tool-container {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    padding: 24px;
}

/* 颜色分类选择器 */
.category-selector {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.category-btn {
    padding: 8px 16px;
    border: 1px solid #eee;
    background: #fff;
    color: #666;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.category-btn:hover {
    background: #f5f7ff;
    border-color: #007bff;
    color: #007bff;
}

.category-btn.active {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
}

/* 颜色展示区域 */
.color-section {
    margin-top: 24px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-header h2 {
    font-size: 16px;
    color: #333;
    font-weight: 600;
}

.toolbar {
    display: flex;
    gap: 8px;
}

.tool-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid #eee;
    background: #fff;
    color: #666;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tool-btn:hover {
    background: #f5f7ff;
    border-color: #007bff;
    color: #007bff;
}

/* 基础颜色网格 */
.base-colors {
    display: grid;
    grid-template-columns: repeat(30, 1fr); /* 每行30个色块 */
    gap: 4px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 24px;
}

.color-box {
    aspect-ratio: 1;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.color-box:hover {
    transform: scale(1.15);
    z-index: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* 颜色搭配和已选颜色区域 */
.color-combinations-row {
    display: grid;
    grid-template-columns: 1.2fr 1.8fr;
    gap: 24px;
    margin-top: 24px;
}

.color-combinations, .selected-colors {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px;
}

/* 颜色搭配网格 */
.combinations-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px;
    background: #fff;
    border-radius: 6px;
}

.combinations-grid .color-box {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.combinations-grid .color-box:hover {
    transform: scale(1.15);
    z-index: 1;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

/* 已选颜色展示 */
.color-palette {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    min-height: 100px;
}

.selected-color {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    transition: transform 0.2s ease;
}

.selected-color:hover {
    transform: scale(1.15);
    z-index: 1;
}

.selected-color::after {
    content: attr(data-color);
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(51, 51, 51, 0.9);
    color: #fff;
    padding: 1px 3px;
    border-radius: 2px;
    font-size: 7px;
    font-family: Monaco, Consolas, monospace;
    letter-spacing: 0;
    white-space: nowrap;
    opacity: 0;
    transition: all 0.2s ease;
    pointer-events: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.selected-color:hover::after {
    opacity: 1;
    bottom: -18px;
}

/* 广告区域 */
.ad-section {
    margin-top: 40px;
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}

.ad-placeholder {
    height: 120px;
    background: #f8f9fa;
    border: 2px dashed #ddd;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 14px;
}

/* 底部版权样式 */
.footer {
    background: #333;
    padding: 20px 0;
    position: fixed;
    bottom: 0;
    width: 100%;
    margin-top: 40px;
}

.footer-content {
    text-align: center;
    color: #fff;
}

.footer-content p {
    margin: 5px 0;
    font-size: 14px;
}

.footer-content a {
    color: #fff;
    text-decoration: none;
}

h2 {
    margin-bottom: 1rem;
    color: #333;
}

.color-code {
    font-size: 10px;
}

/* 移动端适配 */
@media screen and (max-width: 768px) {
    /* 导航栏适配 */
    .nav-menu {
        display: none; /* 在移动端隐藏菜单 */
    }
    
    .nav-content {
        height: 50px; /* 减小导航栏高度 */
    }

    /* 主要内容区适配 */
    main {
        margin: 60px auto 100px; /* 调整边距 */
        padding: 0 15px;
    }

    h1 {
        font-size: 24px; /* 减小标题字号 */
    }

    /* 基础颜色网格适配 */
    .base-colors {
        grid-template-columns: repeat(15, 1fr); /* 每行15个色块 */
        gap: 3px;
        padding: 10px;
    }

    /* 颜色搭配和已选颜色区域适配 */
    .color-combinations-row {
        grid-template-columns: 1fr; /* 改为单列布局 */
        gap: 15px;
    }

    /* 调整色块大小 */
    .combinations-grid .color-box,
    .selected-color {
        width: 32px;
        height: 32px;
    }

    /* 工具容器适配 */
    .tool-container {
        padding: 15px;
    }

    /* 按钮适配 */
    .tool-btn {
        padding: 4px 8px;
        font-size: 12px;
    }

    /* 底部版权适配 */
    .footer {
        padding: 15px 0;
    }

    .footer-content p {
        font-size: 12px;
    }

    /* 广告区域适配 */
    .ad-section {
        margin-top: 20px;
        padding: 15px;
    }

    .ad-placeholder {
        height: 80px;
    }
}

/* 超小屏幕适配 */
@media screen and (max-width: 480px) {
    .base-colors {
        grid-template-columns: repeat(10, 1fr); /* 每行10个色块 */
    }

    .combinations-grid .color-box,
    .selected-color {
        width: 28px;
        height: 28px;
    }

    h1 {
        font-size: 20px;
    }

    .usage-count {
        font-size: 14px;
    }
}