/* =============================================================
   阿坝州新华书店 · 前台补充样式（public.css）
   -------------------------------------------------------------
   前台整体重构为 Tailwind CSS（static/js/tailwind.min.js 本地 Play CDN），
   页面结构全部使用 Tailwind 工具类；本文件只承载两类内容：
   1. 全局背景与基础设置（老站 common.css / index.css 视觉移植）
   2. 迁移自老站的富文本正文排版（.rich-content，裸标签 HTML）
   ============================================================= */

/* Alpine.js 渲染前的隐藏，避免模板闪烁 */
[x-cloak] { display: none !important; }

/* 全局背景：米色 + 纹理（移动端固定，与老站一致） */
body {
    background: #feeacd url('/static/home/images/background.png') center / cover no-repeat fixed;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

/* 首页背景（老站 index.css 使用 background-image.jpg） */
body.page-index {
    background-image: url('/static/home/images/background-image.jpg');
}

/* ================= 富文本正文排版 =================
   迁移内容为老站编辑器输出的裸标签 HTML（p / img / table / ul 等），
   Tailwind preflight 会重置其默认样式，此处按老站正文视觉统一恢复。 */
.rich-content {
    font-size: 15px;
    line-height: 1.8;
    color: #333;
    word-break: break-word;
    overflow: hidden;
}
.rich-content p {
    margin: 0 0 0.75em;
}
.rich-content img {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 8px;
    margin: 0.5em 0;
}
.rich-content h1,
.rich-content h2,
.rich-content h3,
.rich-content h4,
.rich-content h5 {
    margin: 1em 0 0.5em;
    font-weight: 600;
    color: #111;
    line-height: 1.4;
}
.rich-content h1 { font-size: 1.3em; }
.rich-content h2 { font-size: 1.2em; }
.rich-content h3 { font-size: 1.1em; }
.rich-content h4 { font-size: 1.05em; }
.rich-content ul,
.rich-content ol {
    margin: 0 0 0.75em;
    padding-left: 1.5em;
}
.rich-content ul { list-style: disc; }
.rich-content ol { list-style: decimal; }
.rich-content li { margin: 0.25em 0; }
.rich-content a {
    color: var(--brand, #cb141c);
    text-decoration: underline;
}
.rich-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.75em 0;
    font-size: 0.95em;
}
.rich-content th,
.rich-content td {
    border: 1px solid #e5e7eb;
    padding: 6px 8px;
}
.rich-content th {
    background: #f9fafb;
    font-weight: 600;
}
.rich-content blockquote {
    margin: 0.75em 0;
    padding: 0.5em 0.75em;
    border-left: 3px solid #e5e7eb;
    background: #fafafa;
    color: #666;
}
.rich-content strong, .rich-content b { font-weight: 600; }

/* ================= 加载占位 ================= */
img[loading="lazy"] {
    background-color: rgba(0, 0, 0, 0.03);
}
