/* ============================================================
   theme.css — 出海事界 前端 浅色/深色 主题
   默认：浅色（保持原有视觉）
   深色：html[data-theme="dark"]
   ============================================================ */

:root {
  --ct-bg: #ffffff;
  --ct-bg-soft: #f7f8fa;
  --ct-surface: #ffffff;
  --ct-surface-2: #f8f9fa;
  --ct-text: #111827;
  --ct-text-soft: #4b5563;
  --ct-muted: #6b7280;
  --ct-border: rgba(17, 24, 39, .12);
  --ct-border-soft: rgba(17, 24, 39, .07);
  --ct-accent: #e60012;
  --ct-shadow: 0 8px 28px rgba(15, 23, 42, .10);
  --ct-header-bg: #000000;
  --ct-header-text: #ffffff;
  color-scheme: light;
}

html[data-theme="dark"] {
  --ct-bg: #0b0f14;
  --ct-bg-soft: #0e131a;
  --ct-surface: #151b24;
  --ct-surface-2: #111721;
  --ct-text: #e8eef6;
  --ct-text-soft: #c2ccd9;
  --ct-muted: #94a3b8;
  --ct-border: rgba(255, 255, 255, .14);
  --ct-border-soft: rgba(255, 255, 255, .08);
  --ct-accent: #ff3b47;
  --ct-shadow: 0 10px 34px rgba(0, 0, 0, .55);
  --ct-header-bg: #05080c;
  --ct-header-text: #e8eef6;
  color-scheme: dark;
}

/* ---------- 全局过渡 ---------- */
html.ct-theme-anim,
html.ct-theme-anim body {
  transition: background-color .28s ease, color .28s ease;
}

html[data-theme="dark"] body {
  background: var(--ct-bg) !important;
  color: var(--ct-text);
}

/* ============================================================
   深色：浅底容器统一改为深色卡片
   ============================================================ */
html[data-theme="dark"] .wide-box,
html[data-theme="dark"] .carousel-container,
html[data-theme="dark"] .box-container-five,
html[data-theme="dark"] .additional-content-box,
html[data-theme="dark"] .more-tools-label button,
html[data-theme="dark"] .outer-container-tool,
html[data-theme="dark"] .header-tool,
html[data-theme="dark"] .nav-tool,
html[data-theme="dark"] .content-area-tool,
html[data-theme="dark"] .popupp,
html[data-theme="dark"] .popup,
html[data-theme="dark"] .module-aNews,
html[data-theme="dark"] .module-bNews,
html[data-theme="dark"] .module-cNews,
html[data-theme="dark"] .blank-itemNews,
html[data-theme="dark"] .image-boxNews,
html[data-theme="dark"] .calendar-boxNews,
html[data-theme="dark"] #search-header,
html[data-theme="dark"] .result-item,
html[data-theme="dark"] .container-gunyu,
html[data-theme="dark"] .tab-nav-gunyu,
html[data-theme="dark"] .qr-item-gunyu,
html[data-theme="dark"] .four-circles .circle,
html[data-theme="dark"] .eleven-circles .circle,
html[data-theme="dark"] .circle-item,
html[data-theme="dark"] .five-more-button,
html[data-theme="dark"] .four-partners-content,
html[data-theme="dark"] .text-center,
html[data-theme="dark"] .services-section-business2,
html[data-theme="dark"] #module6.website-customization,
html[data-theme="dark"] #module1 .text-overlay .contact-button,
html[data-theme="dark"] #module2.buttons {
  background-color: var(--ct-surface) !important;
  color: var(--ct-text);
  border-color: var(--ct-border) !important;
}

/* 浅底容器内的深色文字 */
html[data-theme="dark"] .wide-box h2,
html[data-theme="dark"] .wide-box p,
html[data-theme="dark"] .wide-box div,
html[data-theme="dark"] .right-tags-container p,
html[data-theme="dark"] .carousel-button,
html[data-theme="dark"] .new-h1,
html[data-theme="dark"] .there-new-module,
html[data-theme="dark"] .four-new-module,
html[data-theme="dark"] .five-new-module,
html[data-theme="dark"] .module-aNews,
html[data-theme="dark"] .module-bNews,
html[data-theme="dark"] .module-cNews,
html[data-theme="dark"] .content-itemNews h3,
html[data-theme="dark"] .descNaewss,
html[data-theme="dark"] .calendar-headerNewss span,
html[data-theme="dark"] .agreement-content-gunyu h3,
html[data-theme="dark"] .panel-gunyu,
html[data-theme="dark"] .panel-gunyu p,
html[data-theme="dark"] .module,
html[data-theme="dark"] .buttonn,
html[data-theme="dark"] .circle-title,
html[data-theme="dark"] .circle-item p {
  color: var(--ct-text);
}

