/* 6 套寺院视觉风格预设 */

body.theme-temple-serenity {
  --style-btn-radius: 8px;
  --style-card-radius: var(--ts-radius, 14px);
}

body.theme-temple-serenity[data-visual-style="zen"] {
  --color-primary: #5c4d3c;
  --color-accent: #c9a962;
  --color-muted-text: #7a6f62;
  --gradient-hero: linear-gradient(135deg, #3d3429 0%, #5c4d3c 50%, #7a6b58 100%);
}

body.theme-temple-serenity[data-visual-style="gold"] {
  --color-primary: #8b6914;
  --color-accent: #e6c547;
  --gradient-hero: linear-gradient(135deg, #6b4f0a 0%, #a67c00 55%, #d4af37 100%);
}

body.theme-temple-serenity[data-visual-style="bamboo"] {
  --color-primary: #3d5c45;
  --color-accent: #8fbc8f;
  --gradient-hero: linear-gradient(135deg, #2d4a35 0%, #4a7c59 100%);
}

body.theme-temple-serenity[data-visual-style="lotus"] {
  --color-primary: #8b5a6b;
  --color-accent: #e8b4bc;
  --gradient-hero: linear-gradient(135deg, #6b4455 0%, #a67b8a 100%);
}

body.theme-temple-serenity[data-visual-style="ink"] {
  --color-primary: #2c2c2c;
  --color-accent: #9e9e9e;
  --gradient-hero: linear-gradient(135deg, #1a1a1a 0%, #424242 100%);
}

body.theme-temple-serenity[data-visual-style="dawn"] {
  --color-primary: #8b5a2b;
  --color-accent: #f4a460;
  --gradient-hero: linear-gradient(135deg, #7a4520 0%, #c97b3a 55%, #f0a060 100%);
}

:root:not([data-theme="dark"]) body.theme-temple-serenity[data-visual-style="zen"] {
  --color-bg: #faf9f7;
}

:root:not([data-theme="dark"]) body.theme-temple-serenity[data-visual-style="gold"] {
  --color-bg: #fffdf5;
  --color-border: #f0e6c8;
}

:root:not([data-theme="dark"]) body.theme-temple-serenity[data-visual-style="bamboo"] {
  --color-bg: #f5f9f6;
}

:root:not([data-theme="dark"]) body.theme-temple-serenity[data-visual-style="lotus"] {
  --color-bg: #fdf8f9;
  --color-border: #f0d8dc;
}

:root:not([data-theme="dark"]) body.theme-temple-serenity[data-visual-style="ink"] {
  --color-bg: #f5f5f5;
  --color-text: #212121;
}

:root:not([data-theme="dark"]) body.theme-temple-serenity[data-visual-style="dawn"] {
  --color-bg: #fffaf5;
  --color-border: #ffe0c2;
}

body.theme-temple-serenity .ts-hero-title,
body.theme-temple-serenity .ts-page-header h1 {
  font-family: var(--font-serif);
}

body.theme-temple-serenity .ts-product-card,
body.theme-temple-serenity .ts-service-card,
body.theme-temple-serenity .ts-post-card,
body.theme-temple-serenity .ts-event-card {
  border-radius: var(--style-card-radius);
}

body.theme-temple-serenity .ts-btn {
  border-radius: var(--style-btn-radius);
}

/* 法会卡片 — 详见 pages.css .ts-page-events */
.ts-events-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  margin-top: 1.5rem;
}

/* 供奉页 */
.ts-offerings-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  margin-top: 1.5rem;
}

.ts-offering-card {
  border: 1px solid var(--color-border);
  background: var(--color-surface, #fff);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border-radius: var(--style-card-radius, 12px);
}

.ts-offering-card h3 {
  margin: 0;
}

.ts-offering-price {
  font-size: 1.25rem;
  color: var(--color-primary);
  font-weight: 600;
  margin-top: auto;
}

.ts-subsection-head {
  margin-bottom: 1.25rem;
}
.ts-subsection-head h2 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.35rem;
}
.ts-section--compact {
  padding: 1.75rem 0;
}
.ts-dharma-events-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  padding: 1.35rem 1.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--ts-radius);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}
.ts-dharma-events-banner h2 {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  margin: 0 0 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.ts-dharma-events-banner p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--color-muted-text);
  max-width: 36rem;
}

.ts-donation-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

.ts-donation-modal[hidden] {
  display: none;
}

.ts-donation-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.ts-donation-modal-panel {
  position: relative;
  background: var(--color-surface, #fff);
  border-radius: var(--style-card-radius) var(--style-card-radius) 0 0;
  width: 100%;
  max-width: 440px;
  padding: 1.25rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
  max-height: min(88dvh, calc(100dvh - env(safe-area-inset-top, 0px) - 1rem));
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.18);
}

@media (min-width: 640px) {
  .ts-donation-modal {
    align-items: center;
    padding: 1rem;
  }

  .ts-donation-modal-panel {
    border-radius: var(--style-card-radius);
    padding: 1.5rem;
    max-height: min(90vh, calc(100vh - 2rem));
    box-shadow: var(--shadow, 0 18px 48px rgba(0, 0, 0, 0.15));
  }
}

.ts-donation-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--color-surface, #fff);
  padding-bottom: 0.35rem;
}

