/* ============================================================
   搭建自己的AI平台 - 前台统一样式表
   覆盖：首页 / AI工具 / 部署方案 / 教程 / 社区 / 找搭子 / 活动
   位于: apps/maker/views/css/maker.css
   ============================================================ */

:root {
    --primary: #f97316;
    --primary-dark: #ea580c;
    --primary-light: #fb923c;
    --primary-bg: rgba(249, 115, 22, 0.08);
    --primary-gradient: linear-gradient(135deg, #f97316, #fb923c);

    --success: #10b981;
    --success-bg: #f0fdf4;
    --success-text: #166534;

    --danger: #ef4444;
    --danger-bg: #fef2f2;
    --danger-text: #991b1b;

    --warning: #f59e0b;
    --warning-bg: #fffbeb;
    --warning-text: #92400e;

    --info: #3b82f6;
    --info-bg: #eff6ff;
    --info-text: #1e40af;

    --cyan: #06b6d4;
    --cyan-bg: #ecfeff;
    --cyan-text: #0891b2;

    --pink: #ec4899;
    --pink-bg: #fdf2f8;
    --pink-text: #db2777;

    --text: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    --bg: #ffffff;
    --bg-alt: #f8fafc;
    --bg-card: #ffffff;

    --border: #e2e8f0;
    --border-light: #f1f5f9;

    --shadow-sm: 0 1px 3px rgba(0,0,0,.06);
    --shadow: 0 1px 4px rgba(0,0,0,.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,.12);
    --shadow-lg: 0 6px 20px rgba(0,0,0,.1);

    --radius: 10px;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    --bg-hover: #f8fafc;
    --bg-input: #ffffff;
    --bg-page: #f8fafc;

    --nav-height: 64px;
    --max-width: 1200px;
}

/* ============================================================
   DARK THEME
   ============================================================ */
[data-theme="dark"] {
    --text: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --bg: #0f172a;
    --bg-alt: #1e293b;
    --bg-card: #1e293b;
    --bg-hover: #1e293b;
    --bg-input: #0f172a;
    --bg-page: #0f172a;
    --border: #334155;
    --border-light: #1e293b;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.3);
    --shadow: 0 1px 4px rgba(0,0,0,.4);
    --shadow-md: 0 4px 16px rgba(0,0,0,.5);
    --shadow-lg: 0 6px 20px rgba(0,0,0,.5);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    transition: background .3s, color .3s;
}
a { color: var(--primary); text-decoration: none; transition: all .2s; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; height: auto; display: block; }

/* ============================================================
   NAVBAR (main.php layout)
   ============================================================ */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    height: var(--nav-height);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.navbar-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}
.navbar-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}
.navbar-nav {
    display: flex;
    gap: 24px;
    list-style: none;
}
.navbar-nav a {
    font-size: .9375rem;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 8px 0;
    position: relative;
}
.navbar-nav a:hover,
.navbar-nav a.active {
    color: var(--primary);
}
.navbar-nav a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
}
.navbar-actions { display: flex; align-items: center; gap: 12px; }

/* Mobile Nav Toggle */
.mobile-nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}
.mobile-nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all .2s;
}

/* Theme Toggle */
.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
}
.theme-toggle:hover { border-color: var(--primary); color: var(--primary); }
.icon-sun, .icon-moon { transition: opacity .2s; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon,
:root:not([data-theme]) .icon-moon { display: none; }

/* ============================================================
   MAIN CONTENT
   ============================================================ */
main { min-height: calc(100vh - var(--nav-height) - 300px); }

/* ============================================================
   HERO (index.php)
   ============================================================ */
.hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
    padding: 100px 0 80px;
    text-align: center;
    color: #fff;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: -40%;
    left: -15%;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(249,115,22,.25), transparent 70%);
    pointer-events: none;
}
.hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    right: -10%;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(59,130,246,.2), transparent 70%);
    pointer-events: none;
}
.hero-container { position: relative; z-index: 1; max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 18px;
    border-radius: 50px;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.2);
    font-size: .8125rem;
    font-weight: 600;
    color: rgba(255,255,255,.9);
    margin-bottom: 24px;
}
.hero-title {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 20px;
    letter-spacing: -.02em;
}
.hero-desc {
    font-size: 1.125rem;
    color: rgba(255,255,255,.7);
    line-height: 1.7;
    margin-bottom: 36px;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}
.hero-actions { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }

/* Hero Stats */
.stats { display: flex; justify-content: center; gap: 56px; margin-top: 56px; }
.stat-item { text-align: center; }
.stat-number {
    font-size: 2rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.stat-label {
    font-size: .8125rem;
    color: rgba(255,255,255,.6);
    margin-top: 4px;
    display: block;
}

/* ============================================================
   SECTIONS
   ============================================================ */
.section { padding: 72px 0; }
.section-alt { background: var(--bg-alt); }
.section-container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 32px; }
.section-title { font-size: 1.5rem; font-weight: 700; color: var(--text); }
.section-more { font-size: .875rem; font-weight: 600; color: var(--primary); }
.section-more:hover { color: var(--primary-dark); }

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-section { max-width: var(--max-width); margin: 0 auto; padding: 0 20px 40px; }
.page-header { margin-bottom: 32px; position: relative; }
.page-header h1 { font-size: 1.75rem; font-weight: 800; color: var(--text); margin-bottom: 8px; letter-spacing: -.02em; }
.page-header .subtitle { font-size: .9375rem; color: var(--text-secondary); line-height: 1.6; max-width: 600px; }

/* ============================================================
   GRIDS
   ============================================================ */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ============================================================
   CARDS (通用)
   ============================================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: box-shadow .2s, transform .2s;
}
.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.card-header { display: flex; justify-content: space-between; align-items: flex-start; padding: 16px 16px 0; }
.card-icon { font-size: 1.5rem; }
.card-body { padding: 14px 16px; }
.card-title { font-size: 1.0625rem; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.card-desc {
    font-size: .8125rem;
    color: var(--text-secondary);
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 8px;
}
.card-meta { display: flex; justify-content: space-between; align-items: center; font-size: .8125rem; }
.card-provider { color: var(--text-muted); }
.card-rating { color: var(--warning); font-weight: 600; }
.card-footer { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-top: 1px solid var(--border-light); font-size: .8125rem; }
.card-category { color: var(--text-muted); }
.card-link { color: var(--primary); font-weight: 600; font-size: .8125rem; }
.card-link:hover { color: var(--primary-dark); }
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.card-author { display: flex; align-items: center; gap: 8px; }
.card-likes { color: var(--text-muted); font-size: .8125rem; }

/* Card: course variant */
.card-course .course-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}
.card-course .course-badges { display: flex; gap: 6px; }
.course-meta { display: flex; gap: 14px; font-size: .8125rem; color: var(--text-muted); margin-bottom: 8px; }

