/* --- header.css --- */
/* 头部和搜索相关样式 */

.header {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-color-dark);
    padding: var(--spacing-md) var(--spacing-xl);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    position: relative;
    padding-bottom: calc(var(--spacing-md) + 20px);
}

/* Logo容器样式 */
.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 25%;
}

.header-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.logo-container:hover .header-logo {
    transform: rotate(10deg);
}

.header h1 {
    font-size: 1.7rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    position: relative;
    padding: 0.4rem 1rem;
    color: var(--primary-color-dark);
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.5);
    display: inline-block;
    transition: all 0.3s ease;
}

.header h1::before {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, 
        rgba(246, 138, 78, 0) 0%,
        rgba(246, 138, 78, 0.7) 50%,
        rgba(246, 138, 78, 0) 100%);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.5s ease;
}

.header h1:hover {
    transform: translateY(-1px);
    text-shadow: 2px 2px 4px rgba(246, 138, 78, 0.2);
}

.header h1:hover::before {
    transform: scaleX(1);
    transform-origin: left;
}

/* 搜索区域样式 */
.search-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 85%;
    justify-content: center;
}

.search-input-row {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: 70%;
    justify-content: center;
}

.search-box {
    padding: 0.7rem 1.1rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.3);
    background-color: rgba(255, 255, 255, 0.2);
    color: var(--text-color-dark);
    width: 320px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    position: relative;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding-left: 2.8rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='rgba(70, 70, 70, 0.7)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 1rem center;
    background-size: 1.2rem;
}

.search-box::placeholder {
    color: rgba(70, 70, 70, 0.6);
    transition: all 0.3s ease;
}

.search-box:focus {
    outline: none;
    background-color: rgba(255, 255, 255, 0.25);
    border-color: rgba(246, 138, 78, 0.4);
    box-shadow: 0 0 0 3px rgba(246, 138, 78, 0.1),
                0 3px 12px rgba(0, 0, 0, 0.08);
    width: 340px;
}

.search-button {
    padding: 0.7rem 1.4rem;
    border: none;
    border-radius: var(--radius-md);
    background: rgba(246, 138, 78, 0.7);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    color: white;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: 0.5s;
}

.search-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(246, 138, 78, 0.2);
}

.search-button:hover::before {
    left: 100%;
}

.search-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(246, 138, 78, 0.15);
}

.search-button::after {
    content: '';
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    transition: transform 0.3s ease;
}

.search-button:hover::after {
    transform: scale(1.05);
}

/* 响应式设计 - 小屏幕设备 */
@media (max-width: 768px) {
    .header {
        padding: var(--spacing-sm);
        flex-direction: column;
        gap: var(--spacing-sm);
        text-align: center;
        padding-bottom: calc(var(--spacing-sm) + 20px);
    }
    
    .logo-container {
        flex-direction: column;
        justify-content: center;
        margin-bottom: 5px;
        width: 100%;
    }
    
    .header-logo {
        width: 32px;
        height: 32px;
        margin-bottom: 5px;
    }
    
    .search-container {
        position: static;
        transform: none;
        width: 100%;
        margin: 10px 0;
    }
    
    .search-input-row {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }
    
    .search-button {
        width: 100%;
        justify-content: center;
    }
    
    .header h1 {
        font-size: 1.5rem;
        padding: 0.3rem 0.8rem;
    }
    
    .search-box {
        width: 100%;
        max-width: 400px;
        margin: 0.5rem 0;
    }
    
    .search-box:focus {
        width: 100%;
    }
    
    .renjian-quote {
        width: 100%;
        max-width: none;
        margin: 0;
        bottom: 0;
        font-size: 0.75rem;
        padding: 0 15px;
        background-color: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        box-shadow: none;
    }
    
    .edit-mode-toggle {
        position: absolute;
        right: 10px;
        bottom: 10px;
        font-size: 0.8rem;
        padding: 4px 8px;
    }
}

