/* 基础与变量 */
:root {
    --bg-primary: rgba(30, 30, 36, 0.85);
    --bg-secondary: rgba(38, 40, 51, 0.95);
    --bg-sidebar: rgba(255, 255, 255, 0.08);
    --border-color: rgba(255, 255, 255, 0.12);
    --text-primary: rgba(255, 255, 255, 0.95);
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);
    --accent-blue: #4C91FF;
    --accent-green: #2ecc71;
    --accent-red: #ff6b6b;
    --accent-orange: #ff9900;
    --shadow-light: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-medium: 0 8px 32px rgba(0, 0, 0, 0.2);
    --border-radius: 16px;
    --icon-radius: 14px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', system-ui, sans-serif;
    color: var(--text-primary);
    background: #1a1a1a;
    min-height: 100vh;
    overflow-x: hidden;
}

/* 背景层 */
.background-layer {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url('https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=1920&auto=format&fit=crop') center/cover no-repeat fixed;
    filter: brightness(0.4);
    z-index: -2;
    transition: background-image 1.5s ease-in-out;
}

.mtab-container {
    display: flex;
    max-width: 1600px;
    min-height: 100vh;
    margin: 0 auto;
    backdrop-filter: blur(20px) saturate(180%);
    background: var(--bg-primary);
    position: relative;
}

/* ===== 左侧边栏样式 ===== */
.sidebar {
    width: 320px;
    flex-shrink: 0;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 20px;
    backdrop-filter: blur(10px);
}

