/* ============================================================
   theme-v2.css — 菩提画院 v2 主题（古纸色 · 唐卡金 · 朱砂红）
   作用：覆盖旧版深色主题，让 register / query / success /
   admin / about 等旧页面获得与新版官网一致的浅色美工。
   旧 DOM 与 JS 交互完全不动，仅做视觉层覆盖。
   引入方式：在 site.css 之后加载本文件。
   ============================================================ */

/* ---------- 1. 变量层：直接替换旧版深色变量 ---------- */
:root {
  --color-bg: #f5efe0;            /* 古纸色 */
  --color-bg-mid: #ede5cf;        /* 稍深纸色 */
  --color-bg-elevated: #fffaf0;   /* 卡片纸白 */
  --color-surface: #fffaf0;
  --color-surface-warm: #fdf6e7;
  --color-indigo: #e6d9ba;        /* 原深蓝 → 暖沙 */
  --color-indigo-deep: #dcccae;
  --color-mineral: #d8c9a6;
  --color-gold: #8b6914;          /* 唐卡金 */
  --color-gold-bright: #a8861e;
  --color-gold-dark: #6b4f0c;
  --color-gold-soft: #c9ab5a;
  --color-cinnabar: #a91d22;      /* 朱砂红 */
  --color-cinnabar-deep: #8c171b;
  --color-coral: #b5452f;
  --color-text: #2b1810;          /* 深褐墨色 */
  --color-text-muted: #6b5544;    /* 褐灰 */
  --color-border: rgba(139, 105, 20, 0.24);
  --color-border-strong: rgba(139, 105, 20, 0.45);

  --shadow-sm: 0 1px 3px rgba(94, 70, 29, 0.10);
  --shadow-md: 0 6px 22px rgba(94, 70, 29, 0.13);
  --shadow-lg: 0 14px 40px rgba(94, 70, 29, 0.16);
}

/* ---------- 2. 页面底色：去掉深色底图，换成古纸色 ---------- */
html,
body,
body[class*="page-"] {
  background-color: #f5efe0 !important;
  color: #2b1810;
}

body,
body::before,
body::after {
  background-image: none !important;
}

/* 顶部品牌渐变饰条（与新版官网一致） */
body::before {
  content: "";
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  z-index: 9999;
  background: linear-gradient(
    90deg,
    #a91d22 0%,
    #c9a44a 25%,
    #8b6914 50%,
    #c9a44a 75%,
    #a91d22 100%
  );
}

::selection {
  background: rgba(169, 29, 34, 0.16);
}

/* ---------- 3. 页头：深色玻璃 → 浅色毛玻璃 ---------- */
.site-header,
.site-header--grand,
.site-header.site-header--scrolled {
  background: rgba(245, 239, 224, 0.92) !important;
  backdrop-filter: blur(10px) saturate(1.1);
  -webkit-backdrop-filter: blur(10px) saturate(1.1);
  border-bottom: 1px solid rgba(139, 105, 20, 0.22) !important;
  box-shadow: 0 1px 10px rgba(94, 70, 29, 0.08) !important;
}

.brand-mark,
.brand-mark:visited {
  color: var(--color-gold) !important;
  text-decoration: none;
}
.brand-mark strong { color: var(--color-gold) !important; letter-spacing: .18em; }
.brand-mark small { color: var(--color-text-muted) !important; }
.brand-mark:hover strong { color: var(--color-gold-dark) !important; }

/* 旧版横向导航（桌面端隐藏，统一使用侧滑菜单） */
.site-nav,
.site-nav--grand {
  display: none !important;
}

/* 汉堡按钮 */
.menu-toggle {
  display: flex !important;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 1px solid rgba(139, 105, 20, .35);
  border-radius: 8px;
  cursor: pointer;
  padding: 10px;
  margin-left: auto;
}
.menu-toggle span {
  display: block;
  height: 2px;
  background: var(--color-gold);
  border-radius: 2px;
  transition: background .2s ease;
}
.menu-toggle:hover { border-color: var(--color-gold); }
.menu-toggle:hover span { background: var(--color-gold-dark); }

