/* ========== 三益堂道易国学文化 - 全局样式 ========== */
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@300;400;500;600;700&display=swap');

/* ===== CSS 变量 ===== */
:root {
  --ink-black: #1a1208;
  --ink-deep: #2d2416;
  --ink-brown: #4a3520;
  --ink-light: #6b4f35;
  --gold: #c9a84c;
  --gold-light: #e2c87a;
  --gold-pale: #f5e9c8;
  --paper: #faf6ed;
  --paper-dark: #f0e8d5;
  --paper-darker: #e4d9c1;
  --red-seal: #8b1a1a;
  --gray-ink: #888078;
  --shadow-ink: rgba(26,18,8,0.15);
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'Noto Serif SC', 'STSong', 'SimSun', serif;
  background-color: var(--paper);
  color: var(--ink-black);
  min-height: 100vh;
  overflow-x: hidden;
  /* 纸张纹理背景 */
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(201,168,76,0.04) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(139,26,26,0.03) 0%, transparent 50%);
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

/* ===== 水墨纹理覆盖层 ===== */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='400' height='400' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

/* ===== 顶部导航 Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250,246,237,0.97);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--paper-darker);
  box-shadow: 0 2px 12px var(--shadow-ink);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
}

.logo-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.logo-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--gold);
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.logo-main {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink-black);
  letter-spacing: 0.05em;
}

.logo-sub {
  font-size: 0.65rem;
  color: var(--gray-ink);
  letter-spacing: 0.1em;
}

/* 菜单按钮 */
.menu-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.menu-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink-brown);
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* 导航抽屉 */
.nav-drawer {
  position: fixed;
  top: 0;
  right: -100%;
  width: 75vw;
  max-width: 280px;
  height: 100vh;
  background: var(--paper);
  z-index: 200;
  transition: right 0.35s cubic-bezier(0.4,0,0.2,1);
  box-shadow: -4px 0 24px rgba(26,18,8,0.2);
  display: flex;
  flex-direction: column;
}

.nav-drawer.open {
  right: 0;
}

.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26,18,8,0.4);
  z-index: 199;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s;
}

.nav-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.drawer-header {
  padding: 1.2rem 1rem;
  border-bottom: 1px solid var(--paper-darker);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-title {
  font-size: 0.9rem;
  color: var(--ink-light);
  letter-spacing: 0.15em;
}

.drawer-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--ink-brown);
  cursor: pointer;
  line-height: 1;
  padding: 0.2rem 0.4rem;
}

.nav-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0;
}

.nav-list li a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1.2rem;
  font-size: 1rem;
  color: var(--ink-brown);
  border-bottom: 1px solid rgba(228,217,193,0.5);
  transition: background 0.2s, color 0.2s;
}

.nav-list li a:active {
  background: var(--paper-dark);
  color: var(--gold);
}

.nav-list li a .nav-icon {
  font-size: 1.1rem;
  width: 1.5rem;
  text-align: center;
}

.nav-contact {
  padding: 1rem;
  border-top: 1px solid var(--paper-darker);
}

.nav-contact a {
  display: block;
  text-align: center;
  padding: 0.7rem;
  background: var(--ink-brown);
  color: var(--gold-pale);
  border-radius: 4px;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
}

/* ===== Hero Banner ===== */
.hero {
  position: relative;
  overflow: hidden;
  height: 200px;
}

.hero-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: sepia(0.3) contrast(0.9);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(250,246,237,0.1) 0%,
    rgba(26,18,8,0.45) 100%
  );
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 1.5rem;
  text-align: center;
}

.hero-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.2em;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
  line-height: 1.4;
}

.hero-sub {
  font-size: 0.8rem;
  color: var(--gold-light);
  letter-spacing: 0.3em;
  margin-top: 0.3rem;
  text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

/* ===== 页面内头部（子页面用）===== */
.page-hero {
  background: linear-gradient(135deg, var(--ink-deep) 0%, var(--ink-brown) 100%);
  padding: 2.5rem 1.2rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 120px; height: 120px;
  border: 2px solid rgba(201,168,76,0.2);
  border-radius: 50%;
}

.page-hero::after {
  content: '';
  position: absolute;
  bottom: -20px; left: -20px;
  width: 80px; height: 80px;
  border: 1.5px solid rgba(201,168,76,0.15);
  border-radius: 50%;
}

.page-hero-icon {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
  display: block;
}

.page-hero-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold-light);
  letter-spacing: 0.2em;
}

