/* ============ 爱机日报 LOVE PHONE DAILY ============ */

@font-face {
  font-family: 'Ma Shan Zheng';
  src: url('../fonts/MaShanZheng-Regular.ttf') format('truetype');
  font-display: swap;
}
@font-face {
  font-family: 'Zhi Mang Xing';
  src: url('../fonts/ZhiMangXing-Regular.ttf') format('truetype');
  font-display: swap;
}
@font-face {
  font-family: 'Liu Jian Mao Cao';
  src: url('../fonts/LiuJianMaoCao-Regular.ttf') format('truetype');
  font-display: swap;
}
@font-face {
  font-family: 'Long Cang';
  src: url('../fonts/LongCang-Regular.ttf') format('truetype');
  font-display: swap;
}

:root {
  --ink: #26231f;
  --paper: #faf6ec;
  --red: #b83227;
  --gold: #e7c27d;
  --hand: 'Ma Shan Zheng', 'KaiTi', 'STKaiti', serif;
  --hand2: 'Zhi Mang Xing', 'KaiTi', 'STKaiti', serif;
  --hand3: 'Long Cang', 'KaiTi', 'STKaiti', serif;
  --wild: 'Liu Jian Mao Cao', 'KaiTi', 'STKaiti', serif;
  --sans: 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  --line-h: 44px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: #efece4;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, textarea, select { font-family: inherit; }

.f-ma   { font-family: var(--hand); }
.f-zhi  { font-family: var(--hand2); }
.f-long { font-family: var(--hand3); }
.f-liu  { font-family: var(--wild); }

/* ---------------- 顶部导航 ---------------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(16px, 4vw, 48px); height: 58px;
  background: rgba(12, 11, 9, .55);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  color: #f3eee2;
}
.nav .brand { display: flex; align-items: baseline; gap: 12px; }
.nav .brand .cn { font-family: var(--hand); font-size: 24px; letter-spacing: 2px; }
.nav .brand .en { font-size: 10px; letter-spacing: 4px; opacity: .65; }
.nav .links { display: flex; gap: clamp(14px, 3vw, 34px); align-items: center; }
.nav .links a { font-family: var(--hand); font-size: 18px; opacity: .75; letter-spacing: 2px; transition: opacity .2s; }
.nav .links a:hover, .nav .links a.on { opacity: 1; }
.nav .links a.admin-link { font-size: 12px; font-family: var(--sans); letter-spacing: 1px; opacity: .4; border: 1px solid rgba(255,255,255,.25); border-radius: 999px; padding: 3px 12px; }
.nav .links a.admin-link:hover { opacity: .9; }

/* ---------------- 签名墙 ---------------- */
.wall {
  position: relative; height: 100svh; min-height: 540px;
  background: #0a0908; overflow: hidden; color: #efe8d8;
}
.wall::after { /* 暗角 */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(0,0,0,.75));
}
.wall .glow {
  position: absolute; width: 46vw; height: 46vw; border-radius: 50%;
  background: radial-gradient(circle, rgba(233,190,110,.16), transparent 65%);
  filter: blur(10px); pointer-events: none;
  animation: breathe 7s ease-in-out infinite;
}
.wall .glow.g1 { top: -12%; left: -8%; }
.wall .glow.g2 { bottom: -18%; right: -6%; animation-delay: -3.5s; }
@keyframes breathe { 0%,100% { opacity:.55; transform: scale(1);} 50% { opacity:1; transform: scale(1.12);} }

#sigField { position: absolute; inset: 0; }
#sigField span {
  position: absolute; white-space: nowrap; cursor: default;
  transform: translate(-50%, -50%) rotate(var(--r, 0deg));
  transition: opacity .35s, color .35s, text-shadow .35s;
  user-select: none;
}
#sigField span:hover { opacity: 1 !important; color: #ffd98a; text-shadow: 0 0 14px rgba(255, 210, 130, .45); }

