/**
 * H5 App - 检测报告移动端样式
 * 适配微信公众号内置浏览器，移动端优先设计
 */

/* ========== CSS 变量定义 ========== */
:root {
  /* 贵金属主题：金/炭灰/暖米 */
  --color-primary: #B8923C;
  --color-primary-dark: #967529;
  --color-primary-light: #F5EDDC;
  --color-primary-bg: #FBF7EE;

  --color-success: #52A352;
  --color-warning: #D4823A;
  --color-danger: #C0392B;
  --color-info: #9B988F;

  --color-text: #2C2C2E;
  --color-text-secondary: #636066;
  --color-text-placeholder: #9B988F;
  --color-border: #E8E2D4;
  --color-background: #F4F1EA;
  --color-white: #ffffff;

  /* 深色辅助色 */
  --color-charcoal: #1C1C1E;
  --color-charcoal-light: #3A3A3C;
  --color-gold-shine: #D4AF37;

  --font-size-xs: 11px;
  --font-size-sm: 13px;
  --font-size-base: 15px;
  --font-size-lg: 17px;
  --font-size-xl: 20px;
  --font-size-xxl: 24px;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --shadow-sm: 0 2px 8px rgba(140, 120, 60, 0.06);
  --shadow-md: 0 4px 16px rgba(140, 120, 60, 0.1);
  --shadow-lg: 0 8px 32px rgba(140, 120, 60, 0.14);

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ========== 基础重置 ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
    "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: var(--font-size-base);
  color: var(--color-text);
  background-color: var(--color-background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

input, button, textarea {
  font-family: inherit;
  font-size: inherit;
  border: none;
  outline: none;
  background: none;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

/* ========== App 容器 ========== */
#app {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  background-color: var(--color-background);
  overflow-x: hidden;
}

/* ========== 页面通用 ========== */
.page {
  min-height: 100vh;
  background-color: var(--color-background);
  display: none;
  flex-direction: column;
  animation: slideInRight 0.3s ease;
}

.page.active {
  display: flex;
}

/* 首页固定视口高度，报告列表区域独立滚动 */
#page-home {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

@keyframes slideInRight {
  from { transform: translateX(30px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* ========== 导航栏 ========== */
.nav-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding-top: var(--safe-top);
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.nav-bar .nav-back {
  position: absolute;
  left: 12px;
  display: flex;
  align-items: center;
  gap: 2px;
  color: var(--color-text);
  font-size: var(--font-size-base);
  cursor: pointer;
  padding: 4px 8px;
}

.nav-bar .nav-back svg {
  width: 20px;
  height: 20px;
}

.nav-bar .nav-title {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--color-text);
}

/* ========== 用户授权登录页 ========== */

/* 顶部渐变区域 - 深炭灰+金线质感 */
.bind-header {
  background: linear-gradient(135deg, #1C1C1E 0%, #3A3A3C 60%, #5C4A1E 100%);
  padding: calc(20px + var(--safe-top)) 24px 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.bind-header::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -20%;
  width: 200px;
  height: 200px;
  background: rgba(212, 175, 55, 0.12);
  border-radius: 50%;
}

.bind-header::after {
  content: '';
  position: absolute;
  bottom: -40%;
  left: -10%;
  width: 160px;
  height: 160px;
  background: rgba(212, 175, 55, 0.08);
  border-radius: 50%;
}

.bind-header .bind-logo {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.3) 0%, rgba(184, 146, 60, 0.15) 100%);
  border: 2px solid rgba(212, 175, 55, 0.4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  position: relative;
  z-index: 1;
}

.bind-header .bind-logo svg {
  width: 32px;
  height: 32px;
  color: #D4AF37;
}

.bind-header h1 {
  font-size: var(--font-size-xl);
  color: #F5EDDC;
  font-weight: 600;
  position: relative;
  z-index: 1;
  letter-spacing: 1px;
}

.bind-header .subtitle {
  font-size: var(--font-size-sm);
  color: rgba(245, 237, 220, 0.7);
  margin-top: 6px;
  position: relative;
  z-index: 1;
}

/* 绑定表单 */
.bind-form {
  background: var(--color-white);
  margin: -20px 16px 0;
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  box-shadow: var(--shadow-md);
  position: relative;
  z-index: 10;
  flex-shrink: 0;
}

.bind-form .form-group {
  margin-bottom: 20px;
}

.bind-form .form-group:last-child {
  margin-bottom: 0;
}

.bind-form .form-label {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-bottom: 8px;
  display: block;
}

.bind-form .input-wrap {
  display: flex;
  align-items: center;
  background: var(--color-background);
  border-radius: var(--radius-md);
  padding: 0 14px;
  height: 48px;
  border: 1.5px solid transparent;
  transition: border-color 0.2s;
}

.bind-form .input-wrap:focus-within {
  border-color: var(--color-primary);
  background: var(--color-white);
}

.bind-form .input-wrap .prefix {
  font-size: var(--font-size-base);
  color: var(--color-text);
  font-weight: 500;
  margin-right: 8px;
  flex-shrink: 0;
}

.bind-form .input-wrap input {
  flex: 1;
  font-size: var(--font-size-base);
  color: var(--color-text);
  height: 100%;
}

.bind-form .input-wrap input::placeholder {
  color: var(--color-text-placeholder);
}

.bind-form .code-row {
  display: flex;
  gap: 10px;
}

.bind-form .code-row .input-wrap {
  flex: 1;
}

.bind-form .code-btn {
  flex-shrink: 0;
  width: 120px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-size: var(--font-size-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.bind-form .code-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.bind-form .submit-btn {
  width: 100%;
  height: 48px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--color-gold-shine) 0%, var(--color-primary) 50%, var(--color-primary-dark) 100%);
  color: #fff;
  font-size: var(--font-size-lg);
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
  margin-top: 8px;
  box-shadow: 0 4px 12px rgba(184, 146, 60, 0.3);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.bind-form .submit-btn:active {
  opacity: 0.85;
}

.bind-form .submit-btn:disabled {
  opacity: 0.5;
}

/* 微信快捷授权 */
.bind-wechat-auth {
  margin: 24px 16px;
  text-align: center;
  flex-shrink: 0;
}

.bind-wechat-auth .divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--color-text-placeholder);
  font-size: var(--font-size-sm);
  margin-bottom: 16px;
}

.bind-wechat-auth .divider::before,
.bind-wechat-auth .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

.bind-wechat-auth .wechat-btn {
  width: 100%;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--color-white);
  border: 1.5px solid var(--color-primary);
  color: var(--color-primary-dark);
  font-size: var(--font-size-base);
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}

.bind-wechat-auth .wechat-btn:active {
  background: var(--color-primary-light);
}

.bind-wechat-auth .wechat-btn svg {
  width: 20px;
  height: 20px;
}

/* 协议 */
.bind-agreement {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 16px 20px;
  font-size: var(--font-size-xs);
  color: var(--color-text-placeholder);
  line-height: 1.5;
  flex-shrink: 0;
}

.bind-agreement .checkbox {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--color-text-placeholder);
  border-radius: 3px;
  flex-shrink: 0;
  margin-top: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.bind-agreement .checkbox.checked {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

.bind-agreement .checkbox.checked::after {
  content: '';
  width: 4px;
  height: 8px;
  border: 2px solid #fff;
  border-top: 0;
  border-left: 0;
  transform: rotate(45deg) translateY(-1px);
}

.bind-agreement a {
  color: var(--color-primary);
}

/* ========== 用户授权页 ========== */
.auth-form {
  background: var(--color-white);
  margin: -20px 16px 0;
  border-radius: var(--radius-lg);
  padding: 32px 24px 28px;
  box-shadow: var(--shadow-md);
  position: relative;
  z-index: 10;
  flex-shrink: 0;
  text-align: center;
}

.auth-avatar {
  width: 80px;
  height: 80px;
  margin: 0 auto 16px;
  position: relative;
}

.auth-avatar .avatar-placeholder {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--color-primary-bg);
  border: 2px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-avatar .avatar-placeholder svg {
  width: 40px;
  height: 40px;
  color: var(--color-text-placeholder);
}

.auth-avatar .avatar-img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--color-primary);
}

.auth-nickname {
  font-size: var(--font-size-base);
  color: var(--color-text-placeholder);
  margin-bottom: 20px;
}

.auth-nickname.authorized {
  color: var(--color-text);
  font-weight: 600;
  font-size: var(--font-size-lg);
}

.auth-btn {
  width: 100%;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  font-size: var(--font-size-base);
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  margin-bottom: 16px;
}

.auth-btn:active {
  background: var(--color-primary);
  color: #fff;
}

.auth-btn svg {
  width: 20px;
  height: 20px;
}

.auth-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 手机号绑定分隔线 */
.auth-divider {
  display: flex;
  align-items: center;
  margin: 20px 0 14px;
  gap: 12px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

.auth-divider span {
  font-size: var(--font-size-xs);
  color: var(--color-text-placeholder);
  white-space: nowrap;
}

/* 微信授权手机号按钮 */
.auth-phone-btn {
  background: var(--color-white);
  border: 1.5px solid #07c160;
  color: #07c160;
}

.auth-phone-btn:active {
  background: #f0fcf6;
}

.auth-phone-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 已绑定手机号显示 */
.auth-phone-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  padding: 12px 16px;
  background: #f0fcf6;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-base);
  color: #07c160;
  font-weight: 600;
}

.auth-phone-display svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.auth-form .submit-btn {
  width: 100%;
  height: 48px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--color-gold-shine) 0%, var(--color-primary) 50%, var(--color-primary-dark) 100%);
  color: #fff;
  font-size: var(--font-size-lg);
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
  box-shadow: 0 4px 12px rgba(184, 146, 60, 0.3);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.auth-form .submit-btn:active {
  opacity: 0.85;
}

