:root {
    --primary-color: #4a86e8;
    --primary-light: #92b4f4;
    --primary-dark: #2a5298;
    --text-light: #f5f5f5;
    --text-dark: #333;
    --bg-light: #f5f5f5;
    --bg-dark: #222;
    --card-light: #fff;
    --card-dark: #333;
    --shadow-light: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-dark: 0 2px 10px rgba(0, 0, 0, 0.3);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans SC', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    min-height: 100vh;
    background-image: none;
    transition: var(--transition);
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.2);
    z-index: -1;
    pointer-events: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    color: var(--text-light);
}

.time-container {
    text-align: center;
}

.time {
    font-size: 3rem;
    font-weight: 300;
    margin-bottom: 5px;
}

.date {
    font-size: 1.2rem;
}

.weather-container {
    background-color: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 15px 20px;
    box-shadow: var(--shadow-light);
    transition: transform 0.3s ease;
    min-width: 300px;
    max-width: 380px;
}

.weather-container:hover {
    transform: translateY(-5px);
}

.weather-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

#refresh-weather {
    background: rgba(255, 255, 255, 0.3);
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: var(--text-light);
    font-size: 0.8rem;
    transition: var(--transition);
}

#refresh-weather:hover {
    background: rgba(255, 255, 255, 0.5);
}

#refresh-weather.rotating {
    animation: rotate 1s linear;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

body.dark #refresh-weather {
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-light);
}

body.dark #refresh-weather:hover {
    background: rgba(0, 0, 0, 0.5);
}

.weather {
    display: flex;
    align-items: center;
}

.weather-icon {
    font-size: 2.5rem;
    margin-right: 15px;
    width: 50px;
    text-align: center;
}

.weather-info {
    text-align: left;
}

#temperature {
    font-size: 1.8rem;
    font-weight: 500;
    line-height: 1;
}

#location {
    font-size: 0.9rem;
    margin-bottom: 3px;
}

.weather-desc {
    font-size: 0.85rem;
    opacity: 0.8;
}

/* 天气详情样式优化 */
.weather-details {
    display: flex;
    justify-content: space-between;
    margin: 15px 0;
    padding: 15px 5px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    flex-wrap: wrap;
}

.weather-detail {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.85rem;
    padding: 0 10px;
    width: 33%;
    text-align: center;
    transition: all 0.3s ease;
}

.weather-detail:hover {
    transform: translateY(-3px);
}

.weather-detail i {
    margin-bottom: 8px;
    font-size: 1.2rem;
}

.weather-detail span {
    line-height: 1.5;
}

.weather-detail .detail-label {
    font-size: 0.8rem;
    opacity: 0.9;
    margin-bottom: 4px;
}

.weather-detail .detail-value {
    font-size: 1rem;
    font-weight: 500;
}

/* 天气预报样式 */
.forecast {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    overflow-x: auto;
    padding-bottom: 5px;
    scrollbar-width: thin;
}

.forecast::-webkit-scrollbar {
    height: 4px;
}

.forecast::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.forecast-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 50px;
    padding: 5px;
}

.forecast-date {
    font-size: 0.75rem;
    margin-bottom: 5px;
}

.forecast-icon {
    font-size: 1rem;
    margin: 5px 0;
}

.forecast-temp {
    font-size: 0.8rem;
}

/* 天气错误提示样式 */
.weather-prompt {
    margin-top: 10px;
    padding: 10px;
    background-color: rgba(255, 100, 100, 0.2);
    border-left: 3px solid rgba(255, 100, 100, 0.8);
    border-radius: 4px;
    font-size: 0.9rem;
    text-align: left;
}

.weather-prompt p {
    margin: 5px 0;
}

.weather-prompt a {
    color: var(--primary-color);
    text-decoration: underline;
    font-weight: bold;
}

.weather-prompt a:hover {
    color: var(--primary-dark);
}

body.dark .weather-prompt {
    background-color: rgba(255, 100, 100, 0.3);
    border-left: 3px solid rgba(255, 100, 100, 0.9);
}

body.dark .weather-prompt a {
    color: var(--primary-light);
}

/* 适配暗色主题 */
body.dark .weather-details {
    border-top-color: rgba(0, 0, 0, 0.3);
    border-bottom-color: rgba(0, 0, 0, 0.3);
}

body.dark .forecast::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.3);
}