.user-info {
    display: flex;
    align-items: center;
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}
.avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 12px;
}
.user-name {
    font-size: 15px;
    font-weight: 500;
    flex: 1;
}
.user-menu {
    display: flex;
    gap: 8px;
}
.menu-btn {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}
.menu-btn:hover {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

/* 时间部件 */
.time-widget {
    margin-bottom: 25px;
}
.time-primary {
    font-size: 3.5rem;
    font-weight: 300;
    letter-spacing: -1px;
    line-height: 1;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.time-secondary {
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.location-selector {
    display: flex;
    align-items: center;
    gap: 6px;
}
.location-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 4px;
    transition: var(--transition);
}
.location-btn:hover {
    background: rgba(255,255,255,0.1);
    color: var(--accent-blue);
}

/* ===== 天气部件 - 重新布局 ===== */
.weather-widget {
    background: rgba(40, 42, 54, 0.95);
    border-radius: 12px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    min-width: 600px;
    flex: 1.2;
    display: flex;
    flex-direction: column;
    max-height: 100%;
    overflow: hidden;
    position: relative;
}

/* 当前天气区域 - 重新布局 */
.weather-current {
    display: flex;
    align-items: center;
    padding-bottom: 1px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 4px;
    flex-shrink: 0;
    min-height: 50px;
    position: relative;
}

/* 左侧天气信息区域 */
.current-weather-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

/* 当前天气信息区域 */
.current-weather-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* 当前温度大字体 */
.current-temp-large {
    margin-right: 15px;
}

.current-temp-large .temp-value {
    font-size: 3rem;
    font-weight: 300;
    color: white;
    line-height: 1;
    letter-spacing: -1px;
}

.current-temp-large .temp-unit {
    font-size: 2.5rem;
    color: rgba(255, 255, 255, 0.7);
    margin-left: 2px;
    font-weight: 300;
}

/* 当前天气详情 */
.current-details {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* 天气描述 - 第一行 */
.weather-text {
    font-size: 13px; /* 增大字体 */
    font-weight: 500;
    color: white;
}

/* 温度和温度范围行 - 第二行 */
.temp-row {
    display: flex;
    align-items: center;
    gap: 12px; /* 增加间距 */
    margin-bottom: 2px;
}

/* 温度范围 */
.temp-range {
    font-size: 13px; /* 增大字体 */
    color: rgba(255, 255, 255, 0.8);
}

/* 风力信息 - 第三行 */
.weather-wind {
    font-size: 13px; /* 增大字体 */
    color: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    display: inline-block;
    max-width: 120px;
}

/* 天气图标在右侧 */
.weather-icon {
    font-size: 3rem; /* 稍微减小图标大小 */
    color: #FFD700;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    order: 2; /* 改变flex顺序 */
    margin-right: 350px;
}

/* 右上角信息区域 */
.weather-current-right {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.update-time {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    gap: 6px;
}
.update-time i {
    font-size: 9px;
}

.weather-source-right {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
}

.source-label-right {
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 8px;
}

.refresh-btn-right {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.7);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 10px;
    transition: all 0.2s ease;
    padding: 0;
    margin-left: 4px;
}

.refresh-btn-right:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: rotate(90deg);
}

/* 7天预报区域 - 修复显示问题 */
.weather-forecast-box {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 3px;
    /* margin-bottom: 10px;  在盒子下方创建10px的空间 底部信息栏已移除 */
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /*min-height: 220px;  确保有足够高度显示完整 */
    min-height: 200px; /* 设置最小高度 */
    max-height: 240px; /* 设置最大高度 */
    height: auto; /* 自动高度 */
}

.forecast-title {
    font-size: 12px;
    font-weight: 600;
    color: white;
    margin-bottom: 3px;
    text-align: center;
}

/* 7天预报网格 - 修复布局 */
.forecast-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    position: relative;
    flex: 1;
    overflow: visible !important;
    /*min-height: 200px;*/
    align-items: start; /* 顶部对齐 */
	height: 180px;
}
/* 温度趋势线容器 */
.high-temp-line-container,
.low-temp-line-container {
    position: absolute;
    left: 0;
    right: 0;
    height: 30px;
    z-index: 1;
    pointer-events: none;
}

.high-temp-line-container {
    top: 25px; /* 调整高温线位置 */
}

.low-temp-line-container {
    top: 25px; /* 调整低温线位置 */
}

/* 折线图SVG样式 */
.trend-line-chart {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    overflow: visible;
}

/* 高温折线 */
.high-temp-line {
    fill: none;
    stroke: #ff6b6b;
    stroke-width: 2px;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* 低温折线 */
.low-temp-line {
    fill: none;
    stroke: #4C91FF;
    stroke-width: 2px;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* 温度点 */
.temp-point {
    fill: white;
    stroke-width: 1px;
    stroke: rgba(0, 0, 0, 0.2);
}

.high-temp-point {
    fill: #ff6b6b;
}

.low-temp-point {
    fill: #4C91FF;
}

/* 列布局 - 优化显示 */
.forecast-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    padding: 8px 4px;
    transition: all 0.2s ease;
    position: relative;
    border: 1px solid transparent;
    z-index: 2;
    height: auto;
    min-height: 180px; /* 增加最小高度确保完整显示 */
    justify-content: flex-start;
    gap: 2px;
}
.forecast-column.today {
    background: rgba(76, 145, 255, 0.12);
    border-color: rgba(76, 145, 255, 0.3);
}

/* 列内元素的详细样式 */
.forecast-weekday {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    margin-bottom: 1px;
    white-space: nowrap;
}

.forecast-date {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 6px;
    font-family: 'Courier New', monospace;
    white-space: nowrap;
}

.forecast-icon {
    font-size: 1.2rem;
    color: #FFD700;
    margin-bottom: 8px;
    height: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}



.forecast-wind {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.8);
	margin-top: 107px;
    margin-bottom: 4px;
    padding: 2px 3px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.forecast-air {
    font-size: 9px;
    color: #2ecc71;
    font-weight: 500;
    padding: 1px 5px;
    background: rgba(46, 204, 113, 0.1);
    border-radius: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.forecast-air.mild {
    color: #f39c12;
    background: rgba(243, 156, 18, 0.1);
}


/* 日历部件 */
.calendar-widget {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 18px;
    margin-bottom: 25px;
    border: 1px solid var(--border-color);
}
.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 14px;
}
.calendar-title { 
    font-weight: 500;
    color: var(--text-primary);
    font-size: 16px;
    flex: 1;
    text-align: center;
}
.calendar-nav-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 4px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.calendar-nav-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}
.calendar-nav-btn#btn-calendar-today {
    padding: 4px 16px;
}
.calendar-week {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 15px;
    text-align: center;
    padding: 5px;
    background: rgba(255,255,255,0.05);
    border-radius: 6px;
}
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
    font-size: 13px;
    margin-bottom: 12px;
}
/* 添加日历格子悬停提示 */
.calendar-day {
    position: relative;
}

.calendar-day .date-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 100;
    pointer-events: none;
    box-shadow: var(--shadow-medium);
}

