/* Modern CSS Reset */
*, *::before, *::after {
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
    font: inherit;
}

/* Dark mode styles */
body.dark-mode {
    background-color: #121212;
    color: #e0e0e0;
}

body.dark-mode #search-input {
    background-color: rgba(40, 40, 40, 0.9);
    border-color: #444;
    color: #e0e0e0;
}

body.dark-mode #search-input:focus {
    border-color: #66a0ff;
}

body.dark-mode .modal-content {
    background: linear-gradient(135deg, #2d2d2d, #1a1a1a);
}

body.dark-mode .modal-content h1,
body.dark-mode .modal-content h2,
body.dark-mode .modal-content h3 {
    color: #e0e0e0;
}

body.dark-mode .modal-content p,
body.dark-mode .modal-content label {
    color: #b0b0b0;
}

body.dark-mode .quick-access-link {
    background-color: #2d2d2d;
}

body.dark-mode .quick-access-link:hover {
    background-color: #3d3d3d;
}

body.dark-mode .quick-access-link .link-title {
    color: #e0e0e0;
}

body.dark-mode .system-link {
    background-color: #2a2a2a;
    border-color: #555;
}

body.dark-mode .system-link:hover {
    background-color: #333;
}

body.dark-mode .form-group input {
    background-color: #2d2d2d;
    border-color: #555;
    color: #e0e0e0;
}

body.dark-mode .form-group input:focus {
    border-color: #66a0ff;
}

body.dark-mode #search-engine,
body.dark-mode .setting-item select {
    background-color: #2d2d2d;
    border-color: #555;
    color: #e0e0e0;
}

body.dark-mode .time-display.dark-mode {
    color: #e0e0e0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

body.dark-mode #cancel-quick-access {
    background-color: #444;
    color: #e0e0e0;
}

body.dark-mode #cancel-quick-access:hover {
    background-color: #555;
}

body.dark-mode .close:hover,
body.dark-mode .close:focus {
    color: #e0e0e0;
    background-color: #444;
}

body.dark-mode .setting-item {
    border-bottom-color: #444;
}

body.dark-mode .modal-content hr {
    background: linear-gradient(to right, transparent, #444, transparent);
}

body {
    margin: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-color: whitesmoke;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 20px;
    color: #333;
    line-height: 1.6;
}

/* Time Display */
.time-display {
    font-size: 4em;
    font-weight: bold;
    margin-bottom: 20px;
    color: white; /* Default color */
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.time-display.black {
    color: black;
    text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.5);
}

img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
}

input, button, textarea, select {
    outline: none;
}

/* Search Container */
.search-container {
    display: flex;
    margin-bottom: 30px;
    align-items: center;
    width: 100%;
    max-width: 600px;
    gap: 12px;
    justify-content: center;
}

.search-input-container {
    position: relative;
    flex: 1;
    max-width: 500px;
}

#search-input {
    width: 100%;
    padding: 14px 20px;
    padding-right: 100px;
    border: 1px solid #ddd;
    border-radius: 24px;
    font-size: 16px;
    box-sizing: border-box;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

#search-input:focus {
    border-color: #4285f4;
    box-shadow: 0 2px 15px rgba(66, 133, 244, 0.3);
}

#search-button {
    position: absolute;
    right: 6px;
    top: 6px;
    height: calc(100% - 12px);
    padding: 0 24px;
    border: none;
    background-color: #4285f4;
    color: white;
    border-radius: 20px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    box-sizing: border-box;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

#search-button:hover {
    background-color: #4285f4;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

#settings-button {
    position: fixed;
    right: 30px;
    bottom: 30px;
    width: 60px;
    height: 60px;
    border: none;
    background-color: #4285f4;
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 100;
}

#settings-button:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.material-symbols-outlined {
    font-size: 32px;
    font-weight: normal;
    font-style: normal;
    line-height: 1;
}

