/* ============================================================
   PAGE-SPECIFIC STYLES — 永约学坊
   Internal sub-page layouts, not shared by the hero splash
   ============================================================ */

/* --- Page Header (sub-page banner) --- */
.page-header {
  position: relative;
  padding: 140px 0 60px;
  margin-top: 68px;
  background: #1a1510;
  text-align: center;
  overflow: hidden;
}
.page-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../unsplash-cross-1-sunset.jpg") center center / cover
    no-repeat;
  opacity: 0.25;
  z-index: 0;
}
.page-header::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(26, 21, 16, 0.6) 0%,
    rgba(26, 21, 16, 0.9) 100%
  );
  z-index: 1;
}
.page-header .container {
  position: relative;
  z-index: 5;
}
.page-header h1 {
  font-family: var(--font-serif);
  font-size: clamp(28px, 3.5vw, 38px);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #f5f0eb;
  margin-bottom: 8px;
}
.page-header .breadcrumb {
  font-size: 13px;
  color: rgba(245, 240, 235, 0.45);
  letter-spacing: 0.04em;
}
.page-header .breadcrumb a {
  color: var(--gold);
}
.page-header .breadcrumb a:hover {
  color: var(--gold-light);
}

/* --- Page Section (standard) --- */
.page-section {
  padding: 72px 0;
  background: var(--surface);
}
.page-section:nth-child(even) {
  background: var(--bg);
}
.page-section:last-of-type {
  padding-bottom: 96px;
}
.page-section .section-title {
  text-align: left;
  margin-bottom: 4px;
}
.page-section .section-divider {
  margin: 12px 0 32px;
}

/* --- Standard Content Layout --- */
.content-body {
  max-width: 800px;
}
.content-body h3 {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.03em;
  margin: 36px 0 14px;
  color: var(--fg);
}
.content-body h4 {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  margin: 28px 0 10px;
  color: var(--fg);
}
.content-body p {
  font-size: 15px;
  line-height: 1.9;
  color: var(--muted);
  margin-bottom: 14px;
}
.content-body ul,
.content-body ol {
  font-size: 15px;
  line-height: 1.9;
  color: var(--muted);
  padding-left: 24px;
  margin-bottom: 14px;
}
.content-body li {
  margin-bottom: 6px;
}
.content-body blockquote {
  margin: 24px 0;
  padding: 20px 24px;
  border-left: 3px solid var(--gold);
  background: rgba(200, 168, 112, 0.06);
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--fg);
  line-height: 1.8;
}

/* --- Full-width content (for wider pages like catalog) --- */
.content-wide {
  max-width: 100%;
}

/* --- Timeline (History page) --- */
.timeline {
  position: relative;
  padding-left: 40px;
  max-width: 700px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--gold);
  opacity: 0.3;
}
.timeline-item {
  position: relative;
  padding-bottom: 32px;
}
.timeline-item:last-child {
  padding-bottom: 0;
}
.timeline-dot {
  position: absolute;
  left: -40px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 3px rgba(200, 168, 112, 0.2);
}
.timeline-year {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--gold-dark);
  margin-bottom: 6px;
}
.timeline-content h4 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--fg);
}
.timeline-content p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
}

/* --- Rules / Regulations --- */
.rules-section {
  margin-bottom: 32px;
}
.rules-section h3 {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  color: var(--fg);
}
.rules-list {
  list-style: none;
  padding: 0;
}
.rules-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
}
.rules-list li:last-child {
  border-bottom: none;
}
.rules-list li::before {
  content: "§ ";
  color: var(--gold);
  font-weight: 600;
}

/* --- Contact Page --- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}
.contact-info-card {
  padding: 32px;
  background: var(--bg);
  border: 1px solid var(--border);
}
.contact-info-card h4 {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--fg);
}
.contact-item {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}
.contact-item .label {
  font-weight: 600;
  color: var(--fg);
  min-width: 70px;
  flex-shrink: 0;
}
.contact-form {
  padding: 32px;
  border: 1px solid var(--border);
  background: var(--surface);
}
.contact-form h4 {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--fg);
}
.form-group {
  margin-bottom: 18px;
}
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--fg);
  letter-spacing: 0.03em;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--fg);
  transition: border-color 0.2s;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--gold);
}
.form-group textarea {
  min-height: 120px;
  resize: vertical;
}

/* --- Tables (Fees, Catalog, Calendar) --- */
.table-wrap {
  overflow-x: auto;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.data-table th {
  background: #1a1510;
  color: #f5f0eb;
  font-weight: 600;
  padding: 14px 16px;
  text-align: left;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
}
.data-table tr:hover td {
  background: rgba(200, 168, 112, 0.04);
}
.data-table .amount {
  font-family: var(--font-serif);
  font-weight: 600;
  color: var(--gold-dark);
}

/* --- News/Notice Cards --- */
.notice-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border);
}
.notice-item {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 24px;
  background: var(--surface);
  transition: background 0.2s;
  cursor: pointer;
}
.notice-item:hover {
  background: rgba(200, 168, 112, 0.04);
}
.notice-tag {
  flex-shrink: 0;
  font-size: 11px;
  padding: 3px 10px;
  background: rgba(200, 168, 112, 0.1);
  color: var(--gold-dark);
  font-weight: 500;
  letter-spacing: 0.04em;
}
.notice-title {
  flex: 1;
  font-size: 15px;
  font-weight: 500;
  color: var(--fg);
}
.notice-date {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.03em;
}

