/* =========/static/css/style.css======== */

/* 1. 全局与变量定义                 */
/* ================================== */
:root {
    /* -- 颜色 -- */
    --color-primary: #2c9893;
    /*--color-active: #f5a623;*/
    --color-active: #2c9893;
    --color-white: #ffffff;
    --color-bg: #f4f5f7;
    --color-text-primary: #333333;
    --color-text-secondary: #999999;
    --color-text-on-dark: #ffffff;

    /* -- 尺寸与间距 -- */
    --nav-height: 24vw;  /* for index.html */
    --tab-height: 12vw;  /* for index.html */
    --bottom-tab-bar-height: 70px;
    --space-base: 16px;
    --space-small: 8px;

    /* -- 圆角与阴影 -- */
    --border-radius-card: 12px;
    --border-radius-item: 8px;
    --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* -- 基础重置 -- */
body, html {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text-primary);
    box-sizing: border-box;
}

*, *::before, *::after {
    box-sizing: inherit;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ================================== */
/* 2. 布局容器                       */
/* ================================== */
/* -- 用于 index.html 的特殊滚动布局 -- */
.scroll-container {
    height: 100vh;
    overflow-y: auto;
    /* 顶部导航和Tab的高度 */
    padding-top: calc(var(--nav-height) + var(--tab-height));
    /* 底部导航栏的高度 */
    padding-bottom: calc(var(--bottom-tab-bar-height) + env(safe-area-inset-bottom));
}

/* -- 用于 exhibition 和 my 页面的标准布局 -- */
.page-wrapper {
    max-width: 600px;
    margin: 0 auto;
    background-color: #fff; /* 大部分页面背景是白色 */
    min-height: 100vh;
    padding-bottom: calc(var(--bottom-tab-bar-height) + env(safe-area-inset-bottom));
}
.page-wrapper--gray-bg {
    background-color: var(--color-bg);
}


/* ================================== */
/* 3. 可重用组件                     */
/* ================================== */

/* -- 3.1. 底部Tab栏 (All pages) -- */
.bottom-tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 600px;
    margin: 0 auto;
    height: var(--bottom-tab-bar-height);
    background-color: var(--color-white);
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -1px 5px rgba(0,0,0,0.06);
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 100;
}
.tab-bar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--color-text-secondary);
    font-size: 11px;
}
.tab-bar-item .icon {
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
}
.tab-bar-item.active {
    color: var(--color-active);
}
.tab-bar-item.active .icon {
    fill: var(--color-active); /* For solid icons */
    stroke: var(--color-active); /* For outline icons */
}
.tab-bar-item.special {
    transform: translateY(-20px);
}
.tab-bar-item.special .icon-wrapper {
    width: 60px;
    height: 60px;
    background-color: var(--color-white);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 8px rgba(0,0,0,0.1);
    margin-bottom: 5px;
}
.tab-bar-item.special .icon {
    width: 30px;
    height: 30px;
    margin-bottom: 0;
}

/* -- 3.2. 通用页面头部 (exhibition, my) -- */
.header-bar {
    display: flex;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    position: sticky;
    top: 0;
    background-color: #fff;
    z-index: 10;
}
.back-button {
    font-size: 24px;
    color: #333;
    padding: 0 10px;
}
.header-title {
    flex-grow: 1;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    /* 修正居中 */
    transform: translateX(-20px);
}

