/* SEO优化：屏幕阅读器专用样式 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 跳转到主内容链接 */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #343a40;
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 1000;
    border-radius: 4px;
}

.skip-link:focus {
    top: 6px;
}

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

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

/* 头部样式优化 */
header {
    background-color: #343a40;
    color: white;
    text-align: center;
    padding: 2rem 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

.site-title {
    font-size: 2.5rem;
    font-weight: 300;
    margin-bottom: 0.5rem;
}

.site-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin: 0;
}

/* Hero区域样式 */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 3rem 1rem;
    margin-bottom: 2rem;
}

.hero-section h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.hero-section p {
    font-size: 1.1rem;
    max-width: 800px;
    margin: 0 auto;
    opacity: 0.9;
}

/* 导航区域优化 */
.scheme-navigation {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    margin: 2rem auto;
    max-width: 1200px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.scheme-navigation h3 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    color: #343a40;
}

.color-scheme-selector {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    padding: 1rem;
    background-color: #fff;
    border-bottom: 1px solid #e9ecef;
}

.scheme-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    background-color: #e9ecef;
    color: #495057;
    cursor: pointer;
    transition: all 0.3s ease;
}

.scheme-btn:hover {
    background-color: #dee2e6;
}

.scheme-btn.active {
    background-color: #007bff;
    color: white;
}

.content-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.description-panel, .color-palette-panel, .demo-panel {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 20px;
    margin-bottom: 20px;
}

.description-panel {
    flex: 1;
    min-width: 300px;
}

.color-palette-panel {
    flex: 1;
    min-width: 300px;
}

.demo-panel {
    flex: 1.5;
    min-width: 400px;
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #343a40;
    border-bottom: 2px solid #f8f9fa;
    padding-bottom: 0.5rem;
}

.color-description {
    margin-bottom: 1rem;
    line-height: 1.8;
}

.color-description h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: #495057;
}

.color-description p {
    margin-bottom: 0.8rem;
}

.color-description ul {
    margin-left: 20px;
    margin-bottom: 0.8rem;
}

.color-description li {
    margin-bottom: 0.3rem;
}

/* 颜色展示区域 - 修复后的统一样式 */
.color-palette {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    max-height: 600px;
    overflow-y: auto;
    padding-right: 10px;
}

.color-palette::-webkit-scrollbar {
    width: 6px;
}

.color-palette::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.color-palette::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.color-palette::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.color-item {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid #e9ecef;
}

.color-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.color-swatch {
    width: 80px;
    height: 60px;
    flex-shrink: 0;
    border-right: 1px solid #e9ecef;
    position: relative;
}

.color-info {
    padding: 12px 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0; /* 防止内容溢出 */
}

.color-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 4px;
    color: #212529;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.color-hex {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-size: 0.85rem;
    color: #6c757d;
    background-color: #f8f9fa;
    padding: 3px 8px;
    border-radius: 4px;
    display: inline-block;
    border: 1px solid #e9ecef;
}

