/*
=====================
项目名称：123极简导航
版本号：v2.3
发布时间：2026-03-28 08:30
文件名：style.css
描述：样式修复版，CSS变量设计令牌
=====================
*/

/* style.css - v2.3 修复版 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/*
=============================================
文件结束：style.css
=============================================
*/

/* ==================== CSS变量设计令牌 ==================== */
:root {
    /* 主色调 */
    --primary: #0066cc;
    --primary-hover: #0052a3;
    --primary-light: rgba(0, 102, 204, 0.06);
    --primary-alpha: rgba(0, 102, 204, 0.1);
    
    /* 功能色 */
    --danger: #c00;
    --danger-hover: #a00;
    --danger-light: rgba(204, 0, 0, 0.1);
    --warning: #ffd700;
    --success: #52c41a;
    
    /* 背景色 */
    --bg-body: #e8e8e8;
    --bg-card: #fff;
    --bg-hover: rgba(0, 102, 204, 0.06);
    --bg-mask: rgba(0, 0, 0, 0.5);
    
    /* 文字色 */
    --text-primary: #333;
    --text-secondary: #999;
    --text-link: #0066cc;
    --text-white: #fff;
    
    /* 边框色 */
    --border-light: #f0f0f0;
    --border-medium: #ddd;
    --border-dark: #ccc;
    
    /* 圆角 */
    --radius-sm: 3px;
    --radius-md: 4px;
    --radius-lg: 6px;
    --radius-xl: 8px;
    --radius-full: 23px;
    
    /* 阴影 */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.15);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.2);
}

/* ==================== 核心布局修复 ==================== */
html {
    scrollbar-gutter: stable;
    overflow-x: hidden;
    overflow-y: scroll;
}

body {
    background-color: var(--bg-body);
    min-height: 100vh;
    padding: 16px 0 0;
    color: var(--text-primary);
    overflow-x: hidden;
    width: 100%;
    min-width: 0;
}

/* ==================== 用户头部与下拉菜单 ==================== */
.user-header {
    position: absolute;
    top: 13px;
    right: 22px;
    font-size: 14px;
    color: var(--text-secondary);
    z-index: 100;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    min-width: 180px;
    overflow: hidden;
    z-index: 102;
    display: none;
}

.dropdown-section {
    padding: 4px 0;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-light);
    margin: 4px 12px;
}

.dropdown-item {
    padding: 10px 16px;
    cursor: pointer;
    color: var(--text-primary);
    transition: all 0.2s;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.dropdown-item:hover {
    background: #f5f5f5;
    color: var(--primary);
}

.dropdown-item.danger {
    color: var(--danger);
}

.dropdown-item.danger:hover {
    background: var(--danger-light);
    color: var(--danger);
}

.login-btn {
    color: var(--text-link);
    cursor: pointer;
    padding: 5px 10px;
    border-radius: var(--radius-md);
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.login-btn:hover {
    background: var(--primary-alpha);
    text-decoration: underline;
}

.user-header .setting-icon {
    cursor: pointer;
    font-size: 18px;
    padding: 0;
    display: block;
}

/* ==================== 主卡片 ==================== */
.main-card {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 43px 65px 49px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow-x: hidden;
    box-sizing: border-box;
    min-width: 0;
    contain: layout paint;
    margin-left: auto;
    margin-right: auto;
}

.main-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(
        circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(255, 255, 255, 0.4) 0%,
        transparent 50%
    );
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
    border-radius: var(--radius-lg);
}

.main-card:hover::before {
    opacity: 1;
}

/* ==================== 时间区域 ==================== */
.time-area {
    text-align: center;
    margin-bottom: 32px;
}

.time-area .date {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0 auto 5px;
    cursor: pointer;
    transition: color 0.2s;
    display: inline-block;
    width: auto;
    padding: 2px 6px;
    border-bottom: 1px dotted transparent;
}

.time-area .date:hover {
    color: var(--primary);
}

.time-area .time {
    font-size: 52px;
    font-weight: 300;
    color: var(--text-primary);
    line-height: 1.2;
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 2px;
}

.time-area .time-main {
    font-size: 60px;
    font-weight: 300;
    color: var(--text-primary);
    letter-spacing: -2px;
}

.time-area .time-sec {
    font-size: 22px;
    font-weight: 300;
    color: var(--text-secondary);
    margin-left: 5px;
}

/* ==================== 搜索区域 ==================== */
.search-area {
    display: flex;
    justify-content: center;
    margin-bottom: 0;
    position: relative;
    z-index: 10;
}

.search-area input {
    width: 518px;
    height: 45px;
    padding: 0 22px;
    border: 1px solid var(--border-medium);
    border-right: none;
    border-radius: var(--radius-full) 0 0 var(--radius-full);
    font-size: 15px;
    outline: none;
    background: #fafafa;
    transition: all 0.2s;
}

.search-area input:focus {
    border-color: var(--primary);
    background: var(--bg-card);
}

.search-area button {
    height: 45px;
    padding: 0 30px;
    background: var(--primary);
    color: var(--text-white);
    border: none;
    border-radius: 0 var(--radius-full) var(--radius-full) 0;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s;
}

.search-area button:hover {
    background: var(--primary-hover);
}

/* 搜索下拉菜单 - 宽度与输入框一致（不包括按钮），微调位置 */
.search-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    left: calc(50% - 40px); /* 整体向左偏移40px */
    transform: translateX(-50%);
    width: 503px; /* 原518px - 40px + 25px = 503px */
    max-width: calc(100% - 200px); /* 移动端限制 */
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    z-index: 20;
    overflow: hidden;
    display: none;
}