/* --- Login / Register --- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1a1510;
  padding: 24px;
  margin-top: 0;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  padding: 48px 40px;
  text-align: center;
}
.auth-logo {
  margin-bottom: 8px;
}
.auth-logo svg {
  width: 48px;
  height: 48px;
}
.auth-card h2 {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
  color: var(--fg);
}
.auth-card .sub {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 28px;
}
.auth-card .form-group {
  text-align: left;
}
.auth-card .btn {
  width: 100%;
  justify-content: center;
  margin-top: 8px;
}
.auth-footer {
  margin-top: 20px;
  font-size: 13px;
  color: var(--muted);
}
.auth-footer a {
  color: var(--gold-dark);
  font-weight: 500;
}
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  font-size: 12px;
  color: var(--muted);
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* --- Library / Reader --- */
.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}
.lib-card {
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  transition:
    transform 0.25s,
    box-shadow 0.25s;
}
.lib-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}
.lib-cover {
  height: 160px;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
}
.lib-info {
  padding: 16px;
}
.lib-info h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--fg);
}
.lib-info .author {
  font-size: 12px;
  color: var(--gold-dark);
  margin-bottom: 6px;
}
.lib-info .desc {
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

/* --- Student Dashboard --- */
.dashboard-layout {
  display: flex;
  min-height: calc(100vh - 68px);
  margin-top: 68px;
}
.dashboard-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: #1a1510;
  padding: 24px 0;
  overflow-y: auto;
}
.dash-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  font-size: 14px;
  color: rgba(245, 240, 235, 0.5);
  transition: all 0.2s;
  cursor: pointer;
}
.dash-nav-item:hover,
.dash-nav-item.active {
  background: rgba(200, 168, 112, 0.08);
  color: #f5f0eb;
}
.dash-nav-item.active {
  border-right: 2px solid var(--gold);
}
.dash-nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.dashboard-main {
  flex: 1;
  background: var(--bg);
  padding: 32px;
  overflow-y: auto;
}
.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}
.dash-header h2 {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
}
.dash-user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--muted);
}
.dash-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1a1510;
  font-weight: 600;
  font-size: 14px;
}
.dash-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.dash-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 20px;
}
.dash-stat .num {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 700;
  color: var(--gold-dark);
}
.dash-stat .label {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}
.dash-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 24px;
  margin-bottom: 20px;
}
.dash-card h4 {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

/* --- Program Detail Cards --- */
.program-detail-card {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 0;
  border: 1px solid var(--border);
  margin-bottom: 24px;
  background: var(--surface);
}
.program-detail-card .side {
  background: #1a1510;
  color: #f5f0eb;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.program-detail-card .side h3 {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.03em;
  margin-bottom: 8px;
}
.program-detail-card .side .badge {
  display: inline-block;
  font-size: 11px;
  padding: 4px 10px;
  background: rgba(200, 168, 112, 0.15);
  color: var(--gold-light);
  font-weight: 500;
  letter-spacing: 0.04em;
}
.program-detail-card .body {
  padding: 32px;
}
.program-detail-card .body p {
  font-size: 14px;
  line-height: 1.8;
  color: var(--muted);
  margin-bottom: 12px;
}
.program-detail-card .body .courses {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.program-detail-card .body .courses span {
  font-size: 12px;
  padding: 4px 10px;
  background: rgba(200, 168, 112, 0.06);
  border: 1px solid var(--border);
  color: var(--muted);
}

/* --- Back to top --- */
.back-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 44px;
  height: 44px;
  background: var(--gold);
  color: #1a1510;
  border: none;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s;
  opacity: 0;
  pointer-events: none;
  z-index: 50;
}
.back-top.visible {
  opacity: 1;
  pointer-events: auto;
}
.back-top:hover {
  background: var(--gold-dark);
  color: #fff;
}

/* --- Fee breakdown --- */
.fee-highlight {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 36px;
}
.fee-item {
  padding: 24px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
}
.fee-item .amount {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 700;
  color: var(--gold-dark);
}
.fee-item .label {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

/* --- Calendar grid --- */
.calendar-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.cal-month {
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
}
.cal-month h4 {
  background: #1a1510;
  color: #f5f0eb;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.cal-month .events {
  padding: 16px;
}
.cal-event {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 13px;
  line-height: 1.5;
}
.cal-event .day {
  flex-shrink: 0;
  font-weight: 700;
  color: var(--gold-dark);
  min-width: 28px;
}

/* --- Responsive: Page-specific --- */
@media (max-width: 768px) {
  .page-header {
    padding: 120px 0 40px;
  }
  .contact-grid {
    grid-template-columns: 1fr;
  }
  .program-detail-card {
    grid-template-columns: 1fr;
  }
  .calendar-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-layout {
    flex-direction: column;
  }
  .dashboard-sidebar {
    width: 100%;
    padding: 12px 0;
    display: flex;
    overflow-x: auto;
  }
  .dash-nav-item {
    white-space: nowrap;
    padding: 10px 16px;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
  }
  .dash-nav-item.active {
    border-right: 1px solid var(--gold);
  }
  .dashboard-main {
    padding: 20px;
  }
  .dash-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .notice-item {
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px;
  }
  .notice-date {
    width: 100%;
  }
}
@media (max-width: 480px) {
  .dash-stats {
    grid-template-columns: 1fr;
  }
  .fee-highlight {
    grid-template-columns: 1fr 1fr;
  }
  .auth-card {
    padding: 32px 24px;
  }
}