.page-hero-desc {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.65);
  margin-top: 0.5rem;
  letter-spacing: 0.15em;
}

/* ===== 分隔装饰 ===== */
.divider {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 1.5rem 0 1rem;
  padding: 0 1rem;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--paper-darker), transparent);
}

.divider-text {
  font-size: 0.7rem;
  color: var(--gray-ink);
  letter-spacing: 0.2em;
  white-space: nowrap;
}

/* ===== 首页分类卡片 ===== */
.section-title {
  text-align: center;
  padding: 1.5rem 1rem 0.5rem;
  font-size: 1.05rem;
  color: var(--ink-brown);
  letter-spacing: 0.2em;
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 2rem;
  height: 2px;
  background: var(--gold);
  margin: 0.4rem auto 0;
  border-radius: 2px;
}

/* 首页分类网格 */
.category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  padding: 0.75rem 0.9rem 1.5rem;
}

.cat-card {
  position: relative;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px var(--shadow-ink);
  border: 1px solid var(--paper-darker);
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  min-height: 130px;
}

.cat-card:active {
  transform: scale(0.97);
}

.cat-card-bg {
  position: absolute;
  inset: 0;
  opacity: 0.08;
  background: radial-gradient(circle at 70% 30%, var(--gold) 0%, transparent 70%);
}

.cat-card-body {
  position: relative;
  z-index: 1;
  padding: 1rem 0.9rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.cat-card-icon {
  font-size: 1.8rem;
  display: block;
  margin-bottom: 0.4rem;
}

.cat-card-name {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink-black);
  letter-spacing: 0.08em;
  line-height: 1.3;
}

.cat-card-sub {
  font-size: 0.7rem;
  color: var(--gray-ink);
  margin-top: 0.3rem;
  letter-spacing: 0.05em;
  line-height: 1.5;
}

.cat-card-arrow {
  position: absolute;
  right: 0.8rem;
  bottom: 0.8rem;
  font-size: 0.75rem;
  color: var(--gold);
}

/* 卡片颜色主题 */
.cat-card.theme-bazi { border-top: 3px solid #8b4513; }
.cat-card.theme-fengshui { border-top: 3px solid #2d6a4f; }
.cat-card.theme-xueye { border-top: 3px solid #1d3557; }
.cat-card.theme-xingming { border-top: 3px solid #6b2d6b; }
.cat-card.theme-zhuji { border-top: 3px solid #8b1a1a; }

/* ===== 子页面内容区域 ===== */
.page-content {
  padding: 0 0.9rem 5rem;
}

/* 服务项目列表 */
.service-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-top: 0.75rem;
}

.service-item {
  background: #fff;
  border-radius: 8px;
  padding: 1rem 1rem 1rem 1.1rem;
  border: 1px solid var(--paper-darker);
  box-shadow: 0 1px 6px var(--shadow-ink);
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.service-item::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--gold);
  border-radius: 0 2px 2px 0;
}

.service-item-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.service-item-info {
  flex: 1;
}

.service-item-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink-black);
  letter-spacing: 0.05em;
}

.service-item-desc {
  font-size: 0.78rem;
  color: var(--gray-ink);
  margin-top: 0.3rem;
  line-height: 1.6;
}

/* ===== 底部导航条 ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(250,246,237,0.97);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--paper-darker);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0.5rem 0 calc(0.5rem + env(safe-area-inset-bottom));
  box-shadow: 0 -2px 12px var(--shadow-ink);
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.2rem 0.5rem;
  color: var(--gray-ink);
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  transition: color 0.2s;
}

.bottom-nav-item .nav-ico {
  font-size: 1.2rem;
  line-height: 1;
}

.bottom-nav-item.active,
.bottom-nav-item:active {
  color: var(--gold);
}

.bottom-nav-item.contact-btn {
  background: var(--ink-brown);
  color: var(--gold-pale);
  border-radius: 6px;
  padding: 0.3rem 0.8rem;
  font-weight: 500;
}

/* ===== 联系我们页面 ===== */
.contact-section {
  padding: 1.5rem 1rem;
}

.contact-card {
  background: #fff;
  border-radius: 10px;
  padding: 1.5rem;
  border: 1px solid var(--paper-darker);
  box-shadow: 0 2px 12px var(--shadow-ink);
  text-align: center;
  margin-bottom: 1rem;
}

.contact-card-title {
  font-size: 0.9rem;
  color: var(--gray-ink);
  letter-spacing: 0.15em;
  margin-bottom: 1rem;
}

.qr-placeholder {
  width: 160px;
  height: 160px;
  margin: 0 auto 1rem;
  border: 2px dashed var(--paper-darker);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
  position: relative;
  overflow: hidden;
}

.qr-placeholder svg {
  width: 100%;
  height: 100%;
}

.contact-tip {
  font-size: 0.78rem;
  color: var(--ink-light);
  line-height: 1.7;
}

.wechat-id {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--paper-dark);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  color: var(--ink-brown);
  margin-top: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

/* 服务时间 */
.info-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--paper-dark);
  font-size: 0.85rem;
  color: var(--ink-brown);
}

