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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
}

/* 背景图 */
.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../bg/001.jpg') center/cover no-repeat;
    z-index: -1;
}

.background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.1);
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 时钟区域 */
.clock-section {
    text-align: center;
    margin-bottom: 30px;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.time {
    font-size: 80px;
    font-weight: 300;
    letter-spacing: 2px;
    line-height: 1;
}

.date {
    font-size: 16px;
    margin-top: 10px;
    opacity: 0.9;
}

/* 搜索框 */
.search-section {
    width: 100%;
    max-width: 700px;
    margin-bottom: 40px;
    position: relative;
}

.search-box {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 12px;
    padding: 8px 8px 8px 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* 搜索引擎选择器 */
.search-engine-selector {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
    margin-right: 8px;
}

.search-engine-selector:hover {
    background: rgba(0, 0, 0, 0.05);
}

.engine-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.engine-arrow {
    font-size: 12px;
    color: #999;
    transition: transform 0.3s;
}

.engine-arrow.rotate {
    transform: rotate(180deg);
}

/* 搜索引擎菜单 */
.engine-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    padding: 8px;
    min-width: 160px;
    display: none;
    z-index: 100;
}

.engine-menu.show {
    display: block;
    animation: menuSlideIn 0.2s ease;
}

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

.engine-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.engine-item:hover {
    background: rgba(74, 144, 217, 0.1);
}

.engine-item.active {
    background: rgba(74, 144, 217, 0.15);
}

.engine-item img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.engine-item span {
    font-size: 14px;
    color: #333;
}

/* 搜索建议下拉框 */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 8px;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    animation: slideDown 0.15s ease;
}

.search-suggestions.show {
    display: block;
}

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

.suggestion-item {
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: background 0.2s;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background: rgba(74, 144, 217, 0.1);
}

.suggestion-item.active {
    background: rgba(74, 144, 217, 0.15);
}

.suggestion-icon {
    color: #999;
    font-size: 14px;
}

.suggestion-text {
    flex: 1;
    font-size: 14px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.suggestion-highlight {
    color: #4a90d9;
    font-weight: 600;
}

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

.search-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: #4a90d9;
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    transition: background-color 0.2s, transform 0.15s;
}

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

/* 分类导航 */
.category-section {
    width: 100%;
    max-width: 900px;
    margin-bottom: 30px;
}

.category-list {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.category-item {
    padding: 10px 24px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
    cursor: pointer;
    border-radius: 20px;
    transition: all 0.3s;
    position: relative;
}

.category-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.category-item.active {
    color: #fff;
    font-weight: 500;
}

.category-item.active::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: #fff;
    border-radius: 1px;
}

/* 网址网格 */
.links-section {
    width: 100%;
    max-width: 1100px;
    flex: 1;
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
}

.link-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 12px 15px;
    background: transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    border: 1px solid transparent;
    gap: 12px;
}

.link-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.link-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    overflow: hidden;
    flex-shrink: 0;
}

.link-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.link-name {
    color: #fff;
    font-size: 14px;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* 编辑按钮 */
.edit-section {
    margin-top: 15px;
}

.edit-btn {
    padding: 6px 18px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    border-radius: 25px;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.2s, transform 0.15s;
    line-height: 1.4;
    display: inline-flex;
    align-items: center;
}

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

.login-btn-header {
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    border-radius: 25px;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.2s, transform 0.15s;
    margin-right: 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    line-height: 1.4;
}

.login-btn-header i {
    font-size: 14px;
}

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

/* 同步按钮 */
.sync-btn {
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    border-radius: 25px;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.2s, transform 0.15s;
    margin-right: 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    line-height: 1.4;
}

.sync-btn i {
    font-size: 14px;
}

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

.sync-btn.syncing i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 退出按钮 */
.logout-btn {
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    border-radius: 25px;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.2s, transform 0.15s;
    margin-right: 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    line-height: 1.4;
}

.logout-btn i {
    font-size: 14px;
}

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

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.modal.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: #fff;
    border-radius: 16px;
    width: 90%;
    max-width: 450px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: translateY(-20px);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal.show .modal-content {
    transform: translateY(0);
}

.edit-modal-content {
    max-width: 600px;
}

@media (max-width: 768px) {
    .modal-content {
        transform: translateY(100%);
    }
    .modal.show .modal-content {
        transform: translateY(0);
    }
}

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

.modal-header h3 {
    font-size: 16px;
    color: #333;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    transition: color 0.3s;
}

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

.modal-body {
    padding: 25px;
}

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

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

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

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #4a90d9;
}