/* 编辑模式切换开关 */
.edit-mode-toggle {
    position: absolute;
    right: 20px;
    bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-color-dark);
    background-color: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 6px 12px;
    border-radius: 20px;
    z-index: 11;
    opacity: 0; /* 默认隐藏 */
    transition: opacity 0.3s ease;
    pointer-events: none; /* 默认不捕获鼠标事件 */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* 透明热区 */
.edit-mode-toggle-area {
    position: absolute;
    right: 10px;
    bottom: 0;
    width: 120px;
    height: 40px;
    z-index: 10;
    cursor: pointer;
}

/* 当鼠标悬浮在热区上时显示编辑按钮 */
.edit-mode-toggle-area:hover + .edit-mode-toggle,
.edit-mode-toggle:hover {
    opacity: 1;
    pointer-events: auto; /* 显示时允许捕获鼠标事件 */
}

.toggle-label {
    font-weight: 500;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

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

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

input:checked + .toggle-slider {
    background-color: var(--primary-color);
}

input:focus + .toggle-slider {
    box-shadow: 0 0 1px var(--primary-color);
}

input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

/* 数据传输按钮容器 */
.buttons-container {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    gap: 15px;
    position: absolute;
    right: 20px;
    bottom: 50px;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    z-index: 11;
}

.buttons-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 透明热区 - 用于触发显示按钮组 */
.buttons-container-area {
    position: absolute;
    right: 0;
    top: 0;
    width: 40px;
    height: 100%;
    z-index: 1;
}

/* 移除非编辑模式下的悬浮显示 */
.buttons-container-area:hover ~ .buttons-container {
    display: none;
}

/* 在编辑模式下始终显示按钮 */
body.edit-mode .buttons-container {
    display: flex;
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

/* 移除按钮的悬浮效果 */
.export-btn:hover,
.import-btn:hover,
.chrome-import-btn:hover,
.upload-bg-btn:hover,
.clear-cache-btn:hover {
    transform: none;
    box-shadow: none;
}

.export-btn:hover::before,
.import-btn:hover::before,
.chrome-import-btn:hover::before,
.upload-bg-btn:hover::before,
.clear-cache-btn:hover::before {
    left: -100%;
}

/* 导出按钮样式 */
.export-btn {
    background: transparent;
    position: relative;
    padding: 5px 15px;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid var(--secondary-color);
    border-radius: 25px;
    outline: none;
    overflow: hidden;
    color: var(--secondary-color);
    transition: color 0.3s 0.1s ease-out;
    text-align: center;
    z-index: 1;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.export-btn span {
    margin: 5px;
}

.export-btn::before {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: auto;
    content: '';
    border-radius: 50%;
    display: block;
    width: 20em;
    height: 20em;
    left: -5em;
    text-align: center;
    transition: box-shadow 0.5s ease-out;
    z-index: -1;
}

.export-btn:hover {
    color: #fff;
    border: 1px solid var(--secondary-color);
}

.export-btn:hover::before {
    box-shadow: inset 0 0 0 10em var(--secondary-color);
}

/* 导入按钮样式 */
.import-btn {
    background: transparent;
    position: relative;
    padding: 5px 15px;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid #4e9af6;
    border-radius: 25px;
    outline: none;
    overflow: hidden;
    color: #4e9af6;
    transition: color 0.3s 0.1s ease-out;
    text-align: center;
    z-index: 1;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.import-btn span {
    margin: 5px;
}

.import-btn::before {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: auto;
    content: '';
    border-radius: 50%;
    display: block;
    width: 20em;
    height: 20em;
    left: -5em;
    text-align: center;
    transition: box-shadow 0.5s ease-out;
    z-index: -1;
}

.import-btn:hover {
    color: #fff;
    border: 1px solid #4e9af6;
}

.import-btn:hover::before {
    box-shadow: inset 0 0 0 10em #4e9af6;
}

/* Chrome收藏夹导入按钮样式 */
.chrome-import-btn {
    background: transparent;
    position: relative;
    padding: 5px 15px;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid #66bb6a;
    border-radius: 25px;
    outline: none;
    overflow: hidden;
    color: #66bb6a;
    transition: color 0.3s 0.1s ease-out;
    text-align: center;
    z-index: 1;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.chrome-import-btn span {
    margin: 5px;
}

.chrome-import-btn::before {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: auto;
    content: '';
    border-radius: 50%;
    display: block;
    width: 20em;
    height: 20em;
    left: -5em;
    text-align: center;
    transition: box-shadow 0.5s ease-out;
    z-index: -1;
}

.chrome-import-btn:hover {
    color: #fff;
    border: 1px solid #66bb6a;
}

.chrome-import-btn:hover::before {
    box-shadow: inset 0 0 0 10em #66bb6a;
}

/* 上传背景按钮样式 */
.upload-bg-btn {
    background: transparent;
    position: relative;
    padding: 5px 15px;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid #9c27b0;
    border-radius: 25px;
    outline: none;
    overflow: hidden;
    color: #9c27b0;
    transition: color 0.3s 0.1s ease-out;
    text-align: center;
    z-index: 1;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.upload-bg-btn span {
    margin: 5px;
}

.upload-bg-btn::before {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: auto;
    content: '';
    border-radius: 50%;
    display: block;
    width: 20em;
    height: 20em;
    left: -5em;
    text-align: center;
    transition: box-shadow 0.5s ease-out;
    z-index: -1;
}

.upload-bg-btn:hover {
    color: #fff;
    border: 1px solid #9c27b0;
}

.upload-bg-btn:hover::before {
    box-shadow: inset 0 0 0 10em #9c27b0;
}

/* 隐藏图标 */
.export-icon,
.import-icon {
    display: none;
}

/* 隐藏旧的导出容器样式 */
.export-container {
    display: none;
}

/* 通知样式 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 0.95rem;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    transform: translateY(-20px);
    opacity: 0;
    transition: all 0.3s ease;
}

.notification.show {
    transform: translateY(0);
    opacity: 1;
}

.notification.success {
    background-color: #28a745;
}

.notification.error {
    background-color: #dc3545;
}

.notification.info {
    background-color: #17a2b8;
}

/* 标题容器样式 */
.title-container {
    position: relative;
    display: inline-block;
}

/* 标题编辑按钮样式 */
.edit-title-btn {
    position: absolute;
    right: -25px;
    bottom: 5px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.8);
    color: var(--primary-color);
    border: none;
    display: none; /* 默认隐藏 */
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    opacity: 0.7;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.edit-title-btn:hover {
    background-color: var(--primary-color);
    color: white;
    transform: scale(1.1);
    opacity: 1;
}

/* 编辑模式下显示编辑按钮 */
body.edit-mode .edit-title-btn {
    display: flex;
}

/* 标题编辑模态框样式 */
#edit-title-modal .modal-container {
    max-width: 400px;
}

/* 清除缓存按钮样式 */
.clear-cache-btn {
    background: transparent;
    position: relative;
    padding: 5px 15px;
    display: none; /* 默认隐藏 */
    align-items: center;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid #4e9af6;
    border-radius: 25px;
    outline: none;
    overflow: hidden;
    color: #4e9af6;
    transition: color 0.3s 0.1s ease-out;
    text-align: center;
    z-index: 1;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* 只在编辑模式下显示清除缓存按钮 */
body.edit-mode .clear-cache-btn {
    display: flex;
}

.clear-cache-btn span {
    margin: 5px;
}

.clear-cache-btn::before {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: auto;
    content: '';
    border-radius: 50%;
    display: block;
    width: 20em;
    height: 20em;
    left: -5em;
    text-align: center;
    transition: box-shadow 0.5s ease-out;
    z-index: -1;
}

.clear-cache-btn:hover {
    color: #fff;
    border: 1px solid #4e9af6;
}

.clear-cache-btn:hover::before {
    box-shadow: inset 0 0 0 10em #4e9af6;
}

/* 人间名言样式 */
.renjian-quote {
    width: 100%;
    max-width: none;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-color-dark);
    margin: 0;
    padding: 0 25px;
    border-radius: 0;
    background-color: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    transition: all 0.3s ease;
    font-style: italic;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
}

.renjian-quote:hover {
    transform: translateY(-1px);
} 