/* 响应式设计调整 */
@media (max-width: 768px) {
    .weather-container {
        min-width: 280px;
        max-width: 100%;
        margin: 0 auto;
        padding: 15px;
    }
    
    .weather-details {
        padding: 12px 0;
        margin: 12px 0;
    }
    
    .forecast {
        margin-top: 8px;
    }
    
    .weather-detail {
        padding: 0 5px;
    }
    
    .weather-detail i {
        font-size: 1.1rem;
    }
    
    .weather-detail .detail-value {
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .weather-icon {
        font-size: 2.2rem;
    }
    
    #temperature {
        font-size: 1.6rem;
    }
    
    .weather-details {
        padding: 10px 0;
    }
}

main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 30px;
    padding: 30px 0;
}

.search-container {
    background-color: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    box-shadow: var(--shadow-light);
    color: var(--text-light);
    transition: transform 0.3s ease;
}

.search-container:hover {
    transform: translateY(-3px);
}

.search-engines {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.search-engine {
    padding: 8px 15px;
    border: none;
    background-color: rgba(255, 255, 255, 0.3);
    color: var(--text-light);
    border-radius: 5px;
    cursor: pointer;
    transition: var(--transition);
}

.search-engine:hover {
    background-color: rgba(255, 255, 255, 0.5);
}

.search-engine.active {
    background-color: var(--primary-color);
    color: white;
}

.search-box {
    display: flex;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 30px;
    padding: 5px 5px 5px 15px;
    overflow: hidden;
}

.search-box i {
    margin-right: 10px;
}

#search-input {
    flex-grow: 1;
    border: none;
    background: transparent;
    color: var(--text-light);
    font-size: 1rem;
    padding: 10px 0;
    outline: none;
}

#search-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

#search-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}

#search-button:hover {
    background-color: var(--primary-dark);
}

.bookmarks-container {
    background-color: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    box-shadow: var(--shadow-light);
    color: var(--text-light);
    transition: transform 0.3s ease;
}

.bookmarks-container:hover {
    transform: translateY(-3px);
}

.bookmarks-container h2 {
    text-align: center;
    margin-bottom: 15px;
    font-weight: 500;
}

.bookmark-categories {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.category {
    padding: 8px 15px;
    border: none;
    background-color: rgba(255, 255, 255, 0.3);
    color: var(--text-light);
    border-radius: 5px;
    cursor: pointer;
    transition: var(--transition);
}

.category:hover {
    background-color: rgba(255, 255, 255, 0.5);
}

.category.active {
    background-color: var(--primary-color);
    color: white;
}

.bookmarks {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 20px;
}

.bookmark-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: var(--transition);
}

.bookmark-item a {
    text-decoration: none;
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.bookmark-icon {
    background-color: rgba(255, 255, 255, 0.3);
    width: 60px;
    height: 60px;
    border-radius: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    margin-bottom: 8px;
    transition: var(--transition);
}

.bookmark-item:hover .bookmark-icon {
    background-color: var(--primary-color);
    transform: translateY(-5px);
}

.bookmark-name {
    font-size: 0.9rem;
}

.todo-container {
    background-color: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    box-shadow: var(--shadow-light);
    color: var(--text-light);
    transition: transform 0.3s ease;
}

.todo-container:hover {
    transform: translateY(-3px);
}

.todo-container h2 {
    text-align: center;
    margin-bottom: 15px;
    font-weight: 500;
}

.todo-form {
    display: flex;
    margin-bottom: 15px;
}

#todo-input {
    flex-grow: 1;
    padding: 10px 15px;
    border: none;
    background-color: rgba(255, 255, 255, 0.3);
    color: var(--text-light);
    border-radius: 5px 0 0 5px;
    outline: none;
}

#todo-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

#todo-add {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 0 5px 5px 0;
    cursor: pointer;
    transition: var(--transition);
}

#todo-add:hover {
    background-color: var(--primary-dark);
}

#todo-list {
    list-style: none;
}

#todo-list li {
    background-color: rgba(255, 255, 255, 0.3);
    margin-bottom: 10px;
    padding: 10px 15px;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.todo-text {
    flex-grow: 1;
}

.todo-actions {
    display: flex;
    gap: 10px;
}

.todo-actions button {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 0.9rem;
}

.complete {
    text-decoration: line-through;
    opacity: 0.7;
}

footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    color: var(--text-light);
}

.settings button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
}

.settings button:hover {
    background-color: var(--primary-color);
}

.quote {
    text-align: center;
    padding: 10px;
    position: relative;
}

#quote-text {
    font-style: italic;
    margin-bottom: 5px;
}

#quote-author {
    font-size: 0.9rem;
}

#refresh-quote {
    position: absolute;
    right: -20px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.3);
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: var(--text-light);
    font-size: 0.8rem;
    transition: var(--transition);
}

#refresh-quote:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: translateY(-50%) rotate(180deg);
}

body.dark #refresh-quote {
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-dark);
}