.login-btn,
.save-btn {
    width: 100%;
    padding: 14px;
    background: #4a90d9;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.login-btn:hover,
.save-btn:hover {
    background: #3a7bc8;
}

/* 编辑标签页 */
.edit-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.edit-tab {
    flex: 1;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    color: #666;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.edit-tab:hover {
    color: #4a90d9;
}

.edit-tab.active {
    color: #4a90d9;
    border-bottom-color: #4a90d9;
}

.edit-panel.hidden {
    display: none;
}

/* 管理列表 */
.manage-list {
    max-height: 400px;
    overflow-y: auto;
}

.manage-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.3s;
}

.manage-item:hover {
    background: #f9f9f9;
}

.manage-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    margin-right: 12px;
    overflow: hidden;
    flex-shrink: 0;
}

.manage-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.manage-info {
    flex: 1;
    min-width: 0;
}

.manage-name {
    font-size: 14px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.manage-url {
    font-size: 12px;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.manage-actions {
    display: flex;
    gap: 8px;
}

.manage-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.15s;
}

.manage-btn.edit {
    background: #e3f2fd;
    color: #1976d2;
}

.manage-btn.delete {
    background: #ffebee;
    color: #d32f2f;
}

.manage-btn:hover {
    opacity: 0.8;
}

/* 响应式 */
@media (max-width: 1024px) {
    .links-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .time {
        font-size: 60px;
    }
    
    .links-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .category-list {
        gap: 5px;
    }
    
    .category-item {
        padding: 8px 16px;
        font-size: 14px;
    }
    
    .link-item {
        padding: 10px 12px;
    }

    /* 手机版编辑模态框占满屏幕 */
    .edit-modal-content,
    .link-edit-content,
    .settings-modal-content {
        width: 100%;
        max-width: 100%;
        max-height: 92vh;
        border-radius: 20px 20px 0 0;
        position: fixed;
        bottom: 0;
        left: 0;
        margin: 0;
    }

    /* 手机版 modal 从底部弹出 */
    .modal {
        align-items: flex-end;
    }

    .modal-content {
        width: 100%;
        max-width: 100%;
        max-height: 92vh;
        border-radius: 20px 20px 0 0;
    }

    /* 手机版 modal body 可滚动 */
    .modal-body {
        padding: 16px;
        overflow-y: auto;
        max-height: calc(92vh - 65px);
    }

    /* 手机版管理列表高度放宽 */
    .manage-list {
        max-height: none;
    }

    /* 手机版管理条目：纵向排列按钮 */
    .manage-item {
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px;
        align-items: flex-start;
    }

    .manage-drag-handle {
        display: none; /* 手机上不显示拖拽把手 */
    }

    .manage-info {
        flex: 1 1 calc(100% - 56px); /* 图标宽度后剩余 */
        min-width: 0;
    }

    /* 把排序按钮和操作按钮合并到一行 */
    .manage-order-buttons,
    .manage-actions {
        flex: 1 1 auto;
    }

    .manage-order-buttons {
        order: 3;
    }

    .manage-actions {
        order: 4;
    }

    /* 手机版置顶按钮文字精简 */
    .order-btn.pin-btn::before {
        content: '⬆';
    }

    /* 管理区筛选栏手机版 */
    .manage-category-filter {
        flex-wrap: wrap;
        gap: 8px;
    }

    .manage-category-filter select {
        flex: 1;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 24px 12px;
    }

    .time {
        font-size: 48px;
    }
    
    .links-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .link-item {
        padding: 10px 12px;
    }
    
    .link-icon {
        width: 28px;
        height: 28px;
    }
    
    .link-name {
        font-size: 13px;
    }

    /* 手机版编辑模态框 */
    .modal-header {
        padding: 14px 16px;
    }

    .modal-header h3 {
        font-size: 16px;
    }

    /* 管理条目更紧凑：信息 + 按钮两行 */
    .manage-item {
        padding: 8px 10px;
    }

    .manage-icon {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    .manage-name {
        font-size: 13px;
    }

    .manage-url {
        font-size: 11px;
    }

    /* 手机版置顶按钮缩小 */
    .order-btn {
        padding: 4px 5px;
        font-size: 10px;
    }

    .order-btn.pin-btn {
        padding: 3px 5px;
    }

    /* 手机版操作按钮缩小 */
    .manage-btn {
        padding: 4px 7px;
        font-size: 10px;
    }

    /* 手机版图标缩小 */
    .manage-icon {
        width: 28px;
        height: 28px;
        font-size: 11px;
    }

    /* 手机版信息区缩小 */
    .manage-name {
        font-size: 12px;
    }

    .manage-url {
        font-size: 10px;
    }

    /* 手机版管理条目更紧凑 */
    .manage-item {
        padding: 6px 8px;
        gap: 8px;
    }

    .manage-info {
        min-width: 0;
        flex: 1 1 auto;
    }

    /* 预设背景3列 */
    .preset-bg-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .settings-btn {
        bottom: 20px;
        right: 20px;
        width: 44px;
        height: 44px;
        font-size: 18px;
    }
}

/* 空状态 */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.7);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 14px;
}

