/* ========================================
   整合优化版CSS - 医往无际导航网站
   ======================================== */

:root {
    --primary-color: #3366ff;
    --primary-hover: #2d78f4;
    --secondary-color: #f8f8f8;
    --accent-color: #f50;
    --text-color: #333;
    --light-text: #000;
    --border-color: #e6e6e6;
    --link-color: #333333;
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
    --header-height: 65px;
    --header-height-mobile: 60px;
    --header-height-small: 55px;
}

/* 基础重置 */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', 'Segoe UI', sans-serif;
    background-color: #f9f9f9;
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    padding-top: var(--header-height);
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: var(--transition);
}

a:hover {
    color: var(--primary-hover);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ========================================
   顶部栏样式
   ======================================== */
.top-header {
    background: linear-gradient(to bottom, #f2f2f2, #fff);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--header-height);
    transition: transform 0.3s ease;
}

.top-header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 8px 15px;
    height: var(--header-height);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo img {
    height: 50px;
    width: auto;
    border-radius: 12px;
    transition: transform 0.3s ease;
}

.logo:hover img {
    transform: scale(1.05);
}

/* 主导航 */
.main-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 60px;
}

.main-nav a {
    display: flex;
    align-items: center;
    color: var(--light-text);
    font-size: 12px;
    padding: 4px 6px;
    border-radius: 4px;
    white-space: nowrap;
    transition: var(--transition);
}

.main-nav a i {
    margin-right: 2px;
    font-size: 18px;
}

.main-nav a:hover {
    color: var(--accent-color);
}

/* 右上角区域 */
.top-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* 日期显示 */
.date-widget {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    border-radius: 20px;
    font-size: 13px;
    color: #2e7d32;
    font-weight: 500;
}

.date-widget i {
    font-size: 16px;
    color: #4caf50;
}

/* ========================================
   邮箱登录样式
   ======================================== */
.email-login {
    position: relative;
}

.email-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 80%);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.email-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.5);
}

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

.email-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    padding: 8px;
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
}

.email-dropdown::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 20px;
    width: 12px;
    height: 12px;
    background: #fff;
    transform: rotate(45deg);
    box-shadow: -2px -2px 4px rgba(0, 0, 0, 0.05);
}

.email-login:hover .email-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.email-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    color: #444;
    transition: all 0.2s ease;
}

.email-dropdown a:hover {
    background: linear-gradient(135deg, #f5f7fa, #e4e8ec);
    color: var(--primary-color);
    transform: translateX(3px);
}

.email-dropdown i {
    width: 20px;
    text-align: center;
    color: var(--primary-color);
    font-size: 16px;
}

/* ========================================
   主搜索栏区域
   ======================================== */
.search-section {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 50%, #3d7ab5 100%);
    padding: 20px 28px;
    position: relative;
    overflow: hidden;
}

.search-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M0,50 Q25,40 50,50 T100,50" stroke="rgba(255,255,255,0.05)" fill="none" stroke-width="2"/><path d="M0,30 Q25,20 50,30 T100,30" stroke="rgba(255,255,255,0.03)" fill="none" stroke-width="2"/></svg>');
    background-size: 200px;
    opacity: 0.2;
}

.search-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    position: relative;
    z-index: 1;
}

/* 左侧：节气 */
.search-left {
    flex: 0 0 120px;
    display: flex;
    justify-content: flex-end;
}