/* 侧滑抽屉 */
.site-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(280px, 80vw);
  height: 100vh;
  background: #fffaf0;
  z-index: 1100;
  transform: translateX(100%);
  transition: transform .3s ease;
  box-shadow: -6px 0 30px rgba(43, 24, 16, .18);
  padding: 1.25rem;
  overflow-y: auto;
}
.site-drawer.open { transform: translateX(0); }

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid rgba(139, 105, 20, .18);
  color: var(--color-gold);
  font-weight: 600;
  letter-spacing: .1em;
}
.drawer-close {
  background: transparent;
  border: none;
  font-size: 1.6rem;
  color: var(--color-gold);
  cursor: pointer;
  line-height: 1;
  padding: 0 .25rem;
}
.drawer-close:hover { color: var(--color-cinnabar); }

.site-drawer a {
  display: block;
  padding: .9rem .75rem;
  color: var(--color-text) !important;
  text-decoration: none;
  border-radius: 999px;
  margin-bottom: .35rem;
  transition: background .2s ease, color .2s ease;
  font-weight: 500;
}
.site-drawer a:hover,
.site-drawer a[aria-current="page"] {
  background: rgba(169, 29, 34, .12) !important;
  color: var(--color-cinnabar) !important;
}

/* 遮罩层 */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(43, 24, 16, .45);
  z-index: 1050;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
}
.drawer-overlay.open {
  opacity: 1;
  visibility: visible;
}

.skip-link {
  background: #fffaf0 !important;
  color: #2b1810 !important;
  border-color: #a91d22 !important;
}

/* ---------- 4. 主体容器 ---------- */
.main-wrap,
.admin-wrap,
.admin-wrap-wide,
.page-strip,
.page-intro {
  background: transparent !important;
  color: #2b1810;
}

.form-page-title,
.admin-page-title,
.page-intro h1,
.page-intro .form-page-title,
.section-title,
.form-section-title,
.admin-card-title,
h1, h2, h3 {
  color: #2b1810 !important;
  text-shadow: none !important;
}

.form-page-lead,
.admin-lead,
.page-intro p,
.form-hint,
.form-label,
.form-label-small {
  color: #6b5544 !important;
  text-shadow: none !important;
}

a,
a:visited {
  color: #6b4f0c;
}
a:hover {
  color: #a91d22;
}

code {
  background: rgba(139, 105, 20, 0.12) !important;
  color: #6b4f0c !important;
  border: 1px solid rgba(139, 105, 20, 0.2);
  border-radius: 4px;
  padding: 0 4px;
}