.search-dropdown-header {
    padding: 8px 16px;
    font-size: 12px;
    color: var(--text-secondary);
    background: #fafafa;
    border-bottom: 1px solid var(--border-light);
    font-weight: 500;
}

.search-dropdown-item {
    padding: 10px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-primary);
    transition: background 0.2s;
    position: relative;
}

.search-dropdown-item:hover {
    background: var(--bg-hover);
}

.search-dropdown-item .search-text {
    flex: 1;
}

.search-dropdown-item .search-delete {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #ccc;
    font-size: 16px;
    line-height: 1;
    transition: all 0.2s;
    opacity: 0;
}

.search-dropdown-item:hover .search-delete {
    opacity: 1;
}

.search-dropdown-item .search-delete:hover {
    background: var(--danger-light);
    color: var(--danger);
}

.search-dropdown-footer {
    padding: 10px 16px;
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    border-top: 1px solid var(--border-light);
    transition: all 0.2s;
}

.search-dropdown-footer:hover {
    color: var(--danger);
    background: var(--danger-light);
}

/* ==================== 导航头部 ==================== */
.nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 13px;
    border-bottom: 1px dotted var(--border-dark);
    min-height: 40px;
    position: relative;
    margin-top: 38px;
}

.nav-title-normal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.edit-mode .nav-title-normal {
    display: none;
}

.nav-title {
    font-size: 13px;
    color: var(--text-primary);
}

.nav-title b {
    font-weight: bold;
    color: #000;
}

.nav-meta {
    display: flex;
    align-items: center;
    gap: 13px;
    font-size: 12px;
    color: var(--text-secondary);
}

.nav-meta span {
    position: relative;
}

.nav-meta span:not(:last-child)::after {
    content: "|";
    margin-left: 13px;
    color: var(--border-medium);
}

.nav-meta .custom-btn {
    color: var(--text-link);
    cursor: pointer;
    font-size: 12px;
    user-select: none;
}

.nav-meta .custom-btn:hover {
    text-decoration: underline;
}

.edit-mode .custom-btn {
    display: none;
}

/* 编辑模式黄色条 */
.edit-bar-content {
    display: none;
    width: 100%;
    justify-content: space-between;
    align-items: center;
    background: var(--warning);
    padding: 6px 14px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0,0,0,0.08);
    box-sizing: border-box;
}

.edit-mode .edit-bar-content {
    display: flex;
}

.edit-nav-name {
    font-weight: bold;
    color: var(--text-primary);
    font-size: 14px;
    text-shadow: 0 1px 0 rgba(255,255,255,0.4);
}

.edit-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.edit-btn {
    cursor: pointer;
    color: var(--text-primary);
    font-size: 12px;
    padding: 5px 14px;
    border-radius: var(--radius-md);
    background: rgba(255,255,255,0.9);
    border: 1px solid rgba(0,0,0,0.15);
    transition: all 0.2s;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
    line-height: 1.4;
    user-select: none;
}

.edit-btn:hover {
    background: var(--bg-card);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0,0,0,0.15);
}

/* ==================== 导航列表 ==================== */
.nav-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.nav-category {
    display: flex;
    flex-direction: column;
    padding: 11px 16px;
    border-bottom: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    transition: background-color 0.2s;
}

.nav-category:last-child {
    border-bottom: none;
}

.nav-category:hover {
    background-color: var(--bg-hover);
}

.category-row {
    display: flex;
    align-items: flex-start;
    gap: 27px;
}

.category-name {
    width: 76px;
    flex-shrink: 0;
    font-size: 15px;
    color: #555;
    font-weight: 600;
    padding-top: 4px;
    cursor: pointer;
    transition: color 0.2s;
    user-select: none;
}

.category-name:hover {
    color: var(--primary);
}

.category-sites {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    row-gap: 6px;
    flex: 1;
    align-items: center;
}

.site-wrapper {
    display: inline-block;
    position: relative;
}