body.dark #refresh-quote:hover {
    background: rgba(0, 0, 0, 0.5);
}

/* 设置面板样式 */
.settings-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: right 0.3s ease;
    color: var(--text-dark);
    display: flex;
    flex-direction: column;
}

.settings-panel.active {
    right: 0;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.settings-header h2 {
    font-weight: 500;
}

.settings-header button {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-dark);
}

.settings-content {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
}

.setting-item {
    margin-bottom: 20px;
}

.setting-item label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.setting-help {
    display: block;
    margin-top: 5px;
    font-size: 0.85rem;
    color: #666;
    line-height: 1.4;
}

body.dark .setting-help {
    color: #aaa;
}

.setting-help a {
    color: var(--primary-color);
    text-decoration: none;
}

.setting-help a:hover {
    text-decoration: underline;
}

.setting-item select, 
.setting-item input[type="text"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: white;
}

.setting-item button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 10px;
}

.settings-footer {
    display: flex;
    justify-content: space-between;
    padding: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    flex-wrap: wrap;
    gap: 10px;
}

.settings-footer button {
    padding: 10px 15px;
    border-radius: 5px;
    border: none;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    flex: 1;
    min-width: 120px;
}

#save-settings {
    background-color: var(--primary-color);
    color: white;
}

#reset-settings {
    background-color: rgba(0, 0, 0, 0.1);
    color: var(--text-dark);
}

#export-settings {
    background-color: #28a745;
    color: white;
}

#export-settings:hover {
    background-color: #218838;
}

#import-settings {
    background-color: #17a2b8;
    color: white;
}

#import-settings:hover {
    background-color: #138496;
}

/* 暗色主题 */
body.dark {
    background-color: var(--bg-dark);
    color: var(--text-light);
}

body.dark .search-container,
body.dark .bookmarks-container,
body.dark .todo-container {
    background-color: rgba(0, 0, 0, 0.5);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

body.dark .weather-container {
    background-color: rgba(0, 0, 0, 0.5);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

body.dark .settings-panel {
    background-color: rgba(30, 30, 30, 0.95);
    color: var(--text-light);
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.4);
}

body.dark .setting-item select,
body.dark .setting-item input[type="text"] {
    background-color: #333;
    border-color: #444;
    color: var(--text-light);
}

body.dark #reset-settings {
    background-color: #333;
    color: var(--text-light);
}

body.dark .search-engine,
body.dark .category {
    background-color: rgba(255, 255, 255, 0.1);
}

body.dark .search-engine:hover,
body.dark .category:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

body.dark .search-box {
    background-color: rgba(255, 255, 255, 0.1);
}

body.dark #todo-input {
    background-color: rgba(255, 255, 255, 0.1);
}

body.dark #todo-list li {
    background-color: rgba(255, 255, 255, 0.1);
}

body.dark .bookmark-icon {
    background-color: rgba(255, 255, 255, 0.1);
}

body.dark .settings button {
    background-color: rgba(0, 0, 0, 0.3);
}

/* 响应式设计 */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 20px;
    }
    
    .time {
        font-size: 2.5rem;
    }
    
    .bookmarks {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
    
    .settings-panel {
        width: 100%;
        right: -100%;
    }
    
    footer {
        flex-direction: column;
        gap: 20px;
    }
    
    .quote {
        text-align: center;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.container {
    animation: fadeIn 1s ease;
}

/* 背景样式 */
body {
    margin: 0;
    padding: 0;
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    color: #fff;
    transition: background-color 0.5s ease;
    background-color: #121212;
    overflow-x: hidden;
}

.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    opacity: 0;
    transition: opacity 1s ease;
    will-change: opacity;
}

.background.loaded {
    opacity: 1;
}

.temp-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -3;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: -1;
}

/* 加载指示器 */
.loading-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.loading-indicator.visible {
    opacity: 1;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* 通知样式 */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: rgba(40, 167, 69, 0.9);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.2);
    font-size: 1rem;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 9999;
}

.notification.show {
    transform: translateY(0);
    opacity: 1;
}

.notification.error {
    background-color: rgba(220, 53, 69, 0.9);
}

/* 设置行样式 */
.setting-row {
    margin-bottom: 15px;
}

/* 表单样式调整 */
form {
    margin: 0;
}

/* 文件输入样式 */
input[type="file"] {
    margin: 10px 0;
    width: 100%;
}

/* 暗色主题按钮状态改进 */
body.dark .search-engine.active,
body.dark .category.active {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 0 8px rgba(74, 134, 232, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

body.dark #save-settings,
body.dark #export-settings,
body.dark #import-settings {
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
}

body.dark .search-engine,
body.dark .category {
    border: 1px solid transparent;
} 