.auth-form .submit-btn:disabled {
  opacity: 0.5;
}

/* 用户头像图片 */
.user-bar .avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

/* ========== 报告列表页 ========== */
.report-list {
  flex: 1;
  padding: 12px 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding-bottom: calc(20px + var(--safe-bottom));
}

/* 搜索栏 */
.search-bar {
  display: flex;
  align-items: center;
  background: var(--color-white);
  border-radius: var(--radius-md);
  padding: 0 12px;
  height: 40px;
  margin-bottom: 12px;
  border: 1px solid var(--color-border);
}

.search-bar svg {
  width: 18px;
  height: 18px;
  color: var(--color-text-placeholder);
  flex-shrink: 0;
  margin-right: 8px;
}

.search-bar input {
  flex: 1;
  font-size: var(--font-size-sm);
  height: 100%;
}

.search-bar input::placeholder {
  color: var(--color-text-placeholder);
}

.search-bar .clear-btn {
  display: none;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.search-bar .clear-btn.visible {
  display: flex;
}

.search-bar .clear-btn svg {
  width: 16px;
  height: 16px;
  margin: 0;
}

/* 标签筛选 */
.filter-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.filter-tabs::-webkit-scrollbar {
  display: none;
}

.filter-tabs .tab {
  padding: 6px 16px;
  border-radius: 100px;
  font-size: var(--font-size-sm);
  white-space: nowrap;
  background: var(--color-white);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.filter-tabs .tab.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

/* 报告卡片 */
.report-card {
  background: var(--color-white);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.1s;
  animation: fadeIn 0.3s ease;
  border-left: 3px solid var(--color-primary);
}

.report-card:active {
  transform: scale(0.98);
  box-shadow: var(--shadow-md);
}

.report-card .card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.report-card .card-type {
  display: flex;
  align-items: center;
  gap: 8px;
}

.report-card .type-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.report-card .type-icon svg {
  width: 20px;
  height: 20px;
}

.report-card .type-tag {
  font-size: var(--font-size-xs);
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 4px;
}

.report-card .status-badge {
  font-size: var(--font-size-xs);
  padding: 3px 10px;
  border-radius: 100px;
  font-weight: 500;
  flex-shrink: 0;
}

.status-completed {
  background: #EDF5ED;
  color: var(--color-success);
}

.status-pending {
  background: #FBF0E5;
  color: var(--color-warning);
}

.status-rejected {
  background: #FBEAE8;
  color: var(--color-danger);
}

.report-card .card-body {
  padding: 12px 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 12px;
}

.report-card .info-row {
  display: flex;
  margin-bottom: 8px;
  font-size: var(--font-size-sm);
}

.report-card .info-row:last-child {
  margin-bottom: 0;
}

.report-card .info-label {
  color: var(--color-text-placeholder);
  width: 70px;
  flex-shrink: 0;
}

.report-card .info-value {
  color: var(--color-text);
  font-weight: 500;
  flex: 1;
  word-break: break-all;
}

.report-card .card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.report-card .report-date {
  font-size: var(--font-size-xs);
  color: var(--color-text-placeholder);
}

.report-card .view-btn {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: var(--font-size-sm);
  color: var(--color-primary);
  font-weight: 500;
}

.report-card .view-btn svg {
  width: 16px;
  height: 16px;
}

/* 空状态 */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.empty-state svg {
  width: 80px;
  height: 80px;
  color: var(--color-border);
  margin-bottom: 16px;
}

.empty-state p {
  font-size: var(--font-size-sm);
  color: var(--color-text-placeholder);
}

/* ========== 报告详情页 ========== */
.detail-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(24px + var(--safe-bottom));
}

/* 报告概要 - 深炭灰+金质感 */
.detail-hero {
  background: linear-gradient(135deg, #1C1C1E 0%, #3A3A3C 60%, #5C4A1E 100%);
  padding: 24px 20px;
  color: #F5EDDC;
  position: relative;
  overflow: hidden;
}

.detail-hero::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -10%;
  width: 180px;
  height: 180px;
  background: rgba(212, 175, 55, 0.1);
  border-radius: 50%;
}

.detail-hero .report-status-large {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(212, 175, 55, 0.2);
  padding: 4px 14px;
  border-radius: 100px;
  font-size: var(--font-size-xs);
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
  color: #D4AF37;
}

.detail-hero h2 {
  font-size: var(--font-size-xl);
  font-weight: 600;
  position: relative;
  z-index: 1;
  color: #F5EDDC;
}

.detail-hero .report-no {
  font-size: var(--font-size-sm);
  opacity: 0.8;
  margin-top: 6px;
  position: relative;
  z-index: 1;
  color: #D4AF37;
}

/* 报告区块通用 */
.detail-section {
  background: var(--color-white);
  margin: 12px 16px 0;
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  animation: fadeIn 0.3s ease;
}

.detail-section .section-title {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-section .section-title::before {
  content: '';
  width: 3px;
  height: 16px;
  background: var(--color-primary);
  border-radius: 2px;
  flex-shrink: 0;
}

/* 信息列表 */
.info-list .info-item {
  display: flex;
  padding: 8px 0;
  font-size: var(--font-size-sm);
  border-bottom: 1px solid var(--color-background);
}

.info-list .info-item:last-child {
  border-bottom: none;
}

.info-list .info-item .label {
  color: var(--color-text-placeholder);
  width: 90px;
  flex-shrink: 0;
}

.info-list .info-item .value {
  color: var(--color-text);
  font-weight: 500;
  flex: 1;
  word-break: break-all;
}

/* 检测项目表格 */
.test-items {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.test-items table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
  min-width: 360px;
}

.test-items th {
  background: var(--color-primary-bg);
  color: var(--color-text-secondary);
  font-weight: 500;
  padding: 10px 8px;
  text-align: left;
  white-space: nowrap;
  font-size: var(--font-size-xs);
}

.test-items th:first-child {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.test-items th:last-child {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.test-items td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--color-background);
  color: var(--color-text);
}

.test-items tr:last-child td {
  border-bottom: none;
}

.test-items .conclusion-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: var(--font-size-xs);
  font-weight: 500;
}

.conclusion-pass {
  background: #EDF5ED;
  color: var(--color-success);
}

.conclusion-pending {
  background: #FBF0E5;
  color: var(--color-warning);
}

.conclusion-fail {
  background: #FBEAE8;
  color: var(--color-danger);
}

/* 检测结论 */
.detail-conclusion {
  background: var(--color-primary-bg);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: var(--font-size-sm);
  color: var(--color-text);
  line-height: 1.6;
  margin-top: 8px;
}

/* 签章区域 */
.signature-area {
  display: flex;
  justify-content: space-around;
  margin-top: 16px;
  gap: 12px;
}

.signature-item {
  text-align: center;
  flex: 1;
}

.signature-item .sig-name {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-bottom: 8px;
}

.signature-item .sig-value {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--color-text);
  font-family: "KaiTi", "STKaiti", serif;
  border-bottom: 1px solid var(--color-border);
  padding: 4px 0;
  min-width: 80px;
}