.solar-term-box {
    text-align: center;
    color: rgba(255, 255, 255, 0.95);
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    min-width: 120px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.solar-term-name {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 6px;
    background: linear-gradient(135deg, #fff, #ffd700);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.solar-term-desc {
    font-size: 0.85rem;
    opacity: 0.9;
    line-height: 1.4;
}

/* 中间：搜索框 */
.search-center {
    flex: 1;
    max-width: 600px;
}

.search-engines {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
}

.search-engines button {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    padding: 6px 16px;
    border-radius: 20px;
    transition: var(--transition);
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
}

.search-engines button:hover {
    color: white;
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
}

.search-engines button.active {
    color: white;
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
}

.search-box {
    display: flex;
    background: #fff;
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
}

.search-box:hover {
    border-color: var(--primary-color);
    box-shadow: 0 8px 25px rgba(225, 225, 150, 0.6);
}

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

.search-btn {
    background: linear-gradient(135deg, var(--accent-color), #fb923c);
    color: white;
    border: none;
    padding: 0 28px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.search-btn:hover {
    background: linear-gradient(135deg, #ea580c, var(--accent-color));
}

/* 右侧：天气方块 */
.search-right {
    flex: 0 0 120px;
    display: flex;
    justify-content: flex-start;
}

.weather-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    min-width: 160px;
    transition: var(--transition);
}

.weather-box:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.35);
}

.weather-icon {
    font-size: 24px;
    color: #ffd700;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.weather-info {
    flex: 1;
}

.weather-temp {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.weather-city {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.85);
    margin-top: 2px;
}

.weather-text {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 2px;
}

/* ========================================
   顶部搜索栏
   ======================================== */
.header-search {
    flex: 1;
    max-width: 450px;
    margin: 0 20px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
}

.header-search.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.header-search-box {
    display: flex;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.3);
    border: 0 solid var(--border-color);
    transition: var(--transition);
}

.header-search-box:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 15px rgba(51, 102, 255, 0.5);
}

.header-search-input {
    flex: 1;
    padding: 10px 18px;
    border: none;
    font-size: 14px;
    outline: none;
    background-color: #fff;
    border-radius: 20px 0 0 20px;
}

