/* ==========================================================================
   善器阁 - 自定义样式
   ========================================================================== */

/* 全局样式 */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --shadow-primary: 0 10px 30px rgba(102, 126, 234, 0.3);
    --shadow-secondary: 0 10px 30px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: 'Noto Sans SC', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ==========================================================================
   导航栏样式
   ========================================================================== */
.navbar {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.navbar.navbar-scrolled {
    background: rgba(255, 255, 255, 0.98) !important;
    box-shadow: 0 2px 30px rgba(0, 0, 0, 0.15);
}

.navbar-brand {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700 !important;
    display: flex;
    align-items: center;
}

.navbar-brand i {
    font-size: 1.8rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all 0.3s ease;
}

.navbar-brand:hover i {
    transform: scale(1.15) rotate(10deg);
}

.navbar-nav .nav-link {
    color: #333 !important;
    font-weight: 500;
    margin: 0 10px;
    position: relative;
    transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: #667eea !important;
    transform: translateY(-2px);
}

.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-gradient);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.navbar-nav .nav-link:hover::after {
    width: 100%;
}

/* ==========================================================================
   Hero 区域样式
   ========================================================================== */
.hero-section {
    background: var(--primary-gradient);
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><defs><radialGradient id="a" cx="50%" cy="50%" r="50%"><stop offset="0%" stop-color="rgba(255,255,255,0.1)"/><stop offset="100%" stop-color="rgba(255,255,255,0)"/></radialGradient></defs><rect width="1000" height="1000" fill="url(%23a)"/></svg>');
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

.gradient-text {
    background: linear-gradient(45deg, #fff, #f0f0f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.animate-bounce {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
        transform: translate3d(0,0,0);
    }
    40%, 43% {
        animation-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060);
        transform: translate3d(0, -30px, 0);
    }
    70% {
        animation-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060);
        transform: translate3d(0, -15px, 0);
    }
    90% {
        transform: translate3d(0,-4px,0);
    }
}

/* ==========================================================================
   悬浮卡片动画
   ========================================================================== */
.floating-cards {
    position: relative;
    width: 400px;
    height: 400px;
    margin: 0 auto;
}

.floating-card {
    position: absolute;
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    animation: floatCard 6s ease-in-out infinite;
}

.floating-card.card-1 {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.floating-card.card-2 {
    top: 20%;
    right: 10%;
    animation-delay: 1.5s;
}

.floating-card.card-3 {
    bottom: 20%;
    left: 10%;
    animation-delay: 3s;
}

.floating-card.card-4 {
    bottom: 20%;
    right: 10%;
    animation-delay: 4.5s;
}

@keyframes floatCard {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(10deg);
    }
}

/* ==========================================================================
   搜索框样式
   ========================================================================== */
.search-container {
    position: relative;
    max-width: 600px;
}

.search-input-group {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50px;
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.search-input-group:focus-within {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.search-input {
    background: transparent !important;
    border: none !important;
    color: white !important;
    padding: 15px 25px !important;
    font-size: 1rem;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.7) !important;
}

.search-input:focus {
    box-shadow: none !important;
    outline: none !important;
}

.btn-search {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 15px 25px;
    transition: all 0.3s ease;
}

.btn-search:hover {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

.search-results {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    animation: slideDown 0.3s ease;
}

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

.search-result-item {
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s ease;
}

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

.search-result-item:hover {
    background: #f8f9fa;
}

.search-result-item h6 {
    font-weight: 600;
    margin-bottom: 5px;
}

.search-result-item h6 a {
    color: #333;
    text-decoration: none;
    transition: color 0.2s ease;
}

.search-result-item h6 a:hover {
    color: #667eea;
}

.search-result-item .badge {
    font-size: 0.75rem;
    padding: 4px 10px;
}

/* ==========================================================================
   下拉菜单样式
   ========================================================================== */
.dropdown-menu {
    border: none;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 10px;
    margin-top: 10px;
    min-width: 220px;
    animation: slideDown 0.3s ease;
    background: white;
}

.dropdown-item {
    border-radius: 10px;
    padding: 10px 15px;
    margin: 2px 0;
    transition: all 0.3s ease;
    color: #333;
    font-weight: 500;
    position: relative;
}

.dropdown-item:hover {
    background: var(--primary-gradient);
    color: white;
    transform: translateX(5px);
}

.dropdown-item .category-emoji {
    font-size: 1.2rem;
    margin-right: 10px;
    display: inline-block;
    transition: transform 0.3s ease;
}

.dropdown-item:hover .category-emoji {
    transform: scale(1.2);
}

.dropdown-toggle::after {
    margin-left: 8px;
    transition: transform 0.3s ease;
}

.dropdown-toggle[aria-expanded="true"]::after {
    transform: rotate(180deg);
}

/* 二级下拉菜单样式 */
.dropdown-submenu {
    position: relative;
}

.dropdown-submenu > .dropdown-toggle::after {
    content: "\f285";
    font-family: 'bootstrap-icons';
    border: none;
    vertical-align: middle;
    margin-left: auto;
    float: right;
    transition: transform 0.3s ease;
}

.dropdown-submenu:hover > .dropdown-toggle::after {
    transform: translateX(3px);
}

.dropdown-submenu > .submenu {
    display: none;
    position: absolute;
    left: 100%;
    top: 0;
    margin-left: 5px;
    min-width: 200px;
}

.dropdown-submenu:hover > .submenu {
    display: block;
    animation: slideRight 0.3s ease;
}

@keyframes slideRight {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 二级菜单项样式 */
.submenu .dropdown-item {
    font-size: 0.9rem;
    padding: 8px 15px;
}

.submenu .dropdown-item i {
    color: #667eea;
    transition: all 0.3s ease;
}

.submenu .dropdown-item:hover i {
    color: white;
    transform: scale(1.1);
}

/* ==========================================================================
   按钮样式
   ========================================================================== */
.btn-primary {
    background: var(--primary-gradient);
    border: none;
    border-radius: 50px;
    padding: 12px 30px;
    font-weight: 600;
    text-transform: none;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-primary);
    position: relative;
    overflow: hidden;
}

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

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
}

.btn-outline-light {
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50px;
    padding: 12px 30px;
    font-weight: 600;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: white;
    transform: translateY(-3px);
}

/* ==========================================================================
   卡片样式
   ========================================================================== */
.category-section {
    margin-bottom: 3rem;
}

.category-header {
    margin-bottom: 2rem;
}

.category-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

.category-title {
    font-size: 2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0;
}

.tool-card.card {
    border: none;
    border-radius: 20px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    overflow: hidden;
    position: relative;
}

.tool-card.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary-gradient);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.tool-card.card:hover::before {
    transform: scaleX(1);
}