/* 底部操作 */
.detail-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 12px;
  padding: 12px 16px calc(12px + var(--safe-bottom));
  background: var(--color-white);
  border-top: 1px solid var(--color-border);
}

.detail-actions button {
  flex: 1;
  height: 44px;
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.detail-actions button:active {
  opacity: 0.85;
}

.detail-actions .btn-secondary {
  background: var(--color-white);
  border: 1.5px solid var(--color-border);
  color: var(--color-text-secondary);
}

.detail-actions .btn-primary {
  background: var(--color-primary);
  color: #fff;
}

.detail-actions button svg {
  width: 18px;
  height: 18px;
}

/* ========== Toast 提示 ========== */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  max-width: 80%;
  text-align: center;
  white-space: pre-wrap;
}

.toast.show {
  opacity: 1;
}

/* ========== Loading ========== */
.loading-mask {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9998;
}

.loading-mask.show {
  display: flex;
}

.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ========== 底部 Tab 栏 ========== */
.tab-bar {
  position: sticky;
  bottom: 0;
  display: flex;
  background: var(--color-white);
  border-top: 1px solid var(--color-border);
  padding-bottom: var(--safe-bottom);
  flex-shrink: 0;
  z-index: 50;
}

.tab-bar .tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 0 6px;
  color: var(--color-text-placeholder);
  font-size: var(--font-size-xs);
  cursor: pointer;
  transition: color 0.2s;
}