.calendar-day:hover .date-tooltip {
    opacity: 1;
    visibility: visible;
}
.calendar-day:not(.weekday):not(.empty) {
    height: 32px;  /* 中等大小，能容纳公历和农历 */
    aspect-ratio: 1 / 1;  /* 使容器成方形 */
    padding: 0px 2px 2px 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; /* 顶部对齐 */
}
.calendar-day.weekday {
    color: var(--text-secondary);
    font-weight: 500;
    height: 30px;
    justify-content: flex-end;
    padding-bottom: 5px;
}
.calendar-day.today {
    background: rgba(76, 145, 255, 0.15);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}
.calendar-day.today .date-number {
    color: var(--accent-blue);
    font-weight: 600;
}
.calendar-day.holiday {
    color: var(--accent-red);
}
.calendar-day.holiday .date-number {
    color: var(--accent-red);
    font-weight: 600;
}
.calendar-day:hover:not(.weekday):not(.today):not(.holiday) {
    background: rgba(255,255,255,0.05);
    color: var(--text-primary);
}
.date-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-bottom: 0px;
    margin-top: -2px;
    position: relative; /* 添加相对定位 */
    width: 100%;
    min-height: 24px;
}
.date-number {
    font-size: 14px !important;
    font-weight: 500;
    line-height: 1.2;
}
/* 节假日文字样式（简洁显示"休"或"班"） */
.date-holiday-text {
    font-size: 8px;
    font-weight: bold;
    color: var(--accent-red);
    position: absolute;
    top: 1px;
    right: 0px;
}
.date-lunar {
    font-size: 10px;
    color: var(--text-muted);
    opacity: 0.8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    line-height: 1.2;
    text-align: center;
    margin-top: -5px;
}
.calendar-holiday-tip {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    padding: 6px;
    background: rgba(255,255,255,0.03);
    border-radius: 6px;
    border-top: 1px solid rgba(255,255,255,0.05);
}
.calendar-holiday-tip i {
    margin-right: 5px;
    color: var(--accent-red);
}

/* 新增节假日标记样式 */
.date-holiday-icon, .date-workday-icon {
    font-size: 9px !important;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    line-height: 1;
    position: absolute;
    top: -6px;
    right: -6px;
}

.date-holiday-icon {
    background: var(--accent-red);
    color: white !important;
}

.date-workday-icon {
    background: #3498db; /* 蓝色表示调休上班 */
    color: white !important;
}

/* 调整今天日期的标记位置 */
.calendar-day.today .date-holiday-icon,
.calendar-day.today .date-workday-icon {
    top: -8px;
    right: -8px;
}

/* 新增工作日样式（调休上班） */
.calendar-day.workday .date-number {
    color: #3498db;
    font-weight: 600;
}

/* 新增节日样式 */
.date-lunar.festival {
    color: var(--accent-orange) !important;
    font-weight: 600;
    font-size: 10px;
    line-height: 1.2;
    max-height: 26px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    white-space: normal; /* 允许换行 */
    word-break: keep-all;
}

/* 处理长节日名称 */
.calendar-day:not(.weekday):not(.empty) .date-lunar.festival {
    -webkit-line-clamp: 2;
    max-height: 24px;
    line-height: 1.2;
}

/* 侧边栏工具按钮 */
.sidebar-tools {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}
.tool-btn {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}
.tool-btn:hover {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
    transform: translateY(-2px);
}

/* ===== 右侧主内容区样式 ===== */
.main-content {
    flex: 1;
    padding: 25px 30px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 顶部双栏布局 - 修复高度限制 */
.top-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    min-height: auto;
    max-height: 320px; /* 稍微增加高度以适应新布局 */
    align-items: stretch;
    overflow: hidden;
}

/* 热搜栏 */
/* 热搜加载状态样式 */
.news-item.loading {
    opacity: 0.6;
    cursor: default;
}

.news-item.loading .news-title {
    color: rgba(255, 255, 255, 0.6);
}

.news-item.loading .news-hotness {
    background: transparent;
    border: 1px dashed rgba(255, 255, 255, 0.3);
}
.hot-news-section {
    flex: 1;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    padding: 16px;
    display: flex;
    flex-direction: column;
    min-width: 350px;
    max-height: 100%;
    overflow: hidden;
}
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    flex-shrink: 0;
}
.section-header h3 {
    font-size: 17px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}
