/*----------------------------------------- */
/* 變數定義（CSS Variables） */
/*----------------------------------------- */
:root {
    --primary-color: #7dcded;
    --secondary-color: #abe4ff;
    --accent-color: #d72660;
    --light-color: #e8f3fc;
    --dark-color: #444;

    /* 古風色彩 */
    --color-ancient-primary: #0A3C53;
    --color-ancient-secondary: #C38D3D;
    --color-ancient-accent: #E55B3F;
    --color-ancient-text: #2c3e50;
    --color-ancient-light: #F7F5F0;

     /* 科技色彩 */
    --color-tech-neon: #00FFFF;
    --color-tech-glow: #2ECC71;
    --color-tech-border: #6B909D;

    /* 混合色 *//* 漸變 Header */
    --color-header-bg: linear-gradient(90deg, var(--color-ancient-primary), #1a5c80);
}


/*----------------------------------------- */
/* 全域樣式（Global Styles） */
/*----------------------------------------- */
body {
    margin: 0;
    font-family: 'Noto Serif TC', 'Playfair Display', sans-serif;
    color: var(--color-ancient-text);
    line-height: 1.8;
    overflow-x: hidden;
    animation: gradientBG 15s ease infinite;
    background-attachment: fixed;
    background-size: 400% 400%;
    background-image:
        var(--gradient-ancient),
        url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%"><defs><pattern id="p" width="100" height="100" patternUnits="userSpaceOnUse"><path d="M 0 0 L 100 100 M 100 0 L 0 100" stroke="%23dcdcdc" stroke-width="0.5" opacity="0.1"/></pattern></defs><rect width="100%" height="100%" fill="url(%23p)"/></svg>');
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.ancient-text {
    font-size: 1.1em;
    letter-spacing: 0.1em; /* 增加字距，模仿古籍排版視覺效果 */
}


/*----------------------------------------- */
/* 文本樣式（Typography Utilities） */
/*----------------------------------------- */
.text-primary-ancient { color: var(--color-ancient-primary) !important; }
.text-secondary-ancient { color: var(--color-ancient-secondary) !important; }
.text-danger-ancient { color: var(--color-ancient-accent) !important; }
.text-muted-ancient { color: var(--color-tech-border) !important; }


/*----------------------------------------- */
/* 頁首與導航（Header / Nav） */
/*----------------------------------------- */
header {
    text-align: center;
    padding: 20px;
    background: rgba(255,255,255,0.8);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.header-title {
    font-size: 2.5em;
    font-weight: 700;
    color: var(--color-ancient-primary);
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.1);
}

.ancient-subtitle {
    border-left: 5px solid var(--color-ancient-secondary);
    padding-left: 15px;
    margin-bottom: 20px;
    color: var(--color-ancient-primary);
    font-weight: 700;
}

.ancient-tech-header {
    background-color: rgba(255, 255, 255, 0.9);    
    border-radius: 15px;
    box-shadow: 0 0 5px rgba(0,0,0,0.1);
    padding: 20px;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-link-ancient {
    color: var(--color-ancient-text) !important;
    font-weight: 700;
    background: rgb(224, 247, 241);
    border-radius: 8px;
    position: relative;
    text-decoration: none;
    transition: color 0.3s ease, background 0.3s ease;
    display: inline-block;
    white-space: nowrap;
}

.nav-link-ancient:hover {
    color: var(--color-ancient-primary) !important;
    background: var(--primary-color);
}

.nav-link-ancient::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background-color: var(--color-tech-neon);
    transition: width 0.3s ease;
}

.nav-link-ancient:hover::after {
    width: 70%;
    box-shadow: 0 0 8px var(--color-tech-neon);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='%230A3C53' stroke-width='3' stroke-linecap='round' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
}


/*----------------------------------------- */
/* 容器與卡片樣式（Container & Card Styles） */
/*----------------------------------------- */
.ancient-tech-content {
    max-width: 1400px;
    margin-top: 50px;
    padding: 0 15px;
}

.ancient-card,.section-card,.ancient-item-bg {
    background-color: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--color-tech-border);
    border-radius: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.ancient-card:hover,.section-card:hover,.ancient-item-bg:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15), 0 0 10px var(--color-tech-neon);
}