/* ---------- 5. 卡片层：覆盖旧版“深色主题细节”段落 ---------- */
/* 该段落在 site.css 末尾，故此处一律 !important 反制 */
.page-intro,
.course-card,
.register-form,
.query-card,
.success-card,
.success-panel,
.result-card,
.admin-card,
.panel-frame,
.contact-section,
.reg-card,
.form-section,
.doc-scroll-panel,
.alert-panel,
.admin-grid > .admin-card,
.ew-panel,
.ew-notice-box {
  background: #fffaf0 !important;
  background-image: none !important;
  color: #2b1810 !important;
  border: 1px solid rgba(139, 105, 20, 0.22) !important;
  box-shadow: 0 6px 22px rgba(94, 70, 29, 0.10) !important;
  text-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.reg-card-header { border-bottom: 1px solid rgba(139, 105, 20, 0.18); }
.admin-grid {
  gap: 18px;
}

/* 统计块 */
.reg-stats,
.admin-stats {
  background: #fdf6e7 !important;
  border: 1px solid rgba(139, 105, 20, 0.18) !important;
}
.reg-stat-label,
.admin-stats dt {
  color: #6b5544 !important;
}
.reg-stat-value,
.admin-stats dd {
  color: #8b6914 !important;
}

/* ---------- 6. 表单控件 ---------- */
.form-input,
.form-select,
select.form-input,
textarea.form-input,
textarea.admin-textarea,
.admin-inline-set-row .form-input,
.reg-search {
  background: #fffdf7 !important;
  color: #2b1810 !important;
  border: 1px solid rgba(139, 105, 20, 0.32) !important;
  box-shadow: inset 0 1px 2px rgba(94, 70, 29, 0.06) !important;
}
.form-input::placeholder,
textarea::placeholder {
  color: #a08a72 !important;
  opacity: 1;
}
.form-input:focus,
textarea:focus,
select:focus {
  border-color: #a91d22 !important;
  box-shadow: 0 0 0 3px rgba(169, 29, 34, 0.14) !important;
  outline: none;
}

.form-field > label,
.form-label,
label {
  color: #5a4632 !important;
}

/* 复选/单选强调色 */
input[type="checkbox"],
input[type="radio"] {
  accent-color: #a91d22;
}

/* 字段错误提示保持可读 */
.field-error {
  color: #a91d22 !important;
}

/* ---------- 7. 按钮 ---------- */
.btn,
button.btn {
  text-shadow: none !important;
}
.btn-primary,
#btn-submit.btn-primary {
  background: linear-gradient(180deg, #b5252a 0%, #a91d22 100%) !important;
  color: #fffaf0 !important;
  border: 1px solid #8c171b !important;
  box-shadow: 0 4px 14px rgba(169, 29, 34, 0.28) !important;
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #a91d22 0%, #8c171b 100%) !important;
}
.btn-primary:disabled {
  background: #c9b18a !important;
  border-color: #b39a6e !important;
  box-shadow: none !important;
}
.btn-secondary {
  background: transparent !important;
  color: #6b4f0c !important;
  border: 1px solid rgba(139, 105, 20, 0.5) !important;
  box-shadow: none !important;
}
.btn-secondary:hover:not(:disabled) {
  background: rgba(139, 105, 20, 0.10) !important;
  color: #4a370a !important;
  border-color: #8b6914 !important;
}
.btn.is-disabled {
  opacity: 0.55;
}

/* ---------- 8. 表格 ---------- */
.reg-table-wrap {
  background: #fffaf0 !important;
  border: 1px solid rgba(139, 105, 20, 0.22) !important;
  border-radius: 10px;
}
.reg-table {
  color: #2b1810 !important;
}
.reg-table th {
  background: #ede5cf !important;
  color: #5a4632 !important;
  border-bottom: 2px solid rgba(139, 105, 20, 0.35) !important;
}
.reg-table td {
  border-bottom: 1px solid rgba(139, 105, 20, 0.14) !important;
  color: #2b1810 !important;
}
.reg-table tbody tr:hover td {
  background: rgba(201, 164, 74, 0.12) !important;
}

.reg-toolbar {
  border-color: rgba(139, 105, 20, 0.18) !important;
}
.reg-toggle { color: #5a4632 !important; }
.reg-status { color: #6b5544 !important; }
.reg-empty { color: #6b5544 !important; }
.admin-json-out {
  background: #f5efe0 !important;
  color: #4a370a !important;
  border: 1px dashed rgba(139, 105, 20, 0.4) !important;
}
.admin-badge {
  background: rgba(169, 29, 34, 0.10) !important;
  color: #a91d22 !important;
  border: 1px solid rgba(169, 29, 34, 0.3) !important;
}
.admin-steps li,
.admin-file-list li {
  color: #5a4632 !important;
}

/* ---------- 9. 状态标签（浅底上保持辨识度） ---------- */
.status-pill--open {
  background: rgba(43, 122, 75, 0.12) !important;
  color: #256b45 !important;
  border: 1px solid rgba(43, 122, 75, 0.35) !important;
}
.status-pill--wait {
  background: rgba(176, 128, 12, 0.14) !important;
  color: #8a6410 !important;
  border: 1px solid rgba(176, 128, 12, 0.4) !important;
}
.status-pill--full {
  background: rgba(169, 29, 34, 0.10) !important;
  color: #a91d22 !important;
  border: 1px solid rgba(169, 29, 34, 0.35) !important;
}
.status-pill--closed {
  background: rgba(107, 85, 68, 0.12) !important;
  color: #6b5544 !important;
  border: 1px solid rgba(107, 85, 68, 0.35) !important;
}

/* 提示面板 */
.alert-panel--info,
.alert--info {
  background: rgba(43, 108, 176, 0.08) !important;
  border: 1px solid rgba(43, 108, 176, 0.28) !important;
  color: #2c5170 !important;
}
.alert-panel--success {
  background: rgba(43, 122, 75, 0.10) !important;
  border: 1px solid rgba(43, 122, 75, 0.32) !important;
  color: #256b45 !important;
}
.alert-panel--error,
.alert-panel--warning {
  background: rgba(169, 29, 34, 0.08) !important;
  border: 1px solid rgba(169, 29, 34, 0.32) !important;
  color: #a91d22 !important;
}

/* ---------- 10. 课程卡 / 成功页 / 查询结果 ---------- */
.course-card .course-item {
  border-left-color: #8b6914 !important;
}
.success-panel .success-title,
.result-card .result-title {
  text-shadow: none !important;
}
.success-panel em,
.success-panel strong {
  color: #6b4f0c !important;
}
.site-footer-contact a { color: #6b4f0c !important; }

/* ---------- 11. 首页大幅英雄区（若旧版页面残留） ---------- */
.grand-hero,
.grand-hero--logo-only,
.home-grand,
.home-grand--minimal {
  background: linear-gradient(180deg, #fdf6e7 0%, #f5efe0 100%) !important;
  color: #2b1810 !important;
}
.grand-atmosphere__sky,
.grand-atmosphere__mountains,
.grand-atmosphere__tibetan {
  opacity: 0.5;
  filter: sepia(0.5) saturate(0.8);
}
.grand-brand-name {
  color: #2b1810 !important;
  text-shadow: none !important;
}
.grand-logo-ring {
  border-color: rgba(139, 105, 20, 0.4) !important;
  box-shadow: 0 0 0 10px rgba(139, 105, 20, 0.08) !important;
}

/* ---------- 12. 页脚 ---------- */
.site-footer,
.site-footer--grand {
  background: #ede5cf !important;
  border-top: 1px solid rgba(139, 105, 20, 0.22) !important;
  color: #6b5544 !important;
}
.site-footer p,
.site-footer p a {
  color: #6b5544 !important;
  text-shadow: none !important;
}

/* ---------- 13. 文档滚动面板 / 健康声明 ---------- */
.doc-scroll-panel {
  scrollbar-color: #c9ab5a #ede5cf;
}
.health-q-item {
  background: #fdf6e7 !important;
  border: 1px solid rgba(139, 105, 20, 0.18) !important;
  color: #2b1810 !important;
}
.health-q-item .health-q-title { color: #5a4632 !important; }

/* ---------- 14. 滚动条 ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #ede5cf; }
::-webkit-scrollbar-thumb {
  background: #c9ab5a;
  border-radius: 6px;
  border: 2px solid #ede5cf;
}
::-webkit-scrollbar-thumb:hover { background: #8b6914; }

/* ---------- 15. 关于页：视频 / 海报区域卡片调亮 ---------- */
.about-media-card,
.grand-about-card,
.grand-contact-card {
  background: #fffaf0 !important;
  border: 1px solid rgba(139, 105, 20, 0.24) !important;
  box-shadow: 0 6px 22px rgba(94, 70, 29, 0.13) !important;
}
.about-media-head p {
  color: #6b5544 !important;
}
.about-media-card .section-kicker,
.grand-about-card .section-kicker {
  color: #8b6914 !important;
}
.teacher-poster {
  background: #fdf6e7 !important;
  border-color: rgba(139, 105, 20, 0.3) !important;
  box-shadow: 0 10px 28px rgba(94, 70, 29, 0.16) !important;
}
.teacher-copy-note {
  color: #6b5544 !important;
}

/* 关于页：深褐墨色标题与视频区更高对比 */
.about-page-title,
.about-media-card h2,
.grand-about-card h2,
.grand-contact-card h2 {
  color: #2b1810 !important;
  text-shadow: none !important;
}
.about-media-head > p,
.teacher-copy > p,
.grand-contact-card p {
  color: #5a4632 !important;
}
.about-video-wrap {
  background: #fdf6e7 !important;
  border-radius: 12px;
  padding: .75rem;
  box-shadow: inset 0 0 0 1px rgba(139, 105, 20, .12);
}
.about-video-wrap video {
  border-radius: 10px;
}
.about-video-links .btn-secondary {
  color: #6b4f0c !important;
  border-color: rgba(139, 105, 20, .5) !important;
}
.about-video-links .btn-secondary:hover {
  background: rgba(139, 105, 20, .10) !important;
  color: #4a370a !important;
}