.news-source-selector {
    display: flex;
    align-items: center;
    gap: 12px;
}
.news-source {
    font-size: 12px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: var(--transition);
}
.news-source:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.05);
}
.news-source.active {
    color: var(--accent-blue);
    background: rgba(76, 145, 255, 0.1);
}
.news-update {
    font-size: 10px;
    color: var(--text-muted);
}
.hot-news-list {
    flex: 1;
    overflow-y: auto;
    max-height: none;
}
.hot-news-list::-webkit-scrollbar {
    width: 5px;
}
.hot-news-list::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.05);
    border-radius: 3px;
}
.hot-news-list::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
}
.hot-news-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.3);
}
.news-item {
    display: flex;
    align-items: center;
    padding: 4px 8px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
    border-radius: 4px;
    margin-bottom: 1px;
    min-height: 30px;
}
.news-item:hover {
    background: rgba(255,255,255,0.08);
}
.news-rank {
    width: 18px; height: 18px;
    background: #555;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    font-size: 11px;
    flex-shrink: 0;
    color: white;
}
.news-rank.top3 { 
    background: #e74c3c; 
    font-weight: 600;
}
.news-rank.top3:nth-child(1) { background: #e74c3c; }
.news-rank.top3:nth-child(2) { background: #ff6a00; }
.news-rank.top3:nth-child(3) { background: #fc0; color: #333; }
/* 热搜标题样式 - 添加长度限制 */
.news-title {
    flex: 1; /* 占据剩余空间 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80%; /* 限制最大宽度为容器的75% */
    font-size: 12px;
    line-height: 1.2;
    margin-right: 8px; /* 添加右边距，避免与热度值太近 */
}

/* 热搜热度值样式 - 确保有固定宽度 */
.news-hotness {
    color: var(--text-muted);
    font-size: 11px;
    flex-shrink: 0; /* 防止被压缩 */
    min-width: 45px;
    text-align: right;
    white-space: nowrap; /* 防止热度值换行 */
}

/* 确保新闻内容容器有合适的布局 */
.news-content {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 18px;
    overflow: hidden; /* 防止内容溢出 */
}

/* 公告栏 */
.announcement-section {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    padding: 15px;
    margin-bottom: 20px;
}
.announcement-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.announcement-content {
    margin-top: 10px;
}
.announcement-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: rgba(255,255,255,0.05);
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 13px;
    transition: var(--transition);
    min-height: 36px;
}
.announcement-item:hover {
    background: rgba(255,255,255,0.08);
}
.announcement-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 8px;
    font-weight: 600;
    margin-right: 8px;
    flex-shrink: 0;
}
.announcement-badge.new {
    background: #e74c3c;
    color: white;
}
.announcement-badge.update {
    background: #3498db;
    color: white;
}
.announcement-badge.fix {
    background: #2ecc71;
    color: white;
}
.announcement-text {
    flex: 1;
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.announcement-time {
    color: var(--text-muted);
    font-size: 11px;
    flex-shrink: 0;
    margin-left: 8px;
}

/* 搜索框 */
.search-section {
    margin-bottom: 25px;
}
.search-container {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    padding: 0 20px;
    height: 55px;
    display: flex;
    align-items: center;
    transition: var(--transition);
}
.search-container:focus-within {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(76, 145, 255, 0.1);
}
.search-icon {
    color: var(--text-muted);
    margin-right: 12px;
    font-size: 18px;
}
.search-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 16px;
    outline: none;
}
.search-input::placeholder { color: var(--text-muted); }
.search-engines {
    display: flex;
    margin-left: 15px;
    gap: 8px;
}
.engine-tab {
    padding: 5px 12px;
    border-radius: 20px;
    background: rgba(255,255,255,0.05);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}
.engine-tab.active {
    background: var(--accent-blue);
    color: white;
}
.engine-tab:hover:not(.active) {
    background: rgba(255,255,255,0.1);
}

/* 分类标签 */
.category-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
}
.category-tab {
    padding: 8px 18px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}