.wall-center {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  text-align: center; z-index: 5; pointer-events: none; width: min(90vw, 900px);
}
.wall-center::before {
  content: ''; position: absolute; inset: -70px -60px; z-index: -1;
  background: radial-gradient(closest-side, rgba(6,5,4,.92) 30%, transparent);
}
.wall-center .tagline {
  font-family: var(--hand); font-size: clamp(19px, 3vw, 32px);
  letter-spacing: .32em; text-indent: .32em; color: #f5efe1;
  text-shadow: 0 2px 18px rgba(0,0,0,.8);
}
.wall-center .logo { margin-top: 34px; display: inline-flex; flex-direction: column; align-items: center; gap: 10px; }
.wall-center .logo .mark {
  font-family: var(--hand); font-size: clamp(22px, 2.6vw, 30px); line-height: 1;
  padding: 12px 14px; border: 2px solid rgba(245, 239, 225, .92); border-radius: 6px;
  color: #f5efe1; letter-spacing: 2px;
}
.wall-center .logo .en { font-size: 11px; letter-spacing: 6px; text-indent: 6px; opacity: .8; }

.scroll-hint {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%);
  z-index: 6; font-family: var(--hand); font-size: 15px; letter-spacing: 3px;
  opacity: .55; animation: bob 2.4s ease-in-out infinite; pointer-events: none;
}
@keyframes bob { 0%,100% { transform: translate(-50%, 0);} 50% { transform: translate(-50%, 7px);} }

