/* ============================================
   UV 代理 · 夏日淡蓝主题
   配色：天空蓝 + 水波青 + 阳光黄
   效果：毛玻璃 · Canvas波浪 · Bounce弹性按钮
   ============================================ */

/* ---------- CSS 变量 ---------- */
:root {
    --sky:        #7EC8E3;
    --aqua:       #5BC0BE;
    --sun:        #FFD93D;
    --bg:         #e8f4f8;
    --card-bg:    rgba(255, 255, 255, 0.55);
    --input-bg:   rgba(255, 255, 255, 0.35);
    --text-deep:  #1A535C;
    --text-mid:   #3A7A85;
    --text-subtle: rgba(26, 83, 92, 0.45);
    --border-subtle: rgba(126, 200, 227, 0.18);
    --shadow-sm:  rgba(126, 200, 227, 0.10);
    --shadow-md:  rgba(126, 200, 227, 0.18);
    --cubic-ease: cubic-bezier(0.16, 1, 0.3, 1);
    --cubic-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---------- 重置 ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    overflow: hidden; /* 防止滚动条，页面就是全屏卡片 */
}

body {
    font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text-deep);
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* ---------- Canvas 波浪背景 ---------- */
#waveCanvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

/* ---------- Glow 光球 ---------- */
.orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.35;
}

#orb1 {
    width: 300px; height: 300px;
    background: rgba(126, 200, 227, 0.25);
    top: -8%; left: -5%;
    animation: floatOrb1 18s ease-in-out infinite;
}

#orb2 {
    width: 250px; height: 250px;
    background: rgba(91, 192, 190, 0.20);
    bottom: -10%; right: -5%;
    animation: floatOrb2 22s ease-in-out infinite;
}

#orb3 {
    width: 200px; height: 200px;
    background: rgba(255, 217, 61, 0.12);
    top: 50%; left: 60%;
    animation: floatOrb3 20s ease-in-out infinite;
}

@keyframes floatOrb1 {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(60px, 40px); }
    66% { transform: translate(-20px, -30px); }
}

@keyframes floatOrb2 {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(-50px, -30px); }
    66% { transform: translate(30px, 20px); }
}

@keyframes floatOrb3 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-40px, -50px); }
}

/* ---------- 顶部导航栏 ---------- */
.top-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.5rem;
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
    animation: fadeDown 0.7s var(--cubic-ease) both;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.nav-logo {
    width: 28px; height: 28px;
    border-radius: 6px;
}

.nav-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-deep);
    letter-spacing: -0.01em;
}

.nav-status {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.8rem;
    color: var(--text-mid);
}

.status-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 8px rgba(74, 222, 128, 0.4);
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ---------- 主体容器 ---------- */
.container {
    position: relative;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 600px;
    padding: 1rem;
}

/* ---------- 毛玻璃卡片 ---------- */
.glass-card {
    width: 100%;
    background: var(--card-bg);
    backdrop-filter: blur(28px) saturate(1.3);
    -webkit-backdrop-filter: blur(28px) saturate(1.3);
    border: 1px solid var(--border-subtle);
    border-radius: 24px;
    padding: 2.5rem 2rem 2rem;
    box-shadow:
        0 12px 48px var(--shadow-sm),
        0 4px 16px rgba(0, 0, 0, 0.03),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    animation: cardEnter 0.9s 0.1s var(--cubic-ease) both;
}

/* ---------- Logo 区域 ---------- */
.logo-section {
    text-align: center;
    margin-bottom: 1.8rem;
}

.hero-logo {
    width: 56px; height: 56px;
    border-radius: 14px;
    margin-bottom: 0.8rem;
    filter: drop-shadow(0 4px 12px rgba(126, 200, 227, 0.25));
}

.hero-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    margin-bottom: 0.5rem;
}

.title-gradient {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--text-deep) 0%, var(--sky) 50%, var(--aqua) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.title-sub {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-subtle);
    letter-spacing: 0.05em;
}

.hero-desc {
    font-size: 0.85rem;
    color: var(--text-subtle);
}

/* ---------- 输入区域 ---------- */
.input-section {
    margin-bottom: 0.6rem;
}

/* 毛玻璃输入框组 */
.input-group {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--input-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1.5px solid var(--border-subtle);
    border-radius: 16px;
    padding: 0.12rem;
    transition: all 0.3s var(--cubic-ease);
}

/* focus 渐变发光边框 */
.input-group::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--sky), var(--aqua), var(--sun));
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
}

.input-group:focus-within::before {
    opacity: 1;
}

/* 搜索图标 */
.input-icon {
    flex-shrink: 0;
    width: 19px;
    height: 19px;
    margin-left: 0.9rem;
    color: var(--text-subtle);
    transition: color 0.3s ease;
}

