/* ═══════════════════════════════════════════════════════
   全局设计 Token — 与小程序 app.wxss 保持一致（Material Direct）
   Primary: #0058BD (蓝)  Secondary: #006E2C (绿)
   单位换算：小程序 rpx 以 750 为设计宽，这里页面按 375px 设计宽，
   所以原 wxss 中的 rpx 数值在此直接 /2 得到 px。
═══════════════════════════════════════════════════════ */
:root {
  --c-primary:         #0058BD;
  --c-primary-dark:    #004494;
  --c-primary-light:   #EAF1FF;
  --c-primary-border:  #ADC8FF;

  --c-secondary:       #006E2C;
  --c-secondary-light: #E6F4EA;
  --c-secondary-border:#89DD9B;

  --c-bg:              #F7F9FF;
  --c-surface:         #FFFFFF;
  --c-surface-low:     #F1F4FA;
  --c-surface-mid:     #EBEEF4;
  --c-surface-high:    #E5E8EE;

  --c-text-1:          #181C20;
  --c-text-2:          #424753;
  --c-text-3:          #727785;
  --c-text-inv:        #FFFFFF;

  --c-border:          #C2C6D5;
  --c-divider:          #EBEEF4;

  --c-warn:            #E65100;
  --c-warn-light:      #FFF3E0;
  --c-error:           #BA1A1A;
  --c-error-light:     #FDECEA;

  --r-sm:  4px;
  --r-md:  8px;
  --r-lg:  12px;
  --r-xl:  16px;
  --r-2xl: 24px;
  --r-full: 50px;

  --shadow-sm: 0 1px 4px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 2px 12px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.10);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--c-bg);
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', sans-serif;
  color: var(--c-text-1);
  font-size: 14px;
  line-height: 1.5;
}

.page-shell {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--c-bg);
  position: relative;
  padding-bottom: 60px;
}

button, input {
  font-family: inherit;
}

/* ── 卡片 ── */
.card {
  background: var(--c-surface);
  border-radius: var(--r-lg);
  margin: 0 12px 8px;
  box-shadow: var(--shadow-sm);
}

/* ── 按钮 ── */
.btn-primary {
  width: 100%;
  height: 48px;
  background: var(--c-primary);
  color: var(--c-text-inv);
  border: none;
  border-radius: var(--r-md);
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.btn-primary:disabled {
  background: var(--c-surface-mid);
  color: var(--c-text-3);
  box-shadow: none;
  cursor: not-allowed;
}
.btn-outline {
  height: 40px;
  padding: 0 20px;
  background: transparent;
  border: 1px solid var(--c-primary);
  color: var(--c-primary);
  border-radius: var(--r-md);
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.form-input-base {
  width: 100%;
  height: 40px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 0 12px;
  font-size: 14px;
  background: var(--c-surface);
  color: var(--c-text-1);
}

/* ── 哈希存证标识（全局统一样式） ── */
.chain-notice {
  margin: 0 12px 8px;
  padding: 10px 12px;
  background: var(--c-secondary-light);
  border-left: 3px solid var(--c-secondary);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  cursor: pointer;
}
.chain-text {
  font-size: 11px;
  color: var(--c-secondary);
  font-weight: 500;
}

/* ── 模态遮罩 ── */
.modal-mask {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.50);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.hash-info-modal {
  background: var(--c-surface);
  border-radius: var(--r-xl);
  margin: 24px 16px;
  padding: 24px 20px;
  max-height: 80vh;
  overflow-y: auto;
  max-width: 400px;
}
.him-title {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: var(--c-primary);
  margin-bottom: 16px;
  text-align: center;
}
.him-body {
  display: block;
  font-size: 13px;
  color: var(--c-text-2);
  line-height: 1.8;
  margin-bottom: 20px;
  white-space: pre-line;
}
.him-close {
  display: block;
  text-align: center;
  background: var(--c-primary);
  color: #fff;
  border-radius: var(--r-lg);
  padding: 10px 0;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.hash-detail-modal {
  background: var(--c-surface);
  border-radius: var(--r-xl);
  margin: 40px 16px;
  padding: 20px;
  max-width: 400px;
}
.hdm-title { display: block; font-size: 14px; font-weight: 700; color: var(--c-text-1); margin-bottom: 12px; }
.hdm-hash {
  display: block;
  font-size: 11px;
  color: var(--c-primary);
  font-family: monospace;
  word-break: break-all;
  background: var(--c-surface-low);
  border-radius: var(--r-md);
  padding: 12px;
  margin-bottom: 8px;
  line-height: 1.7;
}
.hdm-meta { display: block; font-size: 11px; color: var(--c-text-3); margin-bottom: 2px; }
.hdm-close {
  display: block;
  text-align: center;
  background: var(--c-primary);
  color: #fff;
  border-radius: var(--r-lg);
  padding: 9px 0;
  font-size: 14px;
  font-weight: 600;
  margin-top: 12px;
  cursor: pointer;
}

/* ── 空/加载状态 ── */
.empty, .loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 0;
  color: var(--c-text-3);
  font-size: 13px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 80px;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.8);
  color: #fff;
  padding: 10px 20px;
  border-radius: var(--r-md);
  font-size: 13px;
  z-index: 10000;
  max-width: 80%;
  text-align: center;
}
