/* Editor preview stylesheet: mimic frontend article styles for WYSIWYG */

/* Base typography (match frontend base.html variables approximated) */
html, body { background: #fff; }
/* TinyMCE 给 iframe 的 body 会带类名 mce-content-body，这里显式指定并提高优先级 */
body, .mce-content-body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro SC", Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans SC", "Source Han Sans SC", "Microsoft YaHei", sans-serif;
  font-size: 18px !important;           /* ensure override inline leftovers */
  line-height: 1.7 !important;          /* keep in sync with frontend --line-base */
  color: #2c1810;                        /* frontend var(--text-main) */
}

/* Headings */
h1, .mce-content-body h1 { font-size: 40px !important; line-height: 1.25 !important; margin: 0 0 1rem 0; }
h2, .mce-content-body h2 { font-size: 30px !important; line-height: 1.30 !important; margin: 1.4rem 0 .9rem; }
h3, .mce-content-body h3 { font-size: 22px !important; line-height: 1.35 !important; margin: 1.2rem 0 .7rem; }
h4, h5, h6 { margin: 1rem 0 .5rem; }

/* Paragraphs */
p, .mce-content-body p { margin: .9rem 0; font-size: 18px !important; line-height: 1.7 !important; }

/* Links */
a { color: #8B7355; text-decoration: none; }
a:hover { color: #5d4037; text-decoration: underline; }

/* Lists */
ul, ol, .mce-content-body ul, .mce-content-body ol { margin: .8rem 0 .8rem 1.4rem; }
ul { list-style: disc; }
ol { list-style: decimal; }
li { margin: .25rem 0; }

/* Blockquote */
blockquote, .mce-content-body blockquote {
  margin: 1.2rem 0; padding: .75rem 1rem; background: #f7f4f1; border-left: 4px solid #d7ccc8; color: #5d4037;
}

/* Code */
code, .mce-content-body code { background: #f3f4f6; padding: .1rem .35rem; border-radius: 4px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; }
pre, .mce-content-body pre { background: #0b1220; color: #e5e7eb; padding: 1rem; border-radius: 8px; overflow: auto; }
pre code { background: transparent; padding: 0; color: inherit; }

/* Tables */
table, .mce-content-body table { border-collapse: collapse; width: 100%; margin: 1rem 0; }
th, td, .mce-content-body th, .mce-content-body td { border: 1px solid #e5e7eb; padding: .5rem .75rem; }
th, .mce-content-body th { background: #faf7f5; text-align: left; }

/* Images */
img, video { max-width: 100%; height: auto; display: block; margin: 1rem auto; border-radius: 8px; }

/* Horizontal rule */
hr { border: 0; border-top: 1px solid #e5e7eb; margin: 1.5rem 0; }

/* Figure & caption */
figure { margin: 1.25rem 0; }
figcaption { text-align: center; color: #6b5b53; font-size: .9rem; margin-top: .25rem; }

/* Alerts & callouts (optional) */
.note { background: #fff7ed; border-left: 4px solid #fb923c; padding: .75rem 1rem; }
.tip  { background: #ecfeff; border-left: 4px solid #06b6d4; padding: .75rem 1rem; }

/* ===== Components used by content pages ===== */
/* Schedule table */
.schedule-section h2 { font-size: 30px; margin: 1rem 0 .75rem; color:#5d4037; }
.schedule-table-wrapper { width:100%; overflow-x: auto; margin-bottom: 1rem; border-radius: 14px; box-shadow: 0 10px 26px rgba(0,0,0,.08); }
.schedule-table { width: 100%; border-collapse: collapse; background: #fff; table-layout: fixed; min-width: 720px !important; }
.schedule-table col:nth-child(1){ width:8% }
.schedule-table col:nth-child(2){ width:22% }
.schedule-table col:nth-child(3){ width:22% }
.schedule-table col:nth-child(4){ width:28% }
.schedule-table col:nth-child(5){ width:20% }
.schedule-table thead { background: linear-gradient(135deg,#667eea 0%,#764ba2 100%); color: #fff; }
.schedule-table thead th { padding: 16px 12px; font-size: 15px; font-weight: 700; text-align: center; letter-spacing: .3px; }
.schedule-table tbody td { padding: 16px 12px; text-align: center; border-bottom: 1px solid #e2e8f0; font-size: 14px; }
.schedule-table tbody tr:nth-child(even){ background:#f7fafc }
.schedule-table tbody td:first-child{ font-weight:700; color:#667eea }
.schedule-table tbody td:nth-child(4){ font-weight:700; color:#d97706 }
/* 行交互：悬停/聚焦高亮 */
.schedule-table tbody td{ transition: background-color .18s ease, transform .12s ease }
.schedule-table tbody tr:hover td,
.schedule-table tbody tr:focus-within td{ background: rgba(102,126,234,.08) }
.schedule-table tbody tr:hover td:nth-child(4),
.schedule-table tbody tr:focus-within td:nth-child(4){ color:#7c3aed }
.schedule-table tbody tr:hover td,
.schedule-table tbody tr:focus-within td{ transform: translateY(-1px) }
.schedule-table tbody tr:hover td:first-child,
.schedule-table tbody tr:focus-within td:first-child{ border-left:2px solid #667eea; border-top-left-radius:10px; border-bottom-left-radius:10px }
.schedule-table tbody tr:hover td:last-child,
.schedule-table tbody tr:focus-within td:last-child{ border-top-right-radius:10px; border-bottom-right-radius:10px }
.schedule-note { background: linear-gradient(135deg,#fef3c7 0%, #fde68a 100%); padding: 12px 16px; border-radius: 12px; border-left: 5px solid #f59e0b; color:#78350f; }

/* 防止部分安卓浏览器（如夸克）在窄屏下将 CJK 文本逐字换行 */
.schedule-table thead th,
.schedule-table tbody td{ white-space: nowrap !important; word-break: keep-all !important; }
/* 仅允许备注/说明列自动换行，保证可读性 */
.schedule-table tbody td:last-child{ white-space: normal !important; text-align: left; }
/* 移动端横向滚动体验优化 */
.schedule-table-wrapper{ -webkit-overflow-scrolling: touch; }

/* ===== 通用表格兜底（文章内容中的普通 <table> 也生效） ===== */
/* 目的：即使内容里没有加 .schedule-table 类，也避免夸克等浏览器逐字换行 */
.prose table{ border-collapse: collapse; width: 100%; }
.prose table th,
.prose table td{ white-space: nowrap !important; word-break: keep-all !important; }
/* 兜底：最后一列通常是备注/说明，允许换行以保证可读性 */
.prose table tr > *:last-child{ white-space: normal !important; }
/* 小屏下给通用表格一个合理的最小宽度，触发横向滚动（由页面容器提供） */
@media (max-width: 768px){
  .prose table{ min-width: 680px; }
}

/* Practice cards */
.practice-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 28px; margin-top: 1.25rem; }
.practice-card { background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 12px 28px rgba(0,0,0,.1); transition: transform .25s, box-shadow .25s; }
.practice-card:hover { transform: translateY(-6px); box-shadow: 0 20px 40px rgba(102,126,234,.18); }
.practice-card .thumb { height: 220px; display: flex; align-items: center; justify-content: center; font-size: 72px; color: #fff; }
.practice-card .thumb.t1{ background: linear-gradient(135deg,#667eea,#764ba2) }
.practice-card .thumb.t2{ background: linear-gradient(135deg,#f093fb,#f5576c) }
.practice-card .thumb.t3{ background: linear-gradient(135deg,#4facfe,#00f2fe) }
.practice-card .thumb.t4{ background: linear-gradient(135deg,#fa709a,#fee140) }
.practice-card .thumb.t5{ background: linear-gradient(135deg,#30cfd0,#330867) }
.practice-card .thumb.t6{ background: linear-gradient(135deg,#43e97b,#38f9d7) }
.practice-card .body { padding: 20px; }
.practice-card .title { margin: 0 0 8px; font-size: 18px; color: #2d3748; font-weight: 800; }
.practice-card ul { margin: 0; padding-left: 18px; color: #718096; line-height: 1.9; }

@media (max-width:1180px){ .practice-grid{ grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width:640px){ .practice-grid{ grid-template-columns: 1fr; } }

/* ===== Old Photo Gallery Component ===== */
.op-header {
    text-align: center;
    max-width: 900px;
    margin: 20px auto 40px auto;
    padding-bottom: 35px;
    border-bottom: 2px dashed #dfd7c2;
    position: relative;
    background: transparent;
}
.op-theme-toggle {
    position: absolute;
    top: 0;
    right: 10px;
    background: #f4eee1;
    border: 1px solid #dfd7c2;
    color: #2c251e;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    font-family: inherit;
}
.op-tag {
    display: inline-block;
    font-size: 13px;
    color: #8f723b;
    font-weight: 600;
    letter-spacing: 3px;
    margin-bottom: 12px;
    text-transform: uppercase;
}
.op-title {
    font-family: 'Noto Serif SC', serif;
    font-size: 32px;
    font-weight: 700;
    color: #2c251e;
    margin: 15px 0 20px 0 !important;
    line-height: 1.3;
    border: none !important;
    padding: 0 !important;
    background: transparent;
}
.op-intro {
    font-family: 'Noto Serif SC', serif;
    font-size: 15px;
    color: #5a5045;
    max-width: 750px;
    margin: 0 auto 25px auto;
    text-align: justify;
    line-height: 1.8;
}
.op-stats {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    background-color: rgba(143, 114, 59, 0.07);
    border: 1px solid #dfd7c2;
    padding: 8px 24px;
    border-radius: 30px;
    font-size: 14px;
    color: #8f723b;
    font-weight: 600;
}
.op-toc {
    max-width: 1100px;
    margin: 0 auto 45px auto;
    background-color: #ffffff;
    border: 1px solid #dfd7c2;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(44, 37, 30, 0.05);
}
.op-toc-title {
    font-family: 'Noto Serif SC', serif;
    font-size: 18px;
    font-weight: bold;
    color: #2c251e;
    margin: 0 0 18px 0 !important;
    display: flex;
    align-items: center;
    gap: 8px;
    border-left: 3px solid #8f723b !important;
    padding-left: 10px !important;
    border-top: none !important;
    border-right: none !important;
    border-bottom: none !important;
    background: transparent;
}
.op-toc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}
.op-toc-item {
    font-size: 13.5px;
    color: #5a5045 !important;
    text-decoration: none !important;
    padding: 8px 12px;
    background-color: #fbfaf7;
    border: 1px solid #dfd7c2;
    border-radius: 6px;
    transition: all 0.25s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 6px;
}
.op-toc-item:hover {
    border-color: #8f723b !important;
    background-color: rgba(143, 114, 59, 0.07) !important;
    color: #8f723b !important;
    transform: translateY(-2px);
}
.op-section {
    max-width: 1100px;
    margin: 0 auto 55px auto;
    scroll-margin-top: 20px;
}
.op-section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-bottom: 1px solid #dfd7c2;
    padding-bottom: 10px;
    margin-bottom: 24px;
}
.op-section-num {
    font-family: 'Noto Serif SC', serif;
    font-size: 24px;
    font-weight: 700;
    color: #8f723b;
    opacity: 0.85;
}
.op-section-title {
    font-family: 'Noto Serif SC', serif;
    font-size: 20px;
    font-weight: 600;
    color: #2c251e;
    margin: 0 !important;
    border: none !important;
    padding: 0 !important;
    background: transparent;
}
.op-section-meta {
    font-size: 12px;
    color: #8e8375;
    border: 1px solid #dfd7c2;
    background: #ffffff;
    padding: 3px 10px;
    border-radius: 12px;
}
.op-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 18px;
}
.op-card {
    background-color: #ffffff;
    border: 1px solid #dfd7c2;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(44, 37, 30, 0.04);
    display: flex;
    flex-direction: column;
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.op-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(143, 114, 59, 0.12);
    border-color: #8f723b;
}
.op-img-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background-color: #f4eee1;
}
.op-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}
.op-card:hover .op-img-wrapper img {
    transform: scale(1.06);
}
.op-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(44, 37, 30, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.op-card:hover .op-overlay {
    opacity: 1;
}
.op-zoom-icon {
    color: #ffffff;
    background-color: #8f723b;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0.85);
    transition: transform 0.3s ease;
}
.op-card:hover .op-zoom-icon {
    transform: scale(1);
}
.op-card-footer {
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #dfd7c2;
    background-color: #ffffff;
}
.op-card-num {
    font-size: 12px;
    color: #8e8375;
    font-weight: 500;
}
.op-footer {
    text-align: center;
    padding: 40px 0 20px 0;
    margin-top: 30px;
    border-top: 1px solid #dfd7c2;
    font-size: 13px;
    color: #8e8375;
}

/* Lightbox styles */
.op-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 12, 10, 0.97);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.3s ease;
}
.op-lightbox.hidden {
    opacity: 0;
    pointer-events: none;
}
.op-lb-close {
    position: absolute;
    top: 24px;
    right: 24px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    cursor: pointer;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10010;
}
.op-lb-close:hover {
    background-color: #8f723b;
    border-color: #8f723b;
    transform: rotate(90deg);
}
.op-lb-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    cursor: pointer;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10005;
}
.op-lb-nav:hover {
    background-color: #8f723b;
    border-color: #8f723b;
}
.op-lb-prev { left: 24px; }
.op-lb-next { right: 24px; }
.op-lb-viewer {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 90px;
}
.op-lb-viewer img {
    max-width: 90%;
    max-height: 80%;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
    transition: transform 0.3s ease, opacity 0.2s ease;
    border: 2px solid rgba(255, 255, 255, 0.1);
}
.op-lb-meta {
    position: absolute;
    bottom: 30px;
    text-align: center;
    z-index: 10005;
    color: #ffffff;
    background-color: rgba(26, 21, 17, 0.85);
    padding: 12px 24px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    max-width: 80%;
}
.op-lb-title {
    font-family: 'Noto Serif SC', serif;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: #d4b57b;
}
.op-lb-counter {
    font-size: 0.8rem;
    opacity: 0.65;
    letter-spacing: 1px;
}


