
/* 共用 CSS 變數和基本樣式 */
:root {
    --font-size-small: 0.9rem;
    --font-size-normal: 1rem;
    --font-size-large: 1.2rem;
    --font-size-xlarge: 1.4rem;
    --primary-color: #6a5acd;
    --secondary-color: #ffb6c1;
    --accent-color: #87ceeb;
    --text-color: #2c3e50;
    --light-bg: #f8f9fa;
    --story-bg: #ffffff;
}

/* 字體大小類別 */
.font-size-small {
    font-size: var(--font-size-small) !important;
}

.font-size-normal {
    font-size: var(--font-size-normal) !important;
}

.font-size-large {
    font-size: var(--font-size-large) !important;
}

.font-size-xlarge {
    font-size: var(--font-size-xlarge) !important;
}

body {
    font-family: 'Open Sans', sans-serif;
    color: var(--text-color);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.navbar {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    font-weight: 700; /* strong/bold */
}

.navbar-brand {
    font-weight: bold;
    color: var(--primary-color) !important;
    font-size: 1.5rem;
}

.navbar-brand .brand-text {
    font-weight: 800; /* 更粗的字重，必要時改成 700/900 */
    display: inline-block;
}

.nav-link {
    color: var(--text-color) !important;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: var(--primary-color) !important;
    transform: translateY(-2px);
}

/* 導航欄工具按鈕樣式 */
.navbar-tools .btn {
    border-radius: 20px;
    padding: 8px 12px;
    transition: all 0.3s ease;
    border-width: 2px;
    margin: 0 5px;
}

.navbar-tools .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.navbar-tools.d-flex {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
}

.navbar-tools .btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.navbar-tools .btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.navbar-tools .btn-outline-secondary {
    color: var(--text-color);
    border-color: var(--text-color);
}

.navbar-tools .btn-outline-secondary:hover {
    background-color: var(--text-color);
    border-color: var(--text-color);
    color: white;
}

/* 響應式導航欄 - 關鍵修正 */
main {
    padding-top: 80px;
}

main .container {
    padding-top: 0px; /* 您想要的間距值 */
}

/* 修改故事網格佈局 */
.story-grid {
    display: grid;
    grid-template-columns: 1fr; /* 手機版單列 */
    gap: 20px;
    margin-top: 20px;
}


/* 防止導航欄摺疊，讓工具按鈕始終可見 */
.navbar-collapse {
    display: flex !important;
    flex-basis: auto !important;
}

.navbar-toggler {
    display: none !important;
}



/* 浮動按鈕 */
.floating-action {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--primary-color);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    z-index: 1000;
    text-decoration: none; /* Add this line */
}

.floating-action:hover {
    transform: scale(1.1);
    color: white;
}

.floating-share {
    position: fixed;
    bottom: 100px;
    right: 30px;
    background: #e74c3c;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    z-index: 1000;
    text-decoration: none; /* Add this line */
}

.floating-share:hover {
    transform: scale(1.1);
    color: white;
    background: #c0392b;
}

/* Layout & headings */
.masthead {
    background: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)), url('../static/assets/img/Develop_enviroment.jpeg') center/cover no-repeat;
    height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.site-heading h1 {
    font-size: 3.5rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    color: white;
}

.site-heading .subheading {
    font-size: 1.5rem;
    color: var(--secondary-color);
}

/* Story blocks */
.story-container {
    background: var(--story-bg);
    border-radius: 20px;
    padding: 40px;
    margin: 30px 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

.story-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 24px;
    border-radius: 12px;
    text-align: center;
}

.story-header h1 {
    text-align: center; 
    color: white; 
    margin-bottom: 20px; 
    font-size: 2.2rem; /* Reduced from 2.5rem */
    display: flex; 
    align-items: center; 
    justify-content: center;
}

.story-header p {
    text-align: center; 
    font-size: 1.1rem; /* Reduced from 1.2rem */
    color: #666; 
    margin-bottom: 30px; 
    line-height: 1.6;
}

.story-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 20px;
}

.story-card {
    background: var(--story-card-bg);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.story-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.story-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    border-color: var(--accent-color);
}

.story-number {
    background: var(--primary-color);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 15px;
}

.story-title {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 10px;
    font-weight: 700;
}

.story-description {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

.story-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: #888;
}

.story-duration {
    background: var(--secondary-color);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
}


.series-info h3 {
    margin-bottom: 15px;
    font-size: 2rem;
}

.series-info h2 {
    margin-bottom: 15px;
    font-size: 2rem;
}

.series-info p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 0;
}

.read-btn {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    margin-top: 10px;
}

.read-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    color: white;
    text-decoration: none;
}

.series-btn {
    background: linear-gradient(45deg, var(--accent-color), #5dade2);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    margin-top: 10px;
}

.series-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    color: white;
    text-decoration: none;
}