.card-image {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-alt);
}

/* ============================================================
   TAGS / BADGES
   ============================================================ */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: .75rem;
    font-weight: 600;
    background: var(--bg-alt);
    color: var(--text-secondary);
}
.tag-sm { padding: 1px 8px; font-size: .6875rem; }
.tag-green { background: #e8f5e9; color: #2e7d32; }
.tag-orange { background: #fff3e0; color: #e65100; }
.tag-cyan { background: var(--cyan-bg); color: var(--cyan-text); }
.tag-pink { background: var(--pink-bg); color: var(--pink-text); }
.tag-primary { background: var(--primary-bg); color: var(--primary); }
.tag-muted { background: #f5f5f5; color: #999; }

[data-theme="dark"] .tag-green { background: rgba(16,185,129,.15); color: #34d399; }
[data-theme="dark"] .tag-orange { background: rgba(249,115,22,.15); color: #fb923c; }
[data-theme="dark"] .tag-muted { background: rgba(148,163,184,.1); color: #94a3b8; }

/* ============================================================
   AVATARS
   ============================================================ */
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.avatar-sm { width: 28px; height: 28px; }

/* ============================================================
   POSTS (社区/首页)
   ============================================================ */
.post {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: box-shadow .2s, transform .2s;
}
.post:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.post-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.post-author { display: flex; align-items: center; gap: 10px; }
.post-author-info { display: flex; flex-direction: column; }
.post-author-name { font-size: .875rem; font-weight: 600; color: var(--text); }
.post-author-role { font-size: .75rem; color: var(--primary); }
.post-body { margin-bottom: 12px; }
.post-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    line-height: 1.4;
}
.post-title a { color: var(--text); }
.post-title a:hover { color: var(--primary); }
.post-excerpt {
    font-size: .8125rem;
    color: var(--text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.post-footer { display: flex; gap: 16px; font-size: .8125rem; color: var(--text-muted); }

/* ============================================================
   EVENT CARDS
   ============================================================ */
.event-card-link { display: block; text-decoration: none; color: inherit; }
.event-card-link:hover { text-decoration: none; }
.event-card {
    display: flex;
    gap: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: box-shadow .2s, transform .2s, border-color .2s;
}
.event-card-link:hover .event-card {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
    border-color: var(--primary);
}
.event-date {
    flex-shrink: 0;
    width: 60px;
    height: 68px;
    border-radius: var(--radius-sm);
    background: var(--primary-gradient);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
}
.event-month { font-size: .75rem; opacity: .9; }
.event-day { font-size: 1.5rem; font-weight: 700; line-height: 1.1; }
.event-body { flex: 1; min-width: 0; }
.event-meta-top { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.event-category { font-size: .75rem; color: var(--text-muted); }
.event-title { font-size: 1rem; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.event-desc {
    font-size: .8125rem;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 8px;
}
.event-info { display: flex; flex-wrap: wrap; gap: 12px; font-size: .8125rem; color: var(--text-muted); }

/* ============================================================
   EVENT DETAIL
   ============================================================ */
.event-cover {
    border-radius: var(--radius-xl); overflow: hidden;
    margin-bottom: 28px; max-height: 360px;
    background: var(--bg-alt);
}
.event-cover img { width: 100%; height: 100%; object-fit: cover; }
.event-date-badge {
    flex-shrink: 0;
    width: 72px; height: 82px;
    border-radius: var(--radius);
    background: var(--primary-gradient);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    color: #fff;
    box-shadow: 0 4px 16px rgba(249,115,22,.3);
}
.event-date-month { font-size: .8125rem; opacity: .9; }
.event-date-day { font-size: 1.75rem; font-weight: 700; line-height: 1.1; }
.detail-info-top { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.event-meta-bar {
    display: flex; flex-wrap: wrap; gap: 16px;
    margin-top: 12px; font-size: .875rem; color: var(--text-secondary);
}

/* Agenda */
.agenda-list { display: flex; flex-direction: column; gap: 2px; }
.agenda-item {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 10px 14px; border-radius: var(--radius-md);
    font-size: .875rem; color: var(--text-secondary);
    background: var(--bg-alt);
}
.agenda-item:nth-child(even) { background: var(--bg-card); }
.agenda-time {
    flex-shrink: 0; font-weight: 700; color: var(--primary);
    min-width: 50px;
}
.agenda-text { line-height: 1.5; }
.result-box {
    padding: 16px 20px; background: var(--success-bg);
    border: 1px solid #a7f3d0; border-radius: var(--radius-md);
    font-size: .9375rem; color: var(--success-text); line-height: 1.7;
}
.dark .result-box { background: rgba(16,185,129,.1); border-color: rgba(16,185,129,.2); }

/* Signup Form */
.signup-form { display: flex; flex-direction: column; gap: 12px; }
.signup-form .form-group label {
    font-size: .75rem; font-weight: 600; color: var(--text);
    display: block; margin-bottom: 4px;
}
.signup-form .form-group input,
.signup-form .form-group textarea {
    width: 100%; padding: 8px 12px;
    border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    font-size: .8125rem; color: var(--text); background: var(--bg-input);
    transition: border-color .2s; outline: none;
    font-family: inherit; box-sizing: border-box;
}
.signup-form .form-group input:focus,
.signup-form .form-group textarea:focus { border-color: var(--primary); }
.signup-form .form-group textarea { resize: vertical; min-height: 50px; }
.signup-ended, .signup-full {
    text-align: center; padding: 16px;
    font-size: .9375rem; font-weight: 600;
    border-radius: var(--radius-md);
}
.signup-ended { background: var(--bg-alt); color: var(--text-muted); }
.signup-full { background: #fef2f2; color: #991b1b; }
.dark .signup-full { background: rgba(239,68,68,.1); color: #fca5a5; }

/* Related Events in Detail */
.related-event-card {
    display: flex; gap: 14px; padding: 16px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); text-decoration: none; color: inherit;
    transition: box-shadow .2s, transform .2s, border-color .2s;
}
.related-event-card:hover {
    box-shadow: var(--shadow-md); transform: translateY(-2px);
    border-color: var(--primary); text-decoration: none;
}
.related-event-date {
    flex-shrink: 0; width: 48px; height: 60px;
    border-radius: var(--radius-sm); background: var(--primary-gradient);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: #fff;
}
.related-event-day { font-size: 1.25rem; font-weight: 700; line-height: 1.1; }
.related-event-month { font-size: .6875rem; opacity: .9; }
.related-event-info { flex: 1; min-width: 0; }
.related-event-info h4 {
    font-size: .875rem; font-weight: 600; color: var(--text);
    margin: 4px 0; line-height: 1.4;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.related-event-location {
    font-size: .75rem; color: var(--text-muted);
}

/* ============================================================
   FILTER BAR
   ============================================================ */
.filter-bar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px 24px;
    margin-bottom: 28px;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.dark .filter-bar { box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.filter-form { display: flex; gap: 8px; flex: 1; min-width: 200px; }
.search-group {
    position: relative; flex: 1;
}
.search-icon {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    font-size: .875rem; opacity: .4; pointer-events: none;
}
.filter-search {
    width: 100%;
    min-width: 160px;
    padding: 9px 14px 9px 36px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: .875rem;
    color: var(--text);
    background: var(--bg-input);
    outline: none;
    transition: border-color .25s, box-shadow .25s;
    box-sizing: border-box;
}
.filter-search:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-bg); }
.filter-search::placeholder { color: var(--text-muted); }
.filter-btn {
    padding: 8px 18px;
    border-radius: 10px;
    font-size: .875rem;
    font-weight: 600;
    border: none;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    transition: all .2s;
}
.filter-btn:hover { background: var(--primary-dark); }
.filter-clear {
    font-size: .8125rem;
    color: var(--text-muted);
    text-decoration: none;
    padding: 4px 8px;
    white-space: nowrap;
}
.filter-clear:hover { color: var(--danger); }

/* Category Tabs */
.category-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.category-tab {
    padding: 7px 16px;
    border-radius: 20px;
    font-size: .8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-alt);
    text-decoration: none;
    transition: all .25s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid transparent;
}
.category-tab:hover { background: var(--primary-bg); color: var(--primary); border-color: var(--primary); }
.category-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.tab-count {
    font-size: .6875rem;
    background: rgba(255,255,255,.25);
    padding: 1px 7px;
    border-radius: 10px;
    font-weight: 700;
}
.category-tab.active .tab-count { background: rgba(255,255,255,.25); }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state { text-align: center; padding: 60px 0; color: var(--text-muted); }
.empty-icon, .empty-state .icon { font-size: 3rem; margin-bottom: 12px; }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
    display: flex; justify-content: center; align-items: center;
    gap: 4px; padding: 32px 0;
}
.pagination a,
.pagination span {
    display: inline-flex; align-items: center; gap: 2px;
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: .875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all .2s;
    min-width: 40px; justify-content: center;
}
.pagination a:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-bg);
}
.pagination-current {
    background: var(--primary) !important;
    color: #fff !important;
    border-color: var(--primary) !important;
    cursor: default;
}
.pagination-prev, .pagination-next { font-weight: 600; }
.pagination-prev:hover .pagination-next:hover { }

/* ============================================================
   CTA SECTION
   ============================================================ */
.cta {
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
    padding: 72px 0;
    text-align: center;
    color: #fff;
    position: relative;
    overflow: hidden;
}
.cta::before {
    content: '';
    position: absolute;
    top: -50%;
    left: 50%;
    transform: translateX(-50%);
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(249,115,22,.25), transparent 70%);
    pointer-events: none;
}
.cta-container { position: relative; z-index: 1; max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }
.cta-title { font-size: 2rem; font-weight: 800; margin-bottom: 12px; }
.cta-desc { font-size: 1.0625rem; color: rgba(255,255,255,.7); margin-bottom: 28px; }
.cta-actions { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    font-size: .9375rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all .2s;
    text-decoration: none;
    line-height: 1.5;
}
.btn:hover { opacity: .88; transform: translateY(-1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--bg-alt); color: var(--text-secondary); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
.btn-outline { background: transparent; color: #fff; border: 2px solid rgba(255,255,255,.4); }
.btn-outline:hover { border-color: #fff; color: #fff; background: rgba(255,255,255,.1); }
.btn-ghost { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
.btn-ghost:hover { background: var(--primary-bg); }
.btn-sm { padding: 5px 14px; font-size: .8125rem; }
.btn-lg { padding: 14px 32px; font-size: 1.0625rem; }

/* ============================================================
   TOOL / PROJECT CARDS (列表页专用)
   ============================================================ */
.card-grid { display: grid; gap: 20px; }

.tool-card, .project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 22px;
    transition: box-shadow .25s, transform .25s, border-color .25s;
    position: relative;
    overflow: hidden;
}
.tool-card::before, .project-card::before {
    content: ''; position: absolute; left: 0; top: 0; right: 0;
    height: 3px;
    background: var(--primary-gradient);
    opacity: 0;
    transition: opacity .25s;
}
.tool-card:hover, .project-card:hover {
    box-shadow: 0 8px 28px rgba(0,0,0,.07);
    transform: translateY(-3px);
    border-color: var(--primary);
}
.tool-card:hover::before, .project-card:hover::before { opacity: 1; }
.dark .tool-card:hover, .dark .project-card:hover { box-shadow: 0 8px 28px rgba(0,0,0,.2); }
a.tool-card, a.project-card { display: block; text-decoration: none; color: inherit; }
a.tool-card:hover, a.project-card:hover { text-decoration: none; }

.card-clickable { display: block; text-decoration: none; color: inherit; }
.card-clickable:hover { text-decoration: none; }
.tool-card-header, .project-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; gap: 12px; }
.tool-icon, .project-icon {
    font-size: 2rem; line-height: 1; flex-shrink: 0;
    width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
    background: var(--bg-alt); border-radius: 12px;
}
.tool-tags, .project-tags { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.tool-card-body, .project-card-body { margin-bottom: 14px; }
.tool-name, .project-name { font-size: 1.0625rem; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.tool-desc, .project-desc {
    font-size: .8125rem;
    color: var(--text-secondary);
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.tool-card-footer, .project-card-footer {
    display: flex; justify-content: space-between; align-items: center;
    font-size: .8125rem;
    padding-top: 14px;
    border-top: 1px solid var(--border-light);
}
.tool-provider { color: var(--text-muted); }
.project-author-name { color: var(--text-muted); }
.tool-rating, .project-likes { color: var(--warning); font-weight: 700; display: flex; align-items: center; gap: 2px; }
.project-author { display: flex; align-items: center; gap: 8px; }
.author-avatar { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.author-avatar-placeholder { font-size: 1rem; }

/* ============================================================
   TABS (learn)
   ============================================================ */
.tabs { margin-top: -8px; }
.tab-nav {
    display: flex; gap: 4px;
    background: var(--bg-alt);
    padding: 4px;
    border-radius: 14px;
    margin-bottom: 28px;
    border: 1px solid var(--border);
}
.tab-btn {
    padding: 10px 20px;
    border: none;
    background: none;
    border-radius: 11px;
    font-size: .875rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all .25s;
    display: flex; align-items: center; gap: 6px;
    flex: 1; justify-content: center;
}
.tab-btn:hover { color: var(--text); background: var(--bg-hover); }
.tab-btn.active {
    color: var(--primary);
    background: var(--bg-card);
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.tab-icon { font-size: 1rem; }
.tab-label { }
.tab-content { display: none; animation: tabFadeIn .3s ease-out; }
.tab-content.active { display: block; }
@keyframes tabFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Course Grid */
.course-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

/* Course Card Enhancement */
.card-course { display: flex; flex-direction: column; }
.card-course .card-image {
    height: 120px; display: flex; align-items: center; justify-content: center;
    position: relative; overflow: hidden;
}
.card-course .card-image::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,.04), transparent 50%);
}
.card-course .card-image-icon { font-size: 2.25rem; position: relative; z-index: 1; filter: drop-shadow(0 2px 4px rgba(0,0,0,.06)); }
.card-course .card-body { flex: 1; display: flex; flex-direction: column; padding: 16px 18px; }
.card-course .card-footer-bar { margin-top: auto; padding-top: 12px; }
.card-course .card-students { font-size: .75rem; color: var(--text-muted); margin-top: 10px; display: flex; align-items: center; gap: 4px; }

/* Teacher Grid */
.teacher-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.teacher-card { }
.teacher-card-top { margin-bottom: 8px; }
.teacher-actions { display: flex; gap: 8px; margin-top: 14px; }

/* ============================================================
   COMMUNITY SPECIFIC
   ============================================================ */
.post-list {
    display: flex; flex-direction: column; gap: 12px;
}
.post-item {
    display: block; text-decoration: none; color: inherit;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px 24px;
    transition: box-shadow .25s, transform .25s, border-color .25s;
    position: relative;
    overflow: hidden;
}
.post-item::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--primary);
    opacity: 0;
    transition: opacity .25s;
}
.post-item:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,.06);
    transform: translateY(-1px);
    border-color: var(--primary);
}
.post-item:hover::before { opacity: 1; }
.dark .post-item:hover { box-shadow: 0 4px 20px rgba(0,0,0,.2); }

.post-item-inner {
    display: flex; gap: 14px; align-items: flex-start;
}
.post-avatar-col { flex-shrink: 0; }
.post-avatar-col .avatar {
    width: 42px; height: 42px; border-radius: 50%;
    background: var(--primary-gradient);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; font-weight: 700; flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(249,115,22,.2);
}
.post-content-col { flex: 1; min-width: 0; }
.post-item .post-title {
    font-size: 1.0625rem; font-weight: 600; color: var(--text);
    margin-bottom: 4px; line-height: 1.45;
}
.post-item:hover .post-title { color: var(--primary); }
.post-excerpt {
    font-size: .8125rem; color: var(--text-secondary);
    line-height: 1.55; margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.post-meta {
    display: flex; align-items: center; flex-wrap: wrap;
    gap: 6px 14px;
    font-size: .8125rem; color: var(--text-muted);
}
.post-meta .author-name {
    font-size: .8125rem; font-weight: 600; color: var(--text);
}
.author-role-tag {
    font-size: .6875rem; color: var(--primary);
    background: var(--primary-bg); padding: 1px 8px; border-radius: 4px;
    font-weight: 600;
}
.meta-tag {
    font-size: .6875rem; color: var(--cyan-text);
    background: var(--cyan-bg); padding: 1px 8px; border-radius: 4px;
    font-weight: 600;
}
.meta-date { color: var(--text-muted); }
.meta-stat { display: inline-flex; align-items: center; gap: 2px; }

/* Pagination */
.pagination-bar { text-align: center; padding: 24px 0; }

/* ============================================================
   TEAM PAGE SPECIFIC
   ============================================================ */
.team-page { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }

.team-toolbar {
    display: flex; gap: 12px; align-items: center;
    margin-bottom: 24px; flex-wrap: wrap;
}
.team-search-form {
    display: flex; gap: 8px; flex: 1; min-width: 200px;
}
.search-input-wrap {
    display: flex; align-items: center; gap: 8px;
    flex: 1; padding: 0 12px;
    background: var(--bg-card); border: 1.5px solid var(--border);
    border-radius: var(--radius); transition: border-color .2s;
}
.search-input-wrap:focus-within { border-color: var(--primary); }
.search-input-wrap svg { flex-shrink: 0; color: var(--text-muted); }
.search-input-wrap input {
    flex: 1; border: none; outline: none; padding: 8px 0;
    font-size: .875rem; background: transparent; color: var(--text);
}
.search-clear {
    color: var(--text-muted); text-decoration: none; font-size: .9rem; padding: 4px;
}
.search-clear:hover { color: var(--text); }

.active-filters {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    margin-bottom: 16px; font-size: .8125rem; color: var(--text-secondary);
}
.filter-tag {
    background: var(--primary-bg); color: var(--primary);
    padding: 3px 10px; border-radius: 14px; font-size: .8rem;
}
.filter-clear {
    color: var(--primary); text-decoration: none; font-size: .8rem; margin-left: 4px;
}
.filter-clear:hover { text-decoration: underline; }

.member-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.member-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: box-shadow .2s, transform .2s;
    cursor: default;
}
.member-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.member-card-link {
    text-decoration: none; color: inherit; display: block;
}
.member-avatar {
    width: 56px; height: 56px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.375rem; font-weight: 700; color: #fff;
    margin-bottom: 16px;
}
.member-name { font-size: 1.0625rem; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.member-role { font-size: .8125rem; color: var(--primary); margin-bottom: 8px; }
.member-bio {
    font-size: .8125rem; color: var(--text-secondary); line-height: 1.6;
    margin-bottom: 14px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.member-skills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.member-skills .tag { cursor: pointer; }
.member-skills .tag:hover { opacity: .8; }
.member-actions { display: flex; gap: 8px; }

.project-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.project-footer { display: flex; justify-content: space-between; align-items: center; padding-top: 14px; border-top: 1px solid var(--border-light); }
.project-people { font-size: .8125rem; color: var(--text-muted); }

.member-detail-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 32px;
    margin-top: 24px;
}
.member-detail-header {
    display: flex; align-items: center; gap: 20px;
    padding-bottom: 24px; border-bottom: 1px solid var(--border-light);
    margin-bottom: 24px;
}
.member-detail-avatar {
    width: 72px; height: 72px; border-radius: 50%;
    background: var(--primary-gradient);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.75rem; font-weight: 700; color: #fff; flex-shrink: 0;
}
.member-detail-info h1 { font-size: 1.375rem; font-weight: 700; color: var(--text); margin: 0 0 4px; }
.member-detail-role { font-size: .9375rem; color: var(--primary); }
.member-detail-section { margin-bottom: 24px; }
.member-detail-section h3 { font-size: 1rem; font-weight: 600; color: var(--text); margin-bottom: 10px; }
.member-detail-section p { font-size: .9375rem; color: var(--text-secondary); line-height: 1.7; }
.member-detail-skills { display: flex; flex-wrap: wrap; gap: 8px; }
.member-detail-actions { display: flex; gap: 12px; padding-top: 20px; border-top: 1px solid var(--border-light); }

.modal-overlay {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(0,0,0,.45);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.modal-content {
    background: var(--bg-card); border-radius: var(--radius-lg);
    max-width: 480px; width: 100%; padding: 28px;
    box-shadow: var(--shadow-xl); animation: fadeIn .2s ease-out;
}
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px;
}
.modal-header h2 { font-size: 1.125rem; font-weight: 700; color: var(--text); margin: 0; }
.modal-close {
    background: none; border: none; font-size: 1.5rem; color: var(--text-muted);
    cursor: pointer; padding: 0; line-height: 1;
}
.modal-close:hover { color: var(--text); }
.apply-form { display: flex; flex-direction: column; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: .875rem; font-weight: 600; color: var(--text); }
.form-label .required { color: var(--danger); }
.form-input {
    padding: 10px 14px; border: 1.5px solid var(--border);
    border-radius: var(--radius); font-size: .875rem;
    background: var(--bg); color: var(--text);
    transition: border-color .2s; outline: none;
    font-family: inherit;
}
.form-input:focus { border-color: var(--primary); }
.form-textarea { resize: vertical; min-height: 80px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; padding-top: 8px; }

@media (max-width: 900px) {
    .member-grid { grid-template-columns: repeat(2, 1fr); }
    .project-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .member-grid { grid-template-columns: 1fr; }
    .team-toolbar { flex-direction: column; align-items: stretch; }
}

/* ============================================================
   EVENTS PAGE SPECIFIC
   ============================================================ */
.events-page { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }

.filter-btn-evt {
    padding: 6px 16px;
    border-radius: var(--radius-sm);
    font-size: .875rem;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all .2s;
    text-decoration: none;
    display: inline-block;
}
.filter-btn-evt:hover { border-color: var(--primary); color: var(--primary); }
.filter-btn-evt.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.event-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 16px; }

/* events page .event-date redefines the generic one for the events page layout */
.events-page .event-date {
    width: 64px; height: 72px;
    background: var(--primary-gradient);
    border-radius: var(--radius);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center; color: #fff;
}
.events-page .event-date .day { font-size: 1.625rem; font-weight: 700; line-height: 1.1; }
.events-page .event-date .month { font-size: .8125rem; opacity: .9; }

.events-page .event-info { flex: 1; min-width: 0; }
.event-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: .75rem;
    font-weight: 500;
    margin-bottom: 6px;
}
.status-ongoing { background: var(--success-bg); color: var(--success-text); }
.status-upcoming { background: var(--primary-bg); color: var(--primary); }
.status-ended { background: var(--bg-alt); color: var(--text-muted); }

.events-page .event-info h3 {
    font-size: 1rem; font-weight: 600; color: var(--text);
    margin-bottom: 6px;
    display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.events-page .event-info p {
    font-size: .8125rem; color: var(--text-secondary); line-height: 1.5;
    margin-bottom: 10px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.event-meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: .8125rem; color: var(--text-muted); }
.event-meta span { display: inline-flex; align-items: center; gap: 4px; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
    background: var(--bg-alt);
    border-top: 1px solid var(--border);
    padding: 56px 0 0;
    margin-top: 0;
}
.footer-container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 40px; }
.footer-section h3 { font-size: 1.0625rem; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.footer-section h4 { font-size: .9375rem; font-weight: 700; color: var(--text); margin-bottom: 12px; }
.footer-section p { font-size: .875rem; color: var(--text-secondary); line-height: 1.6; }
.footer-section ul { list-style: none; padding: 0; margin: 0; }
.footer-section li { margin-bottom: 8px; }
.footer-section a { font-size: .875rem; color: var(--text-secondary); transition: color .2s; }
.footer-section a:hover { color: var(--primary); }
.footer-bottom { border-top: 1px solid var(--border); padding: 20px 0; font-size: .8125rem; color: var(--text-muted); text-align: center; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .member-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .navbar-nav { display: none; }
    .mobile-nav-toggle { display: flex; }
    .navbar-nav.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
        padding: 16px 20px;
        gap: 12px;
    }

    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .member-grid { grid-template-columns: 1fr; }
    .project-grid { grid-template-columns: 1fr; }
    .stats { gap: 28px; flex-wrap: wrap; }
    .hero { padding: 72px 0 56px; }
    .hero-title { font-size: 2rem; }
    .hero-desc { font-size: 1rem; }
    .section { padding: 56px 0; }

    .filter-bar { flex-direction: column; align-items: stretch; }
    .filter-form { flex-direction: column; }
    .filter-search { width: 100%; }
    .search-group { width: 100%; }
    .category-tabs { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }

    .event-grid { grid-template-columns: 1fr; }
    .event-card { flex-direction: column; }

    .course-grid { grid-template-columns: 1fr; }
    .teacher-grid { grid-template-columns: 1fr; }
    .post-item { padding: 16px 18px; }
    .post-item-inner { flex-direction: column; gap: 10px; }
    .post-avatar-col .avatar { width: 32px; height: 32px; font-size: .8125rem; }

    .tab-nav { flex-direction: column; gap: 2px; }
    .tab-btn { padding: 8px 16px; justify-content: center; }
}

@media (max-width: 480px) {
    .hero-title { font-size: 1.625rem; }
    .section-title { font-size: 1.25rem; }
    .footer-grid { grid-template-columns: 1fr; }
    .cta-title { font-size: 1.5rem; }
}

/* ============================================================
   DETAIL PAGE (tool detail, etc.)
   ============================================================ */
.detail-page { max-width: 1200px; margin: 0 auto; padding: 32px 24px; }
.breadcrumb { display: flex; align-items: center; gap: 8px; margin-bottom: 32px; font-size: .875rem; color: var(--text-muted); }
.breadcrumb a { color: var(--primary); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { color: var(--text-muted); }
.detail-header { display: flex; align-items: flex-start; gap: 24px; margin-bottom: 40px; padding: 32px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-xl); }
.detail-icon { font-size: 4rem; line-height: 1; }
.detail-info { flex: 1; }
.detail-info h1 { font-size: 1.75rem; margin-bottom: 12px; color: var(--text); }
.detail-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.detail-provider { font-size: .875rem; color: var(--text-secondary); }
.detail-rating { font-size: .875rem; color: var(--warning); font-weight: 600; }
.detail-actions { flex-shrink: 0; }
.detail-body { display: grid; grid-template-columns: 1fr 280px; gap: 32px; margin-bottom: 48px; }
.detail-main { }
.detail-section { margin-bottom: 32px; }
.detail-section h2 { font-size: 1.25rem; font-weight: 700; margin-bottom: 16px; color: var(--text); }
.detail-desc { font-size: 1rem; line-height: 1.8; color: var(--text-secondary); }
.detail-features { list-style: none; padding: 0; }
.detail-features li { padding: 8px 0; color: var(--text-secondary); font-size: .9375rem; border-bottom: 1px solid var(--border); }
.detail-features li:last-child { border-bottom: none; }
.detail-stats { display: flex; gap: 24px; padding: 20px 24px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.detail-stat-item { text-align: center; flex: 1; }
.detail-stat-item .stat-value { display: block; font-size: 1.5rem; font-weight: 700; color: var(--primary); }
.detail-stat-item .stat-label { font-size: .8125rem; color: var(--text-muted); }
.detail-sidebar { }
.sidebar-section { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; margin-bottom: 20px; }
.sidebar-section h3 { font-size: 1rem; font-weight: 600; margin-bottom: 16px; color: var(--text); }
.sidebar-categories { list-style: none; padding: 0; }
.sidebar-cat-link { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; color: var(--text-secondary); text-decoration: none; font-size: .875rem; border-bottom: 1px solid var(--border); transition: color .15s; }
.sidebar-cat-link:hover { color: var(--primary); }
.sidebar-cat-link:last-child { border-bottom: none; }
.cat-count { background: var(--bg-secondary); color: var(--text-muted); padding: 2px 8px; border-radius: var(--radius-full); font-size: .75rem; }
.detail-related { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--border); }
.detail-related h2 { font-size: 1.25rem; font-weight: 700; margin-bottom: 24px; }
.card-related { display: block; text-decoration: none; color: inherit; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; transition: box-shadow .2s, transform .2s; }
.card-related:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); text-decoration: none; }
.card-related .card-body h3 { font-size: .9375rem; font-weight: 600; margin-bottom: 4px; }
.card-related .card-body p { font-size: .8125rem; color: var(--text-secondary); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

@media (max-width: 768px) {
    .detail-header { flex-direction: column; padding: 20px; }
    .detail-body { grid-template-columns: 1fr; }
    .detail-actions { width: 100%; }
    .detail-actions .btn { width: 100%; text-align: center; }
    .detail-stats { flex-direction: column; gap: 12px; }
}

/* ============================================================
   STATIC CONTENT PAGES (About / Terms / Privacy)
   ============================================================ */
.static-content { max-width: 800px; }
.static-section { margin-bottom: 36px; }
.static-section h2 { font-size: 1.25rem; font-weight: 700; color: var(--text); margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border-light); }
.static-section h3 { font-size: 1.0625rem; font-weight: 600; color: var(--text); margin: 16px 0 8px; }
.static-section p { font-size: .9375rem; color: var(--text-secondary); line-height: 1.8; margin-bottom: 12px; }
.static-section ul { padding-left: 20px; margin-bottom: 12px; }
.static-section li { font-size: .9375rem; color: var(--text-secondary); line-height: 1.8; margin-bottom: 4px; }
.static-section li strong { color: var(--text); font-weight: 600; }
.tech-stack { display: flex; flex-wrap: wrap; gap: 8px; }
.info-table { width: 100%; border-collapse: collapse; }
.info-table td { padding: 10px 12px; font-size: .875rem; border-bottom: 1px solid var(--border-light); }
.info-table td:first-child { font-weight: 600; color: var(--text); white-space: nowrap; width: 140px; }
.info-table td:last-child { color: var(--text-secondary); }

/* ============================================================
   POST ARTICLE
   ============================================================ */
.post-article {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-bottom: 24px;
}
.post-article-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}
.post-article-author {
    display: flex;
    align-items: center;
    gap: 12px;
}
.post-article-author .avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--primary); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; font-weight: 600;
}
.post-article-author .author-name {
    font-size: .9375rem; font-weight: 600; color: var(--text);
    display: block;
}
.post-article-author .author-role {
    font-size: .8125rem; color: var(--text-muted);
}
.post-article-title {
    font-size: 1.75rem; font-weight: 700;
    line-height: 1.3; margin-bottom: 20px;
    color: var(--text);
}
.post-article-content {
    font-size: 1rem; line-height: 1.8;
    color: var(--text-secondary);
}
.post-article-meta {
    display: flex; align-items: center; gap: 12px;
    font-size: .875rem; color: var(--text-muted);
}