@media (prefers-reduced-motion: reduce) {
  .wall .glow, .scroll-hint { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------------- 作业本（评论区） ---------------- */
.sheet { max-width: 900px; margin: 0 auto; padding: clamp(28px, 6vw, 72px) clamp(16px, 4vw, 32px); }

.paper {
  position: relative;
  background: #fbf7ee;
  background-image: repeating-linear-gradient(
    to bottom, transparent 0, transparent calc(var(--line-h) - 1px),
    rgba(110, 145, 200, .28) calc(var(--line-h) - 1px), rgba(110, 145, 200, .28) var(--line-h));
  border-radius: 6px;
  box-shadow: 0 18px 50px rgba(40, 34, 20, .16), 0 2px 8px rgba(40, 34, 20, .08);
  padding: clamp(28px, 5vw, 56px) clamp(20px, 6vw, 72px) clamp(36px, 6vw, 64px);
}
.paper::before { /* 装订孔 */
  content: ''; position: absolute; left: 14px; top: 0; bottom: 0; width: 1px;
  background: rgba(184, 50, 39, .25);
}
.paper-title {
  font-family: var(--hand); color: var(--red); text-align: center;
  font-size: clamp(34px, 6vw, 48px); letter-spacing: .9em; text-indent: .9em;
  margin-bottom: calc(var(--line-h) * .6);
}
.paper-title::after {
  content: ''; display: block; width: min(240px, 60%); height: 3px;
  margin: 10px auto 0; background: var(--red); opacity: .75; border-radius: 2px;
}

.cmt { margin: 0 0 var(--line-h); }
.cmt .txt {
  font-size: clamp(20px, 3.4vw, 25px); line-height: var(--line-h); color: var(--ink);
  white-space: pre-wrap; word-break: break-word;
}
.cmt .meta {
  display: flex; justify-content: flex-end; align-items: baseline; gap: 12px;
  line-height: var(--line-h);
}
.cmt .meta .who { font-family: var(--hand2); font-size: 20px; color: #413c35; }
.cmt .meta .who::before { content: '——'; }
.cmt .meta .time { font-size: 11px; color: #a49c8c; font-family: var(--sans); }

.cmt-empty { text-align: center; font-family: var(--hand); font-size: 20px; color: #9b927e; line-height: calc(var(--line-h) * 2); }

/* 留言表单 */
.cmt-form { margin-top: calc(var(--line-h) * .8); }
.cmt-form .row { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; line-height: var(--line-h); }
.cmt-form label { font-family: var(--hand); font-size: 19px; color: #6b6353; white-space: nowrap; }
.cmt-form input, .cmt-form textarea {
  border: none; outline: none; background: transparent;
  border-bottom: 1.5px dashed rgba(60, 50, 30, .4);
  font-family: var(--hand); font-size: 20px; color: var(--ink);
  padding: 4px 2px; min-width: 0;
}
.cmt-form input { width: 180px; }
.cmt-form textarea { width: 100%; resize: vertical; min-height: calc(var(--line-h) * 2); line-height: var(--line-h); border-bottom: none; }
.cmt-form textarea:focus, .cmt-form input:focus { border-bottom-color: var(--red); }
.cmt-form .actions { display: flex; justify-content: flex-end; margin-top: 6px; }

.btn {
  display: inline-block; border: 1.5px solid var(--ink); border-radius: 999px;
  background: transparent; color: var(--ink); cursor: pointer;
  padding: 7px 26px; font-size: 14px; letter-spacing: 2px;
  transition: background .2s, color .2s, border-color .2s;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn-red { border-color: var(--red); color: var(--red); font-family: var(--hand); font-size: 18px; padding: 5px 26px; }
.btn-red:hover { background: var(--red); color: #fff; }
.btn-ghost { border-color: rgba(0,0,0,.25); color: #6c6455; font-size: 12px; padding: 5px 16px; }
.btn-ghost:hover { background: rgba(0,0,0,.75); color: #fff; border-color: transparent; }

.form-hint { font-size: 12px; color: #a49c8c; text-align: right; margin-top: 8px; min-height: 16px; }
.form-hint.err { color: var(--red); }

/* ---------------- 报刊厅 / 阅读器 ---------------- */
.page-light { min-height: 100svh; background: #efece4; }
.masthead { text-align: center; padding: 96px 16px 26px; }
.masthead .cn { font-family: var(--hand); font-size: clamp(40px, 7vw, 64px); letter-spacing: .18em; }
.masthead .en { font-size: 11px; letter-spacing: 8px; text-indent: 8px; color: #8d8574; margin-top: 4px; }
.masthead .rule { width: min(680px, 86%); margin: 18px auto 0; border-top: 3px double rgba(60, 50, 30, .55); }

.issue-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 26px; max-width: 1080px; margin: 30px auto 80px; padding: 0 clamp(16px, 4vw, 32px);
}
.issue-card {
  position: relative; background: #fdfaf2; border-radius: 4px; overflow: hidden;
  aspect-ratio: 3 / 4.15; box-shadow: 0 10px 28px rgba(40, 34, 20, .16);
  transition: transform .25s, box-shadow .25s; cursor: pointer;
  display: flex; flex-direction: column;
}
.issue-card:hover { transform: translateY(-5px); box-shadow: 0 20px 44px rgba(40, 34, 20, .24); }
.issue-card img.cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.issue-card .cover-css {
  flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 22px 16px 16px; background:
    linear-gradient(#fdfaf2, #f6f1e3);
  border-top: 4px solid var(--red);
}
.issue-card .cover-css .m { font-family: var(--hand); color: var(--red); font-size: 26px; letter-spacing: 4px; }
.issue-card .cover-css .no { font-size: 11px; color: #948b78; letter-spacing: 2px; margin-top: 4px; }
.issue-card .cover-css .t { font-family: var(--hand); font-size: 24px; margin: auto 0; color: #33302a; padding: 0 6px; }
.issue-card .cover-css .d { font-size: 11px; color: #948b78; letter-spacing: 1px; }
.issue-card .lock-badge {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  background: rgba(15, 13, 10, .78); color: #f0e8d6; font-size: 11px;
  letter-spacing: 1px; padding: 4px 10px; border-radius: 999px; backdrop-filter: blur(4px);
}
.issue-empty { grid-column: 1 / -1; text-align: center; font-family: var(--hand); font-size: 22px; color: #9b927e; padding: 70px 0; }

/* 阅读视图 */
.reader-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  max-width: 980px; margin: 0 auto; padding: 84px clamp(16px, 4vw, 32px) 8px;
}
.reader-bar .back { font-family: var(--hand); font-size: 18px; color: #6c6455; }
.reader-bar .back:hover { color: var(--red); }
.reader-bar .lock-toggle { font-size: 12px; color: #6c6455; background: none; border: 1px solid rgba(0,0,0,.2); border-radius: 999px; padding: 4px 14px; cursor: pointer; }
.reader-bar .lock-toggle:hover { color: var(--red); border-color: var(--red); }

.reader-head { text-align: center; padding: 8px 16px 26px; }
.reader-head h1 { font-family: var(--hand); font-size: clamp(30px, 5vw, 44px); }
.reader-head .sub { font-size: 12px; color: #8d8574; letter-spacing: 2px; margin-top: 6px; }
.reader-head .desc { font-family: var(--hand); color: #57503f; font-size: 19px; margin-top: 12px; }

.pages { max-width: 900px; margin: 0 auto; padding: 0 clamp(12px, 3vw, 32px); }
.pages img.page, .pages iframe.pdf {
  width: 100%; border: none; background: #fff;
  box-shadow: 0 14px 40px rgba(40, 34, 20, .18);
  margin-bottom: 26px; border-radius: 3px;
}
.pages iframe.pdf { height: 84vh; }
.pages .file-note { text-align: center; font-family: var(--hand); color: #9b927e; font-size: 19px; padding: 60px 0; }

.gate {
  max-width: 380px; margin: 40px auto 120px; text-align: center;
  background: #fbf8f0; border-radius: 10px; padding: 44px 30px 38px;
  box-shadow: 0 16px 44px rgba(40, 34, 20, .16);
}
.gate .icon { font-size: 40px; }
.gate h2 { font-family: var(--hand); font-size: 26px; margin: 10px 0 4px; }
.gate p { font-size: 13px; color: #8d8574; }
.gate input {
  width: 100%; margin: 22px 0 16px; border: none; outline: none; background: transparent;
  border-bottom: 2px dashed rgba(60,50,30,.35); text-align: center;
  font-size: 22px; letter-spacing: 6px; padding: 6px; font-family: var(--hand);
}
.gate input:focus { border-bottom-color: var(--red); }
.gate .err { color: var(--red); font-size: 13px; min-height: 18px; margin-top: 10px; }
.gate.shake { animation: shake .4s; }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-8px)} 50%{transform:translateX(7px)} 75%{transform:translateX(-4px)} }

.reader-nav { display: flex; justify-content: space-between; max-width: 900px; margin: 10px auto 90px; padding: 0 clamp(16px, 4vw, 32px); }
.reader-nav a { font-family: var(--hand); font-size: 18px; color: #6c6455; }
.reader-nav a:hover { color: var(--red); }

/* ---------------- 关于页 ---------------- */
.about-body { font-size: 16.5px; line-height: 2; color: #3d382e; }
.about-body p { margin-bottom: 14px; }
.about-body b { color: var(--red); }
.about-sign { font-family: var(--hand2); text-align: right; font-size: 22px; color: #413c35; margin-top: 26px; }

/* ---------------- 管理后台 ---------------- */
.admin-wrap { max-width: 980px; margin: 0 auto; padding: 92px clamp(14px, 3vw, 28px) 100px; }
.admin-wrap h1 { font-family: var(--hand); font-size: 34px; margin-bottom: 22px; }
.card {
  background: #fffdf7; border-radius: 12px; padding: 24px 26px; margin-bottom: 26px;
  box-shadow: 0 8px 26px rgba(40, 34, 20, .1);
}
.card h2 { font-family: var(--hand); font-size: 24px; margin-bottom: 16px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card h2 .spacer { flex: 1; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: #7a7261; margin-bottom: 6px; letter-spacing: 1px; }
.field input[type=text], .field input[type=password], .field input[type=number], .field input[type=date], .field textarea, .field select {
  width: 100%; border: 1px solid #ddd5c2; border-radius: 8px; background: #fffefb;
  padding: 9px 12px; font-size: 14px; outline: none; color: var(--ink);
}
.field textarea { font-family: var(--sans); min-height: 90px; resize: vertical; line-height: 1.7; }
.field textarea.big { min-height: 220px; }
.field input:focus, .field textarea:focus { border-color: var(--red); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 14px; }
@media (max-width: 640px) { .grid2, .grid4 { grid-template-columns: 1fr; } }

.login-box { max-width: 360px; margin: 12vh auto 0; text-align: center; }
.login-box .mark { font-family: var(--hand); font-size: 44px; color: var(--red); letter-spacing: 6px; }
.login-box .en { font-size: 10px; letter-spacing: 5px; color: #948b78; margin: 4px 0 30px; }
.login-box input {
  width: 100%; border: none; border-bottom: 2px dashed rgba(60,50,30,.35); background: transparent;
  text-align: center; font-size: 20px; padding: 8px; outline: none; margin-bottom: 22px; letter-spacing: 4px;
}
.login-box input:focus { border-bottom-color: var(--red); }
.login-box .err { color: var(--red); font-size: 13px; min-height: 18px; margin-bottom: 8px; }

.issue-row { border: 1px solid #e8e0cd; border-radius: 10px; padding: 14px 16px; margin-bottom: 12px; background: #fffefb; }
.issue-row .head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; cursor: pointer; }
.issue-row .head .no { font-family: var(--hand); color: var(--red); font-size: 19px; }
.issue-row .head .t { font-family: var(--hand); font-size: 19px; }
.issue-row .head .meta { font-size: 12px; color: #948b78; }
.issue-row .head .spacer { flex: 1; }
.issue-row .detail { margin-top: 14px; border-top: 1px dashed #e0d8c4; padding-top: 14px; display: none; }
.issue-row.open .detail { display: block; }
.file-li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px dashed #eee6d2; font-size: 13px; }
.file-li .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-li .tag { font-size: 11px; color: #948b78; border: 1px solid #e0d8c4; border-radius: 4px; padding: 1px 6px; }
.mini-btn { border: 1px solid #d8d0bb; background: #fff; border-radius: 6px; font-size: 12px; padding: 3px 10px; cursor: pointer; color: #57503f; }
.mini-btn:hover { border-color: var(--red); color: var(--red); }
.mini-btn.warn:hover { border-color: #a22; color: #a22; }

.cmt-admin-li { display: flex; gap: 10px; align-items: baseline; padding: 8px 0; border-bottom: 1px dashed #eee6d2; font-size: 13px; }
.cmt-admin-li .who { font-weight: 600; white-space: nowrap; }
.cmt-admin-li .txt { flex: 1; color: #57503f; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmt-admin-li .tm { color: #a49c8c; font-size: 11px; white-space: nowrap; }
.admin-sub { font-size: 13px; color: #8d8574; margin: 10px 0 6px; letter-spacing: 1px; }

/* ---------------- 富文本编辑器（后台） ---------------- */
.ed { border: 1px solid #ddd5c2; border-radius: 8px; background: #fffefb; overflow: hidden; }
.ed-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 6px 8px; border-bottom: 1px solid #eee6d2; background: #faf7ee; }
.ed-bar button { border: none; background: transparent; cursor: pointer; font-size: 13px; padding: 4px 9px; border-radius: 6px; color: #57503f; font-family: var(--sans); }
.ed-bar button:hover { background: #efe9da; color: var(--red); }
.ed-sep { width: 1px; height: 16px; background: #e0d8c4; margin: 0 5px; }
.ed-area {
  min-height: 180px; max-height: 460px; overflow: auto;
  padding: 14px 16px; font-size: 15.5px; line-height: 1.9; outline: none;
  font-family: KaiTi, STKaiti, 'Noto Serif SC', serif; color: #2c2822;
}
.ed-area:empty::before { content: attr(data-placeholder); color: #b9b09c; pointer-events: none; }
.ed-area:focus { box-shadow: inset 0 0 0 2px rgba(184, 50, 39, .14); }
.ed-area img { max-width: 100%; border-radius: 4px; }
.ed-area blockquote { border-left: 3px solid var(--red); padding: 2px 0 2px 12px; margin: .8em 0; color: #6c6455; }

/* ---------------- 报纸正文（阅读器） ---------------- */
.article-paper { padding: clamp(28px, 5vw, 64px) clamp(20px, 6vw, 72px); }
.article-body { font-family: KaiTi, STKaiti, 'Noto Serif SC', serif; font-size: 19px; line-height: 2.2; color: #2c2822; }
.article-body p { margin: 0 0 1.1em; text-indent: 2em; }
.article-body h2 { font-family: var(--hand); font-size: clamp(26px, 4.4vw, 34px); color: var(--red); text-align: center; letter-spacing: 6px; margin: .4em 0 .9em; text-indent: 0; }
.article-body h3 { font-family: var(--hand); font-size: 24px; margin: 1em 0 .4em; text-indent: 0; }
.article-body img { display: block; max-width: 100%; height: auto; margin: 20px auto; border-radius: 4px; box-shadow: 0 10px 30px rgba(40, 34, 20, .18); }
.article-body blockquote { border-left: 3px solid var(--red); padding: 4px 0 4px 14px; margin: 1em 0; color: #6c6455; text-indent: 0; }
.article-body ul, .article-body ol { padding-left: 2em; margin: 0 0 1.1em; }
.article-body li { margin-bottom: .3em; }
.article-body hr { border: none; border-top: 1px dashed rgba(60, 50, 30, .35); width: 62%; margin: 1.6em auto; }
.article-body a { color: var(--red); text-decoration: underline; }

/* ---------------- 页脚 / 其它 ---------------- */
.footer {
  background: #0c0b09; color: #cfc6b2; text-align: center;
  padding: 44px 16px 50px; font-size: 12px; letter-spacing: 2px;
}
.footer .fn { font-family: var(--hand); font-size: 20px; color: #efe8d8; letter-spacing: 4px; margin-bottom: 8px; }
.footer .fe { font-size: 9px; letter-spacing: 5px; opacity: .5; margin-bottom: 14px; }

.section-gap { height: 40px; }
.page-main { min-height: calc(100svh - 58px); }
