/* ============================================================
   古渊头 · 博士菜  |  Premium 水墨国风主题
   保持原微信小程序「国风水墨 × 田园乡土」设计语言
   ============================================================ */

/* Google Fonts — 楷体 + 思源黑体 */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;600;700&display=swap');

:root {
  /* ── 品牌色（与小程序保持一致） ── */
  --ink-green:    #2f4a3c;
  --ink-green-2:  #3d6b4f;
  --ink-green-3:  #5d7f63;
  --paper:        #f5efe0;
  --paper-2:      #fffdf6;
  --paper-3:      #f0e6cf;
  --ink:          #2b2923;
  --ink-2:        #6b655a;
  --ink-3:        #a59b8a;
  --pot-brown:    #8b5a2b;
  --pot-brown-2:  #a0602e;
  --cinnabar:     #a6422a;
  --line:         #e3d7bb;

  /* ── 语义别名 ── */
  --primary:       var(--ink-green);
  --primary-light:  var(--ink-green-2);
  --primary-dark:   #1a2e23;
  --primary-tint:   #e9f0eb;
  --accent:        var(--cinnabar);
  --accent-light:  #bf4d34;
  --accent-tint:   rgba(166, 66, 42, 0.07);
  --bg-page:       var(--paper);
  --bg-card:       var(--paper-2);
  --bg-card-hover: #faf5ea;
  --border:        var(--line);
  --border-light:  #ede6d6;
  --text-main:     var(--ink);
  --text-sub:      var(--ink-2);
  --text-muted:    var(--ink-3);
  --text-inverse:  #fff8ec;

  /* ── 阴影（小程序风格，更精致） ── */
  --shadow-sm:  0 3rpx 12rpx rgba(80, 60, 30, 0.06);
  --shadow-md:  0 6rpx 24rpx rgba(80, 60, 30, 0.08);
  --shadow-lg:  0 12rpx 40rpx rgba(80, 60, 30, 0.12);
  --shadow-xl:  0 20rpx 56rpx rgba(80, 60, 30, 0.16);
  --shadow-card: 0 6rpx 24rpx rgba(80, 60, 30, 0.08), 0 1px 2px rgba(80, 60, 30, 0.04);
  --shadow-glow-green: 0 8px 24px rgba(47, 74, 60, 0.3);
  --shadow-glow-cinnabar: 0 8px 20px rgba(166, 66, 42, 0.3);

  /* ── 圆角 ── */
  --radius-xs:   4px;
  --radius-sm:   8px;
  --radius-md:   14px;
  --radius-lg:   20px;
  --radius-xl:   28px;
  --radius-full: 9999px;

  /* ── 字体（与小程序保持一致） ── */
  --font-serif: "STKaiti", "Kaiti SC", "KaiTi", "FZKai-Z03", "Noto Serif SC", serif;
  --font-sans:  "Noto Sans SC", -apple-system, BlinkMacSystemFont, "PingFang SC",
                "Hiragino Sans GB", "Microsoft YaHei", sans-serif;

  /* ── 布局尺寸 ── */
  --header-height: 60px;
  --tabbar-height: 62px;
  --max-width: 1200px;

  /* ── 动效 ── */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring:   cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --transition-base: 0.28s var(--ease-out-expo);
}

/* ── 全局重置 ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--bg-page);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 0.01em;
  overflow-x: hidden;
}

/* ── 宣纸微纹底纹（与小程序 wave.png 纹理呼应） ── */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.03;
  background-image: url('../images/ink/wave.png');
  background-repeat: repeat;
  background-size: 80px 10px;
}

/* ── 墨叶粒子画布 ── */
#ink-canvas-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

/* ── 应用壳 ── */
#app {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  flex: 1;
}

/* ── 页面视图切换（小程序 enterUp 动画风格） ── */
.page-view {
  display: none;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  padding-bottom: calc(var(--tabbar-height) + 28px);
}

.page-view.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

@media (min-width: 768px) {
  .page-view {
    padding-top: 20px;
    padding-bottom: 48px;
  }
}

/* ── 印章标签（与小程序 .seal-mini / .tag 一致风格） ── */
.ink-seal {
  display: inline-block;
  color: var(--cinnabar);
  border: 1.5px solid rgba(166, 66, 42, 0.5);
  border-radius: 3px;
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  background: rgba(166, 66, 42, 0.08);
  font-family: var(--font-serif);
  line-height: 1.6;
}

/* ── 墨绿标签（与小程序 .tag 一致） ── */
.ink-tag {
  display: inline-block;
  background: rgba(166, 66, 42, 0.08);
  color: var(--cinnabar);
  font-size: 11px;
  padding: 3px 10px;
  border-radius: var(--radius-xs);
  font-weight: 500;
  letter-spacing: 0.3px;
  border: 1px solid rgba(166, 66, 42, 0.18);
}

/* ── 水墨标题 ── */
.ink-title {
  font-family: var(--font-serif);
  color: var(--ink);
  font-weight: 700;
  letter-spacing: 1px;
}

/* ── 区块标题（与小程序 .section-head 保持一致：左竖条 cinnabar→pot-brown 渐变） ── */
.section-title {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 32px 0 16px 0;
  letter-spacing: 1px;
  position: relative;
  padding-bottom: 14px;
}

/* 左竖条：小程序 cinnabar→pot-brown 渐变 */
.section-title::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 22px;
  background: linear-gradient(180deg, var(--cinnabar), var(--pot-brown));
  border-radius: 2px;
  flex-shrink: 0;
}

/* 底部水墨波浪饰线（与小程序 .section-head::after 呼应） */
.section-title::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 0;
  bottom: 0;
  height: 4px;
  background: url('../images/ink/wave.png') repeat-x center bottom;
  background-size: 70px 4px;
  opacity: 0.4;
  pointer-events: none;
}

.section-subtitle {
  font-size: 13px;
  color: var(--ink-3);
  margin-top: -10px;
  margin-bottom: 18px;
  line-height: 1.6;
  font-style: italic;
}

/* ── 按钮系统（与小程序 .btn-brown / .btn-green / 朱砂渐变保持一致） ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition-base);
  outline: none;
  letter-spacing: 1px;
  position: relative;
}

.btn-primary {
  background: linear-gradient(135deg, var(--ink-green), var(--ink-green-2));
  color: var(--text-inverse);
  box-shadow: var(--shadow-glow-green);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(47, 74, 60, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--paper-2);
  color: var(--pot-brown);
  border: 1.5px solid var(--pot-brown);
}

.btn-secondary:hover {
  background: rgba(139, 90, 43, 0.06);
  box-shadow: var(--shadow-sm);
}

.btn-accent {
  background: linear-gradient(135deg, var(--cinnabar), var(--accent-light));
  color: var(--text-inverse);
  box-shadow: var(--shadow-glow-cinnabar);
}

.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(166, 66, 42, 0.4);
}

.btn-sm {
  padding: 5px 14px;
  font-size: 12px;
}

.btn-block {
  width: 100%;
}

/* ── 自定义滚动条 ── */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--ink-3);
}

/* ── 选中文本高亮 ── */
::selection {
  background: rgba(47, 74, 60, 0.15);
  color: var(--ink);
}

/* ── Toast ── */
.toast-msg {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink-green);
  color: var(--text-inverse);
  padding: 10px 24px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  opacity: 0;
  transition: all 0.3s var(--ease-out-expo);
  pointer-events: none;
}

.toast-msg.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
