/* ========================================
   RFID技术博客 - 全局样式表
   版本: 1.0.0
   描述: 科技感紫色/蓝色渐变主题
======================================== */

/* ========================================
   CSS变量定义
======================================== */
:root {
    /* 主色调 - 紫色渐变 */
    --primary-color: #667eea;
    --primary-light: #764ba2;
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    
    /* 辅助色 - 蓝色系 */
    --secondary-color: #4facfe;
    --secondary-light: #00f2fe;
    --secondary-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    
    /* 功能色 */
    --success-color: #52c41a;
    --warning-color: #faad14;
    --danger-color: #ff4d4f;
    
    /* 中性色 */
    --text-primary: #1a1a2e;
    --text-secondary: #4a4a6a;
    --text-light: #8c8ca1;
    --bg-light: #f8f9fc;
    --bg-white: #ffffff;
    --border-color: #e8e8f0;
    
    /* 间距 */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-xxl: 4rem;
    
    /* 圆角 */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 20px;
    
    /* 阴影 */
    --shadow-sm: 0 2px 8px rgba(102, 126, 234, 0.1);
    --shadow-md: 0 4px 16px rgba(102, 126, 234, 0.15);
    --shadow-lg: 0 8px 32px rgba(102, 126, 234, 0.2);
    
    /* 字体 */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    
    /* 过渡 */
    --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: var(--font-family);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-light);
    min-height: 100vh;
}

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

ul, ol {
    list-style: none;
}

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

button {
    cursor: pointer;
    border: none;
    outline: none;
    font-family: inherit;
}

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

/* ========================================
   导航栏
======================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-md);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: var(--primary-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 18px;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.nav-link {
    position: relative;
    padding: var(--spacing-xs) 0;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-gradient);
    transition: width var(--transition-fast);
}

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

/* 移动端菜单按钮 */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
    background: transparent;
}

.menu-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: all var(--transition-fast);
}

/* ========================================
   Hero区域
======================================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 80px;
    background: var(--primary-gradient);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: white;
    max-width: 800px;
    margin: 0 auto;
    padding: var(--spacing-xxl) var(--spacing-md);
}

.hero-badge {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    font-size: 0.875rem;
    margin-bottom: var(--spacing-md);
    backdrop-filter: blur(10px);
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    opacity: 0.9;
    margin-bottom: var(--spacing-lg);
    line-height: 1.8;
}

.hero-buttons {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
    flex-wrap: wrap;
}

/* ========================================
   按钮样式
======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-lg);
    transition: all var(--transition-normal);
    cursor: pointer;
}

.btn-primary {
    background: white;
    color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.4);
}

.btn-secondary {
    background: transparent;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: white;
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 16px 36px;
    font-size: 1.125rem;
}

/* ========================================
   卡片样式
======================================== */
.card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
}

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

.card-icon {
    width: 60px;
    height: 60px;
    background: var(--primary-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--spacing-md);
    font-size: 24px;
    color: white;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
    color: var(--text-primary);
}

.card-text {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ========================================
   区块样式
======================================== */
.section {
    padding: var(--spacing-xxl) 0;
}

.section-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.section-title {
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.section-subtitle {
    font-size: 1rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

/* ========================================
   特色栏目展示
======================================== */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
}

/* ========================================
   文章卡片
======================================== */
.article-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    display: flex;
    flex-direction: column;
}

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

.article-card-image {
    height: 180px;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: white;
}

.article-card-content {
    padding: var(--spacing-md);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.article-card-tags {
    display: flex;
    gap: var(--spacing-xs);
    flex-wrap: wrap;
    margin-bottom: var(--spacing-xs);
}

.article-card-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-card-title:hover {
    color: var(--primary-color);
}

.article-card-excerpt {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.article-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--spacing-sm);
    padding-top: var(--spacing-sm);
    border-top: 1px solid var(--border-color);
    font-size: 0.8125rem;
    color: var(--text-light);
}

/* ========================================
   标签样式
======================================== */
.tag {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.tag:hover {
    background: var(--primary-color);
    color: white;
}

.tag.active {
    background: var(--primary-gradient);
    color: white;
}

/* ========================================
   文章列表页
======================================== */
.page-header {
    padding-top: 120px;
    padding-bottom: var(--spacing-xl);
    background: var(--primary-gradient);
    color: white;
    text-align: center;
}

.page-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    margin-bottom: var(--spacing-xs);
}

.page-subtitle {
    font-size: 1rem;
    opacity: 0.9;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    justify-content: center;
    margin-bottom: var(--spacing-lg);
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: var(--spacing-lg);
}

/* ========================================
   产品分类
======================================== */
.product-category {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
}

.product-category:hover {
    box-shadow: var(--shadow-md);
}

.product-category-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    cursor: pointer;
}

