/* 
 * 全新多页面卡片系统 - Materialsmarket 配色
 * 文件路径: css/style.css
 */

:root {
    /* 主色调：珊瑚橙 */
    --primary: #FF6B6B;
    --primary-light: #FF8E8E;
    --primary-dark: #E85555;
    
    /* 辅助色：青蓝 */
    --accent: #4ECDC4;
    --accent-light: #7EDDD6;
    
    /* 中性色 */
    --text-main: #2D3436;
    --text-sub: #636E72;
    --text-light: #B2BEC3;
    --bg-page: #F0F4F8;
    --bg-card: #FFFFFF;
    --border-color: #E1E8ED;
    
    /* 渐变 */
    --gradient-primary: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    --gradient-accent: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
    --gradient-mixed: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    
    /* 阴影 */
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.08);
    --shadow-lg: 0 16px 48px rgba(0,0,0,0.12);
    --shadow-hover: 0 20px 60px rgba(255, 107, 107, 0.15);
}

/* ========== 基础重置 ========== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
}

/* ========== 导航栏 ========== */
.navbar {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    height: 70px;
    padding: 0 50px;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    font-size: 24px;
    font-weight: 800;
    text-decoration: none;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.3s;
}

.brand:hover {
    transform: scale(1.02);
}

.nav-menu {
    display: flex;
    gap: 8px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-sub);
    padding: 10px 20px;
    font-weight: 600;
    font-size: 15px;
    border-radius: 8px;
    transition: all 0.3s;
    position: relative;
}

.nav-link:hover {
    color: var(--primary);
    background: rgba(255, 107, 107, 0.08);
}

.nav-link.active {
    color: var(--primary);
    background: rgba(255, 107, 107, 0.1);
}

/* 移动端菜单按钮 */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

@media (max-width: 900px) {
    .nav-menu { display: none; }
    .mobile-menu-btn { display: block; }
    .navbar { padding: 0 20px; }
}

/* ========== Hero 区域 ========== */
.hero {
    background: var(--gradient-mixed);
    padding: 80px 20px;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: pulse 15s ease-in-out infinite;
}

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

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: clamp(32px, 5vw, 56px);
    font-weight: 800;
    margin-bottom: 20px;
    text-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.hero p {
    font-size: 18px;
    opacity: 0.95;
    margin-bottom: 30px;
}

.hero-btn {
    display: inline-block;
    padding: 16px 40px;
    background: white;
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
    border-radius: 50px;
    transition: all 0.3s;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.hero-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}

/* ========== 页面标题区 ========== */
.page-header {
    background: white;
    padding: 60px 20px 40px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.page-header h1 {
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 800;
    margin-bottom: 12px;
    color: var(--text-main);
}

.page-header p {
    font-size: 16px;
    color: var(--text-sub);
    max-width: 600px;
    margin: 0 auto;
}

/* ========== 主内容区 ========== */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 50px 20px;
}

/* ========== 卡片网格系统 ========== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 50px;
}

@media (max-width: 1024px) {
    .card-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .card-grid { grid-template-columns: 1fr; }
}

/* ========== 卡片样式（核心） ========== */
.card {
    background: var(--bg-card);
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    padding: 30px;
    border: 1px solid var(--border-color);
    text-decoration: none;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* 卡片顶部装饰条 */
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient-mixed);
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

/* Hover 动画效果 */
.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-light);
}

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

/* 卡片图标 */
.card-icon {
    width: 60px;
    height: 60px;
    background: var(--gradient-mixed);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 20px;
    transition: transform 0.3s;
}

.card:hover .card-icon {
    transform: scale(1.1) rotate(5deg);
}

/* 卡片标题 */
.card-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-main);
    transition: color 0.3s;
}

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

/* 卡片描述 */
.card-desc {
    font-size: 14px;
    color: var(--text-sub);
    line-height: 1.7;
    margin-bottom: 20px;
    flex: 1;
}

/* 卡片标签 */
.card-tag {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(78, 205, 196, 0.15);
    color: var(--accent);
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
}

/* 特色卡片（首页使用） */
.card-featured {
    background: var(--gradient-mixed);
    color: white;
}

.card-featured .card-title,
.card-featured .card-desc {
    color: white;
}

.card-featured .card-tag {
    background: rgba(255,255,255,0.2);
    color: white;
}

.card-featured .card-icon {
    background: rgba(255,255,255,0.2);
}

.card-featured::before {
    background: white;
}

/* ========== 分类标题 ========== */
.section-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 30px;
    color: var(--text-main);
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 50px;
    height: 4px;
    background: var(--gradient-mixed);
    border-radius: 2px;
}

/* ========== 广告位样式 ========== */
.ad-container {
    background: #F8F9FB;
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 13px;
    font-weight: 600;
    margin: 30px 0;
    position: relative;
    transition: all 0.3s;
}

.ad-container:hover {
    border-color: var(--primary-light);
    background: white;
}

.ad-container::before {
    content: 'AD';
    position: absolute;
    top: 8px;
    left: 12px;
    font-size: 10px;
    color: var(--text-light);
}

/* 广告尺寸 */
.ad-banner {
    width: 100%;
    height: 90px;
    margin: 0;
}

.ad-rectangle {
    height: 250px;
}

.ad-large {
    height: 400px;
}

/* ========== 页脚 ========== */
.footer {
    background: var(--text-main);
    color: white;
    padding: 60px 20px 30px;
    margin-top: 80px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
}

@media (max-width: 900px) {
    .footer-content { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .footer-content { grid-template-columns: 1fr; }
}

.footer-section h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--primary-light);
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 12px;
}

.footer-section a {
    color: #B2BEC3;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: var(--primary-light);
}

.footer-bottom {
    max-width: 1200px;
    margin: 40px auto 0;
    padding-top: 30px;
    border-top: 1px solid rgba(255,255,255,0.1);
    text-align: center;
    font-size: 14px;
    color: #636E72;
}

/* ========== 特殊页面卡片样式 ========== */

/* 工具卡片 */
.tool-card .card-icon { background: var(--gradient-primary); }

/* 资源卡片 */
.resource-card .card-icon { background: var(--gradient-accent); }

/* 关于页卡片 */
.about-card {
    text-align: center;
    padding: 40px 30px;
}

.about-card .card-icon {
    margin: 0 auto 20px;
    width: 80px;
    height: 80px;
    font-size: 36px;
}

/* 联系表单 */
.contact-form {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-main);
}

.form-input {
    width: 100%;
    padding: 14px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 15px;
    transition: border-color 0.3s;
}

.form-input:focus {
    border-color: var(--primary);
    outline: none;
}

.form-textarea {
    min-height: 150px;
    resize: vertical;
}

.btn-submit {
    width: 100%;
    padding: 16px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
}
