/**
 * Cookie 授权横幅样式
 * 用于 GDPR 隐私合规
 */

/* Cookie 横幅容器 */
#cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  color: #f1f5f9;
  padding: 24px;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  z-index: 10000;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#cookie-banner.show {
  transform: translateY(0);
}

#cookie-banner.hide {
  transform: translateY(100%);
}

/* 内容容器 */
.cookie-banner-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.cookie-banner-text {
  flex: 1;
  min-width: 0;
}

.cookie-banner-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #ffffff;
}

.cookie-banner-description {
  font-size: 14px;
  line-height: 1.6;
  color: #cbd5e1;
  margin-bottom: 12px;
}

.cookie-banner-links {
  display: flex;
  gap: 16px;
  font-size: 13px;
}

.cookie-banner-links a {
  color: #60a5fa;
  text-decoration: none;
  transition: color 0.2s;
}

.cookie-banner-links a:hover {
  color: #93c5fd;
  text-decoration: underline;
}

/* 按钮组 */
.cookie-banner-actions {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

.cookie-btn {
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.cookie-btn-accept {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: #ffffff;
}

.cookie-btn-accept:hover {
  background: linear-gradient(135deg, #4338ca 0%, #6d28d9 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.cookie-btn-reject {
  background: transparent;
  color: #cbd5e1;
  border: 1px solid #475569;
}

.cookie-btn-reject:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #f1f5f9;
}

.cookie-btn-settings {
  background: transparent;
  color: #60a5fa;
  border: 1px solid #3b82f6;
}

.cookie-btn-settings:hover {
  background: rgba(59, 130, 246, 0.1);
}

/* Cookie 设置面板 */
#cookie-settings {
  position: fixed;
  top: 0;
  right: -500px;
  width: 450px;
  height: 100vh;
  background: #ffffff;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  z-index: 10001;
  transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
}

#cookie-settings.show {
  right: 0;
}

.cookie-settings-header {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: #ffffff;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cookie-settings-title {
  font-size: 20px;
  font-weight: 600;
}

.cookie-settings-close {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 24px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.cookie-settings-close:hover {
  opacity: 1;
}

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

.cookie-option {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
}

.cookie-option-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.cookie-option-title {
  font-size: 16px;
  font-weight: 600;
  color: #1e293b;
}

.cookie-option-description {
  font-size: 14px;
  color: #64748b;
  line-height: 1.6;
}

/* 开关样式 */
.cookie-switch {
  position: relative;
  width: 48px;
  height: 24px;
  flex-shrink: 0;
}

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

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

.cookie-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

.cookie-switch input:checked + .cookie-slider {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
}

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

.cookie-switch.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.cookie-settings-actions {
  padding: 24px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* 遮罩层 */
#cookie-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

#cookie-overlay.show {
  opacity: 1;
  visibility: visible;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .cookie-banner-content {
    flex-direction: column;
    align-items: stretch;
  }

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

  .cookie-btn {
    width: 100%;
  }

  #cookie-settings {
    width: 100%;
    right: -100%;
  }

  .cookie-banner-links {
    flex-direction: column;
    gap: 8px;
  }
}