.site-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    color: #555;
    text-decoration: none;
    padding: 2px 5px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    position: relative;
    cursor: pointer;
}

.site-item:hover {
    color: var(--primary);
    background: var(--bg-hover);
}

.site-icon-wrapper {
    width: 17px;
    height: 17px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
}

.site-item .site-icon {
    width: 17px;
    height: 17px;
    border-radius: var(--radius-sm);
}

.site-item .site-letter {
    position: absolute;
    top: 0;
    left: 0;
    width: 17px;
    height: 17px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    color: var(--text-white);
    background: var(--primary);
    border-radius: var(--radius-sm);
}

.edit-mode .site-item {
    padding-left: 24px;
    user-select: none;
}

.edit-mode .site-item:hover {
    background: var(--primary-alpha);
}

.edit-mode .site-item.active {
    background: var(--warning);
}

.site-radio {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 15px;
    height: 15px;
    border: 1.5px solid #bbb;
    border-radius: 50%;
    cursor: pointer;
    background: var(--bg-card);
}

.site-radio.checked {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: inset 0 0 0 3px var(--bg-card);
}

.edit-mode .add-site-btn-inline {
    display: inline-flex;
    align-items: center;
    font-size: 14px;
    color: var(--primary);
    cursor: pointer;
    padding: 3px 5px;
    border-radius: var(--radius-sm);
    margin-left: 5px;
    user-select: none;
}

.edit-mode .add-site-btn-inline:hover {
    background: var(--primary-alpha);
}

/* ==================== 分类操作栏 ==================== */
.category-op-bar {
    background: var(--warning);
    display: none;
    justify-content: space-between;
    align-items: center;
    padding: 5px 11px;
    font-size: 13px;
    margin-bottom: 9px;
    border-radius: var(--radius-sm);
}

.category-op-bar.show {
    display: flex;
}

.category-op-left, .category-op-right {
    display: flex;
    gap: 13px;
}

.category-op-bar .op-btn {
    cursor: pointer;
    color: var(--text-link);
    padding: 3px 6px;
    user-select: none;
}

.category-op-bar .op-btn:hover {
    text-decoration: underline;
}

.category-op-bar .op-btn.danger {
    color: var(--danger);
}

/* ==================== 添加按钮 ==================== */
.add-btn {
    font-size: 14px;
    color: var(--text-link);
    cursor: pointer;
    margin-top: 16px;
    display: none;
    width: fit-content;
    padding: 5px 0;
    user-select: none;
}

.add-btn:hover {
    text-decoration: underline;
}

.edit-mode .add-btn {
    display: block;
}

/* ==================== 工具箱折叠 ==================== */
.fold-btn {
    margin: 27px 0 16px;
    text-align: center;
    font-size: 13px;
    color: #888;
    cursor: pointer;
    padding: 11px;
    background: #f0f7ff;
    border-radius: var(--radius-md);
    transition: all 0.2s;
    user-select: none;
}

.fold-btn:hover {
    color: var(--primary);
    background: #e0efff;
}

.fold-content {
    display: none;
    padding: 16px;
    background: #f5f5f5;
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-width: 0;
    contain: layout paint;
}

