/* ========================================
   DuckWow 首页 Hero 样式
   由 hero.js fetch hero.php 后生效
   ======================================== */
.dw-hero {
    --dwh-brand: var(--theme-color, #00aa90);
    --dwh-brand-light: #00bda3;
    --dwh-brand-dark: #008f7a;
    position: relative;
    padding: 70px 24px 50px;
    overflow: hidden;
}

/* 背景光斑层：四周渐变透明，与周围内容自然衔接 */
.dw-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(ellipse 80% 50% at 20% -10%, rgba(0, 189, 163, .06), transparent),
        radial-gradient(ellipse 60% 40% at 80% 110%, rgba(0, 143, 122, .04), transparent);
    -webkit-mask-image: radial-gradient(ellipse 78% 68% at 50% 42%, #000 35%, transparent 100%);
    mask-image: radial-gradient(ellipse 78% 68% at 50% 42%, #000 35%, transparent 100%);
    pointer-events: none;
}

.dw-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 100%; /* 跟随后台「首页内容宽度」var(--home-max-width) */
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

/* ===== 左侧文字 ===== */
.dw-hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    margin-bottom: 24px;
    border-radius: 999px;
    background: rgba(0, 170, 144, .08);
    color: var(--dwh-brand);
    font-size: 13px;
    font-weight: 400;
    letter-spacing: .5px;
}

.dw-hero-tag::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--dwh-brand);
    animation: dwh-pulse 2s ease-in-out infinite;
}

@keyframes dwh-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .6; transform: scale(.8); }
}

.dw-hero-title {
    font-size: 52px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -1px;
    margin: 0 0 20px;
}

.dw-hero-hl {
    background: linear-gradient(135deg, var(--dwh-brand-light), var(--dwh-brand-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.dw-hero-desc {
    font-size: 17px;
    line-height: 1.7;
    opacity: .72;
    margin: 0 0 32px;
    max-width: 480px;
}

/* ===== 搜索框（大胶囊 + 引擎切换） ===== */
.dw-hero-search {
    max-width: 520px;
}

.dw-search-box {
    margin: 0;
    padding: 4px 12px 10px;
    border: 1px solid rgba(125, 125, 135, .18);
    border-radius: 26px;
    background-color: var(--form-bg, #fff);
    box-shadow: 0 2px 12px rgba(0, 0, 0, .05);
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.dw-search-box:focus-within {
    border-color: var(--dwh-brand);
    box-shadow: 0 4px 20px rgba(0, 170, 144, .12);
    transform: translateY(-1px);
}

.dw-search-key {
    display: block;
    width: 100%;
    margin: 0;
    padding: 12px 14px 8px;
    border: 0;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--form-color, #484b4f);
    font-size: 15px;
    line-height: 1.6;
    outline: none;
}

.dw-search-key::placeholder {
    color: rgba(125, 125, 135, .5);
}

.dw-search-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.dw-search-engines {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-wrap: wrap;
    min-width: 0;
}

.dw-engine {
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 13px;
    line-height: 1.4;
    color: #86909c;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    transition: background-color .2s ease, color .2s ease;
}

.dw-engine:hover {
    color: var(--dwh-brand);
}

.dw-engine.active {
    background: rgba(0, 170, 144, .10);
    color: var(--dwh-brand);
    font-weight: 400;
}

.dw-search-btn {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background-color: var(--dwh-brand);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 170, 144, .30);
    transition: transform .15s ease, filter .15s ease;
}

.dw-search-btn:hover {
    transform: scale(1.08);
    filter: brightness(1.05);
}

.dw-search-btn:active {
    transform: scale(.94);
}

/* ===== 右侧环绕图 ===== */
.dw-hero-visual {
    position: relative;
    height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dw-hero-visual::before {
    content: "";
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 189, 163, .15) 0%, transparent 70%);
    top: 10%;
    right: 10%;
    filter: blur(40px);
    animation: dwh-blob 8s ease-in-out infinite;
}

.dw-hero-visual::after {
    content: "";
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 143, 122, .1) 0%, transparent 70%);
    bottom: 15%;
    left: 15%;
    filter: blur(30px);
    animation: dwh-blob 10s ease-in-out infinite reverse;
}

@keyframes dwh-blob {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(20px, -20px) scale(1.1); }
}

