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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
}

.container {
    max-width: 800px;
    width: 100%;
    margin: 20px auto;
    padding: 25px;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

h1 {
    color: #2c3e50;
    font-size: 28px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.auth-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-btn {
    padding: 8px 16px;
    border: 1px solid #667eea;
    border-radius: 8px;
    background-color: white;
    color: #667eea;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.auth-btn:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.user-info {
    font-size: 14px;
    color: #2c3e50;
    font-weight: 600;
}

.search-container {
    display: flex;
    margin-bottom: 30px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

#cityInput {
    flex: 1;
    padding: 15px 20px;
    font-size: 16px;
    border: none;
    background-color: #f8f9fa;
    transition: all 0.3s ease;
}

#cityInput:focus {
    outline: none;
    background-color: white;
    box-shadow: inset 0 0 0 2px #667eea;
}

#searchBtn {
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

#searchBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.weather-result {
    padding: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.weather-card {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.weather-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.weather-icon {
    font-size: 80px;
    margin-right: 30px;
    color: #667eea;
}

.weather-info h2 {
    font-size: 32px;
    margin-bottom: 10px;
    color: #2c3e50;
    font-weight: 700;
}

.weather-info p {
    font-size: 16px;
    color: #666;
    margin-bottom: 5px;
}

.weather-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-top: 30px;
}

.detail-item {
    background-color: rgba(255, 255, 255, 0.8);
    padding: 15px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.detail-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.detail-item i {
    font-size: 24px;
    color: #667eea;
    margin-bottom: 10px;
}

.detail-item p:first-child {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.detail-item p:last-child {
    font-size: 14px;
    color: #666;
}

.hourly-forecast {
    margin-top: 40px;
}

.hourly-forecast h3 {
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
}

.hourly-items {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    padding-bottom: 10px;
    scrollbar-width: thin;
    scrollbar-color: #667eea #f1f1f1;
}

.hourly-items::-webkit-scrollbar {
    height: 6px;
}

.hourly-items::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.hourly-items::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

.hourly-item {
    min-width: 90px;
    background-color: rgba(255, 255, 255, 0.8);
    padding: 15px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.hourly-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.hourly-item p {
    margin: 8px 0;
    font-size: 14px;
    color: #666;
}

.hourly-item p:first-child {
    font-weight: 600;
    color: #2c3e50;
}

.hourly-item i {
    font-size: 24px;
    margin: 8px 0;
    color: #667eea;
}

.forecast {
    margin-top: 40px;
}

.forecast h3 {
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
}

.forecast-items {
    display: flex;
    overflow-x: auto;
    gap: 20px;
    padding-bottom: 10px;
    scrollbar-width: thin;
    scrollbar-color: #667eea #f1f1f1;
}

.forecast-items::-webkit-scrollbar {
    height: 6px;
}

.forecast-items::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.forecast-items::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

.forecast-item {
    min-width: 130px;
    background-color: rgba(255, 255, 255, 0.8);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.forecast-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.forecast-item p {
    margin: 8px 0;
    font-size: 14px;
    color: #666;
}

.forecast-item p:first-child {
    font-weight: 600;
    color: #2c3e50;
}

.forecast-item i {
    font-size: 28px;
    margin: 10px 0;
    color: #667eea;
}

.forecast-item .temp-range {
    display: flex;
    justify-content: space-between;
    padding: 0 10px;
}

.forecast-item .temp-range span:first-child {
    color: #e74c3c;
    font-weight: 600;
}

.forecast-item .temp-range span:last-child {
    color: #3498db;
    font-weight: 600;
}

.indices {
    margin-top: 40px;
}

.indices h3 {
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
}

.indices-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
}

.index-item {
    background-color: rgba(255, 255, 255, 0.8);
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.index-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.index-item p:first-child {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.index-item p:last-child {
    font-size: 14px;
    color: #666;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 16px;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-left: 10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error {
    text-align: center;
    padding: 40px;
    color: #e74c3c;
    font-size: 16px;
    background-color: rgba(231, 76, 60, 0.1);
    border-radius: 12px;
    border-left: 4px solid #e74c3c;
}

.city-list {
    margin-top: 30px;
}

.city-list h3 {
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
}

.cities {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.city-item {
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.city-item:hover {
    background-color: rgba(255, 255, 255, 1);
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.city-item p {
    margin: 8px 0;
}

.city-item p:first-child {
    font-weight: 600;
    color: #2c3e50;
    font-size: 16px;
}

.city-item p:last-child {
    font-size: 14px;
    color: #666;
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        margin: 10px auto;
        padding: 20px;
    }
    
    h1 {
        font-size: 24px;
        margin-bottom: 20px;
    }
    
    .search-container {
        flex-direction: column;
        gap: 10px;
    }
    
    #cityInput {
        border-radius: 12px;
        padding: 12px 15px;
    }
    
    #searchBtn {
        border-radius: 12px;
        padding: 12px 20px;
    }
    
    .weather-card {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    
    .weather-icon {
        margin-right: 0;
        margin-bottom: 20px;
        font-size: 60px;
    }
    
    .weather-info h2 {
        font-size: 28px;
    }
    
    .weather-details {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .hourly-item {
        min-width: 80px;
        padding: 12px;
    }
    
    .forecast-item {
        min-width: 110px;
        padding: 15px;
    }
    
    .indices-items {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }
    
    h1 {
        font-size: 20px;
    }
    
    #cityInput {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    #searchBtn {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .weather-info h2 {
        font-size: 24px;
    }
    
    .weather-details {
        grid-template-columns: 1fr;
    }
    
    .hourly-item {
        min-width: 70px;
        padding: 10px;
    }
    
    .hourly-item i {
        font-size: 20px;
    }
    
    .forecast-item {
        min-width: 100px;
        padding: 12px;
    }
    
    .forecast-item i {
        font-size: 24px;
    }
    
    .loading,
    .error {
        padding: 30px;
        font-size: 14px;
    }
    
    /* 移动端客服样式 */
    #customer-service {
        bottom: 20px;
        right: 20px;
    }
    
    #cs-button {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
    
    #cs-panel {
        width: 280px;
        height: 400px;
    }
}

/* 悬浮客服样式 */
#customer-service {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
}

#cs-button {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    color: white;
    font-size: 20px;
    position: relative;
}

#cs-button::after {
    content: '客服';
    font-size: 10px;
    margin-top: 2px;
    font-weight: 600;
}

#cs-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

#cs-panel {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 320px;
    height: 450px;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s ease;
}

#cs-panel.active {
    display: flex;
    animation: slideIn 0.3s ease;
}

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