.category-tab.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
}
.category-tab:hover:not(.active) {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

/* 书签网格 */
.bookmarks-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.bookmarks-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    flex-shrink: 0;
}
.bookmarks-header h2 {
    font-size: 22px;
    font-weight: 500;
    margin-right: 10px;
}
.bookmark-count {
    color: var(--text-muted);
    font-size: 14px;
    margin-right: auto;
}
.bookmark-actions {
    display: flex;
    gap: 8px;
}
.action-btn {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}
.action-btn:hover {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}
.action-btn#btn-delete-category:hover {
    background: var(--accent-red);
    border-color: var(--accent-red);
}
.bookmarks-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 18px;
    padding: 5px;
    overflow-y: auto;
    max-height: calc(100vh - 380px);
}
.bookmark-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--icon-radius);
    padding: 15px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: move;
    transition: var(--transition);
    position: relative;
    height: 130px;
    justify-content: space-between;
}
.bookmark-item:hover {
    border-color: var(--accent-blue);
    transform: translateY(-3px);
    box-shadow: var(--shadow-medium);
}
.bookmark-icon {
    width: 48px; height: 48px;
    background: rgba(255,255,255,0.9);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    font-size: 20px;
    color: #333;
    flex-shrink: 0;
}
.bookmark-name {
    font-weight: 500;
    font-size: 13px;
    text-align: center;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 4px;
    flex-shrink: 0;
}
.bookmark-url {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 0;
}
.bookmark-actions {
    position: absolute;
    top: 8px; right: 8px;
    opacity: 0;
    transition: opacity 0.2s;
    display: flex;
    gap: 4px;
}
.bookmark-item:hover .bookmark-actions {
    opacity: 1;
}
.btn-icon {
    width: 24px; height: 24px;
    border-radius: 50%;
    background: rgba(0,0,0,0.4);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 11px;
    transition: var(--transition);
}
.btn-icon:hover {
    background: var(--accent-blue);
    transform: scale(1.1);
}
.btn-icon.delete-btn:hover {
    background: var(--accent-red);
}

/* 拖拽样式 */
.bookmark-item.dragging {
    opacity: 0.5;
    transform: scale(1.05);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

/* 分类右键菜单样式 */
.category-context-menu {
    position: absolute;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--icon-radius);
    padding: 8px 0;
    min-width: 160px;
    box-shadow: var(--shadow-medium);
    z-index: 1000;
    display: none;
}
.category-context-menu.show {
    display: block;
}
.context-menu-item {
    padding: 8px 16px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}
.context-menu-item:hover {
    background: rgba(76, 145, 255, 0.1);
    color: var(--accent-blue);
}
.context-menu-item.delete {
    color: var(--accent-red);
}
.context-menu-item.delete:hover {
    background: rgba(255, 107, 107, 0.1);
    color: var(--accent-red);
}

/* 底部 */
.footer-section {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    padding: 25px;
    text-align: center;
    margin-top: 25px;
}
.footer-links {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
    cursor: pointer;
}
.footer-links a:hover {
    color: var(--accent-blue);
    text-decoration: underline;
}
.friend-links {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
}
.friend-title {
    color: var(--text-muted);
    font-size: 14px;
    margin-right: 15px;
}
.friend-links a {
    color: var(--text-secondary);
    text-decoration: none;
    margin: 0 12px;
    font-size: 13px;
    transition: var(--transition);
}
.friend-links a:hover {
    color: var(--accent-blue);
}
.copyright {
    color: var(--text-muted);
    font-size: 13px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.05);
}

/* ===== 模态框 ===== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal-content {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    width: 90%;
    max-width: 450px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-medium);
    animation: modalAppear 0.3s ease;
}
.modal-content.modal-wide {
    max-width: 700px;
}
@keyframes modalAppear {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}
.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
    z-index: 1;
}
.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    transition: var(--transition);
}
.modal-close:hover {
    color: var(--text-primary);
}
.modal-body { 
    padding: 25px; 
    max-height: calc(90vh - 80px);
    overflow-y: auto;
}
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 14px;
}
.form-group input,
.form-group select:not(.protocol-selector) {
    width: 100%;
    padding: 12px 15px;
    background: rgba(255,255,255,0.08);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
    transition: var(--transition);
}
.form-group input:focus,
.form-group select:focus {
    border-color: var(--accent-blue);
    background: rgba(255,255,255,0.12);
}
.form-group select:not(.protocol-selector) {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 16px;
    padding-right: 40px;
	transition: var(--transition);
}
.form-group select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 10px;
}
.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted);
}
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 25px;
}
.btn-primary, .btn-secondary, .btn-danger {
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}
.btn-primary {
    background: var(--accent-blue);
    color: white;
}
.btn-primary:hover {
    background: #3a7cff;
    transform: translateY(-1px);
}
.btn-secondary {
    background: rgba(255,255,255,0.1);
    color: var(--text-secondary);
}
.btn-secondary:hover {
    background: rgba(255,255,255,0.15);
}
.btn-danger {
    background: var(--accent-red);
    color: white;
}
.btn-danger:hover {
    background: #ff5252;
    transform: translateY(-1px);
}

/* 协议和网址组合输入框 */
.protocol-selector-container {
    display: flex;
    align-items: center;
    gap: 0;
    width: 100%;
}

