/* ========== NavHub 首页 - 苹果主题风格 ========== */

/* 全局重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* CSS 变量 - 苹果配色方案 */
:root {
    /* 背景色 */
    --bg-primary: #F5F5F7;
    --bg-secondary: #FBFBFD;
    --bg-card: #FFFFFF;

    /* 文字颜色 */
    --text-primary: #1D1D1F;
    --text-secondary: #86868B;
    --text-tertiary: #6E6E73;

    /* 强调色 - 苹果蓝 */
    --accent-primary: #0071E3;
    --accent-hover: #0077ED;
    --accent-light: rgba(0, 113, 227, 0.1);

    /* 阴影 */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 28px rgba(0, 0, 0, 0.15);

    /* 边框 */
    --border-light: rgba(0, 0, 0, 0.08);
    --border-medium: rgba(0, 0, 0, 0.12);

    /* 动画 */
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-quick: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);

    /* 圆角 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
}

/* Body 样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========== 导航栏样式 ========== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 48px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 0.5px solid var(--border-light);
    z-index: 1000;
    transition: var(--transition-smooth);
}

.nav-container {
    max-width: 1280px;
    height: 100%;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Logo 样式 */
.nav-logo a {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.022em;
    transition: var(--transition-quick);
}

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

/* 导航链接样式 */
.nav-links {
    display: flex;
    gap: 32px;
    list-style: none;
    align-items: center;
}

.nav-item {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 400;
    position: relative;
    transition: var(--transition-quick);
    letter-spacing: -0.01em;
}

.nav-item::after {
    content: "";
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-primary);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item:hover {
    color: var(--accent-primary);
}

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

/* 右侧功能区 */
.nav-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* 搜索框样式 - 苹果风格 */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box input {
    width: 200px;
    height: 32px;
    padding: 0 36px 0 12px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 13px;
    transition: var(--transition-quick);
    outline: none;
}

.search-box input:focus {
    width: 240px;
    background-color: var(--bg-card);
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px var(--accent-light);
}

.search-box input::placeholder {
    color: var(--text-secondary);
}

.search-icon {
    position: absolute;
    right: 10px;
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
    pointer-events: none;
    transition: var(--transition-quick);
}

.search-box:hover .search-icon {
    color: var(--accent-primary);
}

/* 收藏按钮样式 */
.favorite-btn {
    width: 32px;
    height: 32px;
    background-color: transparent;
    border: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-quick);
}

.favorite-btn:hover {
    background-color: var(--accent-light);
}

.favorite-btn.active {
    background-color: var(--accent-primary);
}

.favorite-btn.active .star-icon {
    fill: var(--bg-card);
    stroke: var(--bg-card);
    color: var(--bg-card);
}

.star-icon {
    width: 18px;
    height: 18px;
    color: var(--text-primary);
    transition: var(--transition-quick);
}

/* 汉堡菜单 */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
}

.hamburger span {
    width: 20px;
    height: 2px;
    background-color: var(--text-primary);
    transition: var(--transition-quick);
    border-radius: 2px;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* ========== 分类标签区域 ========== */
.category-section {
    margin-top: 48px;
    padding: 20px 0;
    background-color: var(--bg-card);
    border-bottom: 0.5px solid var(--border-light);
}

.category-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* 分类标签样式 */
.category-tag {
    padding: 6px 16px;
    border: none;
    border-radius: 16px;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-quick);
    letter-spacing: -0.01em;
}

.category-tag:hover {
    background-color: var(--accent-light);
    color: var(--accent-primary);
}

.category-tag.active {
    background-color: var(--accent-primary);
    color: var(--bg-card);
    box-shadow: 0 2px 8px rgba(0, 113, 227, 0.25);
}

/* ========== 主内容区域 ========== */
.nav-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 48px 24px 80px;
}

/* 卡片网格布局 */
.nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
}