/* ============================================================
   AUTH PAGES (Login / Register)
   ============================================================ */
.auth-page {
    display: flex; justify-content: center; align-items: center;
    min-height: calc(100vh - 120px); padding: 60px 20px;
    position: relative; overflow: hidden;
}
.auth-bg-decoration {
    position: fixed; inset: 0; pointer-events: none; z-index: 0;
    overflow: hidden;
}
.auth-bg-circle {
    position: absolute; border-radius: 50%;
    opacity: .08;
}
.auth-bg-circle-1 {
    width: 600px; height: 600px;
    background: var(--primary-gradient);
    top: -200px; right: -150px;
    animation: authFloat 8s ease-in-out infinite;
}
.auth-bg-circle-2 {
    width: 400px; height: 400px;
    background: var(--primary-gradient);
    bottom: -100px; left: -100px;
    animation: authFloat 10s ease-in-out infinite reverse;
}
.auth-bg-circle-3 {
    width: 300px; height: 300px;
    background: var(--cyan);
    top: 50%; left: 50%; transform: translate(-50%, -50%);
    animation: authFloat 12s ease-in-out infinite;
}
@keyframes authFloat {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, -30px); }
}
.auth-card {
    position: relative; z-index: 1;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 48px 40px 40px;
    width: 100%; max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,.08);
    animation: authCardIn .5s ease-out;
}
.dark .auth-card { box-shadow: 0 20px 60px rgba(0,0,0,.4); }
@keyframes authCardIn {
    from { opacity: 0; transform: translateY(20px) scale(.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.auth-logo { text-align: center; margin-bottom: 24px; }
.auth-logo-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 64px; height: 64px; border-radius: 18px;
    background: var(--primary-gradient);
    font-size: 2rem;
    box-shadow: 0 8px 24px rgba(249,115,22,.25);
}
.auth-header { text-align: center; margin-bottom: 32px; }
.auth-header h1 { font-size: 1.5rem; font-weight: 800; margin-bottom: 8px; color: var(--text); }
.auth-header p { font-size: .875rem; color: var(--text-muted); line-height: 1.5; }
.auth-form { display: flex; flex-direction: column; gap: 20px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: .8125rem; font-weight: 700; color: var(--text); letter-spacing: .01em; }
.input-wrap {
    position: relative; display: flex; align-items: center;
}
.input-icon {
    position: absolute; left: 14px; font-size: 1rem;
    pointer-events: none; opacity: .5; z-index: 1;
}
.form-group input, .form-group select, .form-group textarea {
    padding: 12px 14px 12px 42px;
    border: 1.5px solid var(--border);
    border-radius: 12px; font-size: .9375rem;
    background: var(--bg-input); color: var(--text);
    transition: border-color .25s, box-shadow .25s;
    outline: none; width: 100%; box-sizing: border-box;
}
.form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-bg);
}
.form-group input::placeholder { color: var(--text-muted); font-size: .875rem; }
.form-input-disabled {
    background: var(--bg-hover) !important; color: var(--text-muted) !important;
    cursor: not-allowed; opacity: .7; padding-left: 14px !important;
}
.btn-block {
    width: 100%; padding: 14px !important; font-size: 1rem !important;
    border-radius: 12px !important;
    display: flex !important; align-items: center; justify-content: center;
    gap: 8px;
    transition: transform .2s, box-shadow .2s !important;
}
.btn-block:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(249,115,22,.3) !important; }
.btn-block:active { transform: translateY(0); }
.btn-arrow { transition: transform .2s; }
.btn-block:hover .btn-arrow { transform: translateX(4px); }
.auth-divider {
    text-align: center; margin: 24px 0 0;
    position: relative;
}
.auth-divider span {
    display: block;
}
.auth-footer { text-align: center; margin-top: 20px; font-size: .875rem; color: var(--text-muted); }
.auth-link { color: var(--primary); font-weight: 700; text-decoration: none; }
.auth-link:hover { text-decoration: underline; }
.form-actions { padding-top: 8px; }

