/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #1a1a1a;
    color: #ffffff;
    overflow: hidden;
    height: 100vh;
    position: relative;
}

/* 背景层 */
.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-size: cover;
    background-position: center;
    filter: blur(5px);
    z-index: -1;
    transition: filter 0.3s ease;
}

/* 主容器 */
.container {
    position: relative;
    z-index: 1;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
}

/* 时间显示区域 */
.time-section {
    position: absolute;
    top: 40px;
    left: 40px;
    text-align: left;
    z-index: 10;
}

.current-time {
    font-size: 28px;
    font-weight: bold;
    color: #ffffff;
    margin-bottom: 8px;
}

.current-date {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
}

/* 天气显示区域 */
.weather-section {
    position: absolute;
    top: 40px;
    right: 40px;
    text-align: right;
    z-index: 10;
    min-width: 240px;
}

.weather-container {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-height: auto;
    height: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.weather-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.weather-current {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 60px;
}

.weather-location {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 8px;
}

.weather-location i {
    font-size: 12px;
}

.weather-temp {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 4px;
}

.weather-desc {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
}

.weather-desc i {
    font-size: 14px;
}

.weather-forecast {
    display: flex;
    gap: 12px;
}

.weather-day {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
}

.weather-day-name {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 6px;
    font-weight: 600;
}

.weather-day-icon {
    font-size: 16px;
    margin-bottom: 4px;
}

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

/* 加载状态样式 */
.weather-desc .fa-spinner {
    animation: spin 1s linear infinite;
}

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

.weather-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.weather-container {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 8px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-height: auto !important;
    height: auto !important;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}

.weather-current {
    margin-bottom: 6px !important;
}

.weather-location {
    font-size: 14px !important;
    margin-bottom: 4px !important;
}

.weather-temp {
    font-size: 20px !important;
    margin-bottom: 2px !important;
}

.weather-desc {
    font-size: 12px !important;
}

.weather-forecast {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px !important;
}

.weather-day {
    text-align: center;
}

.weather-day-name {
    font-size: 10px !important;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 2px !important;
}

.weather-day-icon {
    font-size: 14px !important;
    margin-bottom: 2px !important;
}

.weather-day-temp {
    font-size: 10px !important;
    font-weight: 600;
}
    
.weather-forecast {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
    
    .weather-day {
        text-align: center;
    }
    
    .weather-day-name {
        font-size: 12px;
        color: rgba(255, 255, 255, 0.7);
        margin-bottom: 4px;
    }
    
    .weather-day-icon {
        font-size: 16px;
        margin-bottom: 4px;
    }
    
    .weather-day-temp {
        font-size: 12px;
        font-weight: 600;
    }

/* 搜索区域 */
.search-section {
    margin-bottom: 60px;
    width: 100%;
    max-width: 600px;
}

.search-container {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    padding: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.search-engine-selector {
    margin-right: 12px;
}

.engine-select {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    outline: none;
    cursor: pointer;
}

.engine-select option {
    background: #2a2a2a;
    color: white;
}

.search-input-container {
    flex: 1;
    display: flex;
    align-items: center;
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: white;
    font-size: 16px;
    padding: 8px 16px;
}

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

.search-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s;
}

.search-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 快捷链接区域 */
.quick-links-section {
    width: 100%;
    max-width: 800px;
}

.quick-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 20px;
    max-width: 600px;
    margin: 0 auto;
}

.quick-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: white;
    transition: transform 0.3s;
    cursor: pointer;
}

.quick-link:hover {
    transform: translateY(-5px);
}

.quick-link-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    position: relative;
    overflow: hidden;
}

.quick-link-icon img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.quick-link-icon .fa-globe {
    font-size: 24px;
    color: rgba(255, 255, 255, 0.8);
}

.quick-link-name {
    font-size: 14px;
    text-align: center;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 设置按钮 */
.settings-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 100;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* 设置面板 */
.settings-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(20px);
    transition: right 0.3s ease;
    z-index: 1000;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    overflow-y: auto;
}