/* 协议选择下拉框 */
.protocol-selector {
    width: auto !important;
    padding: 10px 12px;
    background: rgba(255,255,255,0.08);
    border: 1px solid var(--border-color);
    border-radius: 8px 0 0 8px; /* 左上和左下圆角 */
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s ease, background-color 0.3s ease; /* 只过渡边框和背景颜色 */
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center; /* 不同的位置 */
    background-size: 14px;
    padding-right: 30px;
    height: 42px;
    border-right: none; /* 移除右边框，与输入框连接 */
}

.protocol-selector:hover {
    background: rgba(255,255,255,0.12);
}

.protocol-selector:focus {
    border-color: var(--accent-blue);
    background: rgba(255,255,255,0.12);
}

/* 网址输入框 */
.url-input-group input[type="text"] {
    flex: 1; /* 占据剩余空间 */
    padding: 10px 12px;
    background: rgba(255,255,255,0.08);
    border: 1px solid var(--border-color);
    border-left: none; /* 移除左边框，与选择框连接 */
    border-radius: 0 8px 8px 0; /* 右上和右下圆角 */
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
	height: 42px; /* 统一高度 */
}

/* 当协议选择框聚焦时，相邻的输入框也要有样式 */
.protocol-selector:focus + input {
    border-color: var(--accent-blue);
}

/* 确保整个组合看起来像一个输入框 */
.url-input-group .protocol-selector-container:focus-within {
    box-shadow: 0 0 0 3px rgba(76, 145, 255, 0.1);
}

/* 添加连接处的视觉优化 */
.protocol-selector-container {
    position: relative;
}

/* 创建连接处的分隔线 */
.protocol-selector::after {
    content: '';
    position: absolute;
    right: 0;
    top: 8px;
    bottom: 8px;
    width: 1px;
    background: var(--border-color);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .protocol-selector-container {
        flex-direction: column;
        gap: 8px;
    }
    
    .protocol-selector,
    .url-input-group input[type="text"] {
        width: 100%;
        border-radius: 8px;
        border: 1px solid var(--border-color);
    }
    
    .protocol-selector {
        border-right: 1px solid var(--border-color); /* 恢复右边框 */
    }

    .calendar-day:not(.weekday):not(.empty) {
        height: 52px;
        padding: 4px 1px;
    }
    
    .date-number {
        font-size: 13px;
    }
    
    .date-lunar {
        font-size: 9px;
    }
    
    .date-lunar.festival {
        font-size: 10px;
        max-height: 20px;
        -webkit-line-clamp: 1; /* 小屏幕只显示一行 */
    }
    
    .date-holiday-icon, .date-workday-icon {
        width: 12px;
        height: 12px;
        font-size: 8px !important;
        top: -4px;
        right: -4px;
    }

}

/* 城市选择模态框 */
.city-list-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
    background: rgba(255,255,255,0.03);
    margin: 15px 0;
}
.city-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.city-province-header {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-blue);
    padding: 8px 10px;
    margin-top: 10px;
    background: rgba(76, 145, 255, 0.1);
    border-radius: 6px;
    border-left: 3px solid var(--accent-blue);
}
.city-province-header:first-child {
    margin-top: 0;
}
.city-item {
    padding: 10px 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 13px;
    margin-left: 15px;
}
.city-item:hover {
    background: rgba(255,255,255,0.1);
    border-color: var(--accent-blue);
    transform: translateX(5px);
}
.city-no-results {
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
    font-size: 14px;
}

/* 壁纸选择模态框 */
.wallpaper-options h4 {
    margin: 20px 0 15px;
    color: var(--text-primary);
    font-size: 16px;
}
.wallpaper-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}
.wallpaper-item {
    aspect-ratio: 16/9;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
    position: relative;
}
.wallpaper-item:hover {
    transform: scale(1.05);
}
.wallpaper-item.active {
    border-color: var(--accent-blue);
}
.wallpaper-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.wallpaper-item:hover img {
    transform: scale(1.1);
}
.wallpaper-item .wallpaper-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 5px;
    font-size: 12px;
    text-align: center;
}
.wallpaper-url-input {
    margin-top: 10px;
}
.wallpaper-url-input input {
    width: 100%;
    margin-bottom: 5px;
}