.product-category-icon {
    width: 64px;
    height: 64px;
    background: var(--primary-gradient);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
    flex-shrink: 0;
}

.product-category-info {
    flex: 1;
}

.product-category-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.product-category-desc {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.product-category-toggle {
    width: 32px;
    height: 32px;
    background: var(--bg-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-fast);
    color: var(--text-light);
}

.product-category.active .product-category-toggle {
    transform: rotate(180deg);
}

.product-category-content {
    display: none;
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
    margin-top: var(--spacing-lg);
}

.product-category.active .product-category-content {
    display: block;
}

.product-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--spacing-md);
}

.product-item {
    background: var(--bg-light);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    text-align: center;
    transition: all var(--transition-fast);
}

.product-item:hover {
    background: rgba(102, 126, 234, 0.1);
}

.product-item-icon {
    font-size: 32px;
    margin-bottom: var(--spacing-xs);
}

.product-item-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9375rem;
}

/* ========================================
   关于页面
======================================== */
.about-section {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: var(--spacing-xl);
    align-items: start;
}

.about-avatar {
    width: 100%;
    max-width: 280px;
    aspect-ratio: 1;
    background: var(--primary-gradient);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 80px;
    color: white;
    margin: 0 auto;
}

.about-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

.about-content p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: var(--spacing-sm);
}

.contact-list {
    margin-top: var(--spacing-lg);
}

.contact-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
    background: var(--bg-light);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-xs);
}

.contact-item-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.contact-item-text {
    color: var(--text-secondary);
}

/* ========================================
   页脚
======================================== */
.footer {
    background: var(--text-primary);
    color: white;
    padding: var(--spacing-xl) 0 var(--spacing-lg);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-lg);
}

.footer-section h3 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    color: white;
}

.footer-section p,
.footer-section a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    line-height: 1.8;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: var(--spacing-lg);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-copyright {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
}

.icp-license {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.75rem;
    margin-top: var(--spacing-xs);
}

/* ========================================
   加载动画
======================================== */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

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

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

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

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

/* 平板设备 */
@media (max-width: 1024px) {
    .hero-content {
        padding: var(--spacing-xl) var(--spacing-md);
    }
    
    .about-section {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .about-avatar {
        max-width: 200px;
    }
}

/* 移动端设备 */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: var(--spacing-md);
        gap: 0;
        box-shadow: var(--shadow-md);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition-normal);
    }
    
    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-link {
        display: block;
        padding: var(--spacing-sm);
        text-align: center;
        border-bottom: 1px solid var(--border-color);
    }
    
    .nav-link:last-child {
        border-bottom: none;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }
    
    .hero {
        min-height: auto;
        padding: 120px 0 60px;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .articles-grid {
        grid-template-columns: 1fr;
    }
    
    .product-category-header {
        flex-wrap: wrap;
    }
    
    .product-category-toggle {
        order: 3;
        margin-left: auto;
    }
    
    .product-list {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .section {
        padding: var(--spacing-xl) 0;
    }
}

/* 小屏手机 */
@media (max-width: 480px) {
    .hero-title {
        font-size: 1.75rem;
    }
    
    .hero-subtitle {
        font-size: 0.9375rem;
    }
    
    .btn {
        width: 100%;
        padding: 14px 20px;
    }
    
    .hero-buttons {
        flex-direction: column;
        padding: 0 var(--spacing-lg);
    }
    
    .card {
        padding: var(--spacing-md);
    }
    
    .product-list {
        grid-template-columns: 1fr;
    }
    
    .filter-bar {
        padding: 0 var(--spacing-sm);
    }
}

/* ========================================
   辅助类
======================================== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }
.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }

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

/* ========================================
   无内容提示
======================================== */
.empty-state {
    text-align: center;
    padding: var(--spacing-xxl) var(--spacing-md);
    color: var(--text-light);
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: var(--spacing-md);
    opacity: 0.5;
}

.empty-state-text {
    font-size: 1.125rem;
}