/* ========== 工具卡片样式 - 苹果风格 ========== */
.nav-card {
    padding: 28px 24px;
    background-color: var(--bg-card);
    border: none;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.nav-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* 不同分类的卡片悬停效果 */
.nav-card[data-category="basic-dev"]:hover {
    background: linear-gradient(135deg, rgba(0, 113, 227, 0.04) 0%, var(--bg-card) 100%);
}

.nav-card[data-category="commercial-dev"]:hover {
    background: linear-gradient(135deg, rgba(175, 82, 222, 0.04) 0%, var(--bg-card) 100%);
}

.nav-card[data-category="research-dev"]:hover {
    background: linear-gradient(135deg, rgba(255, 149, 0, 0.04) 0%, var(--bg-card) 100%);
}

/* 卡片图标样式 */
.card-icon {
    font-size: 44px;
    line-height: 1;
    transition: var(--transition-smooth);
    opacity: 0.9;
}

.nav-card:hover .card-icon {
    transform: scale(1.08);
    opacity: 1;
}

/* 卡片标题 */
.nav-card h3 {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.022em;
    margin-top: 4px;
}

/* 卡片描述 */
.nav-card p {
    font-size: 13px;
    font-weight: 400;
    color: var(--text-secondary);
    line-height: 1.5;
    letter-spacing: -0.01em;
}

.nav-card:hover p {
    color: var(--text-tertiary);
}

/* 隐藏类 */
.nav-card.hidden {
    display: none;
}

/* ========== 响应式设计 ========== */

/* 平板设备 */
@media (max-width: 1024px) {
    .nav-container,
    .category-container,
    .nav-content {
        padding-left: 20px;
        padding-right: 20px;
    }

    .nav-links {
        gap: 24px;
    }

    .nav-item {
        font-size: 12px;
    }

    .nav-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 20px;
    }
}

/* 移动设备 */
@media (max-width: 768px) {
    .navbar {
        height: 44px;
    }

    .nav-container {
        padding: 0 16px;
    }

    .nav-logo a {
        font-size: 16px;
    }

    .hamburger {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: var(--bg-primary);
        flex-direction: column;
        justify-content: center;
        gap: 32px;
        transform: translateX(-100%);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        padding: 40px;
    }

    .nav-links.active {
        transform: translateX(0);
    }

    .nav-item {
        font-size: 24px;
        font-weight: 600;
    }

    .nav-item::after {
        display: none;
    }

    .search-box {
        display: none;
    }

    .category-section {
        margin-top: 44px;
        padding: 16px 0;
    }

    .category-container {
        padding: 0 16px;
        gap: 8px;
    }

    .category-tag {
        font-size: 12px;
        padding: 5px 14px;
    }

    .nav-content {
        padding: 32px 16px 60px;
    }

    .nav-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 16px;
    }

    .nav-card {
        padding: 20px 16px;
    }

    .card-icon {
        font-size: 36px;
    }

    .nav-card h3 {
        font-size: 15px;
    }

    .nav-card p {
        font-size: 12px;
    }

    .favorite-btn {
        width: 32px;
        height: 32px;
    }
}

/* 小屏手机 */
@media (max-width: 480px) {
    .nav-logo a {
        font-size: 15px;
    }

    .favorite-btn {
        width: 28px;
        height: 28px;
    }

    .star-icon {
        width: 16px;
        height: 16px;
    }

    .nav-grid {
        grid-template-columns: 1fr;
    }

    .nav-card {
        padding: 24px 20px;
    }
}

/* ========== 暗色模式支持（预留）========== */
@media (prefers-color-scheme: dark) {
    /* 暗色模式样式可在此处添加 */
}

/* ========== 打印样式 ========== */
@media print {
    .navbar,
    .category-section,
    .search-box,
    .favorite-btn,
    .hamburger {
        display: none;
    }

    .nav-content {
        margin-top: 0;
        padding-top: 0;
    }

    .nav-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

/* ========== 辅助工具类 ========== */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

/* 滚动条美化 - 苹果风格 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* 选中文本样式 */
::selection {
    background: var(--accent-light);
    color: var(--accent-primary);
}

::-moz-selection {
    background: var(--accent-light);
    color: var(--accent-primary);
}
