/* BBQOVN Customer Q&A - H5 */
:root {
	--qa-bg: #ffffff;
	--qa-surface: #ffffff;
	--qa-ink: #17130f;
	--qa-ink-2: #3d342c;
	--qa-muted: #7a6f66;
	--qa-line: #ece2d6;
	--qa-accent: #ff6600;
	--qa-accent-dark: #e65c00;
	--qa-accent-soft: #fff3eb;
	--qa-radius: 14px;
	--qa-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Roboto, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
	margin: 0;
	padding: 0;
	background: var(--qa-bg);
	color: var(--qa-ink);
	font-family: var(--qa-font);
	font-size: 15px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
button { font-family: inherit; font-size: inherit; cursor: pointer; }
input, textarea { font-family: inherit; font-size: inherit; }

.qa-page { padding-bottom: 32px; }

/* ---------- hero ---------- */
.qa-hero {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 26px 18px 18px;
	background: linear-gradient(180deg, #fff8f2 0%, #ffffff 100%);
}

/* 标题 + 副标题占满剩余宽度；按钮只在右侧占自己需要的宽度 */
.qa-hero-text {
	flex: 1 1 auto;
	min-width: 0;
}

.qa-hero-title {
	margin: 0 0 6px;
	font-size: 24px;
	line-height: 1.25;
	letter-spacing: -0.01em;
}

.qa-hero-subtitle {
	margin: 0;
	color: var(--qa-muted);
	font-size: 13px;
}

.qa-ask-btn {
	flex: 0 0 auto;
	width: auto;
	white-space: nowrap;
	border: 0;
	border-radius: 999px;
	background: var(--qa-accent);
	color: #fff;
	font-weight: 600;
	font-size: 14px;
	padding: 11px 20px;
	transition: background .18s ease;
}

.qa-ask-btn:active { background: var(--qa-accent-dark); }

/* ---------- toolbar ---------- */
.qa-toolbar { padding: 0 18px 14px; }

.qa-search { position: relative; margin-bottom: 12px; }

.qa-search-input {
	width: 100%;
	padding: 11px 14px 11px 38px;
	border: 1px solid var(--qa-line);
	border-radius: 999px;
	background: #fff;
	outline: none;
	font-size: 14px;
	-webkit-appearance: none;
}

.qa-search-input:focus {
	border-color: var(--qa-accent);
	box-shadow: 0 0 0 3px rgba(255, 102, 0, .1);
}

.qa-search-icon {
	position: absolute;
	left: 13px;
	top: 50%;
	width: 16px;
	height: 16px;
	transform: translateY(-50%);
	color: var(--qa-muted);
}

.qa-chips {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	padding-bottom: 2px;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}

.qa-chips::-webkit-scrollbar { display: none; }

.qa-chip {
	flex: 0 0 auto;
	padding: 7px 14px;
	border: 1px solid var(--qa-line);
	border-radius: 999px;
	background: #fff;
	color: var(--qa-ink-2);
	font-size: 13px;
	white-space: nowrap;
	transition: all .16s ease;
}

.qa-chip.is-active {
	background: var(--qa-accent);
	border-color: var(--qa-accent);
	color: #fff;
	font-weight: 600;
}

/* ---------- list ---------- */
.qa-list { padding: 0 18px; display: flex; flex-direction: column; gap: 12px; }

.qa-card {
	border: 1px solid var(--qa-line);
	border-radius: var(--qa-radius);
	padding: 16px;
	background: var(--qa-surface);
}

.qa-card-top {
	display: flex;
	align-items: center;
	gap: 9px;
	margin-bottom: 10px;
}

.qa-avatar {
	width: 32px;
	height: 32px;
	flex: 0 0 auto;
	border-radius: 50%;
	background: var(--qa-accent-soft);
	color: var(--qa-accent-dark);
	font-weight: 700;
	font-size: 13px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.qa-meta { min-width: 0; }

.qa-nick { font-size: 13px; font-weight: 600; line-height: 1.2; }
.qa-date { font-size: 11px; color: var(--qa-muted); }

.qa-tag {
	margin-left: auto;
	padding: 3px 9px;
	border-radius: 999px;
	background: #f6efe7;
	color: var(--qa-ink-2);
	font-size: 11px;
	white-space: nowrap;
}

/* 待审核徽章（未审核内容仅自己可见） */
.qa-pending {
	margin-left: 6px;
	padding: 3px 9px;
	border-radius: 999px;
	background: #fff3eb;
	border: 1px solid #ffcf9e;
	color: #a35a17;
	font-size: 11px;
	white-space: nowrap;
}

.qa-question {
	margin: 0;
	font-size: 14px;
	line-height: 1.65;
	word-break: break-word;
	white-space: pre-wrap;
}

.qa-thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

/* ---------- YouTube 视频：封面 + 播放按钮，点击后原地播放 ---------- */
.qa-video {
	position: relative;
	/* PC 端视频占满卡片宽度（上限 560px，详情层内容较宽时不至于过大），手机端同样全宽 */
	width: 100%;
	max-width: 560px;
	aspect-ratio: 16 / 9;
	margin-top: 12px;
	border-radius: 14px;
	overflow: hidden;
	background: #f4ece3;
	cursor: pointer;
	outline-offset: 2px;
}

.qa-video img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.qa-video iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

/* Chrome 已知问题：iframe 祖先链上有 CSS 动画、transform 或 perspective 时，YouTube
   播放器的全屏按钮会"一闪即退"。视频开播后（见 qa.js）给所在容器打上 .qa-fs-safe，
   禁用子树内这些属性，保证全屏可用。 */
.qa-fs-safe,
.qa-fs-safe * {
	animation: none !important;
	transition: none !important;
	transform: none !important;
	transform-style: flat !important;
	perspective: none !important;
	will-change: auto !important;
}

.qa-video-play {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	width: 36px;
	height: 25px;
	border-radius: 7px;
	background: rgba(255, 0, 0, .92);
	box-shadow: 0 6px 16px rgba(0, 0, 0, .3);
	transition: transform .18s ease, background .18s ease;
}

.qa-video-play::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-42%, -50%);
	border-style: solid;
	border-width: 5px 0 5px 9px;
	border-color: transparent transparent transparent #fff;
}

.qa-video:hover .qa-video-play,
.qa-video:focus-visible .qa-video-play {
	transform: translate(-50%, -50%) scale(1.08);
	background: #ff0000;
}

.qa-video.is-playing { cursor: default; }

.qa-video.is-playing .qa-video-play { display: none; }

@media (prefers-reduced-motion: reduce) {
	.qa-video-play { transition: none; }
}

.qa-thumb {
	width: 68px;
	height: 68px;
	padding: 0;
	border: 1px solid var(--qa-line);
	border-radius: 10px;
	overflow: hidden;
	background: #f7f2ec;
}

.qa-thumb img { width: 100%; height: 100%; object-fit: cover; }

.qa-answer {
	margin-top: 12px;
	padding: 11px 12px;
	border-left: 3px solid var(--qa-accent);
	border-radius: 0 10px 10px 0;
	background: #fffaf6;
}

.qa-answer-head {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .05em;
	text-transform: uppercase;
	color: var(--qa-accent-dark);
	margin-bottom: 6px;
}

.qa-answer p {
	margin: 0;
	font-size: 13px;
	line-height: 1.65;
	word-break: break-word;
	white-space: pre-wrap;
}

.qa-card-foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-top: 12px;
	padding-top: 10px;
	border-top: 1px dashed var(--qa-line);
}

