/* ============================================================
   base.css — 前台全域共用樣式（個人創作者風格）
   ------------------------------------------------------------
   命名規則：BEM（block__element--modifier）
   Block 名稱皆在 css命名規則 允許清單內
   所有前台頁面透過 includes/header.php 引用本檔
   ============================================================ */

/* ===== CSS 變數 ===== */
:root {
    --color-primary: #1e40af;
    --color-accent: #3b82f6;
    --color-btn: #2563eb;
    --color-dark: #0f172a;
    --color-text: #1e293b;
    --color-gray: #64748b;
    --color-muted: #94a3b8;
    --color-bg: #f4f6f8;
    --color-bg-light: #eff6ff;
    --color-border: #e2e8f0;
    --font-family: 'Segoe UI', 'Inter', system-ui, sans-serif;
    --container-width: 1200px;
    --radius: 14px;
    --radius-lg: 16px;
    --shadow-light: 0 8px 28px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 16px 40px rgba(0, 0, 0, 0.10);
    --transition: 0.3s;
}

/* ===== 基礎重置 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-family);
}
body {
    background: var(--color-bg);
    color: var(--color-text);
}
a {
    text-decoration: none;
    color: inherit;
}

/* ===== 導覽列 ===== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 40px;
    background: var(--color-dark);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 1000;
    flex-wrap: wrap;
    gap: 10px;
}
.header__brand {
    font-size: 22px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    text-decoration: none;
}
.header__brand-emoji {
    font-size: 24px;
}
.header__brand-dot {
    color: var(--color-accent);
}
.header__brand-sub {
    font-size: 12px;
    font-weight: normal;
    color: var(--color-muted);
    margin-left: 4px;
}
.header__nav ul {
    display: flex;
    list-style: none;
    gap: 28px;
}
.header__link {
    color: var(--color-muted);
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
}
.header__link:hover,
.header__link--active {
    color: #fff;
}
.header__btn {
    background: var(--color-btn);
    color: #fff;
    padding: 8px 24px;
    border-radius: 30px;
    font-weight: bold;
    text-decoration: none;
    font-size: 13px;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.header__btn:hover {
    background: #1d4ed8;
    transform: scale(1.02);
}
.header__toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 6px;
}

/* ===== 按鈕 ===== */
.btn {
    background: var(--color-btn);
    color: #fff;
    padding: 8px 28px;
    border-radius: 40px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn:hover {
    background: var(--color-primary);
    transform: scale(1.02);
}

/* ===== 標籤 ===== */
.tag {
    background: var(--color-bg-light);
    padding: 4px 16px;
    border-radius: 30px;
    font-size: 13px;
    color: var(--color-primary);
    font-weight: 500;
}

/* ===== 頁尾 ===== */
.footer {
    background: var(--color-dark);
    color: var(--color-muted);
    text-align: center;
    padding: 24px 20px;
    font-size: 13px;
}
.footer__link {
    color: var(--color-muted);
    text-decoration: none;
    transition: var(--transition);
}
.footer__link:hover {
    color: #fff;
}

/* ===== 主內容容器 ===== */
.container {
    max-width: var(--container-width);
    margin: 30px auto 50px;
    padding: 0 24px;
}

/* ===== 區塊標題 ===== */
.section {
    margin-top: 44px;
}
.section__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.section__title {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-text);
}
.section__title i {
    color: var(--color-primary);
    margin-right: 8px;
}
.section__link {
    color: var(--color-gray);
    font-weight: 500;
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
}
.section__link:hover {
    color: var(--color-primary);
}

