/* 我的博物馆 · 高一16班 —— 现代私人博物馆 / 编辑式排版 / 个人档案馆
   移动优先。为兼容老旧 WebView：
   - 不使用 CSS 变量、dvh、:has、容器查询、grid、clamp 作为布局手段
   - 主结构用 float + 定高，颜色与尺寸直接写字面值
   - env(safe-area-inset-*) 只出现在文件末尾的 @supports 增强块内
   色彩：纸张 #F7F5EF / 卡片 #FFFFFF / 暖灰边框 #E8E3D9 / 墨色 #292D29
        苔绿 #526858（仅主交互）/ 次要 #77766D / 最浅标签 #8F8C82 / 陶土棕 #A8765C（仅极小标记） */

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: #F7F5EF;
  color: #292D29;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

body.drawer-open {
  overflow: hidden;
}

img {
  border: 0;
}

/* ---------- 页面主列：移动单列、桌面 760px 居中 ---------- */

.page {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 20px 56px;
  box-sizing: border-box;
}

/* ---------- 编辑式头部 ---------- */

.masthead {
  padding: 40px 0 0;
}

.masthead-top {
  overflow: hidden;
  margin-bottom: 26px;
}

.eyebrow {
  font-size: 11px;
  line-height: 18px;
  letter-spacing: 0.16em;
  color: #8F8C82;
  text-transform: uppercase;
}

.eyebrow-left {
  float: left;
}

.eyebrow-right {
  float: right;
  letter-spacing: 0.12em;
}

.masthead-title {
  margin: 0 0 12px;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: #292D29;
}

.masthead-sub {
  margin: 0;
  font-size: 15px;
  line-height: 1.7;
  color: #77766D;
}

.rule {
  height: 1px;
  margin: 28px 0 0;
  background: #E8E3D9;
  font-size: 0;
  line-height: 0;
}

/* ---------- 分组标题行 ---------- */

.section {
  margin-top: 32px;
}

.section-head {
  overflow: hidden;
  margin-bottom: 14px;
}

.section-title {
  float: left;
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 20px;
  letter-spacing: 0.01em;
  color: #292D29;
}

.section-count {
  float: right;
  font-size: 11px;
  line-height: 20px;
  letter-spacing: 0.12em;
  color: #8F8C82;
  text-transform: uppercase;
}

.section-action {
  float: right;
  margin-left: 12px;
  padding: 0;
  border: 0;
  background: none;
  font-family: inherit;
  font-size: 11px;
  line-height: 20px;
  letter-spacing: 0.12em;
  color: #526858;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.section-action.is-hidden {
  display: none;
}

/* ---------- 藏品列表 ---------- */

.list {
  margin: 0;
  padding: 0;
}

.card {
  margin: 0 0 12px 0;
  padding: 14px;
  background: #FFFFFF;
  border: 1px solid #E8E3D9;
  border-radius: 12px;
  box-sizing: border-box;
  overflow: hidden;
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0.04);
}

.card:hover {
  border-color: #D9D3C5;
  background: #FFFDF9;
}

.card:focus {
  outline: 2px solid #526858;
  outline-offset: 2px;
}

.card-media {
  float: left;
  width: 76px;
  height: 76px;
  margin: 0;
  overflow: hidden;
  border-radius: 8px;
  background: #EFECE4;
}

.cover {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  background: #EFECE4;
  object-fit: cover;
}

.card-body {
  padding-left: 90px;
}

.card-title {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.45;
  color: #292D29;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-meta {
  margin: 0 0 8px;
  font-size: 12px;
  line-height: 1.6;
  letter-spacing: 0.04em;
  color: #77766D;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-note {
  margin: 0;
  font-size: 15px;
  line-height: 1.7;
  color: #4B4F49;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  max-height: 3.4em;
}

.card-foot {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: 0.04em;
  color: #526858;
}

.card-foot .arrow {
  color: #8F8C82;
}

/* ---------- 展区陈列：书籍（竖向，突出封面与摘录） ---------- */

.list--book .card {
  padding: 16px;
}

.list--book .card-media {
  width: 80px;
  height: 106px;
}

.list--book .card-body {
  padding-left: 96px;
  min-height: 106px;
}

.list--book .card-title {
  font-size: 18px;
  white-space: normal;
}

.list--book .card-note {
  -webkit-line-clamp: 3;
  max-height: 5.1em;
}

/* ---------- 展区陈列：电影（宽幅剧照，杂志感） ---------- */

.list--movie .card {
  padding: 14px;
}

.list--movie .card-media {
  float: none;
  width: 100%;
  height: 168px;
  margin: 0 0 14px;
  border-radius: 10px;
}

.list--movie .cover {
  border-radius: 10px;
}

.list--movie .card-body {
  padding-left: 0;
}

.list--movie .card-title {
  font-size: 19px;
  white-space: normal;
}

/* ---------- 展区陈列：音乐（轻盈、节奏更密） ---------- */

.list--music .card {
  padding: 12px;
  margin-bottom: 10px;
}

.list--music .card-media {
  width: 68px;
  height: 68px;
  border-radius: 6px;
}

