/**
 * Cookie同意横幅样式
 * 符合Google Consent Mode v2和GDPR要求
 */

/* Cookie同意横幅 */
#cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    animation: slideUp 0.3s ease-out;
}

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

.cookie-consent-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.cookie-consent-text {
    flex: 1;
    min-width: 300px;
}

.cookie-consent-text h3 {
    margin: 0 0 10px 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.cookie-consent-text p {
    margin: 8px 0;
    font-size: 0.95rem;
    line-height: 1.5;
    opacity: 0.95;
}

.cookie-consent-links {
    margin-top: 10px;
}

.cookie-consent-links a {
    color: white;
    text-decoration: underline;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.cookie-consent-links a:hover {
    opacity: 1;
}

.cookie-consent-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Cookie按钮样式 */
.cookie-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.cookie-btn-accept-all {
    background: white;
    color: #667eea;
}

.cookie-btn-accept-all:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.cookie-btn-custom {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid white;
}

.cookie-btn-custom:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.cookie-btn-reject {
    background: transparent;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.cookie-btn-reject:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: white;
}

/* Cookie设置面板 */
#cookie-settings-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease-out;
}

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

.cookie-settings-content {
    background: white;
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease-out;
}

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

.cookie-settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid #e5e7eb;
}

.cookie-settings-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: #1f2937;
}

.cookie-settings-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.cookie-settings-close:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.cookie-settings-body {
    padding: 24px;
}

.cookie-settings-description {
    color: #6b7280;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 24px;
}

/* Cookie设置项 */
.cookie-setting-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 0;
    border-bottom: 1px solid #e5e7eb;
}

.cookie-setting-item:last-child {
    border-bottom: none;
}

.cookie-setting-info {
    flex: 1;
    margin-right: 20px;
}

.cookie-setting-info h4 {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    color: #1f2937;
    font-weight: 600;
}

.cookie-setting-info p {
    margin: 0;
    font-size: 0.9rem;
    color: #6b7280;
    line-height: 1.5;
}

/* Cookie开关样式 */
.cookie-toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
    flex-shrink: 0;
}

.cookie-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cookie-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: 0.3s;
    border-radius: 28px;
}

.cookie-toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cookie-toggle input:checked + .cookie-toggle-slider {
    background-color: #667eea;
}

.cookie-toggle input:focus + .cookie-toggle-slider {
    box-shadow: 0 0 1px #667eea;
}

.cookie-toggle input:checked + .cookie-toggle-slider:before {
    transform: translateX(22px);
}

.cookie-toggle input:disabled + .cookie-toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Cookie设置操作按钮 */
.cookie-settings-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

.cookie-btn-save {
    flex: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 14px 24px;
}

.cookie-btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.cookie-btn-cancel {
    flex: 1;
    background: #f3f4f6;
    color: #374151;
    padding: 14px 24px;
}

.cookie-btn-cancel:hover {
    background: #e5e7eb;
}

/* 移动端响应式 */
@media (max-width: 768px) {
    #cookie-consent-banner {
        padding: 16px;
    }

    .cookie-consent-content {
        flex-direction: column;
        align-items: stretch;
    }

    .cookie-consent-buttons {
        width: 100%;
        flex-direction: column;
    }

    .cookie-btn {
        width: 100%;
    }

    .cookie-settings-content {
        margin: 20px;
        max-height: calc(100vh - 40px);
    }

    .cookie-setting-item {
        flex-direction: column;
        gap: 16px;
    }

    .cookie-setting-info {
        margin-right: 0;
    }

    .cookie-settings-actions {
        flex-direction: column;
    }
}

/* 页脚Cookie设置链接样式（可选） */
.cookie-settings-link {
    color: #667eea;
    text-decoration: none;
    font-size: 0.9rem;
    cursor: pointer;
    transition: color 0.2s;
}

.cookie-settings-link:hover {
    color: #764ba2;
    text-decoration: underline;
}