.qa-helpful {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 6px 12px;
	border: 1px solid var(--qa-line);
	border-radius: 999px;
	background: #fff;
	color: var(--qa-ink-2);
	font-size: 12px;
}

.qa-helpful.is-done {
	border-color: var(--qa-accent);
	background: var(--qa-accent-soft);
	color: var(--qa-accent-dark);
}

.qa-foot-dim { font-size: 11px; color: var(--qa-muted); }

.qa-loading, .qa-empty {
	padding: 44px 18px;
	text-align: center;
	color: var(--qa-muted);
	font-size: 14px;
}

.qa-empty strong { display: block; color: var(--qa-ink); font-size: 15px; margin-bottom: 4px; }

.qa-more { padding: 16px 18px 0; }

.qa-more-btn {
	width: 100%;
	padding: 11px;
	border: 1px solid var(--qa-line);
	border-radius: 999px;
	background: #fff;
	color: var(--qa-ink-2);
	font-size: 14px;
}

.qa-tip {
	margin: 14px 18px 0;
	font-size: 11px;
	color: var(--qa-muted);
	text-align: center;
}

/* ---------- sheet ---------- */
/* hidden 属性必须真的隐藏：.qa-viewer 用了 display:flex，
   会盖掉浏览器对 [hidden] 的默认 display:none，导致不可见的
   全屏灯箱层拦截所有点击 */
[hidden] {
	display: none !important;
}

.qa-mask {
	position: fixed;
	inset: 0;
	background: rgba(23, 19, 15, .45);
	z-index: 60;
}

.qa-sheet {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 61;
	max-height: 92vh;
	overflow-y: auto;
	background: #fff;
	border-radius: 18px 18px 0 0;
	padding: 20px 18px calc(18px + env(safe-area-inset-bottom));
	animation: qaUp .22s ease-out;
}