.list--music .card-media .cover {
  border-radius: 6px;
}

.list--music .card-body {
  padding-left: 80px;
}

.list--music .card-title {
  font-size: 17px;
  margin-bottom: 4px;
}

.list--music .card-meta {
  margin-bottom: 6px;
}

/* ---------- 展区陈列：地方（大图 + 地点，旅行日志） ---------- */

.list--place .card {
  padding: 14px;
}

.list--place .card-media {
  float: none;
  width: 100%;
  height: 180px;
  margin: 0 0 14px;
  border-radius: 10px;
}

.list--place .cover {
  border-radius: 10px;
}

.list--place .card-body {
  padding-left: 0;
}

.list--place .card-title {
  font-size: 19px;
  padding-left: 16px;
  position: relative;
  white-space: normal;
}

.list--place .card-title .dot {
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background: #A8765C;
  font-size: 0;
  line-height: 0;
}

.list--place .card-note {
  -webkit-line-clamp: 3;
  max-height: 5.1em;
}

/* ---------- 展区陈列：美食 / 随笔（文字为主，安静排版） ---------- */

.list--food .card,
.list--essay .card {
  padding: 16px;
}

.list--food .card-media,
.list--essay .card-media {
  width: 52px;
  height: 52px;
  border-radius: 6px;
}

.list--food .card-media .cover,
.list--essay .card-media .cover {
  border-radius: 6px;
}

.list--food .card-body,
.list--essay .card-body {
  padding-left: 68px;
}

.list--food .card-title,
.list--essay .card-title {
  white-space: normal;
}

.list--food .card-note,
.list--essay .card-note {
  clear: both;
  margin-left: -68px;
  font-size: 16px;
  line-height: 1.8;
  color: #3E423C;
  -webkit-line-clamp: 3;
  max-height: 5.4em;
}

/* ---------- 展厅入口 ---------- */

.hall-grid {
  overflow: hidden;
}

.hall-cell {
  float: left;
  width: 48%;
  margin: 0 0 12px 0;
  padding: 16px 16px 14px;
  box-sizing: border-box;
  border: 1px solid #E8E3D9;
  background: #FFFFFF;
  border-radius: 12px;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.4;
  color: #292D29;
  text-align: left;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0.04);
}

.hall-cell-left {
  margin-right: 4%;
}

.hall-cell:hover {
  border-color: #D9D3C5;
  background: #FFFDF9;
}

.hall-cell:focus {
  outline: 2px solid #526858;
  outline-offset: 2px;
}

.hall-cell.is-active {
  border-color: #526858;
}

.hall-name {
  display: block;
  margin-bottom: 8px;
}

.hall-count {
  display: block;
  font-size: 11px;
  line-height: 1.4;
  letter-spacing: 0.12em;
  color: #8F8C82;
  text-transform: uppercase;
}

/* ---------- 按钮 ---------- */

.btn {
  display: inline-block;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 14px;
  line-height: 1;
  padding: 13px 22px;
  border: 1px solid #526858;
  border-radius: 10px;
  background: #526858;
  color: #FFFFFF;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.btn:hover {
  background: #475C4D;
  border-color: #475C4D;
}

.btn-ghost {
  background: transparent;
  color: #4B4F49;
  border-color: #E8E3D9;
}

.btn-ghost:hover {
  background: transparent;
  border-color: #526858;
  color: #526858;
}

/* ---------- 状态提示 ---------- */

.state {
  margin: 0;
  padding: 48px 0;
  font-size: 14px;
  line-height: 1.7;
  color: #77766D;
}

.state-title {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 600;
  color: #292D29;
}

.state-hint {
  margin: 0;
  font-size: 14px;
  line-height: 1.75;
  color: #77766D;
}

/* ---------- 详情页 ---------- */

.detail {
  padding-top: 40px;
}

.detail-top {
  overflow: hidden;
  margin-bottom: 24px;
}

.detail-head {
  overflow: hidden;
}

.detail-media {
  float: left;
  width: 104px;
  height: 138px;
  margin: 0 20px 8px 0;
  overflow: hidden;
  border-radius: 10px;
  background: #EFECE4;
}

.detail-media .cover {
  border-radius: 10px;
}

.detail-headtext {
  overflow: hidden;
}

.detail-kicker {
  margin: 0 0 10px;
  font-size: 11px;
  line-height: 1.4;
  letter-spacing: 0.16em;
  color: #8F8C82;
  text-transform: uppercase;
}

.detail-title {
  margin: 0 0 10px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: #292D29;
}

.detail-meta {
  margin: 0 0 4px;
  font-size: 13px;
  line-height: 1.6;
  letter-spacing: 0.02em;
  color: #77766D;
}

/* 详情页按类型的排版微调：仍是同一套模板 */
.detail--movie .detail-media,
.detail--place .detail-media {
  float: none;
  width: 100%;
  height: 190px;
  margin: 0 0 20px;
  border-radius: 12px;
}

.detail--movie .detail-media .cover,
.detail--place .detail-media .cover {
  border-radius: 12px;
}