/* 分隔线 / 边框 */
html[data-theme="dark"] .hr-container > hr,
html[data-theme="dark"] .service-content-container > hr,
html[data-theme="dark"] .nav-line,
html[data-theme="dark"] .divider-line,
html[data-theme="dark"] .service-line-business2 {
  background: var(--ct-border) !important;
  border-color: var(--ct-border) !important;
}

html[data-theme="dark"] .blank-itemNews::after,
html[data-theme="dark"] .dot-business2 {
  background: var(--ct-border) !important;
}

/* 服务卡片图标（黑色线条）翻转可见 */
html[data-theme="dark"] .box-icon {
  filter: invert(1) brightness(1.65);
}

/* 标签胶囊 / 小色块 */
html[data-theme="dark"] .right-tags-container {
  background: transparent;
}
html[data-theme="dark"] .right-tags-container p {
  background: var(--ct-surface-2);
  border: 1px solid var(--ct-border);
  color: var(--ct-text);
}

/* 表单 / 搜索框 */
html[data-theme="dark"] #search-header,
html[data-theme="dark"] .search-input,
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="search"],
html[data-theme="dark"] textarea {
  background-color: var(--ct-surface) !important;
  color: var(--ct-text) !important;
  border-color: var(--ct-border) !important;
}

html[data-theme="dark"] .search-input::placeholder {
  color: var(--ct-muted) !important;
}

/* 结果卡片 / 列表 */
html[data-theme="dark"] .result-item {
  border-color: var(--ct-border) !important;
}
html[data-theme="dark"] .result-item:hover {
  background: var(--ct-surface-2) !important;
}

/* 日历 */
html[data-theme="dark"] .calendar-boxNews,
html[data-theme="dark"] .calendar-day {
  color: var(--ct-text);
}

/* 页脚保持深色，略作区分 */
html[data-theme="dark"] .five-footer,
html[data-theme="dark"] .new_footer {
  background: #05080c;
  border-top: 1px solid var(--ct-border-soft);
}

/* 白底图片在深色下加一点柔和边界，避免“悬浮白块” */
html[data-theme="dark"] .banner-img {
  filter: brightness(.92);
}

/* 联系我们区块的浅色背景图：深色下压暗，避免亮带 */
html[data-theme="dark"] .contact-section {
  background-color: var(--ct-bg);
}
html[data-theme="dark"] .contact-section::before {
  filter: brightness(.16) saturate(.55);
  opacity: .9;
}

/* 作品展示 / 地图等大图：略降亮度 */
html[data-theme="dark"] .four-image-content img,
html[data-theme="dark"] .there-carousel-slide img {
  filter: brightness(.88);
}

/* ============================================================
   切换按钮
   ============================================================ */
.theme-toggle {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .28);
  background: rgba(255, 255, 255, .06);
  color: #fff;
  cursor: pointer;
  padding: 0;
  margin-left: 10px;
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
}
.theme-toggle:hover {
  background: rgba(255, 255, 255, .16);
  border-color: rgba(255, 255, 255, .55);
  transform: translateY(-1px);
}
.theme-toggle:focus-visible {
  outline: 2px solid #4ea1ff;
  outline-offset: 2px;
}
.theme-toggle svg {
  width: 19px;
  height: 19px;
  display: block;
}
.theme-toggle .tt-sun { display: block; }
.theme-toggle .tt-moon { display: none; }
html[data-theme="dark"] .theme-toggle .tt-sun { display: none; }
html[data-theme="dark"] .theme-toggle .tt-moon { display: block; }

html[data-theme="dark"] .theme-toggle {
  border-color: rgba(255, 255, 255, .22);
  background: rgba(255, 255, 255, .08);
}

@media (max-width: 820px) {
  .theme-toggle {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    margin-left: 8px;
  }
  .theme-toggle svg { width: 17px; height: 17px; }
}

/* 分类图标在深色下略有反差 */
html[data-theme="dark"] .grid-item-five p {
  color: var(--ct-text-soft);
}
html[data-theme="dark"] .grid-item-five img {
  opacity: .92;
}