.dw-orbit-scene {
    position: relative;
    width: 420px;
    height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .35s ease-out;
}

/* ===== 静态轨道虚线环（不旋转，减少视觉噪音） ===== */
.dw-orbit-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 1px dashed rgba(0, 170, 144, .14);
}

.dw-orbit-circle-outer { width: 380px; height: 380px; }
.dw-orbit-circle-inner { width: 236px; height: 236px; border-color: rgba(0, 170, 144, .09); }

.dw-orbit-center {
    position: relative;
    z-index: 10;
    width: 88px;
    height: 88px;
    border-radius: 24px;
    background: rgba(255, 255, 255, .85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, .6);
    box-shadow:
        0 8px 32px rgba(0, 170, 144, .2),
        0 0 0 1px rgba(0, 170, 144, .08),
        inset 0 1px 0 rgba(255, 255, 255, .8);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: dwh-center-float 5s ease-in-out infinite;
}

.dw-orbit-center img {
    width: 52px;
    height: 52px;
    object-fit: contain;
}

@keyframes dwh-center-float {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-6px) scale(1.02); }
}

/* ===== 轨道系统（摩天轮：公转 + 自转抵消，文字始终水平） ===== */
.dw-orbit-track {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    z-index: 5;
    animation: dwh-spin var(--duration) linear infinite;
}

.dw-orbit-track-outer { --duration: 60s; --radius: 190px; }
.dw-orbit-track-inner { --duration: 45s; --radius: 118px; animation-direction: reverse; }

@keyframes dwh-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* 定位在圆周上 */
.dw-orbit-item {
    position: absolute;
    top: 0;
    left: 0;
    transform: rotate(var(--angle)) translateX(var(--radius));
}

/* 反向旋转抵消公转 + 固定角度，保持文字水平 */
.dw-orbit-chip {
    position: absolute;
    top: 0;
    left: 0;
    text-decoration: none;
    animation: dwh-keep-level var(--duration) linear infinite;
}

.dw-orbit-track-inner .dw-orbit-chip {
    animation-direction: reverse;
}

@keyframes dwh-keep-level {
    from { transform: translate(-50%, -50%) rotate(calc(var(--angle) * -1)); }
    to   { transform: translate(-50%, -50%) rotate(calc(var(--angle) * -1 - 360deg)); }
}

/* hover 场景：全部暂停，方便点击 */
.dw-orbit-scene:hover .dw-orbit-track,
.dw-orbit-scene:hover .dw-orbit-chip {
    animation-play-state: paused;
}

/* ===== 胶囊视觉层（独立于公转动画，可自由做 hover/进场） ===== */
.dw-chip-face {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 170, 144, .14);
    box-shadow: 0 4px 14px rgba(0, 0, 0, .06);
    font-size: 12px;
    font-weight: 400;
    color: #4e5969;
    white-space: nowrap;
    transition: transform .25s cubic-bezier(.34, 1.56, .64, 1),
                border-color .25s ease,
                box-shadow .25s ease,
                color .25s ease,
                background-color .25s ease;
    animation: dwh-face-in .55s cubic-bezier(.34, 1.56, .64, 1) backwards;
    animation-delay: calc(200ms + var(--i) * 70ms);
}

/* 进场：从中心弹出 */
@keyframes dwh-face-in {
    from { opacity: 0; transform: scale(.3); }
    to   { opacity: 1; transform: scale(1); }
}

.dw-chip-icon {
    font-size: 13px;
    line-height: 1;
}

.dw-orbit-chip {
    z-index: 5;
}

.dw-orbit-chip:hover {
    z-index: 30;
}

.dw-orbit-chip:hover .dw-chip-face {
    transform: scale(1.18);
    border-color: var(--dwh-brand);
    color: var(--dwh-brand);
    background: #fff;
    box-shadow: 0 8px 24px rgba(0, 170, 144, .22);
}