.settings-panel.show {
    right: 0;
}

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

.settings-header h2 {
    font-size: 24px;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.3s;
}

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

.settings-content {
    padding: 0 30px 30px;
}

/* 登录区域 */
.login-section {
    margin-bottom: 30px;
}

.login-section h3 {
    margin-bottom: 20px;
    color: #ffffff;
}

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

.login-input {
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: white;
    outline: none;
}

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

.login-btn {
    padding: 12px 16px;
    background: #667eea;
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: background 0.3s;
}

.login-btn:hover {
    background: #5a6fd8;
}

/* 设置组 */
.setting-group {
    margin-bottom: 30px;
}

.setting-group h3 {
    margin-bottom: 15px;
    color: #ffffff;
    font-size: 18px;
}

.setting-select, .setting-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: white;
    outline: none;
}

/* 背景选项 */
.bg-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.bg-option {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: background 0.3s;
}

.bg-option:hover {
    background: rgba(255, 255, 255, 0.05);
}

.bg-option input[type="radio"] {
    margin: 0;
}

/* 背景模糊设置 */
.blur-setting {
    margin-top: 20px;
}

.blur-setting label {
    display: block;
    margin-bottom: 10px;
    color: rgba(255, 255, 255, 0.9);
}

.blur-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    -webkit-appearance: none;
}

.blur-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
}

.blur-value {
    display: inline-block;
    margin-top: 5px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

/* 链接管理 */
.links-management {
    margin-top: 15px;
}

.add-link-form {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.link-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: white;
    outline: none;
}

.add-link-btn {
    padding: 8px 16px;
    background: #667eea;
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    transition: background 0.3s;
}

.add-link-btn:hover {
    background: #5a6fd8;
}

.links-list {
    max-height: 200px;
    overflow-y: auto;
}

.link-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    margin-bottom: 5px;
    background: rgba(255, 255, 255, 0.05);
}

.link-info {
    flex: 1;
}

.link-name {
    font-weight: 600;
    margin-bottom: 2px;
}

.link-url {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.link-actions {
    display: flex;
    gap: 5px;
}

.edit-link-btn, .delete-link-btn {
    padding: 4px 8px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

.edit-link-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.delete-link-btn {
    background: rgba(220, 53, 69, 0.3);
    color: white;
}

/* 按钮样式 */
.save-btn {
    width: 100%;
    padding: 12px;
    background: #28a745;
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    transition: background 0.3s;
    margin-bottom: 10px;
}

.save-btn:hover {
    background: #218838;
}

.logout-btn {
    width: 100%;
    padding: 12px;
    background: rgba(220, 53, 69, 0.3);
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    transition: background 0.3s;
}

.logout-btn:hover {
    background: rgba(220, 53, 69, 0.5);
}

/* 登录遮罩 */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.login-modal {
    background: rgba(30, 30, 30, 0.95);
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.login-modal h3 {
    margin-bottom: 10px;
    color: white;
}

.login-modal p {
    margin-bottom: 20px;
    color: rgba(255, 255, 255, 0.8);
}

.login-modal button {
    padding: 10px 20px;
    background: #667eea;
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    transition: background 0.3s;
}

.login-modal button:hover {
    background: #5a6fd8;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .time-section {
        top: 20px;
        left: 20px;
    }
    
    .weather-section {
        top: 20px;
        right: 20px;
    }
    
    .current-time {
        font-size: 24px;
    }
    
    .current-date {
        font-size: 16px;
    }
    
    .weather-container {
        padding: 12px;
    }
    
    .settings-panel {
        width: 100%;
        right: -100%;
    }
    
    .quick-links-grid {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
        gap: 15px;
    }
    
    .quick-link-icon {
        width: 50px;
        height: 50px;
    }
    
    .quick-link-icon img {
        width: 28px;
        height: 28px;
    }
}