/* Header 水平排列优化 */
.header {
    width: 100%;
    padding:0.5rem 1rem;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 auto;
}



.header .logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-direction: row;
    flex-wrap: nowrap;
}

.header .logo img {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.header .logo h1 {
    margin: 0;
    font-size: 1.8rem;
    color: #333;
    font-weight: 600;
    white-space: nowrap;
    writing-mode: horizontal-tb;
    text-orientation: mixed;
}

.header .logo .subtitle {
    font-size: 0.9rem;
    color: #666;
    font-weight: 400;
}

.header .nav {
    display: flex;
    align-items: center;
}

.header .login-btn {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 0 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    line-height: 38px;
    height: 38px;
    transition: background-color 0.3s ease;
    box-sizing: border-box;
}

.header .login-btn:hover {
    background-color: #0056b3;
}

/* 用户信息区域 */
.user-info {
    position: relative;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    animation: fadeIn 0.3s ease;
    user-select: none;
}

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

.user-info::after {
    content: '▼';
    font-size: 0.7rem;
    color: #6c757d;
    margin-left: 0.5rem;
    transition: transform 0.3s ease;
}

.user-info:hover::after {
    transform: rotate(180deg);
    color: #007bff;
}

.user-info:hover {
    background-color: #f8f9fa;
}

#user-phone {
    font-size: 1rem;
    color: #333;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

#user-phone::before {
    content: '👤';
    font-size: 0.9rem;
    filter: grayscale(0.3);
}

/* 用户下拉菜单 */
.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    min-width: 160px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    margin-top: 0.5rem;
    overflow: hidden;
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.95);
}

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

.dropdown-item {
    display: block;
    padding: 0.8rem 1rem;
    color: #333;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

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

.dropdown-item:hover {
    background-color: #f8f9fa;
    color: #007bff;
}

.info-box{
    margin-top: 1rem;
    margin-bottom: 2rem;
    min-height: 100px;
}

/* 工具网格区域 */
.nav-link-box {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
    padding: 0 1rem;
}

.tool-item {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    aspect-ratio: 1;
    background: #1E9FFF;
    border-radius: 12px;
    text-decoration: none;
    color: white;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(30, 159, 255, 0.3);
}

.tool-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(30, 159, 255, 0.4);
    background: #1EAFFF;
}

.tool-item:active {
    transform: translateY(0);
}

.tool-name {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 0.2rem;
    text-align: center;
    line-height: 1.2;
}

.tool-type {
    font-size: 0.75rem;
    opacity: 0.9;
    text-align: center;
    line-height: 1.2;
}


/* 响应式设计 */
@media (max-width: 768px) {
    .header .container {
        padding: 0 1rem;
    }
    
    .header .logo h1 {
        font-size: 1.5rem;
    }
    
    .header .logo img {
        width: 40px;
        height: 40px;
    }
    
    .header .login-btn {
        padding: 0.4rem 1rem;
        font-size: 0.9rem;
    }
    
    /* 移动端用户下拉菜单适配 */
    .user-dropdown {
        right: -10px;
        min-width: 140px;
        box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    }
    
    .dropdown-item {
        padding: 0.7rem 1rem;
        font-size: 0.9rem;
    }
    
    .user-info {
        padding: 0.4rem 0.8rem;
    }
    
    #user-phone {
        font-size: 0.9rem;
    }
    
    #user-phone::before {
        font-size: 0.8rem;
    }
    
    .user-info::after {
        font-size: 0.6rem;
        margin-left: 0.3rem;
    }
}

@media (max-width: 480px) {
    .header .container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .header .logo {
        justify-content: center;
    }
    
    /* 移动端工具网格响应式 */
    .nav-link-box {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 0.8rem;
        margin: 1rem 0;
        padding: 0 1rem;
    }
    
    .tool-name {
        font-size: 0.8rem;
    }
    
    .tool-type {
        font-size: 0.7rem;
    }
}