/* -- 3.3. 工具类 -- */
.ellipsis {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* ================================== */
/* 4. 页面特定样式                   */
/* ================================== */

/* -- 4.1. 首页 (index.html) -- */
body.index-page-body {
    overflow: hidden; /* 防止body滚动 */
}
.custom-nav {
    position: fixed; top: 0; left: 0; right: 0;
    height: var(--nav-height);
    background-color: var(--color-primary);
    display: flex; align-items: center;
    padding: 0 4vw;
    z-index: 99;
}
.nav-left { display: flex; align-items: center; }
.logo { width: 10.67vw; height: 10.67vw; margin-right: 2.67vw; border-radius: 50%; }
.title { height: 7.73vw; object-fit: contain; }

.tabs-nav {
    position: fixed; top: var(--nav-height); left: 0; right: 0;
    display: flex; justify-content: space-around;
    background-color: var(--color-white);
    height: var(--tab-height);
    border-bottom: 1px solid #eee;
    z-index: 99;
}
.tab-item {
    line-height: var(--tab-height);
    font-size: 4vw;
    position: relative;
    padding: 0 1.33vw;
    cursor: pointer;
}
.tab-item.active { color: var(--color-primary); font-weight: bold; }
.tab-item.active::after {
    content: ''; position: absolute; bottom: 0; left: 50%;
    transform: translateX(-50%);
    width: 8vw; height: 0.8vw;
    background-color: var(--color-primary);
    border-radius: 0.4vw;
}

.page-content { padding: 3.2vw; }
.banner-swiper { width: 100%; height: 46.67vw; border-radius: var(--border-radius-card); overflow: hidden; }
.banner-image { width: 100%; height: 100%; object-fit: cover; }
.banner-text { position: absolute; bottom: 2.67vw; left: 2.67vw; color: var(--color-text-on-dark); font-size: 4.8vw; font-weight: bold; text-shadow: 0 0 5px rgba(0, 0, 0, 0.5); }
.swiper-pagination-bullet-active { background-color: var(--color-white) !important; }

.quick-actions { display: flex; flex-wrap: wrap; background-color: var(--color-white); padding: 4vw 0 1.33vw 0; border-radius: var(--border-radius-card); margin-top: 3.2vw; }
.action-item { display: flex; flex-direction: column; align-items: center; width: 33.33%; margin-bottom: 4vw; cursor: pointer; }
.action-icon-wrapper { width: 13.33vw; height: 13.33vw; border-radius: 50%; display: flex; justify-content: center; align-items: center; margin-bottom: 2.13vw; box-shadow: 0 0.53vw 1.33vw rgba(0, 0, 0, 0.08); background-color: var(--color-primary); }
.action-icon { width: 6.67vw; height: 6.67vw; }
.action-text { font-size: 3.47vw; }

.section-module { margin-top: 5.33vw; }
.section-header { display: flex; justify-content: center; align-items: center; margin-bottom: 3.2vw; position: relative; }
.section-more { font-size: 3.47vw; color: var(--color-text-secondary); position: absolute; right: 0; top: 50%; transform: translateY(-50%); }
.section-title-image { height: 5.6vw; object-fit: contain; }

.heritage-scroll { white-space: nowrap; overflow-x: auto; }
.heritage-item { display: inline-block; width: 37.33vw; height: 24vw; margin-right: 2.67vw; position: relative; }
.heritage-image { width: 100%; height: 100%; border-radius: var(--border-radius-item); object-fit: cover; }
.heritage-title { position: absolute; bottom: 1.33vw; left: 1.33vw; color: var(--color-text-on-dark); font-size: 3.73vw; font-weight: bold; text-shadow: 0 0 5px rgba(0, 0, 0, 0.6); }

.policy-list { background-color: var(--color-white); border-radius: var(--border-radius-card); padding: 1.33vw 4vw; box-shadow: var(--shadow-card); }
.policy-item { display: flex; justify-content: space-between; align-items: center; padding: 3.47vw 0; border-bottom: 1px solid #f0f0f0; }
.policy-item:last-child { border-bottom: none; }
.policy-title { flex: 1; font-size: 3.73vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-right: 2.67vw; }
.policy-date { font-size: 3.47vw; color: var(--color-text-secondary); white-space: nowrap; }

.geo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3.2vw; }
.geo-gridss { display: grid; grid-template-columns: 1fr 1fr; gap: 3.2vw; }
.geo-item { background-color: var(--color-white); border-radius: var(--border-radius-card); overflow: hidden; box-shadow: var(--shadow-card); cursor: pointer; transition: transform 0.2s ease, box-shadow 0.2s ease; }
.geo-item:hover { transform: translateY(-5px); box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1); }
.geo-image { width: 100%; height: 33.33vw; object-fit: cover; }
.geo-info { padding: 2.67vw; }
.geo-name { font-size: 4vw; font-weight: bold; }
.geo-desc { font-size: 3.47vw; color: var(--color-text-secondary); margin-top: 1.07vw; }

