/* ============================================================
   手机阅读页样式。
   刻意与主站 public/css/view.css 保持同一套版式（顶栏 / 卡片 / 主色 #2f6fed），
   用户在两个入口之间切换时不应感到是两套界面。
   ============================================================ */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  background: #f6f7f9;
  color: #253047;
  font-size: 16px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  padding-bottom: env(safe-area-inset-bottom);
}
.wrap { max-width: 720px; margin: 0 auto; padding: 20px 16px 32px; }
h1, h2 { line-height: 1.45; }
h2 { font-size: 17px; font-weight: 650; margin: 0 0 12px; }
p { margin: 8px 0; }
a { color: #2f6fed; }

/* ---------- 顶栏 ---------- */
.hdr {
  position: sticky; top: 0; z-index: 10;
  min-height: 68px;
  background: #fff; border-bottom: 1px solid #e9edf2;
  padding: 10px 14px calc(10px + env(safe-area-inset-top)) 14px;
  display: flex; align-items: center; gap: 10px;
}
.hdr .who { flex: 1; min-width: 0; }
.hdr .who b { display: block; font-size: 15px; }
.hdr .who span { font-size: 12.5px; color: #687587; }
.hdr button { width: auto; padding: 7px 13px; font-size: 13.5px; }

/* 头像菜单：和主站同一套交互（点开 / 点外面关闭 / Esc 关闭）。 */
.me { position: relative; flex: none; }
.me button.avatar {
  position: relative;
  width: 36px; height: 36px; padding: 0; border-radius: 50%;
  background: #2f6fed; color: #fff;
  font-size: 15px; font-weight: 600; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 3px rgba(16, 24, 40, .16);
}
/* 电脑在线时才出现的小绿灯；电脑关机/入口未配置时整个元素隐藏，不留灰点。 */
.me .status-dot {
  position: absolute; right: -1px; bottom: -1px; z-index: 2;
  width: 12px; height: 12px; border-radius: 50%;
  background: #22c55e; border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(34, 197, 94, .28);
  pointer-events: none;
}
.me .status-dot[hidden] { display: none; }
.me button.avatar:active { transform: scale(.93); }
.me .me-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 30;
  width: 236px; max-width: calc(100vw - 28px);
  background: #fff; border: 1px solid #e3e6ea;
  border-radius: 12px; box-shadow: 0 8px 28px rgba(16, 24, 40, .14);
  padding: 6px;
}
.me .me-menu[hidden] { display: none; }
.me .me-head {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 8px 10px; margin-bottom: 6px;
  border-bottom: 1px solid #eef0f3;
}
.me .me-avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  background: #2f6fed; color: #fff; font-size: 17px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.me .me-who { min-width: 0; }
.me .me-who b { display: block; font-size: 14.5px; }
.me .me-who span { display: block; font-size: 12px; color: #687587; overflow-wrap: anywhere; }
.me .me-menu > button {
  display: block; width: 100%; text-align: left;
  background: transparent; color: #253047;
  font-size: 14.5px; font-weight: 500; padding: 10px; border-radius: 8px;
}
.me .me-menu > button:hover { background: #f4f6f9; }
.me .me-menu > button.danger { color: #d9453d; }

/* ---------- 状态行（保持轻，不做成卡片） ---------- */
.status-line { color: #687587; font-size: 12.5px; line-height: 1.7; margin: 0 0 4px; }
.status-line span { display: block; }
#auth-message { color: #d9453d; font-size: 13.5px; text-align: center; min-height: 0; margin: 6px 0; }

/* ---------- 登录 ---------- */
.login-box {
  max-width: 380px;
  margin: 10vh auto 0;
  background: #fff; border: 1px solid #e7ebf0; border-radius: 20px;
  padding: 32px 26px;
  box-shadow: 0 8px 30px rgba(25, 40, 65, .045);
}
.login-box .logo {
  width: 48px; height: 48px; border-radius: 14px;
  background: #2f6fed; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700; margin: 0 auto 14px;
}
.login-box h1 { font-size: 22px; text-align: center; margin: 0 0 4px; }
.login-box .sub { text-align: center; color: #687587; font-size: 13px; margin-bottom: 20px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13.5px; color: #5a6472; margin-bottom: 6px; }
input, select, textarea {
  width: 100%; padding: 12px 13px; font-size: 16px;
  border: 1px solid #e3e6ea; border-radius: 10px; background: #fff;
  font-family: inherit; color: inherit;
}
input:focus, select:focus { outline: none; border-color: #2f6fed; box-shadow: 0 0 0 3px rgba(47,111,237,.13); }
input[type="checkbox"], input[type="radio"] { width: auto; margin: 0 8px 0 0; vertical-align: middle; }
button {
  width: 100%; padding: 13px; font-size: 16px; font-weight: 600;
  border: none; border-radius: 10px; background: #2f6fed; color: #fff;
  font-family: inherit; cursor: pointer;
}
button:disabled { opacity: .6; }
button.ghost { background: #f0f3f7; color: #48556a; font-weight: 500; }
.hint { color: #687587; font-size: 12.5px; text-align: center; margin-top: 14px; line-height: 1.6; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
[hidden] { display: none !important; }

/* ---------- 搜索 ---------- */
.search-row { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.search-row input { min-width: 0; flex: 1; }
.search-row button { width: auto; flex: none; padding: 12px 16px; font-size: 14.5px; }
#query-message, #content-message { color: #687587; font-size: 12.5px; min-height: 18px; margin: 4px 0 10px; }

/* ---------- 卡片 ---------- */
.notice-item {
  background: #fff; border: 1px solid #e7ebf0; border-radius: 16px;
  padding: 18px; margin-bottom: 14px;
  box-shadow: 0 2px 6px rgba(25, 40, 65, .025);
}
.notice-open {
  display: block; width: 100%; background: none; color: #253047;
  padding: 0; margin: 0; border-radius: 0; text-align: left;
  font-size: 16px; font-weight: 650; line-height: 1.65; overflow-wrap: anywhere;
}
.notice-open:hover { color: #2f6fed; }
.notice-meta { font-size: 12.5px; margin: 8px 0 0; color: #687587; }
.notice-excerpt { margin: 10px 0 0; color: #465163; font-size: 15px; overflow-wrap: anywhere; }
.notice-content { white-space: pre-wrap; overflow-wrap: anywhere; color: #465163; font-size: 15px; }

/* 详情单独做成卡片；列表容器本身不套卡片。 */
#notice-detail, #content-detail {
  background: #fff; border: 1px solid #e7ebf0; border-radius: 16px;
  padding: 18px; margin: 0 0 14px;
  box-shadow: 0 2px 6px rgba(25, 40, 65, .025);
}
#close-detail, #content-close { width: auto; margin: 0 0 16px; padding: 8px 14px; font-size: 13.5px; }
#detail-title, #content-title { margin: 0 0 10px; }
#detail-meta { font-size: 12.5px; color: #687587; margin: 0 0 12px; }

/* ---------- 任务 / 帖子 / 照片 ---------- */
.content-tabs {
  display: flex; gap: 4px; background: #edf0f4;
  border-radius: 12px; padding: 4px; margin: 0 0 14px;
}
.content-tabs button {
  flex: 1; width: auto; min-height: 42px; padding: 9px;
  background: transparent; color: #5a6472;
  font-size: 14.5px; font-weight: 500; border-radius: 9px;
}
.content-tabs button.on { background: #fff; color: #245ac1; font-weight: 600; box-shadow: 0 1px 4px rgba(25, 40, 65, .06); }
.more { margin-top: 4px; }
.file-links { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.file-links a { color: #245ac1; overflow-wrap: anywhere; }
.task-values { margin: 8px 0; overflow-wrap: anywhere; }
.task-values input[type=checkbox] { width: auto; margin: 0 6px 0 0; }
.history-photo {
  display: block; max-width: 100%; max-height: 320px; object-fit: contain;
  border-radius: 12px; margin: 12px 0; background: #f6f7f9;
}

/* 主站入口：做成一条安静的脚注链接，不强调“当前不在主站”。 */
.note { margin: 18px 0 0; text-align: center; }
#write-entry {
  display: inline-block; padding: 9px 16px; border-radius: 999px;
  background: #eef2f7; color: #245ac1; font-size: 13.5px; font-weight: 600;
  text-decoration: none; overflow-wrap: anywhere;
}
#write-entry:hover { background: #e4ebf7; }

button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 2px solid #2f6fed; outline-offset: 3px;
}
@media (max-width: 480px) {
  .wrap { padding: 16px 14px 28px; }
  .login-box { margin: 8vh 0 24px; max-width: none; padding: 26px 20px; }
  .notice-item, #notice-detail, #content-detail { padding: 16px; border-radius: 14px; }
  .search-row { flex-wrap: wrap; }
  .search-row input { flex-basis: 100%; }
  .search-row button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