.tab-bar .tab-item svg {
  width: 24px;
  height: 24px;
}

.tab-bar .tab-item.active {
  color: var(--color-primary);
}

/* ========== 用户信息栏 ========== */
.user-bar {
  display: flex;
  align-items: center;
  padding: 16px;
  background: var(--color-white);
  margin-bottom: 8px;
  gap: 12px;
}

.user-bar .avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-primary-light);
  border: 1.5px solid var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-bar .avatar svg {
  width: 24px;
  height: 24px;
  color: var(--color-primary);
}

.user-bar .user-info {
  flex: 1;
}

.user-bar .user-info .name {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--color-text);
}

.user-bar .user-info .phone {
  font-size: var(--font-size-sm);
  color: var(--color-text-placeholder);
  margin-top: 2px;
}

.user-bar .logout-btn {
  font-size: var(--font-size-sm);
  color: var(--color-text-placeholder);
  padding: 4px 10px;
  border-radius: 100px;
  background: var(--color-background);
  cursor: pointer;
}

/* 统计概览 */
.stats-overview {
  display: flex;
  background: var(--color-white);
  margin: 0 16px 8px;
  border-radius: var(--radius-md);
  padding: 16px 0;
  box-shadow: var(--shadow-sm);
}

.stats-overview .stat-item {
  flex: 1;
  text-align: center;
  position: relative;
}