.fold-content.show {
    display: block;
    animation: slideDown 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideDown {
    from { 
        opacity: 0; 
        transform: translateY(-15px);
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
    }
    to { 
        opacity: 1; 
        transform: translateY(0);
        max-height: 500px;
        padding-top: 16px;
        padding-bottom: 16px;
    }
}

.fold-icon {
    display: inline-block;
    margin-right: 4px;
}

/* ==================== 工具箱Grid布局 ==================== */
.toolbox-horizontal {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    padding: 8px 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

.tool-item {
    position: relative;
    width: 100%;
    min-width: 0;
    height: 50px;
    background: var(--bg-card);
    border: 1px solid #e0e0e0;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 10px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
    box-sizing: border-box;
}

.tool-item:hover {
    border-color: var(--primary);
    background: #fafafa;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.tool-item.editing {
    border-color: var(--primary);
    background: #f0f7ff;
    box-shadow: 0 0 0 2px var(--primary-alpha);
}

.tool-item.dragging {
    opacity: 0.5;
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
    z-index: 1000;
}

/* 工具箱按钮 */
.tool-delete-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 22px;
    height: 22px;
    background: #ff4d4f;
    color: var(--text-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 2px 6px rgba(255, 77, 79, 0.4);
    border: 2px solid var(--bg-card);
    line-height: 1;
    padding: 0;
    text-align: center;
}

.tool-delete-btn:hover {
    background: #ff7875;
    transform: scale(1.15);
}

.tool-delete-btn::before {
    content: '×';
    display: block;
    line-height: 18px;
    height: 18px;
    width: 18px;
    text-align: center;
}

.tool-edit-btn {
    position: absolute;
    bottom: 2px;
    right: 2px;
    font-size: 10px;
    color: var(--primary);
    cursor: pointer;
    padding: 1px 5px;
    border-radius: var(--radius-sm);
    background: var(--primary-alpha);
    transition: all 0.2s;
    font-weight: 500;
    line-height: 1.2;
}

.tool-edit-btn:hover {
    background: var(--primary);
    color: var(--text-white);
}

.tool-item-main {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    width: 100%;
    height: 100%;
    overflow: hidden;
    min-width: 0;
}

.tool-icon-wrap {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: #f5f5f5;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.tool-item:hover .tool-icon-wrap {
    background: #e8f4ff;
}

.tool-icon-img {
    width: 20px;
    height: 20px;
    border-radius: var(--radius-sm);
    object-fit: contain;
}

.tool-icon-letter {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-white);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: var(--radius-md);
}

.tool-name {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.tool-item:hover .tool-name {
    color: var(--primary);
}

.tool-item-add {
    border: 2px dashed #d9d9d9;
    background: #fafafa;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.tool-item-add:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #f0f7ff;
}

.add-icon {
    font-size: 20px;
    font-weight: 300;
    line-height: 1;
}

/* ==================== 版权 ==================== */
.copyright {
    text-align: center;
    font-size: 12px;
    color: #aaa;
    line-height: 1.8;
    margin-top: 22px;
    padding-bottom: 22px;
}

/* ==================== 弹窗通用 ==================== */
.modal-mask {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-mask);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 999;
}

.modal-card {
    width: 100%;
    max-width: 518px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 27px;
    box-shadow: var(--shadow-lg);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
}

.modal-title {
    font-size: 15px;
    font-weight: bold;
    color: var(--text-primary);
}

.modal-close {
    font-size: 26px;
    cursor: pointer;
    color: var(--text-secondary);
    line-height: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.modal-close:hover {
    color: var(--danger);
    background: #f5f5f5;
}

/* ==================== 表单元素 ==================== */
.form-group {
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 11px;
}

.form-label {
    width: 86px;
    font-size: 14px;
    color: #555;
    text-align: right;
    flex-shrink: 0;
}

.form-label .required {
    color: var(--danger);
}

.form-input, .form-select, .form-textarea {
    flex: 1;
    height: 43px;
    padding: 0 13px;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    font-size: 14px;
    outline: none;
    background: #fafafa;
    transition: all 0.2s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--primary);
    background: var(--bg-card);
}

.form-textarea {
    height: 86px;
    padding: 11px 13px;
    resize: vertical;
    line-height: 1.5;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 97px;
    margin-bottom: 11px;
}

.checkbox-group input {
    width: 15px;
    height: 15px;
    cursor: pointer;
}

.checkbox-group label {
    font-size: 14px;
    color: #555;
    cursor: pointer;
}

.form-submit {
    text-align: center;
    margin-top: 27px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.form-submit button {
    padding: 11px 38px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--primary);
    color: var(--text-white);
    cursor: pointer;
    font-size: 15px;
    transition: background 0.2s;
}

.form-submit button:hover {
    background: var(--primary-hover);
}

.form-submit .btn-default {
    background: #f0f0f0;
    color: #555;
    border: 1px solid var(--border-medium);
    margin-left: 10px;
}

.form-submit .btn-default:hover {
    background: #e0e0e0;
}

/* 设置弹窗特殊样式 - 极简版 */
.setting-modal .form-group {
    flex-direction: row;
    align-items: center;
    gap: 11px;
}

.setting-modal .form-label {
    width: 140px;
    text-align: right;
    font-weight: normal;
    font-size: 14px;
}

.setting-modal .form-input,
.setting-modal .form-select {
    flex: 1;
    height: 43px;
    min-height: 43px;
    font-size: 14px;
}

/* 导入导出区域 - 居中优化 */
.import-export-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px dashed var(--border-light);
    text-align: center;
}

.import-export-section .btn-group {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 0;
}

.import-export-section .import-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 10px;
    line-height: 1.5;
    text-align: center;
}

/* 设置页面保存按钮居中（无取消按钮） */
.form-submit.setting-submit {
    margin-top: 28px;
    justify-content: center;
}