/* ============================================================
   FLASH MESSAGES
   ============================================================ */
.flash-container {
    max-width: var(--max-width); margin: 0 auto; padding: 16px 20px 0;
}
.flash-message {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 16px; border-radius: var(--radius-md);
    font-size: .875rem; margin-bottom: 8px;
    animation: fadeIn .3s ease;
}
.flash-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.flash-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.flash-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.flash-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.flash-close {
    background: none; border: none; font-size: 1.25rem;
    cursor: pointer; color: inherit; opacity: .6; padding: 0 4px;
    line-height: 1;
}
.flash-close:hover { opacity: 1; }
.dark .flash-success { background: #064e3b; color: #a7f3d0; border-color: #065f46; }
.dark .flash-error { background: #450a0a; color: #fecaca; border-color: #7f1d1d; }
.dark .flash-warning { background: #451a03; color: #fde68a; border-color: #78350f; }
.dark .flash-info { background: #172554; color: #bfdbfe; border-color: #1e3a5f; }

/* ============================================================
   USER DROPDOWN
   ============================================================ */
.user-dropdown { position: relative; }
.user-avatar-btn {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--primary); color: #fff;
    border: 2px solid var(--primary); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: .875rem; font-weight: 700;
    transition: transform .2s;
}
.user-avatar-btn:hover { transform: scale(1.05); }
.user-avatar-sm {
    display: inline-flex; align-items: center; justify-content: center;
    width: 100%; height: 100%;
}
.user-avatar-sm-img {
    width: 100%; height: 100%; border-radius: 50%; object-fit: cover;
}
.dropdown-menu {
    position: absolute; right: 0; top: calc(100% + 8px);
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); min-width: 200px;
    box-shadow: 0 10px 30px rgba(0,0,0,.12);
    opacity: 0; visibility: hidden; transform: translateY(-4px);
    transition: opacity .2s, transform .2s, visibility .2s;
    z-index: 100;
}
.dark .dropdown-menu { box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.dropdown-menu.show { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-header { padding: 14px 16px; text-align: center; }
.dropdown-name { display: block; font-weight: 600; font-size: .9375rem; color: var(--text); }
.dropdown-role { display: block; font-size: .75rem; color: var(--text-muted); margin-top: 2px; }
.dropdown-divider { height: 1px; background: var(--border-light); margin: 0; }
.dropdown-item {
    display: block; padding: 10px 16px; font-size: .875rem;
    color: var(--text); text-decoration: none;
    transition: background .15s;
}
.dropdown-item:hover { background: var(--bg-hover); }
.logout-item { color: #ef4444 !important; }
.logout-item:hover { background: #fef2f2 !important; }
.dark .logout-item:hover { background: #3b0a0a !important; }
.nav-item-mobile-only { display: none; }

/* ============================================================
   USER CENTER
   ============================================================ */
.ucenter-page {
    max-width: var(--max-width); margin: 0 auto;
    padding: 40px 20px; display: grid;
    grid-template-columns: 260px 1fr; gap: 32px;
    align-items: start;
}
.ucenter-sidebar { position: sticky; top: 80px; }
.ucenter-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 28px 24px;
    text-align: center; margin-bottom: 16px;
}
.ucenter-avatar { margin-bottom: 12px; }
.avatar-large {
    display: inline-flex; align-items: center; justify-content: center;
    width: 72px; height: 72px; border-radius: 50%;
    background: var(--primary); color: #fff;
    font-size: 1.75rem; font-weight: 700;
}
.ucenter-name { font-size: 1.125rem; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.ucenter-role { font-size: .8125rem; color: var(--text-muted); }
.ucenter-nav { display: flex; flex-direction: column; gap: 2px; }
.ucenter-nav-item {
    display: block; padding: 10px 16px; border-radius: var(--radius-md);
    font-size: .875rem; color: var(--text); text-decoration: none;
    transition: background .15s, color .15s;
}
.ucenter-nav-item:hover { background: var(--bg-hover); }
.ucenter-nav-item.active { background: var(--primary-bg); color: var(--primary); font-weight: 600; }
.ucenter-nav-item.logout { color: #ef4444; margin-top: 16px; }
.ucenter-nav-item.logout:hover { background: #fef2f2; }
.dark .ucenter-nav-item.logout:hover { background: #3b0a0a; }
.ucenter-main { display: flex; flex-direction: column; gap: 24px; }
.ucenter-section {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 28px;
}
.ucenter-section h2 {
    font-size: 1.125rem; font-weight: 700; margin-bottom: 20px;
    color: var(--text);
}
.ucenter-section .section-header { margin-bottom: 20px; }
.ucenter-section .section-header p { font-size: .875rem; color: var(--text-muted); margin-top: 4px; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.info-item { padding: 12px 16px; background: var(--bg-page); border-radius: var(--radius-md); }
.info-label { display: block; font-size: .75rem; color: var(--text-muted); margin-bottom: 4px; }
.info-value { font-size: .875rem; color: var(--text); font-weight: 500; }

/* Teacher */
.teacher-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 8px; }
.stat-card {
    background: var(--bg-page); border-radius: var(--radius-md);
    padding: 20px; text-align: center;
}
.stat-card .stat-number { display: block; font-size: 1.75rem; font-weight: 800; color: var(--primary); }
.stat-card .stat-label { display: block; font-size: .8125rem; color: var(--text-muted); margin-top: 4px; }
.resource-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.resource-card {
    background: var(--bg-page); border-radius: var(--radius-md);
    padding: 20px; text-align: center; cursor: pointer;
    transition: transform .2s, box-shadow .2s;
}
.resource-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.resource-icon { font-size: 2rem; display: block; margin-bottom: 8px; }
.resource-card h3 { font-size: .9375rem; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.resource-card p { font-size: .8125rem; color: var(--text-muted); }

/* Avatar Upload */
.avatar-upload { display: flex; align-items: center; gap: 32px; }
.avatar-preview-wrap {
    flex-shrink: 0; width: 100px; height: 100px; border-radius: 50%;
    overflow: hidden; background: var(--bg-page);
    display: flex; align-items: center; justify-content: center;
    border: 3px solid var(--border-light);
}
.avatar-preview-img, .avatar-preview-letter { width: 100%; height: 100%; object-fit: cover; }
.avatar-preview-letter {
    display: flex; align-items: center; justify-content: center;
    background: var(--primary); color: #fff;
    font-size: 2.5rem; font-weight: 700;
}
.avatar-form { flex: 1; display: flex; flex-direction: column; gap: 12px; }
.avatar-file-wrap { display: flex; align-items: center; gap: 12px; }
.avatar-file-name { font-size: .8125rem; color: var(--text-muted); }
.avatar-large-img {
    width: 72px; height: 72px; border-radius: 50%; object-fit: cover;
}

/* Teacher Apply Status */
.teacher-apply-status { text-align: center; padding: 24px; background: var(--bg-page); border-radius: var(--radius-md); }
.teacher-apply-status p { font-size: .875rem; color: var(--text-secondary); margin-top: 8px; }
.status-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 20px; border-radius: 20px; font-size: .875rem; font-weight: 700; }
.status-pending { background: #fef3c7; color: #92400e; }
.status-rejected { background: #fee2e2; color: #991b1b; }
.dark .status-pending { background: rgba(251,191,36,.15); color: #fbbf24; }
.dark .status-rejected { background: rgba(239,68,68,.15); color: #f87171; }

/* ============================================================
   RESPONSIVE: User Center
   ============================================================ */
@media (max-width: 768px) {
    .ucenter-page { grid-template-columns: 1fr; }
    .ucenter-sidebar { position: static; }
    .info-grid { grid-template-columns: 1fr; }
    .teacher-stats { grid-template-columns: 1fr; }
    .resource-grid { grid-template-columns: 1fr; }
    .auth-card { padding: 24px; }
    .nav-item-mobile-only { display: block; }
    .user-dropdown { display: none; }
}
@media (min-width: 769px) {
    .nav-item-mobile-only { display: none !important; }
}

/* ============================================================
   COURSE DETAIL
   ============================================================ */
.outcomes-list, .prerequisites-list, .audience-list { display: flex; flex-direction: column; gap: 8px; }
.outcome-item, .prerequisite-item, .audience-item {
    font-size: .9375rem; color: var(--text-secondary); line-height: 1.6;
    padding: 6px 0;
}
.detail-tags { display: flex; flex-wrap: wrap; gap: 8px; }

/* Chapter List */
.chapter-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.chapter-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-card);
    transition: box-shadow .2s;
}
.chapter-item:hover { box-shadow: var(--shadow-sm); }
.chapter-header {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 18px;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    user-select: none;
}
.chapter-num {
    font-size: .75rem; font-weight: 700; color: var(--primary);
    background: var(--primary-bg); padding: 2px 10px; border-radius: 4px;
    flex-shrink: 0;
}
.chapter-title {
    flex: 1; font-size: .9375rem; font-weight: 600; color: var(--text);
}
.chapter-lesson-count {
    font-size: .75rem; color: var(--text-muted); flex-shrink: 0;
}
.lesson-list { padding: 6px 0; }
.lesson-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 18px 8px 28px;
    transition: background .15s;
    cursor: pointer;
}
.lesson-item:hover { background: var(--bg-hover); }
.lesson-play-icon {
    font-size: .625rem; color: var(--text-muted); flex-shrink: 0;
    width: 16px; text-align: center;
}
.lesson-item:hover .lesson-play-icon { color: var(--primary); }
.lesson-title {
    flex: 1; font-size: .875rem; color: var(--text-secondary);
    transition: color .15s;
}
.lesson-item:hover .lesson-title { color: var(--text); }
.lesson-meta {
    display: flex; align-items: center; gap: 8px; flex-shrink: 0;
    font-size: .75rem; color: var(--text-muted);
}
.lesson-duration { white-space: nowrap; }
.chapter-summary {
    text-align: center; font-size: .8125rem; color: var(--text-muted);
    padding: 12px; background: var(--bg-alt);
    border-radius: var(--radius-md);
}

/* Sidebar Chapters */
.sidebar-chapters { list-style: none; padding: 0; margin: 0; }
.sidebar-chapters li {
    padding: 8px 0; font-size: .8125rem; color: var(--text-secondary);
    border-bottom: 1px solid var(--border-light);
    display: flex; align-items: center; gap: 6px;
}
.sidebar-chapters li:last-child { border-bottom: none; }
.sidebar-chapter-num { color: var(--primary); font-weight: 700; flex-shrink: 0; }
.sidebar-lesson-count {
    margin-left: auto; font-size: .6875rem; color: var(--text-muted); flex-shrink: 0;
}

/* ============================================================
   ADMIN CHAPTER / LESSON MANAGEMENT
   ============================================================ */
.chapter-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    overflow: hidden;
}
.chapter-card-header {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 18px;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border-light);
}
.chapter-card-title { flex: 1; font-size: .9375rem; font-weight: 600; color: var(--text); }
.chapter-card-actions { display: flex; gap: 6px; }
.lesson-row {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 18px;
    border-bottom: 1px solid var(--border-light);
    font-size: .875rem;
}
.lesson-row:last-child { border-bottom: none; }
.lesson-row-title { flex: 1; color: var(--text-secondary); }
.lesson-row-actions { display: flex; gap: 6px; }
.lesson-row:hover { background: var(--bg-hover); }

.btn-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; border-radius: 4px;
    border: 1px solid var(--border); background: var(--bg-card);
    color: var(--text-secondary); cursor: pointer;
    font-size: .8125rem; transition: all .15s;
    text-decoration: none;
}
.btn-icon:hover { border-color: var(--primary); color: var(--primary); }
.btn-icon-danger:hover { border-color: var(--danger); color: var(--danger); }

.form-section-title {
    font-size: 1rem; font-weight: 700; color: var(--text);
    padding-bottom: 8px; margin-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