.info-row:last-child {
  border-bottom: none;
}

.info-label {
  color: var(--gray-ink);
  flex-shrink: 0;
  width: 4.5rem;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
}

/* ===== 装饰性水墨元素 ===== */
.ink-decoration {
  pointer-events: none;
  position: absolute;
  opacity: 0.06;
  font-size: 5rem;
  color: var(--ink-brown);
  line-height: 1;
  user-select: none;
}

/* ===== 提示横幅 ===== */
.tip-banner {
  background: linear-gradient(90deg, var(--ink-deep), var(--ink-brown));
  color: var(--gold-pale);
  text-align: center;
  padding: 0.6rem 1rem;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  border-bottom: 1px solid var(--gold);
}

/* ===== 引用文字 ===== */
.quote-block {
  margin: 1rem 0;
  padding: 0.8rem 1rem 0.8rem 1.2rem;
  border-left: 3px solid var(--gold);
  background: var(--paper-dark);
  border-radius: 0 6px 6px 0;
  font-size: 0.82rem;
  color: var(--ink-light);
  line-height: 1.8;
  font-style: italic;
  letter-spacing: 0.05em;
}

/* ===== 动画 ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in-up {
  animation: fadeInUp 0.5s ease forwards;
}

.cat-card:nth-child(2) { animation-delay: 0.05s; }
.cat-card:nth-child(3) { animation-delay: 0.1s; }
.cat-card:nth-child(4) { animation-delay: 0.15s; }
.cat-card:nth-child(5) { animation-delay: 0.2s; }

/* ===== 页面滚动条 ===== */
::-webkit-scrollbar {
  width: 3px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--paper-darker);
  border-radius: 3px;
}

/* ===== 印章装饰 ===== */
.seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border: 2px solid var(--red-seal);
  border-radius: 4px;
  color: var(--red-seal);
  font-size: 0.6rem;
  letter-spacing: 0.02em;
  font-weight: 700;
  transform: rotate(-8deg);
  line-height: 1.2;
  text-align: center;
}

/* ===== 首页公告区 ===== */
.notice-bar {
  background: var(--paper-dark);
  border-top: 1px solid var(--paper-darker);
  border-bottom: 1px solid var(--paper-darker);
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow: hidden;
}

.notice-icon {
  font-size: 0.85rem;
  color: var(--red-seal);
  flex-shrink: 0;
}

.notice-text {
  font-size: 0.76rem;
  color: var(--ink-light);
  white-space: nowrap;
  animation: marquee 18s linear infinite;
  letter-spacing: 0.05em;
}

@keyframes marquee {
  from { transform: translateX(100vw); }
  to { transform: translateX(-200%); }
}

/* ===== 页脚 ===== */
.page-footer {
  padding: 1.5rem 1rem;
  text-align: center;
  font-size: 0.72rem;
  color: var(--gray-ink);
  line-height: 1.8;
  letter-spacing: 0.05em;
}

/* ===== 子服务标签 ===== */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.tag {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  background: var(--paper-dark);
  border: 1px solid var(--paper-darker);
  border-radius: 3px;
  font-size: 0.68rem;
  color: var(--ink-light);
  letter-spacing: 0.05em;
}
