/* ─────────────────────────────────────────────────────────────────────
   古建实时 · H5 移动端 APP 组件样式
   ─ 真实 H5 容器(非原型展示),移动端全屏,桌面端居中带阴影
   ───────────────────────────────────────────────────────────────────── */

/* H5 外壳: 移动端整屏背景 / 桌面端给灰色背景以衬托手机宽度内容 */
.h5-shell {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  display: flex;
  justify-content: center;
}

/* 桌面端: 灰色背景 + 容器加阴影 */
@media (min-width: 768px) {
  .h5-shell {
    background:
      radial-gradient(ellipse at top left, color-mix(in oklch, var(--accent) 4%, transparent) 0%, transparent 45%),
      radial-gradient(ellipse at bottom right, color-mix(in oklch, var(--gold-deep) 6%, transparent) 0%, transparent 50%),
      var(--bg-deep);
    padding: 24px 0;
  }
  .h5-app {
    box-shadow: 0 30px 60px -32px color-mix(in oklch, var(--fg) 40%, transparent);
    border-radius: 24px;
    overflow: hidden;
  }
}

/* H5 应用容器: 移动端 100vw, 桌面端居中 480px */
.h5-app {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  position: relative;
}
@media (min-width: 768px) {
  .h5-app {
    min-height: calc(100vh - 48px);
    height: calc(100vh - 48px);
  }
}

/* 隐藏所有原型展示元素 (历史 .phone 改名为 .h5-app, 但避免老样式干扰) */
.dynamic-island, .side-panel, .status-bar { display: none !important; }

/* 应用区域: 占满 h5-app 内剩余空间 */
.app-frame {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  min-height: 0;
}

/* 应用顶栏 - 真实 H5 顶栏(支持 safe-area) */
.appbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(env(safe-area-inset-top), 12px) 14px 10px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.appbar .appbar-title { font-family: var(--font-display); font-size: 17px; font-weight: 600; letter-spacing: 0.04em; color: var(--fg); }
.appbar .appbar-sub { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); }
.appbar .icon-btn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 10px;
  color: var(--muted);
  position: relative;
  flex-shrink: 0;
}
.appbar .icon-btn:hover { color: var(--fg); background: var(--fg-soft); }
.appbar .icon-btn:active { transform: scale(0.94); }
.appbar .icon-btn .dot {
  position: absolute; top: 8px; right: 8px;
  width: 7px; height: 7px;
  background: var(--accent); border-radius: 50%;
  box-shadow: 0 0 0 1.5px var(--bg);
}
.appbar svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* 滚动主体 */
.app-main {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: calc(80px + env(safe-area-inset-bottom));
}
.app-main::-webkit-scrollbar { display: none; }

.h5-app .grid-2 { grid-template-columns: 1fr 1fr; }

.app-section { padding: 16px 16px 4px; }
.app-section + .app-section { padding-top: 4px; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.section-head h2 { font-size: 16px; font-family: var(--font-display); font-weight: 600; }
.section-head .more { font-family: var(--font-mono); font-size: 11px; color: var(--accent); letter-spacing: 0.1em; }

/* 底部 Tab Bar (5 等分, 真实 H5 sticky) */
.tab-bar {
  position: sticky;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: color-mix(in oklch, var(--surface) 94%, transparent);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  padding: 6px 4px calc(8px + env(safe-area-inset-bottom));
  z-index: 10;
}
.tab-bar .tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 4px;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 0.14em;
  -webkit-tap-highlight-color: transparent;
}
.tab-bar .tab svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.tab-bar .tab.active { color: var(--accent); }
.tab-bar .tab.active svg { stroke: var(--accent); }
.tab-bar .tab:active { transform: scale(0.95); }

/* 信息行 / 列表项 ---------- */
.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.list-item:last-child { border-bottom: 0; }
.list-item .li-thumb {
  width: 56px; height: 56px;
  flex-shrink: 0;
  border-radius: var(--radius);
  background: var(--bg-deep);
  display: grid; place-items: center;
  font-family: var(--font-display);
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.2em;
  border: 1px solid var(--border);
  overflow: hidden;
}
.list-item .li-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.86) contrast(1.05);
}
.list-item .li-body { flex: 1; min-width: 0; }
.list-item .li-title { font-weight: 600; font-size: 14px; line-height: 1.4; }
.list-item .li-sub { color: var(--muted); font-size: 12px; margin-top: 4px; }
.list-item .li-tail { text-align: right; font-family: var(--font-mono); font-size: 11px; color: var(--muted); }

/* 数据条 ---------- */
.data-bar {
  height: 6px;
  background: var(--bg-deep);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.data-bar > span {
  display: block; height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.35s ease;
}
.data-bar.jade > span  { background: var(--jade); }
.data-bar.ochre > span { background: var(--ochre); }
.data-bar.umber > span { background: var(--umber); }

.result-toast {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--jade-soft);
  color: var(--jade);
  display: none;
  font-size: 12px;
}
.result-toast.show { display: block; }

/* 古风纹饰: 卷草 SVG 边框 */
.brocade-frame {
  border: 1px solid var(--gold-deep);
  border-radius: 0;
  position: relative;
  padding: 18px;
  background: var(--surface);
}
.brocade-frame::before,
.brocade-frame::after {
  content: '';
  position: absolute;
  inset: 3px;
  border: 1px solid var(--gold-soft);
  pointer-events: none;
}
.brocade-frame::after { inset: 6px; border-color: color-mix(in oklch, var(--gold-deep) 25%, transparent); }