.ancient-header-bg {
    background: var(--color-header-bg);
    border-bottom: 2px solid var(--color-ancient-secondary);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* ---------------------------------------- */
/* 按鈕（Buttons） */
/* ---------------------------------------- */
.btn-primary-ancient {
    background-color: var(--color-ancient-primary);
    border-color: var(--color-ancient-primary);
    color: var(--color-ancient-light);
    transition: all 0.3s ease;
    box-shadow: 0 0 4px var(--color-ancient-text);
}

.btn-primary-ancient:hover {
    background-color: #1a5c80;
    border-color: #1a5c80;
    box-shadow: 0 0 10px var(--color-tech-neon);
    transform: translateY(-2px);
}

.btn-outline-primary-ancient {
    color: var(--color-ancient-primary);
    border-color: var(--color-ancient-primary);
    transition: all 0.3s ease;
}

.btn-outline-primary-ancient:hover {
    background-color: var(--color-ancient-primary);
    color: var(--color-ancient-light);
}


/* ---------------------------------------- */
/* 標籤與進度條（Tags & Progress） */
/* ---------------------------------------- */
.ancient-tag-info {
    background-color: var(--color-tech-border);
    color: var(--color-ancient-light);
    font-size: 0.9em;
    padding: 5px 10px;
    border-radius: 20px;
    transition: background-color 0.3s ease;
}

.ancient-tag-info:hover {
    background-color: var(--color-ancient-primary);
}

.progress-bar {
    background-color: var(--primary-color);
}


/* ---------------------------------------- */
/* 圖片與表格（Media & Tables） */
/* ---------------------------------------- */
.ancient-img {
    border: 0.5px solid var(--color-ancient-primary);
    opacity: 0.9;
    transition: all 0.2s ease;
}

.ancient-img:hover {
    opacity: 1;
    border: 2px solid var(--color-tech-neon);
    box-shadow: 0 0 10px var(--color-tech-neon);
}

.ancient-table {
    border: none;
}

.ancient-table thead,.ancient-table tfoot {
    background-color: var(--color-ancient-light);
    color: var(--color-ancient-primary);
}


/* ---------------------------------------- */
/* Section 動畫（Section Animation） */
/* ---------------------------------------- */
section {
    padding: 20px 0; /* 減少 padding */
    margin: 0;       /* 移除 margin */
    background: rgba(255,255,255,0.8);
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s, transform 0.5s;
    display: none;
}

section.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}


/* ---------------------------------------- */
/* Skills / Courses（表格） */
/* ---------------------------------------- */
.course-table {
    display: flex;
    gap: 40px;
    justify-content: center;
    flex-wrap: wrap;
}

.course-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1 1 300px;
    min-width: 250px;
    max-width: 400px;
}

.course-col h4 {
    margin-top: 0;
    color: var(--accent-color);
    letter-spacing: 2px;
}

.course-col ul {
    flex: 1;
    background: var(--light-color);
    border-radius: 8px;
    padding: 16px 24px;
    box-shadow: 0 2px 8px rgba(255,143,171,0.08);
    border: 2px solid #c0c9cd;
    min-height: 380px;
    display: flex;
    flex-direction: column;
}


/* ---------------------------------------- */
/* Memories / Photos（照片牆） */
/* Downloads（下載區塊） */
/* ---------------------------------------- */
.memory-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.memory-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--color-tech-border);
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    transition: transform .3s ease, box-shadow .3s ease;
}

.memory-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15), 0 0 10px var(--color-tech-neon);
}

.memory-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--color-ancient-primary);
}

.memory-caption {
    margin-top: 10px;
    font-size: 0.95rem;
    color: var(--color-ancient-text);
}

.download-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

.download-item {
    width: 45%;
    text-align: center;
    margin-bottom: 20px;
}

/* ---------------------------------------- */
/* Login Page（登入頁） */
/* ---------------------------------------- */
#login-page {
    padding: 40px 20px;
    text-align: center;
    border-radius: 15px;
    box-shadow: 0 0 20px rgba(0,0,0,0.2);
}

.login-container {
    text-align: center;
    margin-top: 50px;
}

.quote-text { 
    font-style: italic; color: 
    var(--color-ancient-primary); 
}
.quote-cite { 
    color: var(--color-ancient-secondary); 
}


/* ---------------------------------------- */
/* Hero Section */
/* ---------------------------------------- */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 15px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.profile-img {
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    transition: transform 0.3s ease;
}

.profile-img:hover {
    transform: scale(1.03);
}

/* ---------------------------------------- */
/* 小工具（Utilities） */
/* ---------------------------------------- */
.hidden { display: none; }
.hidden-content {
    display: none !important; 
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px dashed var(--color-ancient-secondary);
    box-shadow: none;
}
.ancient-thumbnail { object-fit: cover; } /* 確保圖片相框不會變形 */

.ancient-divider {
    border-top: 2px solid rgb(67, 135, 245);
    opacity: 0.5;
    margin: 40px 0;
}


/* ---------------------------------------- */
/* 響應式調整 */
/* ---------------------------------------- */
@media (max-width: 768px) {
    .ancient-tech-header {
        position: static;
        margin-top: 0;
    }
    .header-title {
        font-size: 2em;
    }
    .ancient-text {
        font-size: 1em;
        line-height: 1.6;
    }
    .nav-link-ancient {
        padding: 6px 12px;
        font-size: 16px !important;
        width: 100%; 
    }
    .course-table { 
        gap: 16px; 
        padding: 0 12px; 
    }
    .download-item { 
        width: 100%; 
    }    
}


/* ---------------------------------------- */
/* 每日一句話（Daily Quote） */
/* ---------------------------------------- */
.daily-container {
    max-width: 1100px;
    margin: 20px auto; 
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
}

/* 針對標題的樣式 */
.daily-quote-section #dailyQuote-cite {
    background-color: #f3f3f3; /* 輕微背景色 */
    border-radius: 4px;
}

.daily-quote-section #dailyQuote {
    font-size: 1.5rem; /* 放大字體 */
    color: #242424; /* 深灰色語錄文字 */
    font-weight: 500;
    font-style: italic;
    padding: 15px;
    border-top: 2px solid #007bff; /* 藍色分隔線 */
    margin-top: 15px;
}
