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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    color: #fff;
}

.container {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
    padding: 40px;
    max-width: 480px;
    width: 100%;
    transition: all 0.3s ease;
}

.container:hover {
    box-shadow: 0 30px 100px rgba(0, 0, 0, 0.5);
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    font-size: 1.8em;
    font-weight: 300;
    letter-spacing: 3px;
    background: linear-gradient(135deg, #fff 0%, #a8edea 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.search-box {
    display: flex;
    gap: 12px;
    margin-bottom: 30px;
    position: relative;
}

.search-box input {
    flex: 1;
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50px;
    font-size: 15px;
    color: #fff;
    outline: none;
    transition: all 0.3s ease;
}

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

.search-box input:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(168, 237, 234, 0.5);
    box-shadow: 0 0 30px rgba(168, 237, 234, 0.2);
}

.search-box button {
    padding: 16px 28px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 1px;
}

.search-box button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.5);
}

.search-box button:active {
    transform: translateY(0);
}

/* 加载动画 */
.loading-container {
    display: none;
    text-align: center;
    padding: 60px 20px;
}

.loading-container.active {
    display: block;
}

.loader {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #a8edea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    letter-spacing: 2px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.weather-info {
    animation: slideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 当前天气卡片 */
.current-weather {
    text-align: center;
    padding: 35px 25px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    border-radius: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 25px;
}

.current-weather h2 {
    font-size: 2em;
    font-weight: 400;
    margin-bottom: 20px;
    letter-spacing: 2px;
}

.weather-icon {
    margin: 15px 0;
    font-size: 120px;
    line-height: 1;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
}

.temperature {
    font-size: 4em;
    font-weight: 200;
    background: linear-gradient(135deg, #fff 0%, #a8edea 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin: 15px 0;
}

.description {
    font-size: 1.3em;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 25px;
    text-transform: capitalize;
    letter-spacing: 1px;
}

.details {
    display: flex;
    justify-content: center;
    gap: 40px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.detail-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.detail-item .label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.detail-item .value {
    font-size: 1.5em;
    font-weight: 300;
    color: #a8edea;
}

/* 预报卡片 */
.forecast {
    margin-top: 10px;
}

.forecast h3 {
    font-size: 1em;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 15px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.forecast-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.forecast-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 22px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
}

.forecast-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(8px);
    border-color: rgba(168, 237, 234, 0.3);
}

.forecast-date {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    min-width: 70px;
    font-size: 14px;
    letter-spacing: 1px;
}

.forecast-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
    justify-content: flex-end;
}

.forecast-icon {
    font-size: 32px;
    line-height: 1;
}

.forecast-temp {
    font-weight: 300;
    color: #a8edea;
    min-width: 90px;
    text-align: right;
    font-size: 15px;
}

.forecast-desc {
    color: rgba(255, 255, 255, 0.6);
    min-width: 80px;
    text-align: right;
    text-transform: capitalize;
    font-size: 13px;
}

/* 错误信息 */
.error-message {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 15px;
    animation: shake 0.5s ease-in-out;
}

.error-message p {
    background: rgba(255, 107, 107, 0.1);
    padding: 15px 25px;
    border-radius: 15px;
    border: 1px solid rgba(255, 107, 107, 0.3);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-10px); }
    40% { transform: translateX(10px); }
    60% { transform: translateX(-10px); }
    80% { transform: translateX(10px); }
}

/* 隐藏类 */
.hidden {
    display: none !important;
}

/* 响应式 */
@media (max-width: 480px) {
    .container {
        padding: 30px 20px;
    }

    header h1 {
        font-size: 1.5em;
    }

    .temperature {
        font-size: 3em;
    }

    .details {
        gap: 25px;
    }

    .forecast-item {
        flex-wrap: wrap;
    }

    .forecast-info {
        width: 100%;
        justify-content: space-between;
        margin-top: 10px;
    }
}
