* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;touch-action: none;-webkit-overflow-scrolling: none;
    overscroll-behavior: none;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Comic Sans MS', 'PingFang SC', cursive, sans-serif;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* 海洋背景 */
.ocean-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, 
        #0077be 0%, 
        #006994 20%,
        #005073 40%,
        #003d5c 60%,
        #002a3f 80%,
        #001a2e 100%
    );
    z-index: -3;
}

/* 光线效果 */
.light-rays {
    position: fixed;
    top: -50%;
    left: 50%;
    transform: translateX(-50%);
    width: 200%;
    height: 100%;
    background: conic-gradient(from 180deg at 50% 0%, 
        transparent 0deg,
        rgba(255,255,255,0.03) 10deg,
        transparent 20deg,
        rgba(255,255,255,0.05) 40deg,
        transparent 50deg,
        rgba(255,255,255,0.03) 70deg,
        transparent 80deg
    );
    z-index: -2;
    animation: rayMove 20s linear infinite;
}

@keyframes rayMove {
    0% { transform: translateX(-50%) rotate(0deg); }
    100% { transform: translateX(-50%) rotate(360deg); }
}

/* 气泡 */
.bubbles {
    position: fixed;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.bubble {
    position: absolute;
    bottom: -100px;
    background: radial-gradient(circle at 30% 30%, 
        rgba(255,255,255,0.8),
        rgba(255,255,255,0.2) 50%,
        transparent 70%
    );
    border-radius: 50%;
    animation: rise linear infinite;
    opacity: 0.6;
}

@keyframes rise {
    0% { 
        transform: translateY(0) translateX(0) scale(1); opacity: 0.6; 
    }
    50% { 
        transform: translateY(-50vh) translateX(20px) scale(1.1); 
        opacity: 0.4; 
    }
    100% { 
        transform: translateY(-100vh) translateX(-10px) scale(0.8); 
        opacity: 0; 
    }
}

/* 沙地 */
.sand {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50px;
    background: linear-gradient(to top, #c2a366, #d4b87a);
    z-index: -2;
    border-radius: 100% 100% 0 0 / 20px 20px 0 0;
}

/* 海草 */
.seaweed-container {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 120px;
    z-index: -1;
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    padding: 0 20px;
    pointer-events: none;
}

.seaweed {
    width: 20px;
    height: 100px;
    background: linear-gradient(to top, #2d5a27, #4a7c43);
    border-radius: 50% 50% 0 0;
    transform-origin: bottom center;
    animation: sway 3s ease-in-out infinite;
}

.seaweed:nth-child(odd) {
    animation-delay: -1.5s;
    height: 80px;
    background: linear-gradient(to top, #1e4620, #3d6b37);
}

@keyframes sway {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}

/*珊瑚 */
.coral {
    position: fixed;
    bottom: 30px;
    font-size: 40px;
    z-index: -1;
}

.coral1 { left: 5%; }
.coral2 { right: 5%; font-size: 35px; }
.coral3 { right: 15%; font-size: 30px; }

/* Nemo小丑鱼 - 向右游scaleX(-1)，向左游scaleX(1) */
.nemo {
    position: fixed;
    font-size: 35px;
    z-index: 10;
    animation: swimNemo 15s linear infinite;cursor: pointer;
}

@keyframes swimNemo {
    0% { 
        left: -60px; 
        top: 15%; 
        transform: scaleX(-1); 
    }
    45% { 
        left: calc(100% + 60px); 
        top: 10%; 
        transform: scaleX(-1); 
    }
    45.1% { 
        left: calc(100% + 60px); 
        top: 10%; 
        transform: scaleX(1); 
    }
    95% { 
        left: -60px; 
        top: 25%; 
        transform: scaleX(1); 
    }
    95.1% { 
        left: -60px; 
        top: 25%; 
        transform: scaleX(-1); 
    }
    100% { 
        left: -60px; 
        top: 15%; 
        transform: scaleX(-1); 
    }
}

/* Dory蓝唐王鱼 */
.dory {
    position: fixed;
    font-size: 40px;
    z-index: 9;
    animation: swimDory 18s linear infinite;animation-delay: -5s;
    cursor: pointer;
}

@keyframes swimDory {
    0% { 
        right: -80px; 
        top: 75%; 
        transform: scaleX(1); 
    }
    45% { 
        right: calc(100% + 80px); 
        top: 70%; 
        transform: scaleX(1); 
    }
    45.1% { 
        right: calc(100% + 80px); 
        top: 70%; 
        transform: scaleX(-1); 
    }
    95% { 
        right: -80px; 
        top: 72%; 
        transform: scaleX(-1); 
    }
    95.1% { 
        right: -80px; 
        top: 72%; 
        transform: scaleX(1); 
    }
    100% { 
        right: -80px; 
        top: 75%; 
        transform: scaleX(1); 
    }
}

/* 海龟 */
.turtle {
    position: fixed;
    font-size: 45px;
    z-index: 8;
    animation: swimTurtle 25s linear infinite;
    cursor: pointer;
}

@keyframes swimTurtle {
    0% { 
        left: -100px; 
        top: 85%; 
        transform: scaleX(-1); 
    }
    49.9% { 
        left: calc(100% + 100px); 
        top: 82%; 
        transform: scaleX(-1); 
    }
    50% { 
        left: calc(100% + 100px); 
        top: 82%; 
        transform: scaleX(1); 
    }
    99.9% { 
        left: -100px; 
        top: 85%; 
        transform: scaleX(1); 
    }
    100% { 
        left: -100px; 
        top: 85%; 
        transform: scaleX(-1); 
    }
}

/* 水母 */
.jellyfish {
    position: fixed;
    font-size: 30px;
    animation: floatJelly 8s ease-in-out infinite;
    z-index: 6;
    pointer-events: none;
}

.jelly1 { left: 8%; top: 12%; }
.jelly2 { right: 8%; top: 20%; animation-delay: -3s; font-size: 25px; }

@keyframes floatJelly {
    0%, 100% { transform: translateY(0) rotate(-5deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

/* 鱼群 - 向右游需要翻转 */
.fish-school {
    position: fixed;
    z-index: 5;
    animation: schoolSwim 20s linear infinite;white-space: nowrap;
    pointer-events: none;
}

.fish-school span {
    font-size: 16px;
    display: inline-block;
    transform: scaleX(-1);
    animation: fishWiggle 0.5s ease-in-out infinite;
}

.fish-school span:nth-child(odd) {
    animation-delay: -0.25s; 
}

@keyframes schoolSwim {
    0% { left: -150px; top: 50%; }
    100% { left: calc(100% + 150px); top: 55%; }
}

@keyframes fishWiggle {
    0%, 100% { transform: scaleX(-1) translateY(0); }
    50% { transform: scaleX(-1) translateY(-3px); }
}

/* 天气卡片 */
.weather-card {
    width: 92%;
    max-width: 380px;
    max-height: 90vh;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 20px;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.3), 
        inset 0 0 0 1px rgba(255, 255, 255, 0.2);
    color: white;
    position: relative;
    z-index: 100;
    overflow-y: auto;overflow-x: hidden;overscroll-behavior: contain;
}

.weather-card::-webkit-scrollbar {
    width: 4px; 
}

.weather-card::-webkit-scrollbar-track { 
    background: rgba(255,255,255,0.1); border-radius: 2px; 
}

.weather-card::-webkit-scrollbar-thumb { 
    background: rgba(255,255,255,0.3); 
    border-radius: 2px; 
}

/*搜索框 */
.search-container { 
    position: relative; 
    margin-bottom: 15px; 
}

.search-box {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.15);
    border-radius: 12px;
    padding: 8px 12px;
    gap: 8px;
}

.search-icon { 
    font-size: 18px; 
}

.search-box input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: white;
    font-size: 15px;
    font-family: inherit;
}

.search-box input::placeholder { 
    color: rgba(255,255,255,0.6); 
}

.search-btn {
    background: rgba(255,107,53,0.7);
    border: none;
    padding: 6px 14px;
    border-radius: 8px;
    color: white;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;font-family: inherit;
}

.search-btn:hover { 
    background: rgba(255,107,53,0.9); 
}

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

/* 城市下拉菜单 */
.city-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(0,50,80,0.95);
    border-radius: 12px;
    margin-top: 5px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 200;
    display: none;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
}

.city-dropdown.show { 
    display: block; 
}

.city-item {
    padding: 12px 15px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.city-item:last-child { 
    border-bottom: none; 
}

.city-item:hover { 
    background: rgba(255,255,255,0.1); 
}

.city-item:active { 
    background: rgba(255,255,255,0.2); 
}

.city-name { 
    font-size: 14px; 
}

.city-region { 
    font-size: 12px; 
    opacity: 0.6; 
}

/* 加载动画 */
.loading {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.loading.show { 
    display: flex; 
}

.loading-fish {
    font-size: 50px;
    transform: scaleX(-1);animation: loadingSwim 1s ease-in-out infinite;
}

@keyframes loadingSwim {
    0%, 100% { transform: scaleX(-1) translateX(-10px) rotate(-10deg); }
    50% { transform: scaleX(-1) translateX(10px) rotate(10deg); }
}

.loading p { 
    margin-top: 15px; 
    font-size: 14px; 
    opacity: 0.8; 
}

/* 天气内容 */
.weather-content { 
    display: block; 
}

.weather-content.hide { 
    display: none; 
}

/*卡片头部 */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.location { 
    display: flex; 
    align-items: center; 
    gap: 6px; 
}

.location-icon { 
    font-size: 18px; 
}

.location-text { 
    font-size: 18px; 
    font-weight: 700;text-shadow: 1px 1px 3px rgba(0,0,0,0.3); 
}

.date-time { 
    text-align: right; 
}

.time { 
    font-size: 16px; 
    font-weight: 600; 
}

.date { 
    font-size: 12px; 
    opacity: 0.85; 
}

/* 主天气区域 */
.weather-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 15px 0;padding: 15px;
    background: rgba(255,255,255,0.08);
    border-radius: 16px;
}

.weather-icon-container { 
    position: relative; 
}

.weather-icon {
    font-size: 65px;
    animation: weatherPulse 3s ease-in-out infinite;
}

@keyframes weatherPulse {
    0%, 100% { transform: scale(1) rotate(-5deg); }
    50% { transform: scale(1.1) rotate(5deg); }
}

/* 装饰小鱼 */
.fish-decoration {
    position: absolute;
    font-size: 18px;
    transform: scaleX(-1);
    animation: fishSwim 4s ease-in-out infinite;
}

.fish-d1 { 
    top: -5px; 
    right: -15px; 
    animation-delay: -1s; 
}

.fish-d2 { 
    bottom: 0; 
    left: -10px; 
    animation-delay: -2s; font-size: 14px; 
}

@keyframes fishSwim {
    0%, 100% { transform: scaleX(-1) translateX(0) translateY(0); }
    25% { transform: scaleX(-1) translateX(3px) translateY(-3px); }
    75% { transform: scaleX(-1) translateX(-3px) translateY(3px); }
}

/* 温度区域 */
.temperature-section { 
    text-align: right; 
}

.temperature {
    font-size: 55px;
    font-weight: 300;
    line-height: 1;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);position: relative;
    display: inline-block;
}

.temperature::after {
    content: '°C';
    font-size: 18px;
    position: absolute;
    top: 5px;
    margin-left: 3px;
}

.weather-desc { 
    font-size: 16px; 
    margin-top: 5px; 
    opacity: 0.9; 
}

.temp-range { 
    font-size: 13px; 
    opacity: 0.75; 
    margin-top: 3px; 
}

/* Nemo语录 */
.nemo-quote {
    background: linear-gradient(135deg, rgba(255,100,50,0.3), rgba(255,150,50,0.2));
    border-radius: 12px;
    padding: 12px 12px 12px 35px;
    margin: 15px 0;
    border-left: 3px solid #ff6b35;
    position: relative;
}

.nemo-quote::before {
    content: '🐠';
    position: absolute;
    left: 8px;
    top: 50%;
    font-size: 20px;
    transform: translateY(-50%) scaleX(-1);
    animation: nemoTalk 1s ease-in-out infinite;
}

@keyframes nemoTalk {
    0%, 100% { transform: translateY(-50%) scaleX(-1) rotate(-10deg); }
    50% { transform: translateY(-50%) scaleX(-1) rotate(10deg); }
}

.quote-text { 
    font-size: 13px; 
    font-style: italic; 
    line-height: 1.4; 
}

/* 详细信息 */
.weather-details {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 15px;
}

.detail-item {
    text-align: center;
    padding: 12px 5px;
    background: rgba(255,255,255,0.08);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.detail-item:active { 
    background: rgba(255,255,255,0.15); 
    transform: scale(0.95); 
}

.detail-icon { 
    font-size: 22px; 
    margin-bottom: 5px;display: block; 
}

.detail-value { 
    font-size: 14px; 
    font-weight: 700; 
}

.detail-label { 
    font-size: 10px; 
    opacity: 0.7;margin-top: 2px; 
}

/* 未来预报 */
.forecast {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.15);
    gap: 5px;
}

.forecast-item {
    text-align: center;
    flex: 1;
    padding: 10px 5px;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.forecast-item:active { 
    background: rgba(255,255,255,0.1); 
}

.forecast-day { 
    font-size: 11px; 
    opacity: 0.8; 
    margin-bottom: 6px; 
}

.forecast-icon {
    font-size: 26px;
    margin-bottom: 6px;
    display: block;
    animation: forecastBounce 2s ease-in-out infinite;
}

.forecast-item:nth-child(1) .forecast-icon { animation-delay: 0s; }
.forecast-item:nth-child(2) .forecast-icon { animation-delay: 0.2s; }
.forecast-item:nth-child(3) .forecast-icon { animation-delay: 0.4s; }

@keyframes forecastBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.forecast-temp { 
    font-size: 12px; 
    font-weight: 600; 
}

/* 底部 */
.card-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 11px;
    opacity: 0.7;
}

.footer-fish { 
    display: inline-block;
    transform: scaleX(-1);
    animation: footerSwim 2s ease-in-out infinite; 
}

@keyframes footerSwim {
    0%, 100% { transform: scaleX(-1) translateX(0); }
    50% { transform: scaleX(-1) translateX(5px); }
}

/* Toast提示 */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,50,80,0.95);
    color: white;
    padding: 15px 25px;
    border-radius: 12px;
    font-size: 14px;
    z-index: 9999;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    max-width: 90%;
    text-align: center;
    animation: toastIn 0.3s ease;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(-50%) translateY(0); }
    to { opacity: 0; transform: translateX(-50%) translateY(-20px); }
}