/* 提示消息 */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    will-change: opacity, transform;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ============ 新增：管理网址增强功能 ============ */

/* 管理区域分类筛选 */
.manage-category-filter {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.manage-category-filter label {
    font-size: 14px;
    color: #555;
}

.manage-category-filter select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
}

/* 增强的管理项 */
.manage-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.3s;
    gap: 12px;
}

.manage-item:hover {
    background: #f9f9f9;
}

.manage-item.dragging {
    opacity: 0.7;
    background: #f0f7ff;
}

/* 拖拽把手 */
.manage-drag-handle {
    color: #ccc;
    cursor: grab;
    font-size: 16px;
    transition: color 0.3s;
}

.manage-drag-handle:hover {
    color: #999;
}

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

/* 图标显示 */
.manage-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #fff;
}

.manage-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 信息区域 */
.manage-info {
    flex: 1;
    min-width: 0;
}

.manage-name {
    font-size: 14px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.manage-url {
    font-size: 12px;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

/* 排序操作按钮 */
.manage-order-buttons {
    display: flex;
    gap: 4px;
}

.order-btn {
    padding: 6px 8px;
    border: none;
    background: #f0f0f0;
    color: #666;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.order-btn:hover:not(:disabled) {
    background: #ddd;
    color: #333;
}

.order-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.order-btn.pin-btn {
    background: #fff3e0;
    color: #e65100;
    font-weight: 600;
}

.order-btn.pin-btn:hover:not(:disabled) {
    background: #ffe0b2;
}

/* 操作按钮 */
.manage-actions {
    display: flex;
    gap: 8px;
}

.manage-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.manage-btn.edit {
    background: #e3f2fd;
    color: #1976d2;
}

.manage-btn.delete {
    background: #ffebee;
    color: #d32f2f;
}

.manage-btn:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

/* 编辑网址详情模态框 */
.link-edit-content {
    max-width: 500px;
}

.modal-body.overflow-auto {
    max-height: calc(80vh - 80px);
    overflow-y: auto;
}

/* link-edit-content 的 modal-body 默认可滚动 */
.link-edit-content .modal-body {
    overflow-y: auto;
    max-height: calc(80vh - 65px);
}

/* 预览区域 */
.link-edit-preview {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 12px;
}

.link-edit-icon-preview {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #fff;
    flex-shrink: 0;
    background: #4a90d9;
    overflow: hidden;
}

.link-edit-icon-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.link-edit-name-preview {
    font-size: 16px;
    color: #333;
    font-weight: 500;
    flex: 1;
}

/* 编辑操作按钮区 */
.link-edit-actions {
    display: flex;
    gap: 12px;
    margin-top: 25px;
}

.link-edit-actions .save-btn {
    flex: 1;
}

.cancel-btn {
    flex: 1;
    padding: 14px;
    background: #f0f0f0;
    color: #666;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.cancel-btn:hover {
    background: #e0e0e0;
}

/* ============ 设置模态框 ============ */
.settings-modal-content {
    max-width: 550px;
    max-height: 85vh;
}

.settings-modal-content .modal-body {
    max-height: calc(85vh - 60px);
    overflow-y: auto;
}

.settings-section {
    margin-bottom: 20px;
}

.settings-group {
    margin-bottom: 14px;
}

.settings-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: #555;
}

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

.settings-group input:focus {
    outline: none;
    border-color: #4a90d9;
}

/* 背景预览 */
.settings-preview {
    margin-bottom: 14px;
}

.preview-label {
    font-size: 13px;
    color: #555;
    margin-bottom: 6px;
}

.bg-preview {
    width: 100%;
    height: 100px;
    border-radius: 10px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 2px solid #eee;
    transition: background-image 0.3s;
}

/* 预设背景 */
.preset-bg-section {
    margin-bottom: 14px;
}

.preset-label {
    font-size: 13px;
    color: #555;
    margin-bottom: 8px;
}

.preset-bg-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.preset-bg-item {
    aspect-ratio: 16/9;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    cursor: pointer;
    border: 3px solid transparent;
    transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
    position: relative;
    overflow: hidden;
}

.preset-bg-item:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.preset-bg-item.active {
    border-color: #4a90d9;
}

.preset-bg-item.active::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #4a90d9;
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

/* 设置按钮 */
.settings-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

.settings-actions .save-btn {
    flex: 1;
    padding: 10px;
    font-size: 14px;
}

.reset-btn {
    flex: 1;
    padding: 10px;
    background: #f0f0f0;
    color: #666;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s;
}

.reset-btn:hover {
    background: #e0e0e0;
}

/* 数据导入导出 */
.data-import-export {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.import-area,
.export-area {
    flex: 1;
    text-align: center;
}

.import-hint,
.export-hint {
    font-size: 12px;
    color: #999;
    margin-top: 8px;
    line-height: 1.4;
}

.import-btn,
.export-btn {
    width: 100%;
    padding: 14px;
    background: #4a90d9;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.import-btn:hover,
.export-btn:hover {
    background: #3a7bc8;
}

.import-btn {
    background: #5cb85c;
}

.import-btn:hover {
    background: #4cae4c;
}

.export-btn {
    background: #f0ad4e;
}

.export-btn:hover {
    background: #ec971f;
}

/* 历史恢复 */
.history-section {
    margin-top: 10px;
}

.history-reset-section {
    text-align: center;
    padding: 16px;
    background: linear-gradient(135deg, #fff5f5, #fff0f0);
    border-radius: 12px;
    margin-bottom: 12px;
    border: 1px dashed #ffcdd2;
}

.history-reset-btn {
    padding: 12px 32px;
    background: linear-gradient(135deg, #ff5252, #f44336);
    color: #fff;
    border: none;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(244, 67, 54, 0.35);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.history-reset-btn i {
    font-size: 16px;
}

.history-reset-btn:hover {
    background: linear-gradient(135deg, #ff1744, #d50000);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 20px rgba(244, 67, 54, 0.45);
}

.history-reset-btn:active {
    transform: translateY(0) scale(0.98);
}

.history-reset-hint {
    font-size: 12px;
    color: #999;
    margin-top: 10px;
}

.history-clear-btn {
    padding: 12px 28px;
    background: linear-gradient(135deg, #ff9800, #f57c00);
    color: #fff;
    border: none;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.35);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 12px;
}

.history-clear-btn i {
    font-size: 16px;
}

.history-clear-btn:hover {
    background: linear-gradient(135deg, #ff6d00, #e65100);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 20px rgba(255, 152, 0, 0.45);
}

.history-clear-btn:active {
    transform: translateY(0) scale(0.98);
}

.history-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, #ddd, transparent);
    margin: 14px 0;
}

.history-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.history-tab {
    padding: 8px 16px;
    background: #f0f0f0;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.history-tab:hover {
    background: #e0e0e0;
}

.history-tab.active {
    background: #4a90d9;
    color: #fff;
}

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

.history-empty {
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 13px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    border-radius: 10px;
    margin-bottom: 10px;
    border: 1px solid #eee;
    transition: all 0.2s ease;
}

.history-item:hover {
    border-color: #4a90d9;
    box-shadow: 0 2px 8px rgba(74, 144, 217, 0.1);
}

.history-info {
    flex: 1;
}

.history-time {
    font-size: 13px;
    color: #333;
}

.history-count {
    font-size: 12px;
    color: #888;
    margin-top: 2px;
}

.history-restore-btn {
    padding: 8px 16px;
    background: linear-gradient(135deg, #4a90d9, #357abd);
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(74, 144, 217, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.history-restore-btn i {
    font-size: 12px;
}

.history-restore-btn:hover {
    background: linear-gradient(135deg, #357abd, #2d6aa3);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 144, 217, 0.4);
}

.history-restore-btn:active {
    transform: translateY(0);
}

/* 设置导航按钮 */
.settings-nav {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.settings-nav-btn {
    flex: 1;
    padding: 8px 10px;
    background: #f5f5f5;
    border: 2px solid transparent;
    border-radius: 8px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.settings-nav-btn i {
    font-size: 14px;
    color: #999;
}

.settings-nav-btn:hover {
    background: #eee;
    border-color: #ddd;
}

.settings-nav-btn.active {
    background: #e8f4fd;
    border-color: #4a90d9;
    color: #4a90d9;
}

.settings-nav-btn.active i {
    color: #4a90d9;
}

/* 设置面板 */
.settings-panel {
    padding-top: 5px;
}

/* 设置按钮 */
.settings-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.3s;
    z-index: 100;
}

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

@media (max-width: 480px) {
    .preset-bg-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .settings-btn {
        bottom: 20px;
        right: 20px;
        width: 44px;
        height: 44px;
        font-size: 18px;
    }
}
