/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    background: linear-gradient(135deg, #ff6b6b 0%, #ffa500 25%, #87ceeb 100%);
    color: #333;
    overflow-x: hidden;
}

/* 顶部时间栏 */
.top-bar {
    display: flex;
    justify-content: center; /* 居中 */
    align-items: center;
    padding: 20px;
    color: white;
}

.time-display {
    text-align: center;
    width: 100%;
}



.current-time {
    font-size: 3rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 5px;
}

.current-date {
    font-size: 1.2rem;
    opacity: 0.9;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* 搜索栏 */
.search-section {
    padding: 20px;
    display: flex;
    justify-content: center;
}

.search-container {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 50px;
    padding: 10px 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-width: 600px;
    width: 100%;
}

.search-bar {
    display: flex;
    align-items: center;
    width: 100%;
}

.search-bar input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 1rem;
    padding: 10px;
}

.search-btn {
    background: #0078d7;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.search-btn:hover {
    background: #005a9e;
    transform: scale(1.05);
}

/* 主要内容区域 */
/* 小部件区域 */
.widgets-section {
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.widgets-container {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
}

/* 保留原有的main-content样式用于兼容性 */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

/* 小部件通用样式 */
.widget {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(15px);
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    transition: all 0.3s ease;
}

.widget:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}





.widget-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.1rem;
}

.widget-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.widget-config-btn {
    background: none;
    border: none;
    color: #666;
    font-size: 1rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.widget-config-btn:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.1);
    transform: scale(1.1);
}

.widget-content {
    padding: 20px;
}

/* 天气小部件 */
.weather-widget {
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
    color: white;
}

.weather-widget .widget-header {
    background: rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
}

.weather-widget .widget-header h3 {
    color: white;
    margin: 0;
}

.weather-widget .widget-config-btn {
    color: white;
    opacity: 0.8;
}

.weather-widget .widget-config-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2);
}

.weather-content {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
}

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

.weather-location {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 8px;
    font-weight: 500;
}

.weather-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.weather-temp {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.weather-desc {
    font-size: 1rem;
    opacity: 0.9;
}

.weather-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.9rem;
}