.detail--movie .detail-headtext,
.detail--place .detail-headtext {
  overflow: visible;
}

.detail--music .detail-media {
  width: 132px;
  height: 132px;
}

.detail--movie .detail-title,
.detail--place .detail-title {
  font-size: 24px;
}

.detail--food .detail-media,
.detail--essay .detail-media {
  width: 64px;
  height: 64px;
  margin-right: 16px;
}

.detail-note {
  margin: 26px 0 0;
  padding-top: 22px;
  border-top: 1px solid #E8E3D9;
  font-size: 16px;
  line-height: 1.9;
  color: #2F332E;
}

.detail-actions {
  margin-top: 26px;
}

.back-row {
  margin-top: 40px;
  padding-top: 22px;
  border-top: 1px solid #E8E3D9;
}

.back-link {
  font-size: 13px;
  line-height: 1.6;
  color: #77766D;
  text-decoration: none;
}

.back-link:hover {
  color: #526858;
}

/* ---------- 底部抽屉 ----------
   默认 visibility:hidden + transform 移出屏幕：
   即使老引擎不支持 transform，也绝不会出现一条白色浮层盖住列表。 */

.drawer-mask {
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  background: rgba(24, 26, 24, 0.34);
  opacity: 0;
  visibility: hidden;
  -webkit-transition: opacity 0.22s ease, visibility 0.22s ease;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.drawer-mask.is-open {
  opacity: 1;
  visibility: visible;
}

.drawer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 21;
  box-sizing: border-box;
  max-width: 760px;
  margin: 0 auto;
  max-height: 420px;
  max-height: 64vh;
  padding: 10px 20px 24px;
  background: #FFFFFF;
  border-radius: 16px 16px 0 0;
  border-top: 1px solid #E8E3D9;
  overflow-y: auto;
  visibility: hidden;
  -webkit-overflow-scrolling: touch;
  -webkit-transform: translateY(100%);
  transform: translateY(100%);
  -webkit-transition: -webkit-transform 0.24s ease, visibility 0.24s ease;
  transition: transform 0.24s ease, visibility 0.24s ease;
}

.drawer.is-open {
  visibility: visible;
  -webkit-transform: translateY(0);
  transform: translateY(0);
}

.drawer-handle {
  width: 36px;
  height: 4px;
  margin: 4px auto 18px;
  border-radius: 2px;
  background: #E8E3D9;
}

.drawer-kicker {
  margin: 0 0 8px;
  font-size: 11px;
  line-height: 1.4;
  letter-spacing: 0.16em;
  color: #8F8C82;
  text-transform: uppercase;
}

.drawer-title {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.45;
  color: #292D29;
}

.drawer-text {
  margin: 0 0 22px;
  font-size: 16px;
  line-height: 1.85;
  color: #3E423C;
}

/* ---------- 桌面端 ---------- */

@media (min-width: 768px) {
  .page {
    padding: 0 32px 72px;
  }

  .masthead {
    padding-top: 56px;
  }

  .masthead-top {
    margin-bottom: 30px;
  }

  .masthead-title {
    font-size: 34px;
    margin-bottom: 14px;
  }

  .masthead-sub {
    font-size: 16px;
  }

  .rule {
    margin-top: 34px;
  }

  .section {
    margin-top: 44px;
  }

  .section-head {
    margin-bottom: 16px;
  }

  .card {
    margin-bottom: 16px;
    padding: 18px;
  }

  .card-media {
    width: 88px;
    height: 88px;
  }

  .card-body {
    padding-left: 104px;
  }

  .card-title {
    font-size: 18px;
  }

  .list--book .card-title {
    font-size: 19px;
  }

  .list--book .card-media {
    width: 92px;
    height: 122px;
  }

  .list--book .card-body {
    padding-left: 112px;
    min-height: 122px;
  }

  .list--movie .card-media {
    height: 200px;
  }

  .list--place .card-media {
    height: 220px;
  }

  .list--music .card {
    padding: 14px;
  }

  .list--music .card-media {
    width: 76px;
    height: 76px;
  }

  .list--music .card-body {
    padding-left: 92px;
  }

  .list--food .card,
  .list--essay .card {
    padding: 20px;
  }

  .list--food .card-media,
  .list--essay .card-media {
    width: 56px;
    height: 56px;
  }

  .list--food .card-body,
  .list--essay .card-body {
    padding-left: 76px;
  }

  .list--food .card-note,
  .list--essay .card-note {
    margin-left: -76px;
  }

  .hall-cell {
    padding: 18px 18px 16px;
  }

  .detail {
    padding-top: 56px;
  }

  .detail-title {
    font-size: 28px;
  }

  .detail-media {
    width: 120px;
    height: 160px;
  }

  .detail--movie .detail-media,
  .detail--place .detail-media {
    height: 240px;
  }

  .detail--music .detail-media {
    width: 152px;
    height: 152px;
  }

  .detail-note {
    font-size: 17px;
  }
}

/* 安全区只在支持 env() 的引擎上增强，不支持时沿用上面的固定内边距 */
@supports (padding: env(safe-area-inset-bottom)) {
  .drawer {
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
  }
}
