/* 纺织学 - 多彩织物风格 */

:root {
    --primary: #D35400;
    --primary-light: #E67E22;
    --secondary: #27AE60;
    --accent: #8E44AD;
    --bg-main: #FDF6F0;
    --bg-sidebar: #2C3E50;
    --text-light: #ECF0F1;
    --text-dark: #2C3E50;
    --card-bg: #FFFFFF;
    --border-color: #E0D5C8;
    --thread-red: #C0392B;
    --thread-blue: #2980B9;
    --thread-green: #27AE60;
    --thread-gold: #F39C12;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
    background-color: var(--bg-main);
    color: var(--text-dark);
    line-height: 1.8;
}

.container {
    display: flex;
    min-height: calc(100vh - 60px);
}

/* 侧边栏 */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, var(--bg-sidebar) 0%, #1A252F 100%);
    color: var(--text-light);
    padding: 30px 20px;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.logo h1 {
    font-size: 24px;
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--thread-gold);
    margin-bottom: 20px;
}

.nav-menu ul {
    list-style: none;
}

.nav-menu li {
    margin-bottom: 8px;
}

.nav-menu a {
    display: block;
    padding: 12px 16px;
    color: var(--text-light);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s;
}

.nav-menu a:hover,
.nav-menu a.active {
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    transform: translateX(5px);
}

.back-link {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.2);
}

.back-link a {
    color: var(--thread-gold);
    text-decoration: none;
    font-size: 14px;
}

.back-link a:hover {
    color: var(--primary-light);
}

/* 内容区 */
.content {
    margin-left: 260px;
    padding: 40px;
    flex: 1;
    max-width: calc(100% - 260px);
}

/* Hero区域 */
.hero {
    text-align: center;
    padding: 50px 20px;
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--thread-gold) 100%);
    border-radius: 16px;
    margin-bottom: 40px;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: repeating-linear-gradient(
        90deg,
        var(--thread-red),
        var(--thread-red) 25%,
        var(--thread-blue) 25%,
        var(--thread-blue) 50%,
        var(--thread-green) 50%,
        var(--thread-green) 75%,
        var(--thread-gold) 75%,
        var(--thread-gold) 100%
    );
}

.hero h2 {
    font-size: 42px;
    color: var(--primary);
    margin-bottom: 10px;
    margin-top: 10px;
}

.hero .subtitle {
    font-size: 20px;
    color: var(--primary-light);
    font-weight: bold;
    margin-bottom: 20px;
}

.hero .description {
    max-width: 800px;
    margin: 0 auto;
    font-size: 16px;
    line-height: 1.8;
}

/* 模块卡片 */
.modules {
    margin-bottom: 40px;
}

.modules h3,
.color-palette h3,
.learning-path h3,
.textile-culture h3 {
    font-size: 24px;
    color: var(--primary);
    margin-bottom: 20px;
    padding-left: 15px;
    border-left: 4px solid var(--accent);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    position: relative;
    overflow: hidden;
}

.card::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--thread-red), var(--thread-blue), var(--thread-green), var(--thread-gold));
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(211, 84, 0, 0.15);
}

.card-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.card h4 {
    font-size: 20px;
    color: var(--primary);
    margin-bottom: 10px;
}

.card p {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
}

.btn {
    display: inline-block;
    padding: 10px 24px;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-size: 14px;
    transition: all 0.3s;
}

.btn:hover {
    background: var(--primary-light);
    transform: scale(1.05);
}

/* 色彩展示 */
.color-palette {
    margin-bottom: 40px;
}

.palette-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
}

.color-swatch {
    aspect-ratio: 1;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    transition: all 0.3s;
    cursor: pointer;
}

.color-swatch:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.color-swatch span {
    background: rgba(255,255,255,0.9);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    color: #333;
}

/* 学习路径 */
.learning-path {
    margin-bottom: 40px;
}

.path-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 30px;
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.step {
    text-align: center;
    padding: 20px;
    min-width: 150px;
}

.step-num {
    display: inline-block;
    width: 45px;
    height: 45px;
    line-height: 45px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    border-radius: 50%;
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 18px;
}

.step h4 {
    color: var(--primary);
    margin-bottom: 5px;
}

.step p {
    font-size: 13px;
    color: #666;
}

.step-arrow {
    font-size: 24px;
    color: var(--primary-light);
}

/* 纺织文化 */
.textile-culture {
    margin-bottom: 40px;
}

.culture-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.culture-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 25px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all 0.3s;
    position: relative;
}

.culture-card::before {
    content: "";
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    pointer-events: none;
}

.culture-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.culture-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.culture-card h4 {
    font-size: 18px;
    color: var(--primary);
    margin-bottom: 8px;
}

.culture-card p {
    font-size: 13px;
    color: #666;
}

/* 页脚 */
.footer {
    background: var(--bg-sidebar);
    color: var(--thread-gold);
    text-align: center;
    padding: 20px;
    margin-left: 260px;
}

.footer p {
    font-size: 14px;
}

/* 响应式 */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        position: relative;
        height: auto;
    }
    
    .content {
        margin-left: 0;
        max-width: 100%;
    }
    
    .footer {
        margin-left: 0;
    }
    
    .container {
        flex-direction: column;
    }
    
    .path-steps {
        flex-direction: column;
    }
    
    .step-arrow {
        transform: rotate(90deg);
    }
    
    .palette-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