.weather-detail {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.weather-detail:last-child {
    border-bottom: none;
}

.weather-detail-label {
    opacity: 0.8;
}

.weather-detail-value {
    font-weight: 500;
}

.weather-loading {
    text-align: center;
    padding: 40px 20px;
    opacity: 0.8;
}

.weather-error {
    text-align: center;
    padding: 20px;
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
    border-radius: 8px;
    margin: 10px;
}

/* 记事本小部件 */
.notepad-widget {
    background: linear-gradient(135deg, #fff9c4 0%, #fff59d 100%);
}

#notepad-content {
    width: 100%;
    height: 150px;
    border: none;
    outline: none;
    background: transparent;
    resize: none;
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* 待办事项小部件 */
.todo-widget {
    background: linear-gradient(135deg, #424242 0%, #616161 100%);
    color: white;
}

.todo-widget .widget-header {
    background: rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.todo-widget .widget-header h3 {
    color: white;
    margin: 0;
    text-align: center;
    width: 100%;
}

.add-todo-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: bold;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-todo-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.todo-widget .widget-content {
    padding: 20px;
    max-height: 300px;
    overflow-y: auto;
}

.todo-add-form {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.todo-title-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 8px 15px;
    color: white;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.3s ease;
}

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

.todo-title-input:focus {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.add-todo-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 35px;
    height: 35px;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: bold;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.add-todo-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.add-todo-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

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

.todo-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.todo-item:hover {
    background: rgba(255, 255, 255, 0.15);
}

.todo-item.completed {
    opacity: 0.6;
    background: rgba(255, 255, 255, 0.05);
}

.todo-item.completed .todo-title {
    text-decoration: line-through;
}

.todo-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
}

.todo-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #4CAF50;
}

.todo-title {
    flex: 1;
    font-weight: 500;
    font-size: 0.95rem;
    word-break: break-word;
    text-align: center;
}

.todo-priority {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.todo-priority:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.todo-priority.high {
    background: rgba(244, 67, 54, 0.8);
    color: white;
}

.todo-priority.medium {
    background: rgba(255, 152, 0, 0.8);
    color: white;
}

.todo-priority.low {
    background: rgba(76, 175, 80, 0.8);
    color: white;
}

.todo-content {
    flex: 1;
    min-width: 0;
}

.todo-description {
    font-size: 0.8rem;
    opacity: 0.8;
    margin-left: 28px;
    word-break: break-word;
    line-height: 1.4;
}

.todo-actions {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
}

.todo-action-btn {
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    font-size: 0.7rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.todo-action-btn:hover {
    background: rgba(0, 0, 0, 0.7);
}

.todo-empty {
    text-align: center;
    padding: 40px 20px;
    opacity: 0.8;
    font-size: 0.9rem;
}

.todo-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.8rem;
}

.todo-count {
    font-weight: bold;
}

.todo-progress {
    display: flex;
    align-items: center;
    gap: 5px;
}

.progress-bar {
    width: 60px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #4CAF50;
    transition: width 0.3s ease;
}

/* 卡片区域 */
.cards-section {
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.cards-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    color: white;
}

.cards-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.settings-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 1.2rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.edit-mode-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 1.2rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.edit-mode-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.edit-mode-btn.active {
    background: rgba(40, 167, 69, 0.3);
    border-color: rgba(40, 167, 69, 0.5);
    color: #28a745;
}

.cards-header h3 {
    font-size: 1.5rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.add-card-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 1rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.add-card-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 20px;
}

/* 卡片样式 */
.card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    user-select: none;
}

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

.card-icon {
    width: 50px;
    height: 50px;
    margin: 0 auto 10px;
    border-radius: 10px;
    object-fit: cover;
    background: #f0f0f0;
}

.card-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: #333;
    margin-bottom: 10px;
}

.card-actions {
    position: absolute;
    top: 5px;
    right: 5px;
    display: none;
    gap: 5px;
}

.edit-mode .card-actions {
    display: flex;
}

.action-btn {
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: rgba(0, 0, 0, 0.7);
}

/* 拖拽手柄样式 */
.card-drag-handle {
    position: absolute;
    top: 5px;
    left: 5px;
    color: #666;
    font-size: 0.8rem;
    cursor: grab;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.card:hover .card-drag-handle {
    opacity: 0;
}

.edit-mode .card-drag-handle {
    opacity: 1;
}

.card-drag-handle:active {
    cursor: grabbing;
}

/* 拖拽状态样式 */
.card.dragging {
    opacity: 0.8;
    transform: rotate(2deg) scale(1.05);
    z-index: 1000;
    cursor: grabbing;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.card.drag-over {
    border: 2px dashed #0078d7;
    background: rgba(0, 120, 215, 0.1);
    transform: scale(1.02);
    transition: all 0.2s ease;
    box-shadow: 0 0 15px rgba(0, 120, 215, 0.3);
}

/* 拖拽到边缘时的视觉反馈 */
.cards-container.drag-to-start::before {
    background: linear-gradient(to right, rgba(0, 120, 215, 0.3), transparent);
}

.cards-container.drag-to-end::after {
    background: linear-gradient(to left, rgba(0, 120, 215, 0.3), transparent);
}

/* 拖拽时的容器样式 */
.cards-container.dragging {
    cursor: grabbing;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 500px;
    max-width: 90%;
    max-height: 90%;
    overflow-y: auto;
}

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

.modal-header h3 {
    margin: 0;
    color: #333;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    transition: color 0.3s ease;
}

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

.modal-body {
    padding: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #0078d7;
}

.icon-preview {
    margin-top: 10px;
    text-align: center;
}

.icon-preview img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid #ddd;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid #eee;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #0078d7;
    color: white;
}

.btn-primary:hover {
    background: #005a9e;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .main-content,
    .widgets-container {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .main-content,
    .widgets-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .search-container {
        max-width: 90%;
    }
    
    .cards-container {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 15px;
    }
    
    .current-time {
        font-size: 2rem;
    }
    
    .current-date {
        font-size: 1rem;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeIn 0.5s ease-out;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 设置模态框样式 */
.settings-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.settings-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.settings-section h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.1rem;
    font-weight: 600;
}

.data-management-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}



/* 小部件开关样式 */
.widget-toggle-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.widget-toggle-item {
    display: flex;
    align-items: center;
}

.toggle-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    gap: 12px;
}

.toggle-label input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 50px;
    height: 24px;
    background-color: #ccc;
    border-radius: 12px;
    transition: background-color 0.3s ease;
}

.toggle-slider:before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-label input[type="checkbox"]:checked + .toggle-slider {
    background-color: #0078d7;
}

.toggle-label input[type="checkbox"]:checked + .toggle-slider:before {
    transform: translateX(26px);
}

.toggle-text {
    font-size: 1rem;
    color: #333;
    font-weight: 500;
}

/* 小部件排序样式 */
.widget-order-container {
    margin-top: 10px;
}

.order-hint {
    margin: 0 0 15px 0;
    color: #666;
    font-size: 0.9rem;
}

.widget-order-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.widget-order-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    cursor: grab;
    transition: all 0.3s ease;
    user-select: none;
}

.widget-order-item:hover {
    background: #e9ecef;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.widget-order-item:active {
    cursor: grabbing;
}

.widget-order-item.dragging {
    opacity: 0.7;
    transform: rotate(2deg);
    z-index: 1000;
}

.widget-order-item.drag-over {
    border: 2px dashed #0078d7;
    background: rgba(0, 120, 215, 0.05);
}

.widget-order-handle {
    margin-right: 12px;
    color: #666;
    font-size: 1.2rem;
    cursor: grab;
}

.widget-order-item:active .widget-order-handle {
    cursor: grabbing;
}

.widget-order-text {
    flex: 1;
    font-size: 1rem;
    color: #333;
    font-weight: 500;
}

.widget-order-toggle {
    margin-left: 12px;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.widget-order-toggle:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.1);
}

.widget-order-toggle.visible {
    color: #28a745;
}

.widget-order-toggle.hidden {
    color: #6c757d;
} 

/* 移除边缘拖拽提示色块相关样式 */
.cards-container::before,
.cards-container::after,
.cards-container.drag-to-start::before,
.cards-container.drag-to-end::after {
    display: none !important;
} 