.dw-orbit-glow {
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 170, 144, .12) 0%, transparent 70%);
    filter: blur(30px);
    animation: dwh-glow 4s ease-in-out infinite;
}

@keyframes dwh-glow {
    0%, 100% { opacity: .6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}

/* ===== 深色模式（跟随 OneNav io-black-mode） ===== */
.io-black-mode .dw-hero::before {
    background:
        radial-gradient(ellipse 80% 50% at 20% -10%, rgba(0, 189, 163, .08), transparent),
        radial-gradient(ellipse 60% 40% at 80% 110%, rgba(0, 143, 122, .05), transparent);
}

.io-black-mode .dw-orbit-center {
    background: rgba(30, 30, 30, .85);
    border-color: rgba(255, 255, 255, .1);
}

.io-black-mode .dw-chip-face {
    background: rgba(30, 30, 30, .92);
    border-color: rgba(255, 255, 255, .1);
    color: #a0a0a0;
}

.io-black-mode .dw-orbit-chip:hover .dw-chip-face {
    background: #24272a;
    color: #14b89d;
    border-color: #14b89d;
}

.io-black-mode .dw-search-box {
    background-color: #24272a;
    border-color: rgba(255, 255, 255, .1);
    box-shadow: 0 2px 12px rgba(0, 0, 0, .3);
}

.io-black-mode .dw-search-box:focus-within {
    border-color: #14b89d;
    box-shadow: 0 4px 20px rgba(20, 184, 157, .18);
}

.io-black-mode .dw-search-key {
    color: #999;
}

.io-black-mode .dw-search-key::placeholder {
    color: rgba(153, 153, 153, .4);
}

.io-black-mode .dw-engine {
    color: #7d8590;
}

.io-black-mode .dw-engine:hover {
    color: #14b89d;
}

.io-black-mode .dw-engine.active {
    background: rgba(20, 184, 157, .15);
    color: #14b89d;
}

.io-black-mode .dw-search-btn {
    box-shadow: 0 4px 12px rgba(0, 0, 0, .35);
}

/* ===== 响应式：平板 ===== */
@media (max-width: 1100px) {
    .dw-hero-inner { gap: 30px; }
    .dw-hero-title { font-size: 42px; }
    .dw-orbit-scene { width: 340px; height: 340px; }
    .dw-orbit-circle-outer { width: 310px; height: 310px; }
    .dw-orbit-circle-inner { width: 196px; height: 196px; }
    .dw-orbit-track-outer { --radius: 155px; }
    .dw-orbit-track-inner { --radius: 98px; }
    .dw-chip-face { font-size: 11px; padding: 5px 10px; }
}

/* ===== 响应式：移动端（隐藏右侧环绕图） ===== */
@media (max-width: 900px) {
    .dw-hero { padding: 50px 20px 40px; }
    .dw-hero-inner { grid-template-columns: 1fr; text-align: center; }
    .dw-hero-text { display: flex; flex-direction: column; align-items: center; }
    .dw-hero-title { font-size: 36px; }
    .dw-hero-desc { font-size: 15px; margin-bottom: 24px; }
    .dw-hero-search { width: 100%; max-width: 480px; }
    .dw-hero-visual { display: none; }
}

@media (max-width: 480px) {
    .dw-hero-title { font-size: 30px; }
    .dw-search-box { border-radius: 22px; padding: 2px 10px 8px; }
    .dw-search-key { font-size: 14px; padding: 10px 10px 6px; }
    .dw-engine { font-size: 12px; padding: 4px 9px; }
    .dw-search-btn { width: 34px; height: 34px; }
}

/* ===== 动效降级 ===== */
@media (prefers-reduced-motion: reduce) {
    .dw-orbit-track,
    .dw-orbit-chip,
    .dw-chip-face,
    .dw-orbit-center,
    .dw-orbit-glow,
    .dw-hero-visual::before,
    .dw-hero-visual::after,
    .dw-hero-tag::before {
        animation: none;
    }

    .dw-orbit-scene,
    .dw-search-box,
    .dw-search-btn,
    .dw-engine,
    .dw-chip-face {
        transition: none;
    }
}