/* 预览区域样式 */
.preview-container {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.preview-container:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.preview-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.header-content h4 {
    margin: 0 0 5px 0;
    font-size: 1.3rem;
    font-weight: 600;
}

.header-content p {
    margin: 0;
    opacity: 0.9;
    font-size: 0.9rem;
}

.header-accent {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    opacity: 0.2;
    position: absolute;
    right: -20px;
    top: -20px;
}

.preview-body {
    background-color: #f8f9fa;
    padding: 0;
}

.preview-nav {
    display: flex;
    padding: 15px 20px;
    gap: 5px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.nav-item {
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-item:hover {
    background-color: rgba(0,0,0,0.05);
}

.nav-item.active {
    color: white !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.preview-content {
    padding: 20px;
}

.content-card {
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
    transition: transform 0.2s ease;
}

.content-card:hover {
    transform: translateY(-2px);
}

.card-header {
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.card-header h5 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.card-accent {
    width: 40px;
    height: 4px;
    border-radius: 2px;
}

.card-body {
    padding: 20px;
}

.card-body p {
    margin-bottom: 15px;
    line-height: 1.5;
    color: #495057;
}

.card-tags {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tag {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.card-actions {
    display: flex;
    gap: 10px;
}

.preview-btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.preview-btn.primary {
    color: white;
}

.preview-btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2) !important;
}

.preview-btn.outline {
    background-color: transparent;
    border-width: 1.5px;
}

.preview-btn.outline:hover {
    background-color: rgba(0,0,0,0.05);
}

.feature-cards {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.feature-card {
    flex: 1;
    padding: 15px;
    border-radius: 8px;
    position: relative;
    transition: transform 0.2s ease;
}

.feature-card:hover {
    transform: translateY(-2px);
}

.feature-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    font-weight: bold;
}

.feature-card h6 {
    margin: 0 0 5px 0;
    font-size: 0.9rem;
    font-weight: 600;
}

.feature-card p {
    margin: 0;
    font-size: 0.8rem;
    color: #6c757d;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .feature-cards {
        flex-direction: column;
        gap: 10px;
    }
    
    .card-actions {
        flex-direction: column;
    }
    
    .preview-nav {
        overflow-x: auto;
        padding-bottom: 5px;
    }
}

/* 页脚样式优化 */
footer {
    background-color: #343a40;
    color: white;
    padding: 3rem 1rem 2rem;
    margin-top: 3rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
    color: #f8f9fa;
    font-size: 1.2rem;
}

.footer-section p {
    margin-bottom: 0.5rem;
    opacity: 0.9;
    line-height: 1.5;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.footer-section a {
    color: #adb5bd;
    text-decoration: none;
}

.footer-section a:hover {
    color: white;
    text-decoration: underline;
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 2rem;
    border-top: 1px solid #495057;
    text-align: center;
}

.footer-bottom p {
    margin-bottom: 0.5rem;
    opacity: 0.8;
}

.footer-bottom nav a {
    color: #adb5bd;
    text-decoration: none;
    margin: 0 0.5rem;
}

.footer-bottom nav a:hover {
    color: white;
}

/* 子方案选择器样式 */
.sub-scheme-container {
    margin: 20px 0;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.sub-scheme-container h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #333;
}

.sub-scheme-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sub-scheme-btn {
    padding: 6px 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background-color: #fff;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.sub-scheme-btn:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
}

.sub-scheme-btn.active {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .content-container {
        flex-direction: column;
    }
    
    .description-panel, .color-palette-panel, .demo-panel {
        min-width: 100%;
    }
}

/* 响应式调整 */
@media (max-width: 768px) {
    .sub-scheme-buttons {
        justify-content: center;
    }
    
    .sub-scheme-btn {
        font-size: 13px;
        padding: 5px 10px;
    }
}

/* 颜色展示区域样式 */
.color-palette-showcase {
    margin-top: 25px;
    padding: 20px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border: 1px solid #e9ecef;
}

.color-palette-showcase h5 {
    margin-bottom: 15px;
    font-size: 1.1rem;
    color: #343a40;
    font-weight: 600;
}

/* 删除重复的颜色样式，使用上面统一样式 */

/* 新的颜色数值表 - 色卡网格布局 */
.color-palette-showcase {
    width: 100%;
}

.color-swatches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    padding: 10px 0;
}

.color-swatch-card {
    aspect-ratio: 1;
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
    transform: translateY(20px);
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.color-swatch-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.color-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.3) 60%, transparent 100%);
    padding: 20px 12px 12px;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.color-swatch-card:hover .color-overlay {
    transform: translateY(0);
}

.color-card-name {
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 4px;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.color-card-hex {
    color: rgba(255,255,255,0.9);
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-size: 0.8rem;
    text-align: center;
    background-color: rgba(255,255,255,0.2);
    padding: 2px 6px;
    border-radius: 4px;
    backdrop-filter: blur(4px);
}

/* 新颜色数值表响应式设计 */
@media (max-width: 768px) {
    .color-swatches-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 12px;
        padding: 8px 0;
    }

    .color-swatch-card {
        border-radius: 10px;
    }

    .color-overlay {
        padding: 15px 10px 10px;
    }

    .color-card-name {
        font-size: 0.85rem;
        margin-bottom: 3px;
    }

    .color-card-hex {
        font-size: 0.75rem;
        padding: 2px 5px;
    }
}

@media (max-width: 480px) {
    .color-swatches-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 10px;
    }

    .color-swatch-card {
        border-radius: 8px;
    }

    .color-overlay {
        padding: 12px 8px 8px;
    }

    .color-card-name {
        font-size: 0.8rem;
    }

    .color-card-hex {
        font-size: 0.7rem;
        padding: 1px 4px;
    }
}

/* AI提示词生成区域样式 */
.ai-prompt-section {
    display: flex;
    justify-content: center;
    padding: 30px 20px;
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.ai-prompt-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 18px 40px;
    font-size: 1.2rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.ai-prompt-btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.ai-prompt-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.4);
}

.ai-prompt-btn:hover:before {
    left: 100%;
}

.ai-prompt-btn:active {
    transform: translateY(-1px);
}

.btn-icon {
    font-size: 1.5rem;
}

.btn-text {
    letter-spacing: 0.5px;
}

/* 模态框样式 */
.prompt-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.prompt-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: white;
    border-radius: 16px;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #e9ecef;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.8rem;
    color: white;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s ease;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    opacity: 1;
}

.modal-body {
    padding: 25px;
    max-height: calc(80vh - 70px);
    overflow-y: auto;
}

.prompt-content {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    border-left: 4px solid #667eea;
    color: #333;
    max-height: 400px;
    overflow-y: auto;
}

.prompt-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.copy-btn, .download-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-btn {
    background-color: #667eea;
    color: white;
}

.copy-btn:hover {
    background-color: #5a6fd8;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.download-btn {
    background-color: #6c757d;
    color: white;
}

.download-btn:hover {
    background-color: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(108, 117, 125, 0.3);
}

/* 响应式调整 - AI提示词区域 */
@media (max-width: 768px) {
    .ai-prompt-btn {
        padding: 15px 30px;
        font-size: 1rem;
    }
    
    .btn-icon {
        font-size: 1.3rem;
    }
    
    .modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .modal-header {
        padding: 15px 20px;
    }
    
    .modal-header h3 {
        font-size: 1.2rem;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .prompt-content {
        padding: 15px;
        font-size: 0.9rem;
        max-height: 300px;
    }
    
    .prompt-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .copy-btn, .download-btn {
        width: 100%;
        padding: 12px;
    }
}