/* ==================== Toast通知样式 ==================== */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 12px 16px;
    min-width: 200px;
    max-width: 300px;
    box-shadow: var(--shadow-medium);
    transform: translateX(120%);
    transition: transform 0.3s ease;
    z-index: 10000;
    backdrop-filter: blur(10px);
}

.toast-notification.show {
    transform: translateX(0);
}

.toast-notification.success {
    border-left: 4px solid var(--accent-green);
}

.toast-notification.error {
    border-left: 4px solid var(--accent-red);
}

.toast-notification.warning {
    border-left: 4px solid var(--accent-orange);
}

.toast-notification.info {
    border-left: 4px solid var(--accent-blue);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast-content i {
    font-size: 18px;
}

.toast-success .toast-content i {
    color: var(--accent-green);
}

.toast-error .toast-content i {
    color: var(--accent-red);
}

.toast-warning .toast-content i {
    color: var(--accent-orange);
}

.toast-info .toast-content i {
    color: var(--accent-blue);
}

/* 响应式设计 */
@media (max-width: 1400px) {
    .top-row {
        flex-direction: column;
        min-height: auto;
        max-height: 450px; /* 垂直排列时增加高度 */
    }
    
    .weather-widget {
        min-width: 100%;
        max-height: none;
    }
    
    .forecast-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1200px) {
    .forecast-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

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

@media (max-width: 768px) {
    .bookmarks-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 12px;
    }
    .bookmark-item {
        height: 120px;
        padding: 12px 8px;
    }
    .bookmark-icon {
        width: 40px; height: 40px;
        font-size: 18px;
    }
    .modal-content {
        width: 95%;
        margin: 10px;
    }
    .wallpaper-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .city-list {
        grid-template-columns: repeat(2, 1fr);
    }
    .footer-links {
        gap: 15px;
    }
    .friend-links a {
        margin: 0 8px;
        display: inline-block;
        margin-bottom: 5px;
    }
    .hot-news-section {
        max-height: 300px;
    }
    .news-item {
        min-height: 28px;
        padding: 3px 6px;
        margin-bottom: 1px;
    }

    .toast-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        transform: translateY(-150%);
    }
    
    .toast-notification.show {
        transform: translateY(0);
    }
	
    .forecast-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .weather-current {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .temp-row {
        justify-content: center;
    }
    
    .weather-icon {
        margin-left: 0;
        margin-top: 10px;
        order: -1;
    }
    
    .weather-current-right {
        position: relative;
        top: auto;
        right: auto;
        align-items: center;
        margin-top: 10px;
    }
}

@media (max-width: 600px) {
    .forecast-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 15px;
    }
    .sidebar {
        padding: 15px;
    }
    .time-primary {
        font-size: 2.8rem;
    }
    .bookmarks-grid {
        grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
    }
    .footer-links {
        flex-direction: column;
        gap: 10px;
    }
    .friend-links {
        text-align: left;
    }
    .friend-links a {
        display: block;
        margin: 5px 0;
    }
    .wallpaper-grid {
        grid-template-columns: 1fr;
    }
    .city-list {
        grid-template-columns: 1fr;
    }
    .hot-news-section {
        padding: 12px;
    }
    .news-item {
        font-size: 12px;
        padding: 2px 6px;
        min-height: 26px;
    }
    .news-title {
        max-width: 70%;
    }
    .url-protocol-selector {
        flex-direction: column;
        gap: 8px;
    }

    .forecast-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .forecast-column {
        min-height: 160px;
    }
    
    .forecast-high-temp,
    .forecast-low-temp {
        font-size: 11px;
    }
    
    .forecast-wind {
        font-size: 8px;
    }

    .calendar-day:not(.weekday):not(.empty) {
        height: 46px;
        padding: 3px 1px;
    }
    
    .date-number {
        font-size: 12px;
    }
    
    .date-lunar {
        font-size: 8px;
    }
    
    .date-lunar.festival {
        font-size: 9px;
        max-height: 18px;
    }
    
    /* 在非常小的屏幕上，隐藏节日名称，只显示图标 */
    .calendar-day .date-lunar.festival {
        display: none;
    }
    
    .calendar-day:hover .date-lunar.festival {
        display: -webkit-box;
    }

}