/* API配置按钮 */
.api-config-btn {
    background: rgba(100,200,255,0.7);
    border: none;
    padding: 6px 10px;
    border-radius: 8px;
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    margin-left: 5px;
}

.api-config-btn:hover {
    background: rgba(100,200,255,0.9);
}

.api-config-btn:active {
    transform: scale(0.95);
}

/* API配置弹窗 */
.api-config-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,30,50,0.9);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.api-config-modal.show {
    display: flex;
}

.api-config-content {
    background: rgba(0,50,80,0.95);
    border-radius: 20px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.9) translateY(-20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.api-config-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.api-config-header h3 {
    margin: 0;
    font-size: 20px;
    color: white;
}

.close-btn {
    background: rgba(255,100,100,0.3);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s;
}

.close-btn:hover {
    background: rgba(255,100,100,0.6);
}

.api-config-body {
    padding: 20px;
    color: white;
}

.api-info {
    background: rgba(100,200,255,0.2);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 20px;
    border-left: 3px solid rgba(100,200,255,0.8);
}

.api-info p {
    margin: 5px 0;
    font-size: 13px;
}

.api-field {
    margin-bottom: 20px;
}

.api-field label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
}

.api-field input {
    width: 100%;
    padding: 10px 12px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s;
}

.api-field input:focus {
    outline: none;
    border-color: rgba(100,200,255,0.8);
    background: rgba(255,255,255,0.15);
}