/* Settings Modal */
.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.6);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: linear-gradient(135deg, #ffffff, #f5f7fa);
    margin: 10% auto;
    padding: 30px;
    border: none;
    width: 90%;
    max-width: 500px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.3s ease;
    position: relative;
}

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

/* 快速访问样式 */
.quick-access-container {
    width: 100%;
    max-width: 800px;
    margin: 20px 0;
    padding: 20px;
}

.quick-access-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
}

.quick-access-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

#add-quick-access {
    width: 36px;
    height: 36px;
    border: none;
    background-color: #4285f4;
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

#add-quick-access:hover {
    background-color: #3367d6;
    transform: scale(1.1);
}

.quick-access-links {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 12px;
}

.quick-access-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.quick-access-link:hover {
    background-color: #e8eaed;
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

.quick-access-link .link-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #4285f4;
    color: white;
    font-weight: bold;
    font-size: 16px;
}

.quick-access-link .link-title {
    font-size: 14px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.quick-access-link .delete-button {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    border: none;
    background-color: rgba(255, 255, 255, 0.8);
    color: #ff4757;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
}

.quick-access-link:hover .delete-button {
    opacity: 1;
}

/* 系统链接样式 */
.system-link {
    border: 1px solid #ddd;
    background-color: #f0f0f0;
}

.system-link:hover {
    background-color: #e6e6e6;
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

/* 设置链接特殊图标样式 */
.system-link .link-icon .material-symbols-outlined {
    font-size: 24px;
    color: white;
}

/* 添加按钮链接特殊样式 */
.add-button-link {
    border: 1px dashed #4CAF50;
    background-color: rgba(76, 175, 80, 0.1);
}

.add-button-link:hover {
    background-color: rgba(76, 175, 80, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(76, 175, 80, 0.2);
}

.add-button-link .link-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

/* 模态框表单样式 */
.modal-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 500;
    color: #333;
}

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

.form-group input:focus {
    border-color: #4285f4;
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.1);
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
}

.modal-buttons button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

#save-quick-access {
    background-color: #4285f4;
    color: white;
}

#save-quick-access:hover {
    background-color: #3367d6;
}

#cancel-quick-access {
    background-color: #f1f3f4;
    color: #333;
}

#cancel-quick-access:hover {
    background-color: #e8eaed;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    top: 20px;
    right: 25px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close:hover,
.close:focus {
    color: #333;
    background-color: #f0f0f0;
    text-decoration: none;
    cursor: pointer;
}

/* Modal Content Styling */
.modal-content h1 {
    color: #202124;
    font-size: 28px;
    margin-bottom: 25px;
    text-align: center;
    font-weight: 500;
}

.modal-content h2 {
    color: #202124;
    font-size: 22px;
    margin: 25px 0 15px;
    font-weight: 500;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 8px;
}

.modal-content h3 {
    color: #5f6368;
    font-size: 18px;
    margin: 20px 0 10px;
    font-weight: 500;
}

.modal-content p {
    color: #5f6368;
    margin: 10px 0;
    font-size: 15px;
}

.modal-content hr {
    border: none;
    height: 1px;
    background: linear-gradient(to right, transparent, #ddd, transparent);
    margin: 25px 0;
}

/* Search Engine Select */
#search-engine {
    width: 100%;
    padding: 12px 15px;
    margin-top: 10px;
    border: 1px solid #ddd;
    border-radius: 12px;
    background-color: #fff;
    font-size: 16px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

#search-engine:focus {
    border-color: #4285f4;
    box-shadow: 0 2px 10px rgba(66, 133, 244, 0.2);
}

/* Settings Modal Buttons */
.modal-content button {
    padding: 12px 20px;
    border: none;
    background-color: #4285f4;
    color: white;
    border-radius: 12px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    margin-top: 15px;
    width: 100%;
    min-width: auto;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.modal-content button:hover {
    background-color: #4285f4;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.modal-content #reset-bg {
    background-color: #ea4335;
}

.modal-content #reset-bg:hover {
    background-color: #ea4335;
}

