/* ============================================
   简念生活 - 统一样式库
   版本: 2.0
   更新日期: 2026-03-10
   ============================================ */

/* CSS变量定义 */
:root {
    /* 主色调 */
    --primary: #667eea;
    --primary-dark: #764ba2;
    --accent: #f093fb;
    
    /* 背景色 */
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bg-card: rgba(255, 255, 255, 0.95);
    --bg-glass: rgba(255, 255, 255, 0.1);
    
    /* 文字色 */
    --text-primary: #333;
    --text-secondary: #666;
    --text-light: #999;
    --text-white: #fff;
    
    /* 边框 */
    --border-light: rgba(255, 255, 255, 0.2);
    --border-card: #e0e0e0;
    
    /* 阴影 */
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.15);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.2);
    --shadow-hover: 0 20px 60px rgba(0,0,0,0.3);
    
    /* 圆角 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 25px;
    
    /* 间距 */
    --space-xs: 8px;
    --space-sm: 12px;
    --space-md: 20px;
    --space-lg: 30px;
    --space-xl: 40px;
    
    /* 动画 */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-md);
}

/* ============================================
   导航栏
   ============================================ */
.navbar {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-light);
    padding: var(--space-sm) 0;
    margin: calc(-1 * var(--space-md)) calc(-1 * var(--space-md)) 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all var(--transition-normal);
}

.navbar.scrolled {
    background: rgba(102, 126, 234, 0.95);
    box-shadow: var(--shadow-md);
}

.navbar-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-logo {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-white);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    transition: opacity var(--transition-fast);
}

.navbar-logo:hover {
    opacity: 0.9;
}

.navbar-nav {
    display: flex;
    gap: var(--space-md);
    list-style: none;
}

.navbar-nav > li {
    position: relative;
}

.navbar-nav a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all var(--transition-normal);
    padding: var(--space-xs) calc(var(--space-xs) + 2px);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    gap: 5px;
}

.navbar-nav a:hover {
    color: var(--text-white);
    background: rgba(255, 255, 255, 0.2);
}

.navbar-nav a.active {
    color: var(--text-white);
    background: rgba(255, 255, 255, 0.25);
}

/* 二级导航菜单 */
.navbar-nav .dropdown {
    position: relative;
}

.navbar-nav .dropdown > a::after {
    content: '▼';
    font-size: 0.7rem;
    transition: transform var(--transition-fast);
}

.navbar-nav .dropdown:hover > a::after {
    transform: rotate(180deg);
}

.navbar-nav .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(255, 255, 255, 0.98);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: var(--space-xs) 0;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-normal);
    z-index: 1001;
    margin-top: 5px;
}

.navbar-nav .dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.navbar-nav .dropdown-menu li {
    list-style: none;
}

.navbar-nav .dropdown-menu a {
    color: var(--text-primary);
    padding: 10px var(--space-md);
    border-radius: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.navbar-nav .dropdown-menu a:hover {
    background: #f8f9ff;
    color: var(--primary);
}

.navbar-nav .dropdown-menu a.active {
    background: #f0f0f0;
    color: var(--primary);
}

.navbar-nav .dropdown-menu .menu-label {
    font-size: 0.75rem;
    color: var(--text-light);
    padding: 8px var(--space-md);
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 5px;
}

/* ============================================
   Header区域
   ============================================ */
header {
    text-align: center;
    padding: var(--space-xl) var(--space-md) calc(var(--space-xl) + 20px);
    color: var(--text-white);
}

.logo {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: var(--space-xs);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    animation: fadeInDown 0.8s ease;
}

.logo a {
    color: var(--text-white);
    text-decoration: none;
}

.tagline {
    font-size: 1.2rem;
    opacity: 0.9;
    font-weight: 300;
    animation: fadeInUp 0.8s ease 0.2s both;
}

/* ============================================
   搜索框
   ============================================ */
.search-box {
    max-width: 600px;
    margin: 0 auto var(--space-xl);
    position: relative;
    animation: fadeInUp 0.8s ease 0.4s both;
}

.search-box input {
    width: 100%;
    padding: 15px 25px;
    border: none;
    border-radius: var(--radius-xl);
    font-size: 1rem;
    box-shadow: var(--shadow-lg);
    outline: none;
    transition: all var(--transition-normal);
}

.search-box input:focus {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

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

/* ============================================
   卡片组件
   ============================================ */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
    border: 1px solid transparent;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary);
}

.card-header {
    display: flex;
    align-items: center;
    margin-bottom: var(--space-sm);
    padding-bottom: var(--space-sm);
    border-bottom: 2px solid #f0f0f0;
}

.card-icon {
    width: 45px;
    height: 45px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-right: var(--space-sm);
    background: var(--bg-gradient);
    color: var(--text-white);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    flex: 1;
}

.card-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: var(--space-sm);
}

/* ============================================
   分类组件
   ============================================ */
.category {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
}

.category:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.category-header {
    display: flex;
    align-items: center;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 2px solid #f0f0f0;
}