.tool-card.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.tool-icon {
    width: 50px;
    height: 50px;
    background: var(--primary-gradient);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.tool-card:hover .tool-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: var(--shadow-primary);
}

.card-title a {
    color: #333 !important;
    font-weight: 600;
    transition: all 0.3s ease;
}

.card-title a:hover {
    color: #667eea !important;
}

/* ==========================================================================
   模态框样式
   ========================================================================== */
.modal-content {
    border: none;
    border-radius: 20px;
    backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.95);
}

.modal-header {
    background: var(--primary-gradient);
    color: white;
    border-radius: 20px 20px 0 0;
}

.modal-title {
    font-weight: 600;
}

/* ==========================================================================
   页脚样式
   ========================================================================== */
.footer {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%) !important;
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.05)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
}

.footer-link {
    position: relative;
    z-index: 10;
    display: inline-block;
    transition: all 0.3s ease;
    cursor: pointer;
}

.footer-link:hover {
    color: white !important;
    text-decoration: underline !important;
}

/* ==========================================================================
   响应式设计
   ========================================================================== */
@media (max-width: 991px) {
    /* 移动端二级菜单样式 */
    .dropdown-submenu > .submenu {
        position: static;
        display: none;
        margin-left: 20px;
        margin-top: 5px;
        box-shadow: none;
        background: rgba(102, 126, 234, 0.05);
        border-left: 3px solid #667eea;
    }

    .dropdown-submenu > .dropdown-toggle::after {
        content: "\f282";
    }
}

@media (max-width: 768px) {
    .floating-cards {
        width: 300px;
        height: 300px;
    }

    .floating-card {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }

    .category-icon {
        font-size: 2.5rem;
    }

    .category-title {
        font-size: 1.5rem;
    }

    .hero-content h1 {
        font-size: 2.5rem !important;
    }
}

@media (max-width: 576px) {
    .btn-lg {
        padding: 10px 20px;
        font-size: 1rem;
    }

    .d-flex.gap-3 {
        flex-direction: column;
        gap: 1rem !important;
    }

    .floating-cards {
        display: none;
    }
}

/* ==========================================================================
   动画增强
   ========================================================================== */
.tool-card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.tool-card:hover {
    animation: cardPulse 0.6s ease-in-out;
}

@keyframes cardPulse {
    0% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-10px) scale(1.02); }
    100% { transform: translateY(-10px) scale(1); }
}

/* 加载动画 */
.category-section {
    opacity: 0;
    animation: fadeInUp 0.8s ease-out forwards;
}

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

/* 文字渐变效果 */
.gradient-text-primary {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 悬停效果增强 */
.stretched-link::after {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
    content: "";
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-gradient);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 选择文本样式 */
::selection {
    background: rgba(102, 126, 234, 0.3);
    color: #333;
}

::-moz-selection {
    background: rgba(102, 126, 234, 0.3);
    color: #333;
}