.stats-overview .stat-item:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 0;
  top: 20%;
  height: 60%;
  width: 1px;
  background: var(--color-border);
}

.stats-overview .stat-num {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--color-primary-dark);
  font-family: "Georgia", "Times New Roman", serif;
}

.stats-overview .stat-label {
  font-size: var(--font-size-xs);
  color: var(--color-text-placeholder);
  margin-top: 4px;
}

/* 快捷入口 */
.quick-entry {
  display: flex;
  background: var(--color-white);
  margin: 0 16px 12px;
  border-radius: var(--radius-md);
  padding: 16px 0;
  box-shadow: var(--shadow-sm);
}

.quick-entry .entry-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.quick-entry .entry-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.quick-entry .entry-icon svg {
  width: 22px;
  height: 22px;
}

.quick-entry .entry-label {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
}

/* ========== PDF 查看器 ========== */
.pdf-viewer {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  background: #1a1a1a;
  display: none;
  flex-direction: column;
  animation: fadeIn 0.25s ease;
}

.pdf-viewer.show {
  display: flex;
}

.pdf-viewer .viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(10px + var(--safe-top)) 12px 10px;
  background: #111;
  color: #fff;
  flex-shrink: 0;
}

.pdf-viewer .viewer-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.2s;
}

.pdf-viewer .viewer-close:active {
  background: rgba(255, 255, 255, 0.15);
}

.pdf-viewer .viewer-close svg {
  width: 22px;
  height: 22px;
  color: #fff;
}

.pdf-viewer .viewer-title {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
}

