/* anr.loc.cc — 相册 + 心情，跟随系统深浅色 */
:root {
  --bg: #fbfaf8;
  --fg: #1b1b1b;
  --muted: #8a857e;
  --line: #eae6e0;
  --card: #ffffff;
  --accent: #31655a;
  --accent-soft: #e8f0ed;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1113;
    --fg: #e9e6e2;
    --muted: #918d87;
    --line: #24272b;
    --card: #171a1d;
    --accent: #8ed0bb;
    --accent-soft: #1b2b28;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.75 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }

/* 布局 */
.wrap { max-width: 680px; margin: 0 auto; padding: 0 22px 96px; }
.wrap.narrow { max-width: 360px; padding-top: 14vh; }

/* 页头 */
.masthead { padding: 72px 0 44px; }
.masthead h1 {
  margin: 0; font-size: 34px; font-weight: 600; letter-spacing: .14em;
}
.masthead h1::after {
  content: ""; display: block; width: 36px; height: 2px;
  background: var(--accent); margin-top: 18px; border-radius: 2px;
}
.masthead.small { padding: 28px 0 8px; }
.tagline { margin: 14px 0 0; color: var(--muted); font-size: 14px; letter-spacing: .18em; }
.masthead-rule { height: 1px; background: var(--line); margin: 0 0 48px; }

/* ===== 全屏三栏布局：每栏 10 行 = 一页约一个月 ===== */
html, body.stage-page { height: 100%; }
body.stage-page {
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
}
.stage {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0 clamp(16px, 3vw, 56px);
  box-sizing: border-box;
}

/* 标题居中 */
.stage-head {
  text-align: center;
  padding: clamp(28px, 5vh, 64px) 0 clamp(20px, 3vh, 36px);
  flex: none;
}
.stage-head h1 {
  margin: 0;
  font-size: clamp(30px, 4.6vw, 56px);
  font-weight: 500;
  letter-spacing: .1em;
  line-height: 1.1;
}
.stage-head .tagline {
  margin: 10px 0 0;
  font-size: 13px;
  letter-spacing: .28em;
  color: var(--muted);
}
.stage-head::after {
  content: "";
  display: block;
  width: 40px;
  height: 2px;
  margin: 18px auto 0;
  background: var(--accent);
  border-radius: 2px;
}

/* 三列 */
.grid {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: 0 clamp(14px, 2.2vw, 44px);
  min-height: 0;
  overflow: hidden;
}
.col {
  list-style: none;
  margin: 0;
  padding: 0 0 0 clamp(10px, 1.4vw, 22px);
  display: grid;
  grid-template-rows: repeat(10, minmax(0, 1fr));
  row-gap: 0;
  min-height: 0;
  height: 100%;
  box-sizing: border-box;
  border-left: 1px solid var(--line);
}
.col:first-child { border-left: 0; padding-left: 0; }
.col li {
  min-height: 0;
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--line);
}
.col li:last-child { border-bottom: 0; }

/* 单条 */
.cell {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1vw, 14px);
  width: 100%;
  min-width: 0;
  padding: 4px 2px;
  text-decoration: none;
  color: inherit;
  border-radius: 5px;
  transition: background .16s ease;
}
.cell:hover { background: var(--accent-soft); }
.cell-thumb {
  flex: none;
  width: clamp(38px, 3.2vw, 54px);
  height: clamp(38px, 3.2vw, 54px);
  border-radius: 4px;
  overflow: hidden;
  background: var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
}
.cell-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cell-noimg { font-size: 14px; color: var(--muted); }
.cell-main { min-width: 0; flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 3px; }
.cell-text {
  display: block;
  font-size: clamp(12.5px, .95vw, 15px);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cell-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: clamp(10.5px, .72vw, 12px);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}
.cell-dot { opacity: .45; }
.cell-empty { visibility: hidden; }

/* 页脚 */
.stage-foot {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0 clamp(14px, 2.4vh, 28px);
  font-size: 11px;
  letter-spacing: .12em;
  color: var(--muted);
}
.stage-foot .pager { margin: 0; }
.stage-foot .pg { font-size: 12px; letter-spacing: .06em; }

/* 窄屏：退回单栏滚动，保证可读 */
@media (max-width: 900px) {
  .stage { min-height: 0; }
  .grid { grid-template-columns: 1fr; gap: 0; }
  .col { grid-template-rows: none; border-left: 0; padding-left: 0; }
  .col li { border-bottom: 0; }
  .cell { padding: 10px 2px; border-bottom: 1px solid var(--line); }
  .cell-thumb { width: 54px; height: 54px; }
  .cell-text { font-size: 14.5px; white-space: normal; }
  .stage-head { padding: 36px 0 24px; }
  .stage-foot { flex-direction: column; align-items: flex-start; }
}