.btn {
    height: 43px;
    padding: 0 26px;
    border-radius: var(--radius-md);
    font-size: 15px;
    cursor: pointer;
    border: none;
    line-height: 43px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-default {
    background: #f0f0f0;
    color: #555;
    border: 1px solid var(--border-medium);
}

.btn-default:hover {
    background: #e0e0e0;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-primary {
    background: var(--primary);
    color: var(--text-white);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

/* ==================== 天气组件 ==================== */
.weather-widget {
    position: absolute;
    top: 43px;
    right: 65px;
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    padding: 5px 11px;
    border-radius: var(--radius-md);
    transition: background 0.2s;
    text-decoration: none;
}

.weather-widget:hover {
    background: rgba(0,0,0,0.03);
}

.weather-icon {
    font-size: 20px;
}

.weather-temp {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}

.weather-text {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ==================== 响应式适配 ==================== */
@media screen and (max-width: 820px) {
    html {
        scrollbar-gutter: auto;
        overflow-y: auto;
    }

    body {
        padding: 0;
    }

    .main-card {
        padding: 22px 16px 27px;
        border-radius: 0;
        max-width: 100%;
    }

    .category-name {
        width: 60px;
        font-size: 14px;
    }

    .site-item {
        font-size: 13px;
    }

    .time-area .time-main {
        font-size: 46px;
    }

    .time-area .time-sec {
        font-size: 18px;
    }

    .search-area input {
        width: 100%;
        max-width: 302px;
    }

    .search-area button {
        height: 42px;
    }
    
    /* 移动端搜索下拉适配 - 宽度与输入框一致，微调位置 */
    .search-dropdown {
        left: calc(50% - 20px); /* 整体向左偏移20px（移动端比例缩小） */
        transform: translateX(-50%);
        width: 100%;
        max-width: 282px; /* 原302px - 20px */
    }

    .user-header {
        position: relative;
        top: auto;
        right: auto;
        justify-content: flex-end;
        padding: 10px 16px;
        font-size: 13px;
    }

    .user-dropdown {
        right: 16px;
    }

    .setting-modal .form-group {
        flex-direction: column;
        align-items: flex-start;
    }

    .setting-modal .form-label {
        width: auto;
        text-align: left;
    }

    .setting-modal .form-input,
    .setting-modal .form-select {
        width: 100%;
        height: 40px;
    }

    .weather-widget {
        position: static;
        margin: 10px auto;
        justify-content: center;
    }

    .modal-card {
        max-width: calc(100% - 32px);
        width: calc(100% - 32px);
        padding: 20px;
        max-height: 80vh; /* 确保不超过屏幕高度 */
        overflow-y: auto;
    }
    
    /* 移动端弹框表单优化 */
    .modal-card .form-group {
        margin-bottom: 16px;
    }
    
    .modal-card .form-input,
    .modal-card .form-select,
    .modal-card .form-textarea {
        font-size: 16px; /* 防止iOS缩放 */
        padding: 12px;
    }
    
    .modal-card .form-submit {
        margin-top: 20px;
    }
    
    .modal-card button {
        padding: 12px 20px;
        font-size: 16px;
    }
    
    .edit-bar-content {
        padding: 8px 12px;
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    
    .edit-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .toolbox-horizontal {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .tool-item {
        height: 44px;
        padding: 0 8px;
    }
    
    .tool-delete-btn {
        width: 20px;
        height: 20px;
        font-size: 12px;
        top: -8px;
        right: -8px;
    }
    
    .tool-edit-btn {
        font-size: 9px;
        padding: 1px 4px;
    }
    
    .tool-icon-wrap {
        width: 24px;
        height: 24px;
    }
    
    .tool-icon-img {
        width: 16px;
        height: 16px;
    }
    
    .tool-name {
        font-size: 13px;
    }
    
    /* 移动端导入导出按钮保持居中 */
    .import-export-section .btn-group {
        flex-direction: row;
        align-items: center;
    }
}

@media screen and (max-width: 550px) {
    .time-area .time-main {
        font-size: 36px;
    }

    .search-area {
        padding: 0 16px;
    }

    .nav-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
        margin-top: 20px;
    }

    .nav-title-normal {
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }

    .category-row {
        flex-direction: column;
        gap: 10px;
    }

    .category-name {
        width: 100%;
        padding-top: 0;
    }
    
    .user-menu {
        padding: 5px;
    }

    .toolbox-horizontal {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .tool-delete-btn {
        width: 18px;
        height: 18px;
        font-size: 11px;
        top: -6px;
        right: -6px;
    }
}

/* ==================== 暗色模式支持 ==================== */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-body: #1a1a1a;
        --bg-card: #2d2d2d;
        --text-primary: #e0e0e0;
        --text-secondary: #888;
        --border-light: #444;
        --border-medium: #555;
        --bg-hover: rgba(255,255,255,0.05);
    }
    
    .search-dropdown {
        background: #2d2d2d;
        border-color: #555;
    }
    
    .search-dropdown-header {
        background: #3a3a3a;
    }
    
    .fold-content {
        background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
        border-color: rgba(255,255,255,0.1);
    }
    
    .tool-item {
        background: rgba(255,255,255,0.05);
        border-color: rgba(255,255,255,0.1);
    }
    
    .tool-name {
        color: #e2e8f0;
    }
    
    .form-input, .form-select, .form-textarea {
        background: #3a3a3a;
        color: var(--text-primary);
        border-color: #555;
    }
    
    .form-input:focus, .form-select:focus, .form-textarea:focus {
        background: #444;
    }
}

/* ==================== 移动端基础触控修复 v1.0 ==================== */
/* 
 * 修复范围：仅触摸设备（pointer: coarse）且视口<820px
 * PC端零影响：使用pointer媒体查询确保PC鼠标设备不触发
 * 修改内容：1)触控目标44px 2)搜索下拉全屏避障 3)编辑栏按钮精简重组
 */
@media screen and (max-width: 820px) and (pointer: coarse) {
    
    /* --- 1. 全局触控安全区 --- */
    .site-item {
        min-height: 44px;
        padding: 8px 10px;
        font-size: 15px;
    }
    
    .site-icon-wrapper {
        width: 20px;
        height: 20px;
    }
    
    .site-item .site-icon,
    .site-item .site-letter {
        width: 20px;
        height: 20px;
    }
    
    .site-radio {
        width: 20px;
        height: 20px;
        left: 2px;
    }
    
    .edit-mode .site-item {
        padding-left: 28px;
    }
    
    /* --- 2. 编辑栏按钮重组（危险操作移至底部固定栏） --- */
    .edit-bar-content {
        padding: 10px 12px;
        gap: 10px;
    }
    
    .edit-nav-name {
        font-size: 15px;
        width: 100%;
    }
    
    .edit-actions {
        gap: 12px;
    }
    
    .edit-btn {
        min-height: 44px;
        min-width: 64px;
        padding: 10px 18px;
        font-size: 14px;
    }
    
    /* 分类操作栏触控扩大 */
    .category-op-bar {
        padding: 8px 12px;
        gap: 8px;
    }
    
    .category-op-left,
    .category-op-right {
        gap: 8px;
        flex-wrap: wrap;
    }
    
    .category-op-bar .op-btn {
        min-height: 36px;
        padding: 6px 10px;
        font-size: 14px;
        background: rgba(255,255,255,0.3);
        border-radius: var(--radius-sm);
        display: inline-flex;
        align-items: center;
    }
    
    /* --- 3. 搜索下拉全屏避障（键盘弹出时占据可用空间） --- */
    .search-dropdown {
        position: absolute;
        top: calc(100% + 5px);
        bottom: auto;
        left: calc(50% - 20px); /* 整体向左偏移20px */
        transform: translateX(-50%);
        width: 100%;
        max-width: 282px; /* 原302px - 20px */
        border-radius: var(--radius-lg);
        max-height: 200px; /* 限制高度，避免超出屏幕 */
        overflow-y: auto;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.2);
        z-index: 1000;
    }
    
    .search-dropdown-item {
        min-height: 48px;
        padding: 12px 20px;
        font-size: 16px;
    }
    
    .search-dropdown-item .search-delete {
        width: 24px;
        height: 24px;
        opacity: 1;
        font-size: 18px;
    }
    
    .search-dropdown-footer {
        min-height: 48px;
        padding: 14px 20px;
        font-size: 14px;
    }
    
    /* --- 4. 时间区域可读性增强 --- */
    .time-area .time-main {
        font-weight: 400;
        letter-spacing: -1px;
    }
    
    .time-area .date {
        font-size: 15px;
    }
    
    /* --- 5. 弹窗底部安全区（iPhone Home Indicator） --- */
    .modal-card {
        padding-bottom: max(27px, env(safe-area-inset-bottom));
    }
    
    /* --- 6. 工具箱触控扩大 --- */
    .tool-item {
        min-height: 54px;
    }
    
    .tool-delete-btn {
        width: 26px;
        height: 26px;
        font-size: 16px;
        top: -10px;
        right: -10px;
    }
    
    .tool-edit-btn {
        font-size: 11px;
        padding: 2px 6px;
    }
    
    /* --- 7. 下拉菜单触控扩大 --- */
    .dropdown-item {
        min-height: 48px;
        padding: 12px 20px;
        font-size: 15px;
    }
    
    /* --- 8. 表单元素触控优化 --- */
    .form-input, .form-select, .form-textarea {
        min-height: 48px;
        font-size: 16px;
    }
    
    .form-submit button {
        min-height: 48px;
        padding: 12px 32px;
    }
    
    .btn {
        min-height: 48px;
    }
}

/* 超小屏（<400px）额外优化 */
@media screen and (max-width: 400px) and (pointer: coarse) {
    .edit-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .edit-btn {
        flex: 1;
        justify-content: center;
    }
    
    .category-op-left,
    .category-op-right {
        width: 100%;
        justify-content: space-between;
    }
}

/* ==================== 移动端视觉生动化 v2.0 ==================== */
/* 
 * 设计目标：卡片化布局 + 紧凑信息密度 + 细腻微交互
 * 隔离策略：严格限定 pointer: coarse 触摸设备，PC端零感知
 * 核心变化：
 *   1. 分类卡片化（阴影+圆角+hover上浮）
 *   2. 左侧品牌色条（视觉锚点）
 *   3. 网站项hover右滑动效（生动反馈）
 *   4. 时间区域毛玻璃质感（iOS风格）
 *   5. 编辑栏琥珀渐变（替代刺眼黄色）
 *   6. 全站紧凑8px网格（间距缩小20%）
 */
@media screen and (max-width: 820px) and (pointer: coarse) {
    
    /* --- 1. 分类卡片化：独立白底+细微阴影+hover动效 --- */
    .nav-list {
        gap: 8px; /* 紧凑8px网格 */
    }
    
    .nav-category {
        background: var(--bg-card);
        border: none; /* 移除原边框 */
        border-radius: var(--radius-xl); /* 8px大圆角 */
        padding: 12px; /* 紧凑内边距 */
        box-shadow: 0 2px 8px rgba(0,0,0,0.04), 0 0 1px rgba(0,0,0,0.08); /* 双层阴影 */
        transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
        position: relative;
        overflow: hidden;
    }
    
    .nav-category:hover {
        transform: translateY(-1px); /* 轻微上浮 */
        box-shadow: 0 4px 16px rgba(0,0,0,0.08), 0 0 1px rgba(0,0,0,0.1); /* 阴影加深 */
    }
    
    .nav-category:active {
        transform: translateY(0); /* 按下回弹 */
        box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    }
    
    /* 分类hover时左侧微光扫过效果 */
    .nav-category::after {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 50%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
        transition: left 0.6s;
        pointer-events: none;
    }
    
    .nav-category:hover::after {
        left: 150%;
    }
    
    /* --- 2. 左侧品牌色条：3px蓝色竖线作为视觉锚点 --- */
    .category-name {
        position: relative;
        padding-left: 12px; /* 为色条留空间 */
        font-size: 16px; /* 字号增大 */
        font-weight: 600; /* 加粗 */
        color: var(--text-primary);
        width: auto; /* 移除固定宽度 */
        min-width: 60px;
        line-height: 1.3;
    }
    
    .category-name::before {
        content: '';
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        width: 3px;
        height: 16px;
        background: var(--primary);
        border-radius: 2px;
        opacity: 0.8;
    }
    
    .category-name:hover {
        color: var(--primary);
    }
    
    /* --- 3. 网站列表紧凑化+右滑动效 --- */
    .category-sites {
        gap: 6px 8px; /* 紧凑间距 */
        row-gap: 6px;
    }
    
    .site-item {
        font-size: 15px; /* 增大 */
        font-weight: 500; /* 中等字重 */
        padding: 6px 10px; /* 紧凑 */
        border-radius: var(--radius-md);
        transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
        position: relative;
        overflow: hidden;
    }
    
    /* 网站项hover时右移+渐变背景（生动反馈） */
    .site-item:hover {
        transform: translateX(3px);
        background: linear-gradient(90deg, var(--primary-light), transparent 80%);
        color: var(--primary);
    }
    
    .site-item:active {
        transform: translateX(3px) scale(0.98);
    }
    
    /* 选中状态（编辑模式）增强 */
    .edit-mode .site-item.active {
        background: linear-gradient(135deg, #ffd700, #ffed4e);
        box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
        font-weight: 600;
    }
    
    /* --- 4. 时间区域毛玻璃质感（iOS风格） --- */
    .time-area {
        background: rgba(255,255,255,0.72);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-radius: var(--radius-xl);
        padding: 20px 16px;
        margin: 0 0 24px 0;
        border: 1px solid rgba(255,255,255,0.5);
        box-shadow: 0 4px 20px rgba(0,0,0,0.03);
        position: relative;
        overflow: hidden;
    }
    
    /* 时间数字tabular nums防跳动 */
    .time-area .time {
        font-variant-numeric: tabular-nums;
        letter-spacing: -1px;
    }
    
    .time-area .time-main {
        font-size: 52px; /* 更大 */
        font-weight: 300;
        background: linear-gradient(135deg, var(--text-primary), #666);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }
    
    .time-area .date {
        font-size: 15px;
        font-weight: 500;
        color: var(--text-secondary);
        letter-spacing: 0.5px;
    }
    
    /* --- 5. 编辑栏琥珀渐变（替代刺眼黄色）+ 单行紧凑化修复 --- */
    .edit-bar-content {
        background: linear-gradient(135deg, #ffd700 0%, #ffb700 100%);
        border: 1px solid rgba(0,0,0,0.06);
        box-shadow: 0 2px 12px rgba(255, 183, 0, 0.25);
        /* 单行紧凑布局：强制水平排列，减小高度 */
        flex-direction: row !important;
        flex-wrap: nowrap;
        padding: 6px 10px;
        min-height: 40px;
        height: auto;
        gap: 8px;
        align-items: center;
    }
    
    /* 编辑栏标题：单行截断，不占过多空间 */
    .edit-bar-content .edit-nav-name {
        font-size: 14px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        flex: 1;
        min-width: 0;
        margin-right: 8px;
    }
    
    /* 编辑栏按钮组：扁平化 */
    .edit-bar-content .edit-actions {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 6px;
        width: auto;
        flex-shrink: 0;
    }
    
    /* 编辑栏按钮：扁小紧凑 + 文字强制居中 */
    .edit-bar-content .edit-btn {
        min-height: 28px;
        height: 28px;
        padding: 0 12px;
        font-size: 13px;
        line-height: 1;
        border-radius: var(--radius-sm);
        white-space: nowrap;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        text-align: center;
    }
    
    .category-op-bar {
        background: linear-gradient(135deg, #ffd700, #ffcc00);
        box-shadow: 0 2px 8px rgba(255, 215, 0, 0.2);
    }
    
    /* 按钮按压效果（触觉反馈） */
    .edit-btn:active,
    .op-btn:active,
    .form-submit button:active,
    .btn:active {
        transform: scale(0.97);
        transition: transform 0.1s;
    }
    
    /* 超小屏编辑栏微调：标题和按钮更紧凑 */
    @media screen and (max-width: 400px) {
        .edit-bar-content {
            padding: 5px 8px;
        }
        .edit-bar-content .edit-nav-name {
            font-size: 13px;
        }
        .edit-bar-content .edit-btn {
            padding: 0 10px;
            font-size: 12px;
        }
    }
    
    /* --- 6. 搜索区域紧凑化 + 按钮文字横版强制 --- */
    .search-area {
        margin-bottom: 8px;
    }
    
    .search-area input {
        height: 48px; /* 增大 */
        font-size: 16px;
        font-weight: 400;
    }
    
    .search-area button {
        height: 48px;
        font-weight: 500;
        letter-spacing: 0.5px;
        white-space: nowrap; /* 强制横版不换行 */
        min-width: 64px; /* 确保足够宽度容纳文字 */
        padding: 0 20px;
    }
    
    /* --- 7. 工具箱卡片化 --- */
    .tool-item {
        background: var(--bg-card);
        border: 1px solid var(--border-light);
        box-shadow: 0 1px 3px rgba(0,0,0,0.02);
        border-radius: var(--radius-md);
        transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    }
    
    .tool-item:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0,0,0,0.08);
        border-color: var(--primary-alpha);
    }
    
    /* --- 8. 弹窗玻璃质感 --- */
    .modal-mask {
        background: rgba(0,0,0,0.45);
        backdrop-filter: blur(4px);
    }
    
    .modal-card {
        background: rgba(255,255,255,0.98);
        box-shadow: 0 20px 60px rgba(0,0,0,0.3), 0 0 0 1px rgba(0,0,0,0.05);
        border-radius: var(--radius-lg);
    }
    
    /* --- 9. 紧凑全局间距 + 账号移至白框内右上角 --- */
    .main-card {
        padding: 16px 12px 24px; /* 更紧凑 */
        gap: 8px;
        position: relative; /* 为user-header定位提供参考 */
    }
    
    /* 账号区域：移至白框内右上角，仅显示齿轮 */
    .user-header {
        position: absolute;
        top: 12px;
        right: 12px;
        z-index: 10;
    }
    
    .user-menu {
        padding: 8px;
    }
    
    /* 隐藏用户名，仅显示齿轮 */
    .user-header #userDisplay,
    .user-header .user-menu > span:not(.setting-icon) {
        display: none !important;
    }
    
    .user-header .setting-icon {
        display: block !important;
        font-size: 18px;
        padding: 0;
    }
    
    /* 下拉菜单位置调整（相对于圆形按钮） */
    .user-dropdown {
        top: calc(100% + 8px);
        right: 0;
        min-width: 160px;
    }
    
    .nav-header {
        margin-top: 24px;
        margin-bottom: 16px;
        padding-bottom: 12px;
    }
    
    .fold-btn {
        margin: 20px 0 12px;
        border-radius: var(--radius-md);
    }
    
    /* --- 10. 微交互统一 --- */
    .dropdown-item,
    .search-dropdown-item {
        transition: all 0.15s ease;
    }
    
    .dropdown-item:active,
    .search-dropdown-item:active {
        background: var(--primary-light);
        transform: scale(0.98);
    }
}