/* -- 4.2. 名片页 (exhibition-list.html) -- */
.list-header { padding: 20px 20px 10px; }
.list-title { font-size: 28px; font-weight: bold; }
.list-subtitle { font-size: 14px; color: #999; margin-top: 4px; }
.exhibition-list { padding: 10px 20px; display: flex; flex-direction: column; gap: 16px; }
.exhibition-card { position: relative; height: 200px; border-radius: 16px; overflow: hidden; box-shadow: 0 6px 16px rgba(0,0,0,0.08); color: white; display: block; }
.card-bg-image { width: 100%; height: 100%; object-fit: cover; position: absolute; top: 0; left: 0; z-index: 1; }
.card-tags { position: absolute; top: 12px; right: 12px; display: flex; gap: 6px; z-index: 2; }
.card-tag { font-size: 11px; padding: 4px 8px; border-radius: 10px; background-color: rgba(0,0,0,0.3); }
.card-title { position: absolute; bottom: 16px; left: 16px; font-size: 22px; font-weight: bold; z-index: 2; text-shadow: 0 1px 4px rgba(0,0,0,0.5); }

/* -- 4.3. 我的页面 (my.html) -- */


/* style.css (找到并替换 4.4 节中的列表页样式) */

/* ================================== */
/* 4.4. 漫画页 (comic-list, comic-detail) */
/* ================================== */

/* -- 漫画列表页 (作为首页Tab，采用网格布局) -- */
.comic-grid-container {
    display: grid;
    /* 创建两列，每列占据可用空间的一半 */
    grid-template-columns: 1fr 1fr;
    /* 定义列与行之间的间距 */
    gap: 3.2vw;
}

.comic-grid-card {
    display: block;
    background-color: var(--color-white);
    border-radius: var(--border-radius-item);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.comic-grid-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.comic-grid-image-wrapper {
    position: relative;
    /* 定义图片容器的高宽比，例如 5:4 */
    padding-top: 125%; /* 5 / 4 = 1.25 */
    background-color: #eee; /* 图片加载前的占位背景色 */
}

.comic-grid-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* 保证图片填满容器而不变形 */
}

.comic-grid-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    /* 从透明到黑色的渐变，让文字更清晰 */
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 100%);
}

.comic-grid-title {
    position: absolute;
    bottom: 2.6vw;
    left: 2.6vw;
    right: 2.6vw;
    margin: 0;
    font-size: 4vw;
    font-weight: 600;
    color: var(--color-white);
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    /* 限制标题最多显示两行 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.comic-grid-author {
    padding: 2.6vw;
    font-size: 3.2vw;
    color: var(--color-text-secondary);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background-color: var(--color-white); /* 确保背景色 */
}


/* -- 漫画详情页 (保持不变) -- */
.comic-detail-container {
    padding: var(--space-base);
}

.comic-detail-header {
    padding-bottom: var(--space-base);
    margin-bottom: var(--space-base);
    border-bottom: 1px solid #f0f0f0;
}

.comic-detail-header h1 {
    font-size: 22px;
    margin: 0 0 8px 0;
}

.comic-detail-meta {
    font-size: 14px;
    color: var(--color-text-secondary);
    margin: 0;
}

.comic-detail-content {
    background-color: #fff;
}

.comic-image-page {
    display: block;
    width: 100%;
    height: auto;
}