/* ===== 網格 ===== */
.grid {
    display: grid;
    gap: 24px;
}
.grid--video {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.grid--list {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

/* ===== 頁面標題橫幅 ===== */
.page-header {
    background: linear-gradient(135deg, var(--color-dark) 30%, #1e3a8a);
    color: #fff;
    padding: 28px 24px 24px;
    text-align: center;
    position: relative;
    isolation: isolate;
    box-sizing: border-box;
    height: 200px !important;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.page-header--compact {
    padding: 28px 24px 24px;
    text-align: left;
    height: auto !important;
    min-height: 0;
    overflow: visible;
}
.page-header__icon {
    font-size: 44px;
    color: #60a5fa;
    margin-bottom: 10px;
}
.page-header__avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-accent), var(--color-primary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
    font-weight: 700;
    margin: 0 auto 8px;
    border: 3px solid var(--color-accent);
    box-shadow: 0 6px 18px rgba(30, 64, 175, 0.35);
}
.page-header__title {
    font-size: 34px;
    font-weight: 800;
}
.page-header__title span {
    color: #60a5fa;
}
.page-header__desc {
    color: var(--color-muted);
    font-size: 15px;
    margin-top: 6px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}
.page-header__breadcrumb {
    max-width: 900px;
    margin: 0 auto;
    font-size: 14px;
    color: var(--color-muted);
}
.page-header__breadcrumb a {
    color: var(--color-muted);
    text-decoration: none;
    transition: var(--transition);
}
.page-header__breadcrumb a:hover {
    color: #fff;
}
.page-header__breadcrumb-sep {
    margin: 0 8px;
}
.page-header__breadcrumb-current {
    color: #60a5fa;
}

/* ===== 個人 Hero 區（藍色系） ===== */
.hero {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 48px 24px 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 40px;
    position: relative;
    isolation: isolate;
}
.hero__avatar {
    flex-shrink: 0;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-accent), var(--color-primary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 12px 40px rgba(30, 64, 175, 0.3);
    border: 4px solid #fff;
    position: relative;
}
.hero__status {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    background: #22c55e;
    border-radius: 50%;
    border: 3px solid #fff;
}
.hero__text {
    flex: 1;
    min-width: 220px;
}
.hero__greeting {
    font-size: 14px;
    color: var(--color-btn);
    font-weight: 600;
    letter-spacing: 1px;
}
.hero__title {
    font-size: 38px;
    font-weight: 800;
    color: var(--color-text);
    margin: 4px 0 6px;
}
.hero__highlight {
    color: var(--color-primary);
}
.hero__bio {
    font-size: 16px;
    color: var(--color-gray);
    line-height: 1.7;
    max-width: 500px;
    margin: 6px 0 14px;
}
.hero__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-bottom: 16px;
}
.hero__social {
    display: flex;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
}
.hero__social-link {
    color: var(--color-gray);
    font-size: 22px;
    transition: var(--transition);
}
.hero__social-link:hover {
    color: var(--color-primary);
    transform: translateY(-2px);
}
.hero__social .btn {
    margin-right: 6px;
}

/* ===== 個人統計 ===== */
.stats-row {
    max-width: var(--container-width);
    margin: 8px auto 0;
    padding: 0 24px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 30px 50px;
    border-bottom: 1px solid var(--color-border);
}
.stats-row__item {
    display: flex;
    align-items: center;
    gap: 10px;
}
.stats-row__icon {
    font-size: 20px;
    color: var(--color-primary);
    width: 28px;
    text-align: center;
}
.stats-row__num {
    font-weight: 700;
    font-size: 18px;
    color: var(--color-text);
}
.stats-row__label {
    font-size: 14px;
    color: var(--color-gray);
}

/* ===== 影片卡片 ===== */
.video {
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-light);
    transition: 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    cursor: pointer;
    display: flex;
    flex-direction: column;
}
.video:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}
.video__thumb {
    position: relative;
    background: var(--color-dark);
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 32px;
}
.video__thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.video__duration {
    position: absolute;
    bottom: 10px;
    right: 12px;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    padding: 2px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.video__badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--color-btn);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 14px;
    border-radius: 30px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.video__info {
    padding: 16px 18px 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.video__title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 4px;
    color: var(--color-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.video__meta {
    font-size: 13px;
    color: var(--color-gray);
    display: flex;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
}
.video__meta i {
    margin-right: 4px;
}

/* ===== Hero / 頁面標題 背景圖（後台設定，buildHeroStyles 產生） ===== */
.hero.card--has-bg {
    background-image: var(--card-bg);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}
.hero.card--blur::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: var(--card-bg);
    background-size: cover;
    background-position: center;
    filter: blur(var(--card-blur, 0px));
    z-index: -1;
}
.page-header.card--has-bg {
    background-image: linear-gradient(135deg, rgba(15, 23, 42, 0.88), rgba(30, 58, 138, 0.88)), var(--card-bg);
    background-size: cover;
    background-position: center;
}
.page-header.card--blur::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: var(--card-bg);
    background-size: cover;
    background-position: center;
    filter: blur(var(--card-blur, 0px));
    z-index: -1;
}
.page-header--compact.card--has-bg {
    background-image: linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(30, 58, 138, 0.9)), var(--card-bg);
}

/* ===== 統計數據卡片 ===== */
.grid--stats {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin-bottom: 40px;
}
.stat {
    background: #fff;
    border-radius: var(--radius);
    padding: 20px 16px;
    text-align: center;
    box-shadow: var(--shadow-light);
    border: 1px solid var(--color-border);
    transition: var(--transition);
}
.stat:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}
.stat__num {
    font-size: 28px;
    font-weight: 800;
    color: var(--color-primary);
}
.stat__label {
    font-size: 13px;
    color: var(--color-gray);
    margin-top: 4px;
}
.stat__sub-label {
    font-size: 11px;
    color: var(--color-muted);
    margin-top: 2px;
}

/* ===== 響應式（共用） ===== */
@media (max-width: 992px) {
    .header {
        padding: 12px 20px;
    }
    .header__nav ul {
        gap: 18px;
    }
    .grid--video {
        grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    }
    .hero {
        padding: 30px 20px 10px;
        gap: 24px;
    }
    .hero__avatar {
        width: 120px;
        height: 120px;
        font-size: 48px;
    }
    .hero__title {
        font-size: 30px;
    }
    .page-header__title {
        font-size: 28px;
    }
}
@media (max-width: 600px) {
    .header {
        flex-direction: row;
        padding: 10px 16px;
    }
    .header__toggle {
        display: block;
    }
    .header__nav {
        display: none;
        flex-basis: 100%;
        width: 100%;
    }
    .header__nav--open {
        display: block;
    }
    .header__nav ul {
        display: flex;
        flex-direction: column;
        gap: 0;
        width: 100%;
    }
    .header__nav li {
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }
    .header__nav a {
        display: block;
        padding: 14px 4px;
    }
    .grid--video {
        grid-template-columns: 1fr;
    }
    .grid--list {
        grid-template-columns: 1fr;
    }
    .header__btn span {
        display: none;
    }
    .hero {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 20px 16px 6px;
    }
    .hero__tags {
        justify-content: center;
    }
    .hero__social {
        justify-content: center;
        flex-wrap: wrap;
    }
    .hero__bio {
        max-width: 100%;
    }
    .hero__avatar {
        width: 100px;
        height: 100px;
        font-size: 40px;
    }
    .hero__title {
        font-size: 26px;
    }
    .stats-row {
        justify-content: center;
        gap: 16px 30px;
    }
    .page-header {
        padding: 28px 16px 24px;
    }
    .page-header__icon {
        font-size: 34px;
    }
    .page-header__title {
        font-size: 22px;
    }
}
