/* ============ 红色文化馆网页版 全局样式（主题色 #9F1709，与小程序一致） ============ */
:root {
	--theme: #9F1709;
	--theme-light: #c9574a;
	--bg: #f1f1f1;
	--card: #ffffff;
	--text: #333333;
	--text-grey: #999999;
	--line: #ededed;
	--orange: #e64340;
	--green: #1aad19;
	--blue: #10aeff;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
	font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
	font-size: 14px; color: var(--text); background: var(--bg);
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; border: none; background: none; cursor: pointer; }
img { display: block; }

/* 全屏容器（所有屏幕尺寸都铺满浏览器窗口） */
.app {
	position: relative; width: 100%; min-height: 100vh; margin: 0;
	background: var(--bg);
	display: flex; flex-direction: column;
}

/* ---------- 顶部导航 ---------- */
.nav {
	position: sticky; top: 0; z-index: 100; height: 46px; flex-shrink: 0;
	display: flex; align-items: center; justify-content: center;
	background: var(--theme); color: #fff;
}
.nav-title { font-size: 16px; font-weight: 500; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-back, .nav-home {
	position: absolute; top: 0; height: 46px; width: 46px; color: #fff; font-size: 20px;
	display: none; align-items: center; justify-content: center;
}
.nav-back { left: 4px; }
.nav-home { right: 4px; }
.nav.has-back .nav-back, .nav.has-home .nav-home { display: flex; }

/* ---------- 内容区 ---------- */
.page { flex: 1; padding-bottom: 64px; min-height: 60vh; }
.page.pad { padding: 12px; }

/* ---------- 底部 tabBar ---------- */
.tabbar {
	position: fixed; bottom: 0; left: 0; right: 0; z-index: 100; height: 56px;
	display: flex; background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.tabbar.hidden { display: none; }
.tab-item {
	flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
	gap: 2px; font-size: 11px; color: var(--text-grey);
}
.tab-icon { width: 24px; height: 24px; }
.tab-item.active { color: var(--theme); }
.tab-item.active .tab-icon { filter: drop-shadow(0 0 0.5px var(--theme)); }

/* ---------- 轮播图：宽度铺满，图片完整显示不裁切，两侧带装饰底纹 ---------- */
.swiper {
	position: relative; overflow: hidden; width: 100%;
	aspect-ratio: 16 / 10; max-height: 480px;
	background-color: #1a0a08;
	background-image:
		radial-gradient(circle at 20% 50%, rgba(159,23,9,.35) 0%, transparent 45%),
		radial-gradient(circle at 80% 50%, rgba(159,23,9,.35) 0%, transparent 45%),
		repeating-linear-gradient(45deg, rgba(255,255,255,.03) 0 2px, transparent 2px 14px),
		repeating-linear-gradient(-45deg, rgba(255,255,255,.03) 0 2px, transparent 2px 14px);
	border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,.1);
}
.swiper-track { display: flex; height: 100%; transition: transform .45s ease; }
.swiper-item { flex: 0 0 100%; position: relative; cursor: pointer; height: 100%; }
.swiper-item img { width: 100%; height: 100%; object-fit: contain; object-position: center; }
.swiper-overlay {
	position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 15px 15px;
	background: linear-gradient(transparent, rgba(0,0,0,.7)); color: #fff; font-size: 14px; font-weight: 500;
	text-shadow: 0 1px 2px rgba(0,0,0,.5);
}
.swiper-dots { position: absolute; bottom: 8px; left: 0; right: 0; display: flex; justify-content: center; gap: 5px; }
.swiper-dots i { width: 6px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.6); transition: width .3s; }
.swiper-dots i.on { width: 14px; background: #fff; }

/* ---------- 首页菜单网格 ---------- */
.menu-card { background: var(--card); margin: 12px; border-radius: 10px; padding: 16px 6px 6px; }
.menu-grid { display: flex; flex-wrap: wrap; }
.menu-item { width: 25%; display: flex; flex-direction: column; align-items: center; gap: 6px; padding-bottom: 14px; cursor: pointer; }
.menu-item .img {
	width: 52px; height: 52px; display: flex; align-items: center; justify-content: center;
	background-color: #9F7146;
	border-top-right-radius: 32px; border-top-left-radius: 28px;
	border-bottom-right-radius: 25px; border-bottom-left-radius: 25px;
}
.menu-item .img img { width: 32px; height: 32px; object-fit: contain; }
.menu-item .title { font-size: 12px; color: var(--text); }

/* ---------- 通用卡片 / 列表 ---------- */
.card { background: var(--card); border-radius: 10px; margin: 12px; overflow: hidden; }
.card-title { font-size: 15px; font-weight: 600; padding: 12px 14px 8px; }

/* 左图右文列表（leftbig1） */
.news-list { background: var(--card); border-radius: 10px; margin: 12px; }
.news-item { display: flex; gap: 10px; padding: 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.news-item:last-child { border-bottom: none; }
.news-item .pic { width: 92px; height: 66px; border-radius: 6px; object-fit: cover; flex-shrink: 0; background: #eee; }
.news-item .info { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; }
.news-item .t { font-size: 14px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.news-item .m { font-size: 11px; color: var(--text-grey); display: flex; align-items: center; gap: 6px; }

/* 标签 */
.tag { display: inline-block; font-size: 10px; padding: 1px 6px; border-radius: 4px; line-height: 16px; }
.tag.red { color: var(--theme); background: rgba(159,23,9,.08); }
.tag.orange { color: #ff9900; background: rgba(255,153,0,.1); }
.tag.purple { color: #7a5af5; background: rgba(122,90,245,.1); }
.tag.green { color: var(--green); background: rgba(26,173,25,.1); }
.tag.grey { color: #888; background: #f0f0f0; }

/* 分类横滑标签（公告通知页） */
.cate-tabs { display: flex; gap: 8px; padding: 12px 12px 4px; overflow-x: auto; scrollbar-width: none; }
.cate-tabs::-webkit-scrollbar { display: none; }
.cate-tab { flex-shrink: 0; padding: 6px 16px; border-radius: 16px; background: #fff; font-size: 13px; color: #666; cursor: pointer; border: 1px solid var(--line); }
.cate-tab.active { background: var(--theme); color: #fff; border-color: var(--theme); }

/* 通知卡片（公告通知页） */
.notice-item { background: var(--card); margin: 10px 12px; border-radius: 10px; padding: 12px 14px; cursor: pointer; }
.notice-item .head { display: flex; align-items: center; gap: 8px; }
.notice-item .t { flex: 1; font-size: 14px; font-weight: 500; }
.notice-item .meta { margin-top: 6px; font-size: 11px; color: var(--text-grey); display: flex; gap: 4px; align-items: center; }
.notice-item .content { margin-top: 6px; font-size: 12px; color: #777; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- 报名卡片 ---------- */
.enroll-item { position: relative; background: var(--card); margin: 12px; border-radius: 10px; padding: 14px; cursor: pointer; }
.enroll-item .status { position: absolute; top: 0; right: 0; background: var(--theme); color: #fff; font-size: 11px; padding: 3px 10px; border-radius: 0 10px 0 10px; }
.enroll-item .status.grey { background: #b2b2b2; }
.enroll-item .t { font-size: 15px; font-weight: 600; margin-bottom: 10px; padding-right: 60px; }
.enroll-item .line { display: flex; gap: 10px; }
.enroll-item .line img { width: 100px; height: 72px; border-radius: 6px; object-fit: cover; background: #eee; flex-shrink: 0; }
.enroll-item .desc { font-size: 12px; color: #666; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.enroll-item .cnt { margin-top: 6px; font-size: 11px; color: var(--text-grey); }

/* ---------- 表单 ---------- */
.form-card { background: var(--card); margin: 12px; border-radius: 10px; padding: 4px 14px; }
.form-item { display: flex; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.form-item:last-child { border-bottom: none; }
.form-item label { width: 84px; flex-shrink: 0; font-size: 14px; line-height: 34px; }
.form-item label .req { color: var(--orange); margin-right: 2px; }
.form-item .ctrl { flex: 1; }
.form-item input[type=text], .form-item input[type=mobile], .form-item input[type=number], .form-item input[type=date], .form-item input[type=password], .form-item select, .form-item textarea {
	width: 100%; height: 34px; border: none; outline: none; font-size: 14px; background: transparent; font-family: inherit; color: var(--text);
}
.form-item textarea { height: 70px; resize: none; line-height: 1.5; padding-top: 6px; }
.form-item input::placeholder, .form-item textarea::placeholder { color: #bbb; }

/* ---------- 按钮 ---------- */
.btn { display: block; width: 100%; height: 42px; border-radius: 21px; font-size: 15px; display: flex; align-items: center; justify-content: center; transition: opacity .2s; }
.btn:active { opacity: .8; }
.btn-primary { background: var(--theme); color: #fff; }
.btn-plain { background: #fff; color: #666; border: 1px solid #ddd; }
.btn-danger { background: #fff; color: var(--orange); border: 1px solid rgba(230,67,64,.4); }
.btn-mini { display: inline-block; width: auto; height: 28px; padding: 0 14px; border-radius: 14px; font-size: 12px; }
.btn-disabled { opacity: .5; pointer-events: none; }
.btn-area { padding: 18px 12px; }
.btn-row { display: flex; gap: 10px; padding: 0 12px; }
.btn-row .btn { flex: 1; }

/* ---------- 个人中心 ---------- */
.my-up {
	position: relative; padding: 26px 18px 30px; background: var(--theme); color: #fff; cursor: pointer;
}
.my-up .bg { position: absolute; right: 14px; top: 18px; width: 56px; height: 56px; border-radius: 50%; background: rgba(255,255,255,.15); display: flex; align-items: center; justify-content: center; }
.my-up .bg img { width: 30px; height: 30px; }
.my-up .name { font-size: 18px; font-weight: 600; }
.my-up .desc { margin-top: 8px; font-size: 12px; opacity: .85; display: flex; gap: 6px; align-items: center; }
.my-up .light { background: rgba(255,255,255,.2); color: #fff; }
.cell-group { background: var(--card); border-radius: 10px; margin: 12px; overflow: hidden; }
.cell { display: flex; align-items: center; padding: 14px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 14px; }
.cell:last-child { border-bottom: none; }
.cell:active { background: #fafafa; }
.cell .ic { width: 20px; text-align: center; margin-right: 10px; }
.cell .arrow { margin-left: auto; color: #ccc; }
.cell .hint { margin-left: auto; color: var(--text-grey); font-size: 12px; }

/* ---------- 详情页 ---------- */
.detail-top { background: var(--card); padding: 16px 14px; }
.detail-top h1 { font-size: 18px; line-height: 1.45; }
.detail-meta { margin-top: 10px; display: flex; gap: 10px; font-size: 11px; color: var(--text-grey); }
.detail-body { background: var(--card); margin: 12px; border-radius: 10px; padding: 16px 14px; font-size: 14px; line-height: 1.8; color: #444; }
.detail-body p { margin-bottom: 10px; text-indent: 0; }
.detail-body img { max-width: 100%; border-radius: 6px; margin: 8px 0; }
.cover-big { width: 100%; height: 190px; object-fit: cover; }

/* ---------- AI 对话 ---------- */
.ai-page { display: flex; flex-direction: column; height: calc(100vh - 46px - 0px); background: #f7f3f0; }
.model-bar { position: relative; padding: 10px 14px; background: #fff; border-bottom: 1px solid var(--line); font-size: 13px; color: #666; display: flex; align-items: center; gap: 4px; cursor: pointer; z-index: 20; }
.model-name { color: var(--theme); font-weight: 600; }
.model-dropdown { position: absolute; top: 100%; left: 0; right: 0; background: #fff; border-bottom: 1px solid var(--line); box-shadow: 0 8px 16px rgba(0,0,0,.06); }
.model-option { display: flex; align-items: center; padding: 12px 14px; gap: 8px; }
.model-option.active { background: #fdf6f5; }
.model-option .n { font-size: 14px; color: var(--text); }
.model-option .d { font-size: 11px; color: var(--text-grey); }
.model-check { margin-left: auto; color: var(--theme); }
.chat-list { flex: 1; overflow-y: auto; padding: 14px 12px 6px; }
.msg { display: flex; gap: 8px; margin-bottom: 16px; }
.msg .avatar { width: 34px; height: 34px; border-radius: 50%; overflow: hidden; background: var(--theme); flex-shrink: 0; }
.msg .avatar img { width: 100%; height: 100%; object-fit: cover; }
.msg .bubble-wrap { max-width: 78%; }
.msg .bubble { padding: 10px 12px; border-radius: 4px 12px 12px 12px; font-size: 14px; line-height: 1.7; word-break: break-word; white-space: pre-wrap; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.msg.user { flex-direction: row-reverse; }
.msg.user .bubble-wrap { display: flex; flex-direction: column; align-items: flex-end; }
.msg.user .bubble { background: var(--theme); color: #fff; border-radius: 12px 4px 12px 12px; }
.msg .time { margin-top: 4px; font-size: 10px; color: #b5aca6; }
.msg .actions { margin-top: 4px; font-size: 11px; color: var(--theme); cursor: pointer; }
.bubble .cursor { display: inline-block; width: 2px; height: 14px; background: var(--theme); vertical-align: middle; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0; } }
.reasoning-block { margin-bottom: 8px; border: 1px solid #eee3d9; border-radius: 8px; background: #fdf9f5; overflow: hidden; }
.reasoning-toggle { display: flex; align-items: center; gap: 6px; padding: 8px 10px; font-size: 12px; color: #9c7b5f; cursor: pointer; }
.reasoning-content { padding: 0 10px 10px; font-size: 12px; color: #9c8368; line-height: 1.7; white-space: pre-wrap; }
.bubble.error-text { color: var(--orange); }
.ai-loading { display: flex; gap: 8px; margin-bottom: 16px; }
.ai-loading .dots { display: flex; gap: 4px; padding: 14px 16px; background: #fff; border-radius: 4px 12px 12px 12px; }
.ai-loading .dots i { width: 6px; height: 6px; border-radius: 3px; background: #cbb; animation: bounce 1.2s infinite; }
.ai-loading .dots i:nth-child(2) { animation-delay: .15s; }
.ai-loading .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-5px); } }
.ai-loading .lt { font-size: 12px; color: #b5aca6; margin-top: 14px; }
.preset-area { padding: 8px 12px 4px; background: #fff; border-top: 1px solid var(--line); }
.preset-title { font-size: 11px; color: var(--text-grey); margin-bottom: 6px; }
.preset-list { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; }
.preset-list::-webkit-scrollbar { display: none; }
.preset-item { flex-shrink: 0; font-size: 12px; color: var(--theme); background: rgba(159,23,9,.06); border-radius: 14px; padding: 6px 12px; cursor: pointer; }
.ai-input { display: flex; align-items: center; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); }
.ai-input input { flex: 1; height: 38px; border: 1px solid #e5ddd5; border-radius: 19px; padding: 0 14px; font-size: 14px; outline: none; }
.ai-input .clear { font-size: 12px; color: var(--text-grey); cursor: pointer; }
.ai-input .send { width: 60px; height: 38px; border-radius: 19px; background: var(--theme); color: #fff; font-size: 14px; opacity: .5; cursor: pointer; }
.ai-input .send.active { opacity: 1; }

/* ---------- 视频页 ---------- */
.video-box { position: relative; width: 100%; background: #000; }
.video-box video { width: 100%; max-height: 240px; display: block; }
.video-box .btn-enlarge {
	position: absolute; top: 8px; right: 8px; z-index: 5;
	width: 32px; height: 32px; border-radius: 50%;
	background: rgba(0,0,0,.5); color: #fff; font-size: 16px;
	display: flex; align-items: center; justify-content: center;
	cursor: pointer; user-select: none;
}
.video-box .btn-enlarge:hover { background: rgba(0,0,0,.7); }

/* 视频放大遮罩 */
.video-fullscreen {
	position: fixed; inset: 0; z-index: 9999;
	background: #000; display: flex; align-items: center; justify-content: center;
}
.video-fullscreen video { width: 100%; max-height: 100vh; max-height: 100dvh; }
.video-fullscreen .btn-close {
	position: absolute; top: 16px; right: 16px; z-index: 10;
	width: 40px; height: 40px; border-radius: 50%;
	background: rgba(255,255,255,.2); color: #fff; font-size: 22px;
	display: flex; align-items: center; justify-content: center;
	cursor: pointer; user-select: none;
}
.video-fullscreen .btn-close:hover { background: rgba(255,255,255,.35); }

/* ---------- 空状态 / 加载 ---------- */
.empty { text-align: center; padding: 60px 0 40px; color: #b5b5b5; font-size: 13px; }
.empty .ico { font-size: 40px; margin-bottom: 10px; }
.load-more { text-align: center; padding: 14px; color: var(--text-grey); font-size: 12px; }
.spinner { width: 28px; height: 28px; border: 3px solid rgba(159,23,9,.2); border-top-color: var(--theme); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.page-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 50; pointer-events: none; }
.page-loading[hidden] { display: none; }
.page.blocked { pointer-events: none; filter: grayscale(.3); }

/* ---------- 弹窗 / 提示 ---------- */
.mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 200; display: flex; align-items: center; justify-content: center; }
.mask[hidden] { display: none; }
.modal { width: 78%; max-width: 320px; background: #fff; border-radius: 12px; overflow: hidden; animation: pop .18s ease; }
@keyframes pop { from { transform: scale(.9); opacity: 0; } }
.modal-title { padding: 18px 18px 0; font-size: 16px; font-weight: 600; text-align: center; }
.modal-content { padding: 12px 18px 20px; font-size: 14px; color: #666; line-height: 1.6; max-height: 50vh; overflow-y: auto; white-space: pre-wrap; }
.modal-btns { display: flex; border-top: 1px solid var(--line); }
.modal-btns .btn { height: 44px; border-radius: 0; font-size: 15px; }
.modal-btns .btn:first-child { border-right: 1px solid var(--line); }
.toast {
	position: fixed; left: 50%; bottom: 18%; transform: translateX(-50%); z-index: 300;
	background: rgba(0,0,0,.75); color: #fff; font-size: 13px; padding: 10px 18px; border-radius: 8px; max-width: 70%;
	animation: fadein .2s;
}
.toast[hidden] { display: none; }
@keyframes fadein { from { opacity: 0; } }

/* ---------- 收藏/足迹列表 ---------- */
.fav-item { display: flex; align-items: center; gap: 8px; }
.fav-item .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 搜索框 */
.search-bar { display: flex; gap: 8px; padding: 12px; }
.search-bar input { flex: 1; height: 36px; border-radius: 18px; border: none; background: #fff; padding: 0 16px; outline: none; font-size: 13px; }
.search-bar button { width: 52px; height: 36px; border-radius: 18px; background: var(--theme); color: #fff; font-size: 13px; }

/* 排序菜单 */
.sort-bar { display: flex; gap: 8px; padding: 0 12px 10px; overflow-x: auto; scrollbar-width: none; }
.sort-bar .s { flex-shrink: 0; font-size: 12px; color: #666; padding: 5px 12px; background: #fff; border-radius: 14px; cursor: pointer; }
.sort-bar .s.on { color: var(--theme); background: rgba(159,23,9,.08); font-weight: 600; }

/* 关于我们 内容 */
.about-body { background: var(--card); margin: 12px; border-radius: 10px; padding: 20px 16px; line-height: 1.9; font-size: 14px; color: #444; }
.about-body p { margin-bottom: 12px; }

/* 课程卡片 */
.course-item { display: flex; gap: 12px; background: var(--card); margin: 12px; border-radius: 10px; padding: 12px; cursor: pointer; align-items: center; }
.course-item img { width: 90px; height: 126px; border-radius: 8px; object-fit: cover; object-position: center top; flex-shrink: 0; background: #eee; }
.course-item .t { font-size: 14px; font-weight: 600; line-height: 1.4; }
.course-item .d { margin-top: 6px; font-size: 12px; color: var(--text-grey); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* 静态图文页 */
.art-hero { width: 100%; height: 200px; object-fit: cover; }
.art-body { background: var(--card); margin: 12px; border-radius: 10px; padding: 18px 16px; line-height: 1.9; font-size: 14px; color: #444; }
.art-body h2 { font-size: 16px; margin: 16px 0 8px; color: var(--text); border-left: 4px solid var(--theme); padding-left: 8px; }
.art-body p { margin-bottom: 10px; }
.art-body img { width: 100%; border-radius: 8px; margin: 10px 0; }

/* 状态徽标行（报名详情） */
.status-banner { display: flex; align-items: center; gap: 10px; background: var(--card); margin: 12px; border-radius: 10px; padding: 14px; }
.status-banner .ico { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.status-banner .ico.ok { background: rgba(26,173,25,.12); }
.status-banner .ico.wait { background: rgba(255,153,0,.12); }
.status-banner .ico.no { background: rgba(230,67,64,.12); }
.status-banner .t { font-size: 15px; font-weight: 600; }
.status-banner .d { font-size: 12px; color: var(--text-grey); margin-top: 2px; }

/* 表单只读展示（报名详情字段） */
.view-row { display: flex; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
.view-row:last-child { border-bottom: none; }
.view-row label { width: 90px; color: var(--text-grey); flex-shrink: 0; }
.view-row .v { flex: 1; word-break: break-all; }