.header-search-btn {
    background: linear-gradient(135deg, var(--primary-color), #4a9bff);
    color: white;
    border: none;
    padding: 0 25px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    border-radius: 0 25px 25px 0;
    transition: var(--transition);
}

.header-search-btn:hover {
    background: linear-gradient(135deg, var(--primary-hover), #3a8bff);
}

/* ========================================
   主体内容布局
   ======================================== */
.main-container {
    display: flex;
    max-width: 1200px;
    margin: 20px auto 30px;
    padding: 0 15px;
    gap: 20px;
}

/* 左侧导航栏 */
.nav-sidebar {
    flex: 0 0 220px;
    position: sticky;
    top: 90px;
    align-self: flex-start;
    height: calc(100vh - 120px);
    overflow-y: auto;
    padding-right: 8px;
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 #f5f5f5;
}

.nav-sidebar::-webkit-scrollbar {
    width: 8px;
}

.nav-sidebar::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 4px;
}

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

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

.nav-category {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    padding: 12px;
    animation: fadeIn 0.5s ease-out forwards;
}

.category-title {
    font-size: 16px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    color: var(--text-color);
}

.category-title i {
    margin-right: 10px;
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.nav-links a {
    display: flex;
    align-items: center;
    padding: 10px 10px;
    border-radius: 4px;
    transition: var(--transition);
    color: var(--link-color);
    font-size: 14px;
    font-weight: 400;
}

.nav-links a i {
    margin-right: 10px;
    width: 16px;
    text-align: center;
    color: var(--primary-color);
    font-size: 16px;
}

.nav-links a:hover {
    background-color: #f0f7ff;
    color: var(--primary-color);
}

.nav-links a.active,
.nav-links a.active i {
    background-color: var(--primary-color);
    color: #f0f7ff;
    font-weight: bold;
}

/* 右侧内容区 */
.content-main {
    flex: 1;
}

.link-section {
    background-color: #fff;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    padding: 20px;
    margin-bottom: 20px;
    scroll-margin-top: 80px;
    animation: fadeInUp 0.6s ease-out forwards;
}

.section-title {
    font-size: 16px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
}

.section-title i {
    margin-right: 10px;
    color: var(--primary-color);
}

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

/* 链接样式 */
.web-link {
    display: flex;
    align-items: center;
    padding: 12px 12px;
    background-color: #f8fafc;
    border-radius: 6px;
    color: var(--link-color);
    border: 1px solid #e2e8f0;
    transition: var(--transition);
    font-size: 14px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.web-link:hover {
    background-color: #f0f7ff;
    border-color: #c3dafe;
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.web-link i {
    width: 20px;
    margin-right: 8px;
    font-size: 16px;
    color: var(--primary-color);
    flex-shrink: 0;
}

/* ========================================
   返回顶部按钮
   ======================================== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(51, 102, 255, 0.3);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background-color: var(--primary-hover);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(51, 102, 255, 0.4);
}

/* ========================================
   底部样式
   ======================================== */
.site-footer {
    background: linear-gradient(to bottom, #fff, #ccc);
    padding: 15px 0 12px;
    border-top: 1px solid var(--border-color);
    margin-top: 20px;
    position: relative;
    z-index: 10;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 12px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 14px;
    gap: 12px;
}

.footer-links a {
    display: flex;
    align-items: center;
    color: var(--light-text);
    font-size: 12px;
    transition: var(--transition);
}

.footer-links a i {
    margin-right: 5px;
    font-size: 12px;
}

.footer-links a:hover {
    color: var(--accent-color);
}

.copyright {
    text-align: center;
    color: var(--light-text);
    font-size: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

/* ========================================
   动画效果
   ======================================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   响应式设计
   ======================================== */
@media (max-width: 1200px) {
    .links-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .search-wrapper {
        gap: 20px;
    }
    
    .search-left,
    .search-right {
        flex: 0 0 160px;
    }
}

@media (max-width: 992px) {
    .main-container {
        flex-direction: column;
    }
    
    .nav-sidebar {
        position: static;
        margin-bottom: 20px;
        height: auto;
        overflow-y: visible;
    }
    
    .nav-links {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .nav-links a {
        flex: 1 0 calc(50% - 8px);
        font-size: 14px;
    }
    
    .links-grid {
        grid-template-columns: repeat(2, 2fr);
    }
    
    .web-link {
        font-size: 14px;
    }
    
    .main-nav {
        gap: 12px;
        margin-left: 15px;
    }
    
    .main-nav a {
        font-size: 13px;
        padding: 4px 6px;
    }
    
    .header-search {
        max-width: 350px;
    }
    
    /* 搜索区域响应式 */
    .search-wrapper {
        flex-direction: column;
        gap: 20px;
    }
    
    .search-left,
    .search-right {
        flex: none;
        width: 100%;
        justify-content: center;
    }
    
    .solar-term-box,
    .weather-box {
        width: 100%;
        max-width: 300px;
    }
    
    .solar-term-box {
        text-align: center;
    }
    
    .search-center {
        width: 100%;
        max-width: 500px;
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: var(--header-height-mobile);
    }
    
    .search-section {
        padding: 30px 15px;
    }
    
    .logo img {
        height: 40px;
    }
    
    .main-nav {
        margin-left: 10px;
        gap: 8px;
    }
    
    .main-nav a {
        font-size: 11px;
        padding: 3px 5px;
    }
    
    .header-search {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        margin: 0;
        padding: 10px;
        background: white;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        max-width: none;
    }
    
    .header-search-box {
        box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
    }
    
    .search-box {
        max-width: 100%;
    }
    
    .search-input {
        padding: 14px 18px;
    }
    
    .search-btn {
        padding: 0 24px;
    }
    
    .search-engines {
        gap: 8px;
        flex-wrap: wrap;
    }
    
    .search-engines button {
        padding: 5px 12px;
        font-size: 12px;
    }
    
    .links-grid {
        gap: 10px;
    }
    
    .web-link {
        padding: 10px 12px;
    }
    
    .footer-links {
        gap: 8px;
    }
    
    .footer-links a {
        font-size: 12px;
    }
    
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 16px;
    }
    
    .email-dropdown {
        right: -10px;
        min-width: 140px;
    }
    
    .email-dropdown a {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    /* 日期显示隐藏 */
    .date-widget {
        display: none;
    }
}

@media (max-width: 576px) {
    :root {
        --header-height: var(--header-height-small);
    }
    
    .search-section {
        padding: 25px 12px;
    }
    
    .logo img {
        height: 35px;
    }
    
    .nav-links a {
        flex: 1 0 100%;
    }
    
    .links-grid {
        grid-template-columns: 2fr;
    }
    
    .web-link {
        padding: 10px;
    }
    
    .web-link i {
        font-size: 14px;
    }
}
