/* ============================================================
   我的滑雪日记 · 胶片拍立得记忆册风格
   暖色纸感 + 拍立得卡片（白框 + 粗底边 + 轻微旋转 + 和纸胶带）
   家人分类用「和纸胶带便签」表现，标题用手写楷书感。
   品牌蓝绿（#1B6FC4 / #0F6E56）保留作小点缀。
   ============================================================ */

/* 整页暖色纸感（diary.css 只在 diary.html 加载，不影响其他页） */
main {
  background:
    radial-gradient(1200px 400px at 80% -120px, rgba(232,162,61,.10), transparent 60%),
    linear-gradient(180deg, #fcf5e9 0%, #f7ecd8 100%);
}

/* 规矩区也跟着暖起来，避免冷蓝补丁 */
section.alt { background: #f3e7d2; }
.alt .card { border-color: #e6d2ac; background: #fffdf8; }
.alt .card:hover { border-color: #d9bd86; }

.dy-msg {
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: var(--r-m, 12px);
  font-size: 14px;
  border: 0.5px solid var(--line);
  background: var(--bg-2);
}
.dy-msg.warn { color: #8a4b0e; background: #fff3df; border-color: #f0d3ad; }
.dy-msg.err  { color: #9a2525; background: #fdecec; border-color: #f0bcbc; }
.dy-msg.ok   { color: #0f6e56; background: #e9f7f1; border-color: #a9ddca; }

/* ============ 发布表单（暖色便签纸） ============ */
.dy-compose {
  position: relative;
  background: linear-gradient(180deg, #fffdf8, #fdf6ea);
  border: 1px solid #e9d6b6;
  border-radius: 16px;
  padding: 26px 22px 22px;
  margin-bottom: 26px;
  box-shadow: 0 8px 24px rgba(120, 90, 40, .10);
}
/* 顶部一段胶带 */
.dy-compose::before {
  content: '';
  position: absolute; top: -10px; left: 50%;
  width: 120px; height: 24px;
  transform: translateX(-50%) rotate(-2deg);
  background: repeating-linear-gradient(45deg, rgba(15,110,86,.82) 0 9px, rgba(11,92,72,.82) 9px 18px);
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(20,80,60,.25);
}
.dy-compose h3 { margin: 0 0 4px; font-size: 19px; font-family: "STKaiti","KaiTi","楷体",serif; color: #4a3520; }
.dy-hint { color: #8a755a; font-size: 13px; margin: 0 0 16px; }
.dy-field { display: block; margin-bottom: 14px; }
.dy-field > span {
  display: block;
  font-size: 12.5px;
  color: #7a6248;
  margin-bottom: 6px;
  font-weight: 600;
}
.dy-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) {
  .dy-row2 { grid-template-columns: 1fr; }
  .dy-compose { padding: 20px 16px 16px; }
}
.dy-input, .dy-textarea, .dy-search, .dy-sel {
  width: 100%;
  border: 1px solid #e3d2b3;
  border-radius: var(--r-s, 9px);
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--ink);
  background: #fffdf8;
  box-sizing: border-box;
}
.dy-input[type="file"] { padding: 8px 10px; background: #fff; }
.dy-textarea { min-height: 92px; resize: vertical; line-height: 1.55; }
.dy-input:focus, .dy-textarea:focus, .dy-search:focus, .dy-sel:focus {
  outline: none;
  border-color: #d9a441;
  box-shadow: 0 0 0 3px rgba(217, 164, 65, .15);
}
.dy-count { color: var(--ink-3); font-weight: 400; margin-left: 4px; }
.dy-uphint { color: #8a755a; font-size: 12.5px; }
.dy-actions { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.dy-spacer { flex: 1; }
.dy-progress {
  margin-top: 12px;
  height: 6px;
  background: #efe2c8;
  border-radius: 99px;
  overflow: hidden;
}
.dy-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #e8932f, #1B6FC4);
  transition: width .2s;
}

/* ============ 工具栏 ============ */
.dy-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.dy-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.dy-search { flex: 1; min-width: 180px; max-width: 360px; }
.dy-sel { width: auto; min-width: 96px; }

/* 广场 / 我的 分段标签（暖色） */
.dy-tabs {
  display: inline-flex;
  background: #f3e6cf;
  border: 1px solid #e3cfa8;
  border-radius: 99px;
  padding: 3px;
  gap: 2px;
}
.dy-tabs button {
  border: 0; background: none; font-family: inherit;
  font-size: 14px; color: #7a6248;
  padding: 6px 18px; border-radius: 99px; cursor: pointer;
}
.dy-tabs button.on {
  background: #fff; color: #4a3520; font-weight: 600;
  box-shadow: 0 1px 2px rgba(120, 90, 40, .12);
}

/* ============ 家人墙 / 分类筛选（一目了然） ============ */
.dy-family {
  position: relative;
  background: rgba(255, 253, 248, .82);
  border: 1px dashed #d9b98a;
  border-radius: 16px;
  padding: 16px 18px 18px;
  margin-bottom: 22px;
  backdrop-filter: blur(2px);
}
.dy-family-head {
  font-family: "STKaiti","KaiTi","楷体",serif;
  font-size: 19px;
  font-weight: 700;
  color: #6b4a2b;
  margin-bottom: 12px;
  letter-spacing: .5px;
}
.dy-family-sub { font-family: inherit; font-size: 13px; color: var(--ink-3); font-weight: 400; margin-left: 6px; }
.dy-who-filter { display: flex; flex-wrap: wrap; gap: 10px; }

/* 和纸胶带风家人 chips（发布表单选择 + 家人墙筛选共用） */
.dy-who-chip {
  border: 1px solid #e3c79b;
  background: #fff7ea;
  color: #7a4a16;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: transform .15s, background .15s, box-shadow .15s, color .15s;
  transform: rotate(-1deg);
}
.dy-who-chip:nth-child(even) { transform: rotate(1deg); }
.dy-who-chip:hover { background: #fdeecd; }
.dy-who-chip.on {
  background: linear-gradient(135deg, #e8932f, #d9772a);
  color: #fff;
  border-color: #cf6f1f;
  box-shadow: 0 3px 8px rgba(200, 110, 20, .30);
  transform: rotate(0deg) scale(1.04);
}

/* ============ 拍立得卡片网格 ============ */
.dy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 28px 22px;
}
@media (max-width: 560px) {
  .dy-grid { grid-template-columns: 1fr; gap: 30px; }
}
.dy-card {
  position: relative;
  background: #fff;
  border-radius: 3px;
  padding: 12px 12px 0;
  box-shadow: 0 8px 22px rgba(90, 60, 30, .16), 0 2px 4px rgba(90, 60, 30, .10);
  display: flex;
  flex-direction: column;
  transition: transform .18s, box-shadow .18s;
}
/* 散落相册感：每张轻微旋转 */
.dy-card:nth-child(4n+1) { transform: rotate(-1.4deg); }
.dy-card:nth-child(4n+2) { transform: rotate(1deg); }
.dy-card:nth-child(4n+3) { transform: rotate(-.6deg); }
.dy-card:nth-child(4n)   { transform: rotate(1.4deg); }
.dy-card:hover {
  transform: translateY(-4px) rotate(0deg) !important;
  box-shadow: 0 14px 32px rgba(90, 60, 30, .24);
}
/* 顶部一段和纸胶带固定照片 */
.dy-card::before {
  content: '';
  position: absolute; top: -11px; left: 50%;
  width: 88px; height: 26px;
  transform: translateX(-50%) rotate(-3deg);
  background: repeating-linear-gradient(45deg, rgba(232,162,61,.85) 0 8px, rgba(214,140,40,.85) 8px 16px);
  box-shadow: 0 1px 3px rgba(120, 80, 20, .25);
  border-radius: 2px;
  z-index: 3;
}
.dy-video-wrap {
  position: relative;
  background: #0e1a24;
  aspect-ratio: 16 / 9;
  border-radius: 2px;
  overflow: hidden;
}
.dy-video-wrap video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #000;
}

/* ============ 照片相册网格（拍立得里的「一叠照片」） ============ */
.dy-photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  margin-top: 5px;
}
.dy-photo-grid:first-child { margin-top: 0; }
/* 只有 1 张照片：整张展示，不裁切（保留完整画面），深底居中 */
.dy-photo-grid--1 { grid-template-columns: 1fr; gap: 0; }
.dy-photo {
  display: block;
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 2px;
  background: #0e1a24;
}
.dy-photo:hover { opacity: .92; }
.dy-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* 单张照片用 contain，避免把横/竖构图裁掉 */
.dy-photo-grid--1 .dy-photo { aspect-ratio: 4 / 3; }
.dy-photo-grid--1 .dy-photo img { object-fit: contain; }

/* 发布表单里的照片缩略图预览（带删除按钮 + 大小） */
.dy-photo-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.dy-photo-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e3d2b3;
  background: #0e1a24;
}
.dy-photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dy-photo-rm {
  position: absolute; top: 2px; right: 2px;
  width: 20px; height: 20px;
  border: 0; border-radius: 50%;
  background: rgba(0, 0, 0, .55); color: #fff;
  font-size: 14px; line-height: 1; cursor: pointer;
  padding: 0; display: flex; align-items: center; justify-content: center;
}
.dy-photo-rm:hover { background: rgba(160, 30, 30, .85); }
.dy-photo-size {
  position: absolute; bottom: 2px; left: 2px;
  background: rgba(0, 0, 0, .5); color: #fff;
  font-size: 10px; padding: 1px 4px; border-radius: 3px;
}
.dy-card-body {
  padding: 14px 6px 28px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  background: #fff;
}
.dy-card h4 {
  margin: 0;
  font-size: 17px;
  line-height: 1.35;
  font-family: "STKaiti","KaiTi","楷体",serif;
  color: #4a3520;
  font-weight: 700;
}
.dy-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: #8a755a;
  flex-wrap: wrap;
}
.dy-avatar {
  width: 22px; height: 22px;
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex: 0 0 auto;
  box-shadow: 0 1px 2px rgba(0,0,0,.15);
}
.dy-loc { color: #7a6248; }
.dy-body { font-size: 14px; color: #5b4636; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.dy-actions-row { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.dy-like {
  border: 1px solid #e3d2b3;
  background: #fff;
  border-radius: 99px;
  padding: 5px 12px;
  font-size: 13px;
  cursor: pointer;
  color: #7a6248;
  font-family: inherit;
}
.dy-like.on { background: #fdecec; border-color: #f0bcbc; color: #c0392b; }
.dy-link-btn {
  border: 0;
  background: none;
  color: var(--ink-3);
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  padding: 5px 6px;
}
.dy-link-btn:hover { color: var(--ink); }
.dy-edit-form { display: flex; flex-direction: column; gap: 8px; }
.dy-empty { color: #8a755a; text-align: center; padding: 40px 0; font-size: 14.5px; }
.dy-pager { display: flex; gap: 8px; justify-content: center; margin-top: 22px; }

/* 卡片上的家人标签：一小片暖色和纸胶带 */
.dy-who-tag {
  display: inline-flex; align-items: center;
  font-size: 11.5px; font-weight: 700;
  color: #7a4a16;
  background: #f6d8a8;
  padding: 2px 9px;
  border-radius: 3px;
  transform: rotate(-1.5deg);
  box-shadow: 0 1px 2px rgba(120, 80, 20, .18);
  letter-spacing: .5px;
}

/* 个人条（登录后显示，强化「这是我的空间」） */
.dy-profile {
  background: linear-gradient(135deg, #1B6FC4, #0F6E56);
  color: #fff;
  border-radius: var(--r-m, 16px);
  padding: 20px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  box-shadow: 0 6px 20px rgba(27, 111, 196, .18);
}
.dy-profile-id { display: flex; align-items: center; gap: 14px; }
.dy-profile-avatar {
  width: 56px; height: 56px; border-radius: 50%;
  background: rgba(255, 255, 255, .22);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 600; flex: 0 0 auto;
  border: 2px solid rgba(255, 255, 255, .5);
}
.dy-profile-meta { display: flex; flex-direction: column; }
.dy-profile-name { font-size: 19px; font-weight: 700; }
.dy-profile-sub { font-size: 12.5px; opacity: .85; margin-top: 2px; }
.dy-profile-stats { display: flex; gap: 26px; }
.dy-stat { display: flex; flex-direction: column; align-items: center; min-width: 56px; }
.dy-stat b { font-size: 22px; font-weight: 700; line-height: 1.1; }
.dy-stat span { font-size: 12px; opacity: .85; margin-top: 2px; }
@media (max-width: 560px) {
  .dy-profile { flex-direction: column; align-items: flex-start; }
  .dy-profile-stats { gap: 20px; width: 100%; justify-content: space-around; }
}

/* 自己的卡片高亮 + 「我发的」标记 */
.dy-card.mine { box-shadow: 0 0 0 2px rgba(27, 111, 196, .40), 0 8px 22px rgba(90, 60, 30, .16); }
.dy-mine-ribbon {
  position: absolute; top: 10px; left: 10px;
  background: #1B6FC4; color: #fff;
  font-size: 11.5px; font-weight: 600;
  padding: 3px 9px; border-radius: 99px;
  z-index: 2;
}
.dy-mine-tag, .dy-clip-tag {
  font-size: 11.5px; font-weight: 500;
  padding: 1px 7px; border-radius: 99px;
  background: #efe2c8; color: #7a6248;
}
.dy-clip-tag { background: #e9f7f1; color: #0f6e56; }

/* 申请上传权限面板 + 公开勾选 */
.dy-check { display: flex; align-items: center; }
.dy-check-inline { display: flex; align-items: center; gap: 6px; font-size: 14px; color: #7a6248; }
.dy-check-inline input { width: auto; }
.dy-apply h3 { margin: 0 0 12px; font-size: 18px; font-family: "STKaiti","KaiTi","楷体",serif; color: #4a3520; }