.button-group {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 2em;
}

/* Progress UI */
.reading-progress {
    border-radius: 10px;
    padding: 12px;
    margin: 12px 0;
    background: linear-gradient(90deg, rgba(255,255,255,0.9), rgba(255,255,255,0.95));
}

/* Story content */
.story-content {
    line-height: 1.8;
    font-size: 1.05rem;
    padding: 18px;
    background: var(--story-bg);
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}

body {
    transition: font-size 0.3s ease;
}

/* 或者針對特定元素 */
.story-content, .story-header h1, p {
    transition: font-size 0.3s ease;
}

/* Footer 共用樣式 */
.site-footer {
    background: linear-gradient(135deg, #2c3e50, #34495e); 
    color: #ecf0f1; 
    padding: 40px 0 20px; 
    margin-top: 60px;
}

.footer-brand-container {
    background: rgba(255,255,255,0.1); 
    padding: 25px; 
    border-radius: 15px; 
    backdrop-filter: blur(10px); 
    border: 1px solid rgba(255,255,255,0.2);
    margin-bottom: 25px;
}

.footer-brand-title {
    background: linear-gradient(90deg, #87ceeb, #6a5acd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

.footer-brand-subtitle {
    color: #bdc3c7; 
    margin-bottom: 15px; 
    font-size: 1.1rem; 
    font-style: italic;
}

.footer-copyright {
    color: #95a5a6; 
    font-size: 0.95rem; 
    margin-bottom: 0;
}

.footer-sections {
    border-top: 2px solid rgba(255,255,255,0.2); 
    padding-top: 30px;
}

.footer-card {
    background: rgba(255,255,255,0.05); 
    padding: 20px; 
    border-radius: 10px; 
    height: 100%;
    transition: transform 0.3s ease;
}

.footer-card:hover {
    transform: translateY(-5px);
}

.footer-card-orange {
    border-left: 4px solid #f39c12;
}

.footer-card-blue {
    border-left: 4px solid #3498db;
}

.footer-card-title {
    margin-bottom: 15px; 
    font-weight: 600; 
    font-size: 1.2rem;
}

.footer-card-orange .footer-card-title {
    color: #f39c12;
}

.footer-card-blue .footer-card-title {
    color: #3498db;
}

.footer-text {
    font-size: 0.95rem; 
    color: #bdc3c7; 
    line-height: 1.7; 
    margin-bottom: 15px;
}

.footer-link {
    color: #e74c3c; 
    text-decoration: none; 
    font-weight: 500; 
    padding: 6px 12px; 
    border: 1px solid #e74c3c; 
    border-radius: 15px; 
    transition: all 0.3s ease; 
    display: inline-block; 
    font-size: 0.85rem;
}

.footer-link:hover {
    background: #e74c3c;
    color: white;
}

.footer-list {
    list-style: none; 
    padding: 0; 
    font-size: 0.95rem; 
    color: #bdc3c7; 
    margin-bottom: 0;
}

.footer-list-item {
    margin-bottom: 8px; 
    padding-left: 20px; 
    position: relative;
}

.footer-list-item:last-child {
    margin-bottom: 0;
}

.footer-list-item i {
    position: absolute; 
    left: 0; 
    top: 2px; 
    font-size: 0.8rem;
}

/* 圖示顏色 */
.icon-yellow { color: #f1c40f; }
.icon-red { color: #e74c3c; }
.icon-purple { color: #9b59b6; }
.icon-green { color: #2ecc71; }

/* Small screens */
@media (max-width:768px) {
    .site-heading h1 { font-size:2.5rem; }
    .story-container { padding:20px; }
    .story-grid { grid-template-columns: 1fr; }
}

/* 桌面版滾動隱藏效果 */
@media (min-width: 992px) {
    #mainNav {
        transition: top 0.3s cubic-bezier(.4,0,.2,1), background-color 0.2s;
        position: fixed;
        width: 100%;
        z-index: 1000;
        top: 0;
    }
    #mainNav.is-fixed {
        top: -64px;
        background-color: #fff;
        border-bottom: 1px solid #eee;
    }
    #mainNav.is-fixed.is-visible {
        top: 0;
    }
}

/*手機版導航欄樣式 */
@media (max-width: 991.98px) {
    #mainNav {
        transition: top 0.3s cubic-bezier(.4,0,.2,1), background-color 0.2s;
        position: fixed;
        width: 100%;
        z-index: 1000;
        top: 0;
    }
    #mainNav.is-fixed {
        top: -64px; /* 根據你的 navbar 高度調整 */
        background-color: #fff;
        border-bottom: 1px solid #eee;
    }
    #mainNav.is-fixed.is-visible {
        top: 0;
    }
}