.input-group:focus-within .input-icon {
    color: var(--sky);
}

/* 输入框本体 */
.input-group input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    outline: none;
    padding: 0.8rem 0.7rem;
    font-size: 0.95rem;
    color: var(--text-deep);
}

.input-group input::placeholder {
    color: var(--text-subtle);
}

/* ============================================
   🎯 Bounce 弹性按钮
   ============================================ */
#uv-submit {
    flex-shrink: 0;
    margin: 0.12rem;
    padding: 0.7rem 1.35rem;
    background: linear-gradient(135deg, var(--sky), var(--aqua));
    border: none;
    border-radius: 14px;
    color: #fff;
    font-size: 0.93rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s var(--cubic-ease);
    box-shadow: 0 4px 15px rgba(126, 200, 227, 0.35);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.02em;
}

/* hover 上浮 + 发光增强 */
#uv-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(126, 200, 227, 0.50);
}

/* active 按下 */
#uv-submit:active {
    transform: scale(0.94);
}

/* Bounce 弹性动画（JS触发） */
#uv-submit.bounce {
    animation: btnBounce 0.45s var(--cubic-bounce);
}

@keyframes btnBounce {
    0%   { transform: scale(1); }
    35%  { transform: scale(0.86); }
    65%  { transform: scale(1.07); }
    100% { transform: scale(1); }
}

/* 按钮内部光泽 */
#uv-submit::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

#uv-submit:hover::after {
    left: 100%;
}

.btn-text {
    position: relative;
    z-index: 1;
}

/* ---------- 错误信息 ---------- */
.error-area {
    min-height: 0;
    text-align: center;
}

#uv-error {
    font-size: 0.82rem;
    color: #FF6B6B;
    margin-top: 0.4rem;
}

#uv-error-code {
    font-size: 0.72rem;
    color: var(--text-subtle);
    margin-top: 0.2rem;
    white-space: pre-wrap;
    word-break: break-all;
}

/* ---------- 快捷 Chip ---------- */
.chips-section {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-top: 1.2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-subtle);
}

.chips-label {
    font-size: 0.78rem;
    color: var(--text-subtle);
    white-space: nowrap;
}

.chips-row {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    background: rgba(126, 200, 227, 0.10);
    border: 0.5px solid var(--border-subtle);
    border-radius: 100px;
    font-size: 0.78rem;
    font-family: inherit;
    color: var(--text-mid);
    cursor: pointer;
    transition: all 0.25s var(--cubic-ease);
}

.chip:hover {
    transform: translateY(-1px);
    background: rgba(126, 200, 227, 0.20);
    box-shadow: 0 3px 12px var(--shadow-sm);
    color: var(--text-deep);
}

.chip:active {
    transform: scale(0.95);
}

.chip-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* ---------- 底部状态栏 ---------- */
.bottom-bar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1rem;
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-subtle);
    font-size: 0.75rem;
    color: var(--text-subtle);
    animation: fadeUp 0.9s 0.2s var(--cubic-ease) both;
}

.bottom-bar a {
    color: var(--sky);
    text-decoration: none;
    transition: color 0.2s ease;
}

.bottom-bar a:hover { color: var(--aqua); }

.bottom-bar kbd {
    display: inline-block;
    padding: 0.1em 0.45em;
    font-size: 0.75em;
    font-family: inherit;
    background: rgba(126, 200, 227, 0.12);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    line-height: 1.4;
}

/* ---------- 代理 iframe 全屏覆盖 ---------- */
#uv-frame {
    position: fixed;
    inset: 0;
    z-index: 100;
    width: 100%;
    height: 100%;
    border: none;
    background: #fff;
}

/* ---------- 入场动画 ---------- */
@keyframes fadeDown {
    from { opacity: 0; transform: translateY(-16px); }
}

@keyframes cardEnter {
    from { opacity: 0; transform: translateY(28px) scale(0.97); }
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(12px); }
}

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
    .glass-card {
        padding: 1.8rem 1.2rem 1.5rem;
        border-radius: 20px;
    }

    .title-gradient {
        font-size: 1.4rem;
    }

    .hero-logo {
        width: 44px; height: 44px;
    }

    .input-group {
        border-radius: 14px;
    }

    .input-group input {
        padding: 0.7rem 0.5rem;
        font-size: 0.9rem;
    }

    #uv-submit {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }

    .chips-section {
        flex-direction: column;
        align-items: flex-start;
    }

    .top-nav {
        padding: 0.65rem 1rem;
    }

    .bottom-bar {
        flex-wrap: wrap;
        gap: 0.3rem;
    }
}

/* ---------- 无障碍：reduced-motion ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }

    #waveCanvas { display: none; }
    .orb { display: none; }
    #uv-submit.bounce { animation: none; }
}