/* ============================================================
   出海工具页（/toolh）
   ============================================================ */
.nav-item-tool { color: #c9d2de !important; }
.nav-item-tool:hover,
.nav-item-tool.active { color: #ffffff !important; }

html[data-theme="dark"] .logo-text-tool { color: var(--ct-text); }
html[data-theme="dark"] .carousel-tool,
html[data-theme="dark"] .carousel-inner-tool {
  background: var(--ct-surface) !important;
  color: var(--ct-text);
  border-color: var(--ct-border) !important;
}
html[data-theme="dark"] .carousel-item-tool { color: var(--ct-text); }
html[data-theme="dark"] .search-input-tool {
  background: var(--ct-surface) !important;
  color: var(--ct-text) !important;
  border-color: var(--ct-border) !important;
}
html[data-theme="dark"] .search-tab-tool { color: var(--ct-muted); }
html[data-theme="dark"] .search-tab-tool.active-tool { color: var(--ct-text); }
html[data-theme="dark"] .content-tool { background: var(--ct-bg); }

/* 出海快讯：日历/意见收集面板 */
html[data-theme="dark"] .calendar-boxNews,
html[data-theme="dark"] .calendar-headerNews,
html[data-theme="dark"] .calendar-headerNewss,
html[data-theme="dark"] .calendar-wrapperNews,
html[data-theme="dark"] .calendar-boxNews .calendar,
html[data-theme="dark"] #calendar,
html[data-theme="dark"] .calendar-container,
html[data-theme="dark"] .calendar {
  background: var(--ct-surface) !important;
  color: var(--ct-text) !important;
  border-color: var(--ct-border) !important;
}
html[data-theme="dark"] .calendar-boxNews th,
html[data-theme="dark"] .calendar-boxNews td,
html[data-theme="dark"] .calendar-boxNews span,
html[data-theme="dark"] .calendar-boxNews div,
html[data-theme="dark"] .calendar-boxNews p {
  color: var(--ct-text) !important;
  border-color: var(--ct-border-soft) !important;
}
html[data-theme="dark"] .calendar-boxNews .fa-caret-right {
  color: var(--ct-text) !important;
}

/* 日历（calendar.html 使用通用类名，需限定作用域） */
html[data-theme="dark"] .calendar-boxNews .container,
html[data-theme="dark"] .calendar-boxNews .calendar-container,
html[data-theme="dark"] .calendar-boxNews .calendar-detail,
html[data-theme="dark"] .calendar-boxNews .calendar-days,
html[data-theme="dark"] .calendar-boxNews .day,
html[data-theme="dark"] .calendar-boxNews .weekday {
  background: var(--ct-surface-2) !important;
  color: var(--ct-text) !important;
  border-color: var(--ct-border) !important;
  box-shadow: none !important;
}
html[data-theme="dark"] .calendar-boxNews .day:hover { background: #1e293b !important; }
html[data-theme="dark"] .calendar-boxNews .day.today {
  background: #1d3a5f !important;
  border-color: var(--ct-accent) !important;
}
html[data-theme="dark"] .calendar-boxNews .calendar-header { color: var(--ct-muted) !important; }
html[data-theme="dark"] .calendar-boxNews #current-date { color: var(--ct-text) !important; }
html[data-theme="dark"] .calendar-boxNews button {
  background: #1e293b !important;
  color: var(--ct-text) !important;
  border-color: var(--ct-border) !important;
}

html[data-theme="dark"] .calendar-boxNews .countdown-panel,
html[data-theme="dark"] .calendar-boxNews #activities-display,
html[data-theme="dark"] .calendar-boxNews .activity-item,
html[data-theme="dark"] .calendar-boxNews .no-activity {
  background: var(--ct-surface-2) !important;
  color: var(--ct-text) !important;
  border-color: var(--ct-border) !important;
}
html[data-theme="dark"] .calendar-boxNews .countdown-panel h3,
html[data-theme="dark"] .calendar-boxNews #countdown-display {
  color: var(--ct-text) !important;
}

html[data-theme="dark"] .calendar-boxNews .activities-panel {
  background: var(--ct-surface-2) !important;
  box-shadow: none !important;
}
html[data-theme="dark"] .calendar-boxNews .no-activities { color: var(--ct-muted) !important; }