.ts-donation-modal-head h2 {
  font-size: 1.1rem;
  margin: 0;
}

.ts-modal-close {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 999px;
  background: var(--color-bg);
  color: inherit;
  cursor: pointer;
}

.ts-donation-actions {
  margin-top: 0.5rem;
}

.ts-donation-actions .ts-btn-lg {
  width: 100%;
}

body.ts-donation-open .ts-mobile-bar {
  display: none;
}

.ts-donation-form .ts-field {
  display: block;
  margin-bottom: 1rem;
}

.ts-donation-form .ts-field[hidden] {
  display: none !important;
}

.ts-donation-fixed-amount {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--style-btn-radius);
  background: color-mix(in srgb, var(--color-primary) 6%, var(--color-bg));
  border: 1px solid var(--color-border);
  font-size: 0.9rem;
}

.ts-donation-fixed-amount strong {
  display: block;
  margin-top: 0.25rem;
  font-size: 1.35rem;
  color: var(--color-primary);
  font-family: var(--font-serif);
}

.ts-donation-form .ts-field span {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.875rem;
}

.ts-donation-form input,
.ts-donation-form textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--style-btn-radius);
  background: var(--color-bg);
}

.ts-donation-result {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--ts-radius);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  font-size: 0.95rem;
  line-height: 1.5;
}

.ts-donation-result[hidden] {
  display: none !important;
}

.ts-donation-result--success {
  border-color: color-mix(in srgb, #16a34a 45%, var(--color-border));
  background: color-mix(in srgb, #16a34a 10%, var(--color-surface));
  color: var(--color-text);
}

.ts-donation-result--error {
  border-color: color-mix(in srgb, #dc2626 45%, var(--color-border));
  background: color-mix(in srgb, #dc2626 10%, var(--color-surface));
}

.ts-donation-result--info {
  border-color: color-mix(in srgb, var(--color-primary) 35%, var(--color-border));
  background: color-mix(in srgb, var(--color-primary) 8%, var(--color-surface));
}

.ts-form-msg {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: var(--color-muted-text);
}

.ts-form-msg[hidden] {
  display: none !important;
}

.ts-form-msg--error {
  color: #dc2626;
}

.ts-loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem;
  color: var(--color-muted-text);
}

.ts-loading i {
  animation: ts-spin 1s linear infinite;
}

@keyframes ts-spin {
  to { transform: rotate(360deg); }
}

.ts-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem;
  color: var(--color-muted-text);
}

/* 首页法会卡片（插件注入，主样式见 main.css） */
.ts-events-home .ts-link-more {
  font-weight: 600;
}

.ts-visit-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .ts-visit-grid {
    grid-template-columns: 280px 1fr;
  }
}

.ts-visit-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ts-visit-list li {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.ts-visit-list i {
  color: var(--color-primary);
  font-size: 1.25rem;
  margin-top: 0.15rem;
}