@keyframes qaUp { from { transform: translateY(18px); opacity: .7; } }

.qa-sheet-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
}

.qa-sheet-head h2 { margin: 0; font-size: 18px; }

.qa-sheet-tip { margin: 4px 0 16px; font-size: 12px; color: var(--qa-muted); }

.qa-icon-btn {
	width: 30px;
	height: 30px;
	flex: 0 0 auto;
	border: 0;
	border-radius: 50%;
	background: #f6efe7;
	color: var(--qa-ink-2);
	font-size: 18px;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
}

.qa-field { margin-bottom: 14px; }

.qa-field label {
	display: block;
	font-size: 12px;
	font-weight: 600;
	margin-bottom: 6px;
}

.qa-field label span { font-weight: 400; color: var(--qa-muted); }

.qa-field input,
.qa-field textarea {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--qa-line);
	border-radius: 10px;
	background: #fff;
	outline: none;
	font-size: 14px;
}

.qa-field textarea { min-height: 104px; resize: vertical; line-height: 1.6; }

.qa-field input:focus,
.qa-field textarea:focus {
	border-color: var(--qa-accent);
	box-shadow: 0 0 0 3px rgba(255, 102, 0, .1);
}

.qa-uploads { display: flex; gap: 8px; flex-wrap: wrap; }

.qa-up-tile {
	position: relative;
	width: 76px;
	height: 76px;
	border: 1px solid var(--qa-line);
	border-radius: 10px;
	overflow: hidden;
	background: #f7f2ec;
}

.qa-up-tile img { width: 100%; height: 100%; object-fit: cover; }

.qa-up-del {
	position: absolute;
	top: 3px;
	right: 3px;
	width: 19px;
	height: 19px;
	border: 0;
	border-radius: 50%;
	background: rgba(23, 19, 15, .7);
	color: #fff;
	font-size: 12px;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
}

.qa-up-add {
	width: 76px;
	height: 76px;
	border: 1px dashed #d8c9b8;
	border-radius: 10px;
	background: #fff;
	color: var(--qa-muted);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 2px;
	font-size: 11px;
}

.qa-up-add b { font-size: 19px; font-weight: 400; line-height: 1; }

.qa-form-error {
	margin: 0 0 10px;
	padding: 9px 12px;
	border-radius: 8px;
	background: #fdf0ee;
	color: #c0392b;
	font-size: 12px;
}

.qa-sheet-foot { display: flex; gap: 10px; margin-top: 6px; }

.qa-btn-ghost,
.qa-btn-primary {
	flex: 1;
	padding: 12px;
	border-radius: 999px;
	font-size: 14px;
	font-weight: 600;
	border: 1px solid transparent;
}

.qa-btn-ghost { background: #fff; border-color: var(--qa-line); color: var(--qa-ink-2); }

.qa-btn-primary { background: var(--qa-accent); color: #fff; }

.qa-btn-primary:disabled { opacity: .6; }

/* ---------- viewer ---------- */
.qa-viewer {
	position: fixed;
	inset: 0;
	z-index: 90;
	background: rgba(12, 10, 8, .92);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 18px;
}

.qa-viewer img { max-width: 100%; max-height: 88vh; border-radius: 8px; }

.qa-viewer-close {
	position: absolute;
	top: 14px;
	right: 14px;
	width: 36px;
	height: 36px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .18);
	color: #fff;
	font-size: 20px;
}

/* ---------- toast ---------- */
.qa-toast {
	position: fixed;
	left: 50%;
	bottom: 32px;
	transform: translate(-50%, 16px);
	max-width: 86vw;
	padding: 11px 16px;
	border-radius: 10px;
	background: var(--qa-ink);
	color: #fff;
	font-size: 13px;
	opacity: 0;
	pointer-events: none;
	transition: all .2s ease;
	z-index: 120;
	text-align: center;
}

.qa-toast.is-show { opacity: 1; transform: translate(-50%, 0); }

.qa-busy {
	position: fixed;
	inset: 0;
	z-index: 100;
	background: rgba(255, 255, 255, .6);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 13px;
	color: var(--qa-muted);
}

/* iframe 嵌入模式：section 自带底部留白，这里收紧页面自身的 */
body.embed .qa-page { padding-bottom: 8px; }

/* ---------- 手机端 ---------- */
@media (max-width: 680px) {
	/* 手机端视频全宽 */
	.qa-video { width: 100%; min-width: 0; }
	.qa-video-play { width: 44px; height: 30px; border-radius: 8px; }
}
