/**
 * 海道俱乐部 - 隐私与 Cookie 同意管理样式 v2
 * 超窄横向置底布局 · 与主站设计语言一致
 */

/* ===== Cookie 同意横幅 (超窄横向置底布局) ===== */
#haidoCookieBanner {
  position: fixed;
  bottom: -100%;
  left: 0;
  right: 0;
  transform: none;
  width: 100%;
  max-width: 100%;
  background: linear-gradient(180deg, rgba(19,39,66,0.97) 0%, rgba(10,22,40,0.97) 100%);
  border-top: 1px solid rgba(201,168,76,0.12);
  border-radius: 0;
  padding: 8px 20px;
  z-index: 9999;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.4);
  transition: bottom 0.35s cubic-bezier(0.4,0,0.2,1);
}
#haidoCookieBanner.haido-banner-in { bottom: 0; }
#haidoCookieBanner.haido-banner-out { bottom: -100%; transition: bottom 0.3s ease; }

.haido-banner-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  max-width: 1200px;
  margin: 0 auto;
}

.haido-banner-content {
  display: flex;
  align-items: center;
  gap: 8px;
}
.haido-banner-icon,
.haido-banner-text h3,
.haido-banner-categories {
  display: none;
}

.haido-banner-text {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 1 auto;
}
.haido-banner-text p {
  font-size: 12px;
  color: rgba(240,236,225,0.55);
  line-height: 1.3;
  margin: 0;
  white-space: nowrap;
}
.haido-banner-link {
  color: #c9a84c;
  text-decoration: underline;
  font-weight: 500;
  white-space: nowrap;
}
.haido-banner-link:hover { color: #e8d08a; }

/* ===== 操作按钮 (横向紧凑) ===== */
.haido-banner-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.haido-btn {
  padding: 5px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  font-family: inherit;
  white-space: nowrap;
}
.haido-btn-reject {
  background: rgba(255,255,255,0.05);
  color: rgba(240,236,225,0.5);
  border: 1px solid rgba(255,255,255,0.06);
}
.haido-btn-reject:hover { background: rgba(255,255,255,0.08); color: rgba(240,236,225,0.7); }
.haido-btn-save {
  background: rgba(201,168,76,0.08);
  color: #c9a84c;
  border: 1px solid rgba(201,168,76,0.15);
}
.haido-btn-save:hover { background: rgba(201,168,76,0.12); }
.haido-btn-accept {
  background: linear-gradient(135deg, #c9a84c, #a08030);
  color: #0a1628;
}
.haido-btn-accept:hover {
  background: linear-gradient(135deg, #d4b85a, #b09040);
}

/* ===== 设置图标 (右下角) ===== */
#haidoSettingsIcon {
  position: fixed;
  bottom: 80px;
  right: 12px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(201,168,76,0.12), rgba(201,168,76,0.04));
  border: 1px solid rgba(201,168,76,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 9998;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
#haidoSettingsIcon svg {
  width: 18px;
  height: 18px;
  stroke: #c9a84c;
  animation: hsiSpin 4s linear infinite;
}
@keyframes hsiSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
#haidoSettingsIcon:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 18px rgba(201,168,76,0.12);
}

/* ===== 设置面板 (右下角弹出) ===== */
#haidoSettingsPanel {
  position: fixed;
  bottom: 130px;
  right: 20px;
  width: 340px;
  max-width: 90vw;
  background: linear-gradient(160deg, rgba(19,39,66,0.98) 0%, rgba(10,22,40,0.98) 100%);
  border: 1px solid rgba(201,168,76,0.12);
  border-radius: 14px;
  padding: 18px;
  z-index: 9999;
  box-shadow: 0 16px 40px rgba(0,0,0,0.5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(0.97);
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
}
#haidoSettingsPanel.haido-panel-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
.haido-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.haido-panel-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: #f0ece1;
  margin: 0;
}
.haido-panel-close {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  border: none;
  color: rgba(240,236,225,0.4);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.haido-panel-close:hover { background: rgba(255,255,255,0.08); color: #f0ece1; }
.haido-panel-desc { font-size: 11px; color: rgba(240,236,225,0.4); line-height: 1.6; margin-bottom: 14px; }
.haido-panel-categories { display: flex; flex-direction: column; gap: 10px; }
.haido-panel-cat {
  padding: 10px;
  border-radius: 8px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.03);
}
.haido-pcat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.haido-pcat-label { font-size: 12px; font-weight: 500; color: #f0ece1; }
.haido-pcat-badge {
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 8px;
  background: rgba(201,168,76,0.12);
  color: #c9a84c;
  font-weight: 600;
}
.haido-pcat-badge.optional { background: rgba(255,255,255,0.06); color: rgba(240,236,225,0.4); }
.haido-pcat-desc { font-size: 10px; color: rgba(240,236,225,0.35); line-height: 1.4; margin-bottom: 8px; }

/* Toggle 开关 */
.haido-pcat-toggle { position: relative; display: inline-block; width: 36px; height: 20px; }
.haido-pcat-toggle input { opacity: 0; width: 0; height: 0; }
.haido-pcat-slider {
  position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255,255,255,0.08);
  border-radius: 20px;
  transition: all 0.3s ease;
}
.haido-pcat-slider:before {
  content: '';
  position: absolute;
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: all 0.3s ease;
}
.haido-pcat-toggle input:checked + .haido-pcat-slider { background: linear-gradient(135deg, #c9a84c, #a08030); }
.haido-pcat-toggle input:checked + .haido-pcat-slider:before { transform: translateX(16px); }
.haido-pcat-toggle input[disabled] + .haido-pcat-slider { opacity: 0.3; cursor: not-allowed; }

.haido-panel-footer {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.haido-pfooter-link {
  font-size: 10px;
  color: rgba(201,168,76,0.6);
  text-decoration: none;
  text-align: center;
}
.haido-pfooter-link:hover { color: #c9a84c; }
.haido-pfooter-actions { display: flex; gap: 6px; }
.haido-pbtn {
  flex: 1;
  padding: 6px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: all 0.2s ease;
}
.haido-pbtn-reject { background: rgba(255,255,255,0.04); color: rgba(240,236,225,0.5); }
.haido-pbtn-reject:hover { background: rgba(255,255,255,0.08); }
.haido-pbtn-accept { background: linear-gradient(135deg, #c9a84c, #a08030); color: #0a1628; }
.haido-pbtn-accept:hover { background: linear-gradient(135deg, #d4b85a, #b09040); }
.haido-pbtn-save { background: rgba(201,168,76,0.08); color: #c9a84c; border: 1px solid rgba(201,168,76,0.15); }
.haido-pbtn-save:hover { background: rgba(201,168,76,0.12); }

/* ===== 移动端适配 ===== */
@media (max-width: 768px) {
  #haidoCookieBanner { padding: 10px 12px; }
  .haido-banner-inner {
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
  }
  .haido-banner-text {
    flex: 1 1 auto;
    align-items: flex-start;
    justify-content: flex-start;
  }
  .haido-banner-text p {
    font-size: 11px;
    white-space: normal !important;
    line-height: 1.5;
    max-width: 100%;
  }
  .haido-banner-link { white-space: nowrap; }
  .haido-banner-actions { width: 100%; justify-content: center; gap: 8px; }
  .haido-banner-actions .haido-btn {
    flex: 1;
    text-align: center;
    white-space: normal;
    font-size: 10px;
    padding: 5px 8px;
  }
  .haido-btn { padding: 5px 10px; font-size: 11px; }
  #haidoSettingsIcon { bottom: 70px; right: 12px; width: 38px; height: 38px; }
  #haidoSettingsPanel { right: 12px; width: calc(100% - 24px); }
}
