/* --- Variables & Reset --- */
:root {
    --primary: #3b82f6;
    --primary-dark: #1e40af;
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    --radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body, html {
    margin: 0;
    padding: 0;
    font-family: 'Noto Sans SC', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
}

a { text-decoration: none; color: inherit; transition: var(--transition); }
ul { list-style: none; padding: 0; margin: 0; }

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 24px;
}

/* --- Header (Glassmorphism) --- */
.glass-header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 16px 0;
    box-shadow: var(--shadow-sm);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--primary);
}
.logo i { font-size: 1.5rem; }
.logo h1 { font-size: 1.25rem; font-weight: 700; color: var(--text-main); margin: 0; }

.back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-light);
    background: transparent;
    border: 1px solid var(--border);
}

.back-btn:hover {
    background: white;
    color: var(--primary);
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* --- Hero Section --- */
.tutorial-hero {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: white;
    padding: 60px 0 80px; /* Bottom padding allows content to overlap if needed */
    text-align: center;
    margin-bottom: -40px; /* Overlap effect */
}

.tutorial-hero h2 {
    font-size: 2rem;
    margin: 0 0 10px;
    font-weight: 700;
}
.tutorial-hero p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin: 0;
}

/* --- Main Content Area --- */
.tutorial-container {
    position: relative;
    z-index: 10;
}

/* --- Search Box --- */
.search-wrapper {
    background: white;
    padding: 8px 16px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    box-shadow: var(--shadow-md);
    margin-bottom: 40px;
    border: 2px solid transparent;
    transition: var(--transition);
}

.search-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.search-icon { color: var(--text-light); margin-right: 12px; font-size: 1.1rem; }

.search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
    padding: 8px 0;
    background: transparent;
}

/* --- List Header --- */
.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 4px;
}

.list-header h3 { margin: 0; font-size: 1.2rem; display: flex; align-items: center; gap: 8px; }
.chapter-count { font-size: 0.9rem; color: var(--text-light); background: #e2e8f0; padding: 2px 10px; border-radius: 12px; }

/* --- Chapter Cards --- */
.chapter-list { display: flex; flex-direction: column; gap: 16px; }

.chapter-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: var(--transition);
    overflow: hidden;
}

.chapter-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: #bfdbfe; /* Light Blue */
}

.chapter-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    width: 100%;
}

.chapter-info {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.chapter-badge {
    background: #eff6ff;
    color: var(--primary);
    font-weight: 700;
    font-size: 0.85rem;
    padding: 6px 12px;
    border-radius: 8px;
    white-space: nowrap;
    border: 1px solid #dbeafe;
}

.chapter-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
}

.chapter-card:hover .chapter-title { color: var(--primary); }

.chapter-action {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-light);
}

.read-text { font-size: 0.9rem; opacity: 0; transform: translateX(10px); transition: var(--transition); }
.arrow-icon { font-size: 0.9rem; transition: var(--transition); }

/* Hover Effects for Action */
.chapter-card:hover .read-text { opacity: 1; transform: translateX(0); color: var(--primary); }
.chapter-card:hover .arrow-icon { color: var(--primary); transform: translateX(4px); }

/* --- No Results --- */
.no-results {
    text-align: center;
    padding: 60px 0;
    color: var(--text-light);
}
.no-results i { font-size: 3rem; margin-bottom: 16px; color: #cbd5e1; }
.no-results p { font-size: 1.1rem; }

/* --- Responsive --- */
@media (max-width: 768px) {
    .tutorial-hero { padding: 40px 0 60px; }
    .tutorial-hero h2 { font-size: 1.5rem; }
    
    .chapter-link { padding: 16px; }
    .chapter-info { flex-direction: column; align-items: flex-start; gap: 8px; }
    .chapter-action { display: none; } /* Hide action text on mobile for cleanliness */
    
    /* Show a simple arrow instead */
    .chapter-link::after {
        content: '\f054'; /* FontAwesome chevron-right */
        font-family: "Font Awesome 6 Free"; 
        font-weight: 900;
        color: var(--text-light);
        margin-left: 10px;
    }
}