.category-icon {
    width: 45px;
    height: 45px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-right: var(--space-sm);
}

.category-title {
    font-size: 1.3rem;
    font-weight: 700;
}

.category-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 3px;
}

/* 分类颜色 */
.chat { --cat-color: #10a37f; }
.image { --cat-color: #ff6b6b; }
.code { --cat-color: #4ecdc4; }
.video { --cat-color: #f7b731; }
.audio { --cat-color: #5f27cd; }
.writing { --cat-color: #00d2d3; }
.search { --cat-color: #ff9ff3; }
.learning { --cat-color: #54a0ff; }

.chat .category-icon { background: rgba(16, 163, 127, 0.2); }
.image .category-icon { background: rgba(255, 107, 107, 0.2); }
.code .category-icon { background: rgba(78, 205, 196, 0.2); }
.video .category-icon { background: rgba(247, 183, 49, 0.2); }
.audio .category-icon { background: rgba(95, 39, 205, 0.2); }
.writing .category-icon { background: rgba(0, 210, 211, 0.2); }
.search .category-icon { background: rgba(255, 159, 243, 0.2); }
.learning .category-icon { background: rgba(84, 160, 255, 0.2); }

/* ============================================
   链接列表
   ============================================ */
.links {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.link-item {
    display: flex;
    align-items: center;
    padding: var(--space-sm);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-primary);
    transition: all var(--transition-normal);
    border: 1px solid transparent;
}

.link-item:hover {
    background: #f8f9ff;
    border-color: var(--primary);
    transform: translateX(5px);
}

.link-icon {
    width: 35px;
    height: 35px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: var(--space-sm);
    font-size: 1.1rem;
    background: #f0f0f0;
}

.link-info {
    flex: 1;
}

.link-name {
    font-weight: 500;
    font-size: 0.95rem;
}

.link-desc {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 2px;
}

.link-arrow {
    color: #ccc;
    font-size: 1.2rem;
    transition: color var(--transition-fast);
}

.link-item:hover .link-arrow {
    color: var(--primary);
}

/* ============================================
   标签
   ============================================ */
.tag {
    display: inline-block;
    padding: 4px 12px;
    background: var(--primary);
    color: var(--text-white);
    border-radius: 15px;
    font-size: 0.8rem;
    margin-right: var(--space-xs);
    margin-bottom: var(--space-xs);
    transition: all var(--transition-fast);
}

.tag:hover {
    transform: scale(1.05);
}

.tag.green { background: #10a37f; }
.tag.orange { background: #f7b731; }
.tag.purple { background: #764ba2; }
.tag.red { background: #ff6b6b; }

/* ============================================
   按钮
   ============================================ */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: var(--radius-xl);
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    border: none;
    outline: none;
}

.btn-primary {
    background: var(--bg-gradient);
    color: var(--text-white);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-white);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ============================================
   返回顶部按钮
   ============================================ */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--bg-gradient);
    color: var(--text-white);
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

/* ============================================
   Footer
   ============================================ */
footer {
    text-align: center;
    padding: var(--space-xl) var(--space-md);
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

footer a {
    color: var(--text-white);
    text-decoration: none;
    transition: opacity var(--transition-fast);
}

footer a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

/* ============================================
   动画
   ============================================ */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* ============================================
   响应式设计
   ============================================ */
@media (max-width: 768px) {
    .navbar {
        padding: var(--space-xs) 0;
        margin: calc(-1 * var(--space-md)) calc(-1 * var(--space-md)) 0;
    }
    
    .navbar-logo {
        font-size: 1.1rem;
    }
    
    .navbar-nav {
        gap: var(--space-xs);
    }
    
    .navbar-nav a {
        font-size: 0.85rem;
        padding: var(--space-xs) calc(var(--space-xs) - 2px);
    }
    
    .logo {
        font-size: 2rem;
    }
    
    .tagline {
        font-size: 1rem;
    }
    
    header {
        padding: var(--space-lg) var(--space-md);
    }
    
    .card:hover,
    .category:hover {
        transform: translateY(-3px);
    }
    
    .back-to-top {
        width: 45px;
        height: 45px;
        bottom: 20px;
        right: 20px;
    }
}

@media (max-width: 480px) {
    .navbar-nav {
        gap: 8px;
    }
    
    .navbar-nav a {
        font-size: 0.8rem;
        padding: 4px 6px;
    }
    
    .logo {
        font-size: 1.8rem;
    }
}

/* ============================================
   工具类
   ============================================ */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: var(--space-xs); }
.mt-2 { margin-top: var(--space-sm); }
.mt-3 { margin-top: var(--space-md); }
.mt-4 { margin-top: var(--space-lg); }

.mb-1 { margin-bottom: var(--space-xs); }
.mb-2 { margin-bottom: var(--space-sm); }
.mb-3 { margin-bottom: var(--space-md); }
.mb-4 { margin-bottom: var(--space-lg); }

.hidden { display: none !important; }
.visible { display: block !important; }

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: var(--text-white);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 骨架屏 */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