.pdf-viewer .viewer-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #fff;
  position: relative;
  touch-action: pan-y;
}

.pdf-viewer .viewer-content {
  padding: 24px 16px 40px;
  min-height: 100%;
}

/* 报告内容样式（查看器内） */
.pdf-viewer .viewer-content .report-doc {
  font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: #333;
  max-width: 100%;
}

.pdf-viewer .viewer-content .report-doc .doc-header {
  text-align: center;
  border-bottom: 3px solid #B8923C;
  padding-bottom: 16px;
  margin-bottom: 20px;
}

.pdf-viewer .viewer-content .report-doc .doc-header .org-name {
  font-size: 13px;
  color: #666;
  margin-bottom: 6px;
}

.pdf-viewer .viewer-content .report-doc .doc-header .doc-title {
  font-size: 22px;
  font-weight: 700;
  color: #1a1a1a;
  letter-spacing: 3px;
}

.pdf-viewer .viewer-content .report-doc .doc-header .doc-meta {
  font-size: 12px;
  color: #999;
  margin-top: 6px;
}

.pdf-viewer .viewer-content .report-doc .info-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 18px;
}

.pdf-viewer .viewer-content .report-doc .info-table td {
  padding: 8px 10px;
  border: 1px solid #ddd;
  font-size: 13px;
}

.pdf-viewer .viewer-content .report-doc .info-table .label-cell {
  background: #FBF7EE;
  font-weight: 600;
  width: 80px;
}

.pdf-viewer .viewer-content .report-doc .section-title {
  font-size: 14px;
  font-weight: 700;
  color: #1a1a1a;
  border-left: 4px solid #B8923C;
  padding-left: 8px;
  margin-bottom: 10px;
}

.pdf-viewer .viewer-content .report-doc .section-meta {
  font-size: 12px;
  color: #999;
  margin-left: 10px;
  font-weight: 400;
}

.pdf-viewer .viewer-content .report-doc .result-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 18px;
}

.pdf-viewer .viewer-content .report-doc .result-table th {
  background: #B8923C;
  color: #fff;
  padding: 8px 6px;
  border: 1px solid #967529;
  font-size: 12px;
  text-align: center;
}

.pdf-viewer .viewer-content .report-doc .result-table td {
  padding: 8px 6px;
  border: 1px solid #ddd;
  font-size: 12px;
  text-align: center;
}

.pdf-viewer .viewer-content .report-doc .result-table .even-row {
  background: #fafafa;
}

.pdf-viewer .viewer-content .report-doc .conclusion-box {
  background: #FBF7EE;
  border-radius: 6px;
  padding: 12px;
  font-size: 13px;
  color: #333;
  line-height: 1.8;
  margin-bottom: 18px;
}

.pdf-viewer .viewer-content .report-doc .sign-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
}

.pdf-viewer .viewer-content .report-doc .sign-table td {
  padding: 10px;
  border: 1px solid #ddd;
  font-size: 13px;
  text-align: center;
}

.pdf-viewer .viewer-content .report-doc .sign-table .sign-label {
  background: #FBF7EE;
  font-weight: 600;
}

.pdf-viewer .viewer-content .report-doc .sign-table .sign-name {
  font-family: 'KaiTi', 'STKaiti', serif;
  font-weight: 600;
  font-size: 14px;
}

.pdf-viewer .viewer-content .report-doc .org-footer {
  border-top: 1px solid #eee;
  padding-top: 12px;
  font-size: 11px;
  color: #999;
  line-height: 1.8;
}

.pdf-viewer .viewer-toolbar {
  display: flex;
  gap: 10px;
  padding: 10px 16px calc(10px + var(--safe-bottom));
  background: #111;
  flex-shrink: 0;
}

.pdf-viewer .toolbar-btn {
  flex: 1;
  height: 42px;
  border: none;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s;
}

.pdf-viewer .toolbar-btn:active {
  opacity: 0.7;
}

.pdf-viewer .toolbar-btn svg {
  width: 18px;
  height: 18px;
}

.pdf-viewer .btn-download {
  background: linear-gradient(135deg, #D4AF37 0%, #B8923C 50%, #967529 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(184, 146, 60, 0.3);
}

.pdf-viewer .btn-open {
  background: #333;
  color: #fff;
}