.api-field input::placeholder {
    color: rgba(255,255,255,0.4);
}

.api-field small {
    display: block;
    margin-top: 5px;
    font-size: 11px;
    opacity: 0.7;
}

.api-priority {
    background: rgba(255,200,100,0.2);
    border-radius: 10px;
    padding: 12px;
    border-left: 3px solid rgba(255,200,100,0.8);
    margin-top: 15px;
}

.api-priority p {
    margin: 5px 0;
    font-size: 13px;
}

.api-config-footer {
    padding: 15px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.save-btn, .cancel-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
}

.save-btn {
    background: rgba(100,200,100,0.7);
    color: white;
}

.save-btn:hover {
    background: rgba(100,200,100,0.9);
}

.cancel-btn {
    background: rgba(150,150,150,0.5);
    color: white;
}

.cancel-btn:hover {
    background: rgba(150,150,150,0.7);
}

/* 响应式 - 小屏幕 */
@media (max-height: 700px) {
    .weather-card { padding: 15px; }
    .weather-icon { font-size: 50px; }
    .temperature { font-size: 45px; }
    .weather-main { padding: 10px; margin: 10px 0; }
    .nemo-quote { padding: 10px 10px 10px 30px; margin: 10px 0; }
    .weather-details { gap: 5px; }
    .detail-item { padding: 8px 3px; }
    .detail-icon { font-size: 18px; }
    .forecast { margin-top: 10px; padding-top: 10px; }
    .forecast-icon { font-size: 22px; }
}

@media (max-width: 350px) {
    .weather-details { grid-template-columns: repeat(2, 1fr); }
    .location-text { font-size: 16px; }
}