#cs-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#cs-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

#cs-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

#cs-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

#cs-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

#cs-content p {
    margin-bottom: 20px;
    color: #666;
    font-size: 14px;
}

#cs-input-container {
    display: flex;
    border-top: 1px solid #eee;
    padding: 15px;
}

#cs-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 20px 0 0 20px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}

#cs-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

#cs-send {
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 0 20px 20px 0;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

#cs-send:hover {
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.4);
}

.cs-reply {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

.cs-message {
    background-color: #f1f1f1;
    padding: 10px 15px;
    border-radius: 18px 18px 4px 18px;
    margin-bottom: 8px;
    font-size: 14px;
    color: #333;
    align-self: flex-end;
    max-width: 80%;
}

.cs-reply-message {
    background-color: #5a6fd8;
    color: #ffffff !important;
    padding: 12px 18px;
    border-radius: 18px 18px 18px 4px;
    font-size: 15px;
    font-weight: 500;
    align-self: flex-start;
    max-width: 80%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* 滚动条样式 */
#cs-content::-webkit-scrollbar {
    width: 6px;
}

#cs-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

#cs-content::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

#cs-content::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.modal.active {
    display: block;
}

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    width: 90%;
    max-width: 400px;
    animation: modalSlideIn 0.3s ease;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.modal-header h2 {
    font-size: 20px;
    color: #2c3e50;
    font-weight: 700;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-btn:hover {
    color: #333;
    background-color: #f1f1f1;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #666;
    font-weight: 600;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.submit-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

#login-message, #register-message {
    margin-top: 15px;
    font-size: 14px;
    text-align: center;
    padding: 10px;
    border-radius: 8px;
}

#login-message.error, #register-message.error {
    background-color: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    border-left: 4px solid #e74c3c;
}

#login-message.success, #register-message.success {
    background-color: rgba(46, 204, 113, 0.1);
    color: #27ae60;
    border-left: 4px solid #27ae60;
}

/* 响应式设计 - 模态框 */
@media (max-width: 480px) {
    .modal-content {
        margin: 20% auto;
        padding: 20px;
        width: 95%;
    }
    
    .modal-header h2 {
        font-size: 18px;
    }
    
    .form-group input {
        padding: 10px 12px;
    }
    
    .submit-btn {
        padding: 10px;
    }
}

/* 响应式设计 - 认证按钮 */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .auth-buttons {
        align-self: flex-end;
    }
    
    .auth-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
}