/* 详情页（点进去放大显示） */
.detail { max-width: 900px; padding-top: 32px; }
.detail-nav { margin-bottom: 24px; }
.detail-body { font-size: 17px; line-height: 1.85; margin-bottom: 26px; word-break: break-word; }
.detail-photo { display: block; margin: 0 0 14px; border-radius: 4px; overflow: hidden; background: var(--line); }
.detail-photo img { width: 100%; height: auto; display: block; }
.detail-meta { margin-top: 22px; font-size: 12.5px; color: var(--muted); letter-spacing: .04em; }
.feed-row { text-decoration: none; color: inherit; }

/* 空状态 */
.empty { padding: 72px 0; text-align: center; color: var(--muted); font-size: 14px; letter-spacing: .1em; }
.empty::before {
  content: ""; display: block; width: 44px; height: 44px; margin: 0 auto 20px;
  border: 1px solid var(--line); border-radius: 50%;
}

/* 分页 */
.pager { display: flex; gap: 18px; align-items: center; justify-content: center; margin-top: 64px; font-size: 13px; letter-spacing: .06em; }
.pg { color: var(--accent); text-decoration: none; }
.pg-info { color: var(--muted); }

/* 页脚 */
.foot { margin-top: 88px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; letter-spacing: .16em; }

/* 卡片 / 表单 */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 24px; margin-bottom: 22px; }
.card h2 { margin: 0 0 18px; font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 8px; letter-spacing: .06em; }
input[type=password], textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--bg); color: var(--fg); font: inherit; outline: none; transition: border-color .2s;
}
input[type=password]:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 130px; line-height: 1.7; }
button { font: inherit; cursor: pointer; border: 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 20px;
  border-radius: 6px; text-decoration: none; font-size: 13.5px; border: 1px solid transparent; letter-spacing: .04em; transition: .2s; }
.btn.primary { background: var(--accent); color: #fff; margin-top: 18px; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { border-color: var(--line); background: transparent; color: var(--fg); }
.btn.ghost:hover { border-color: var(--muted); }
.btn.danger { color: #c0392b; border-color: var(--line); background: transparent; }
.btn.danger:hover { border-color: #c0392b; }
.btn:disabled { opacity: .45; cursor: default; }
.file { position: relative; overflow: hidden; cursor: pointer; }
.login { display: flex; flex-direction: column; }
.login button { margin-top: 20px; background: var(--accent); color: #fff; padding: 13px; border-radius: 6px; letter-spacing: .1em; }
.alert { color: #c0392b; font-size: 13px; margin: 0 0 14px; }

/* 后台 */
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 44px 0 26px; flex-wrap: wrap; }
.admin-head h1 { margin: 0; font-size: 21px; letter-spacing: .06em; font-weight: 600; }
.admin-nav { display: flex; gap: 10px; align-items: center; }
.tag { font-size: 10px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px; vertical-align: middle; letter-spacing: .1em; }
.hint { font-size: 12px; color: var(--muted); }
.picker { display: flex; align-items: center; gap: 14px; margin-top: 14px; flex-wrap: wrap; }
.preview { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.preview img { width: 96px; height: 96px; object-fit: cover; border-radius: 4px; }
.thumb-wrap { position: relative; }
.thumb-x { display: block; font-size: 11px; color: var(--muted); text-align: center; margin-top: 5px; }
.rows { list-style: none; margin: 0; padding: 0; }
.row { display: flex; gap: 14px; align-items: center; padding: 15px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row.muted { color: var(--muted); font-size: 14px; }
.thumb { width: 58px; height: 58px; object-fit: cover; border-radius: 4px; flex: none; }
.row-main { flex: 1; min-width: 0; }
.row-text { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-meta { font-size: 12px; color: var(--muted); margin-top: 5px; font-variant-numeric: tabular-nums; }
.row-actions { display: flex; gap: 8px; align-items: center; flex: none; }
.row-actions form { display: inline; }
.status { font-size: 13px; color: var(--muted); margin-left: 14px; }

@media (max-width: 520px) {
  .masthead { padding: 48px 0 32px; }
  .masthead h1 { font-size: 26px; }
  .photos { grid-template-columns: 1fr; }
  .row-actions .btn { padding: 7px 11px; font-size: 13px; }
  .wrap { padding-bottom: 64px; }
}

.ok { color: #1f7a4d; background: #eaf6ef; border: 1px solid #cfe9da; border-radius: 6px; padding: 10px 12px; font-size: 13px; margin: 0 0 14px; }
@media (prefers-color-scheme: dark) { .ok { color: #8ed0bb; background: #16261f; border-color: #24483a; } }