.modal-content #todaybingwallpaper {
    background-color: #4285f4;
}

.modal-content #todaybingwallpaper:hover {
    background-color: #4285f4;
}

.modal-content input[type="file"] {
    margin-top: 10px;
    width: 100%;
    padding: 10px;
    border: 1px dashed #ddd;
    border-radius: 12px;
    background-color: #f8f9fa;
}

/* Settings Item */
.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.setting-item:last-of-type {
    border-bottom: none;
}

.setting-item label {
    color: #333;
    font-size: 16px;
    flex-grow: 1;
}

/* Toggle Switch Styles */
.toggle-container {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.toggle-checkbox {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-label {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 26px;
}

.toggle-label:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.toggle-checkbox:checked + .toggle-label {
    background-color: #4285f4;
}

.toggle-checkbox:focus + .toggle-label {
    box-shadow: 0 0 1px #4285f4;
}

.toggle-checkbox:checked + .toggle-label:before {
    transform: translateX(24px);
}

/* Animation for the toggle */
.toggle-label:before {
    transition: transform 0.2s ease-in-out;
}

.toggle-label {
    transition: background-color 0.2s ease-in-out;
}

.setting-item select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #fff;
    font-size: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.sub-setting {
    margin-left: 20px;
    border-bottom: none;
    padding-top: 5px;
    padding-bottom: 5px;
}

/* Quick Links */
.quick-links-container {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 600px;
    margin-top: 20px;
}

.quick-link {
    text-decoration: none;
    color: #4285f4;
    padding: 12px 20px;
    border: 1px solid #4285f4;
    border-radius: 24px;
    font-weight: 500;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
}

.quick-link:hover {
    background-color: #4285f4;
    color: white;
    box-shadow: 0 4px 10px rgba(66, 133, 244, 0.3);
}

/* Responsive styles for tablets */
    @media screen and (max-width: 768px) {
    .time-display {
        font-size: 3em;
    }

    body {
        padding: 15px;
    }
    
    .search-container {
        flex-direction: column;
        width: 100%;
        gap: 15px;
    }
    
    .search-input-container {
        width: 100%;
        max-width: 100%;
    }
    
    #search-input {
        padding: 14px 20px;
        padding-right: 100px;
        border-radius: 24px;
    }
    
    #settings-button {
        width: 50px;
        height: 50px;
        border-radius: 50%;
        margin-top: 10px;
    }
    
    .modal-content {
        width: 95%;
        padding: 25px 20px;
        margin: 15% auto;
    }
    
    .quick-links-container {
        flex-direction: column;
        align-items: center;
        width: 100%;
    }
    
    .quick-link {
        width: 100%;
        text-align: center;
        margin-bottom: 10px;
    }
    
    /* Settings Modal Buttons */
    .modal-content button {
        width: 100%;
        min-width: auto;
        margin-bottom: 10px;
    }
    
    .modal-content input[type="file"] {
        width: 100%;
    }
}

/* Responsive styles for mobile phones */
    @media screen and (max-width: 480px) {
    .time-display {
        font-size: 2.5em;
    }

    body {
        padding: 10px;
    }
    
    .search-container {
        margin-bottom: 20px;
    }
    
    #search-input {
        padding: 12px 18px;
        padding-right: 90px;
        font-size: 16px;
    }
    
    #search-button {
        padding: 0 20px;
        font-size: 14px;
    }
    
    .modal-content {
        width: 95%;
        padding: 20px 15px;
        margin: 20% auto;
    }
    
    .modal-content h1 {
        font-size: 24px;
        margin-bottom: 20px;
    }
    
    .modal-content h2 {
        font-size: 20px;
        margin: 20px 0 15px;
    }
    
    .modal-content h3 {
        font-size: 17px;
    }
    
    .modal-content p {
        font-size: 14px;
    }
    
    .modal-content button {
        padding: 10px 15px;
        font-size: 14px;
    }
}
