/* ===== 全局基础样式 / 响应式变量 ===== */
:root {
  --color-primary: #35b4ae;
  --color-primary-dark: #30879c;
  --color-primary-light: #a9e0ee;
  --color-bg: #f3f3f3;
  --color-text: #333;
  --color-text-light: #666;
  --color-border: #c0c0c0;
  --color-shadow: rgba(161, 161, 161, 0.5);
  --radius-lg: 1.6rem;
  --radius-md: 0.75rem;
  --radius-sm: 0.4rem;
  --max-width: 1024px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --nav-height: 3rem;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/* 修复：CSS 中显式声明 display 会覆盖 HTML 的 [hidden] 属性，
   导致带 hidden 属性的元素仍然可见（如全局图片预览层会被一直显示）。
   强制 [hidden] 始终生效。 */
[hidden] { display: none !important; }

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--color-text);
  background-color: var(--color-bg);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

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

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

/* 滚动容器 */
#app {
  min-height: 100vh;
  position: relative;
}

.scroll-page {
  position: relative;
  width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  padding-top: calc(var(--nav-height) + var(--safe-top));
}

/* 通用工具类 */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.hidden { display: none !important; }
.text-center { text-align: center; }
.ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 标题左侧色块 */
.title-box {
  display: inline-block;
  width: 0.3rem;
  height: 1.1rem;
  background-color: var(--color-primary);
  border-radius: 0 0.3rem 0.3rem 0;
  margin-right: 0.6rem;
  vertical-align: middle;
}

/* 加载占位 */
.loading-placeholder {
  padding: 2rem;
  text-align: center;
  color: var(--color-text-light);
}

/* ===== 响应式：PC 端适配 ===== */
/* 在大屏下将列表类页面限制为居中卡片，避免过宽拉伸 */
@media (min-width: 768px) {
  :root {
    --nav-height: 3.5rem;
    font-size: 17px;
  }
  .scroll-page {
    max-width: var(--max-width);
    margin: 0 auto;
    box-shadow: 0 0 24px rgba(0, 0, 0, 0.06);
    background-color: #fff;
  }
}
