/*
Theme Name: 学生萌え (Student Moe)
Theme URI: https://example.com/
Author: 学生萌え
Description: 学生萌え 网站主题 —— 首页（区域1~5）、搜索页、个人空间页、文章页、登录页、留言墙、我的关注。
Version: 1.0
Requires at least: 6.0
Tested up to: 6.7
License: GNU General Public License v2 or later
Text Domain: student-moe
*/

/* ---------- 基础 ---------- */
html, body { margin: 0; padding: 0; }
body {
  background: #f1f5f9; color: #0f172a;
  font-family: "Noto Sans JP", "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, sans-serif;
}
img { max-width: 100%; height: auto; }

:root {
  --sky: #38bdf8; --sky-deep: #0ea5e9; --ink: #0f172a;
  --muted: #64748b; --line: #e2e8f0; --yellow: #f59e0b;
}

/* ---------- 后台管理工具条（登录管理员时）/ 屏幕阅读器 ---------- */
body.admin-bar .r1 { top: 32px; }
body.admin-bar { height: calc(100vh - 32px); }
@media screen and (max-width: 782px) {
  body.admin-bar .r1 { top: 46px; }
  body.admin-bar { height: calc(100vh - 46px); }
}
.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px);
}
/* ---------- 与 WordPress 输出对接的补充样式 ---------- */
/* 区域3.1 菜单：深色按钮（与原型一致） */
.menu a {
  flex: 1; text-align: center; font: inherit; font-weight: 700; font-size: 13px;
  color: #fff; background: #0f172a; border-radius: 9px; padding: 6px;
  text-decoration: none; transition: .18s;
}
.menu a:hover { background: var(--sky); color: #fff; }
/* 头像：换成真实头像图片时保持圆形 */
.r1 .avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.c1111 img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.b2mid .ava img, .item .face img, .author .face img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
/* 登录页：表单保持 d1 卡片原有排版 */
.d1 form { display: flex; flex-direction: column; gap: 18px; }
.tip a { color: #0284c7; text-decoration: none; }
.tip a:hover { text-decoration: underline; }
/* 搜索页 b1 分类（现在是 <a>） */
.b1 a {
  position: relative; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer;
  color: #64748b; text-decoration: none; transition: .18s; white-space: nowrap;
}
.b1 a:hover { color: var(--sky-deep); }
.b1 a.on { color: var(--sky-deep); }
.b1 a.on::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -5px; height: 2px;
  border-radius: 2px; background: var(--sky);
}
/* 空间页背景：更换按钮与待审核提示（纯文本风格） */
.c121 .bg-change {
  position: absolute; right: 16px; bottom: 12px; color: #fff; font-size: 12px;
  font-weight: 700; cursor: pointer; text-decoration: underline; opacity: .92;
}
.c121 .bg-change:hover { opacity: 1; }
.c121 .bg-pending {
  position: absolute; right: 16px; top: 12px; background: rgba(15, 23, 42, .55); color: #fff;
  font-size: 11px; border-radius: 999px; padding: 3px 10px;
}

/* 空状态里的链接 */
.empty a { color: #0284c7; text-decoration: none; }

.sm-msg { padding: 10px 14px; border-radius: 10px; font-size: 13px; line-height: 1.7; margin: 10px 0; }
.sm-msg.err { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }
.sm-msg.ok  { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }

/* ================= 移动端适配（页眉 / 页脚） ================= */
@media (max-width: 1024px) {
  .r1 { height: auto !important; flex: 0 0 auto !important; flex-wrap: wrap; padding: 10px 14px; gap: 10px; }
  .r1 .logo { width: 46px; height: 46px; flex: 0 0 46px; font-size: 17px; border-radius: 10px; }
  .r1 .sitname { font-size: 20px; padding: 2px 6px; }
  .r1 .search { order: 3; flex: 1 0 100%; padding: 5px 6px 5px 14px; }
  .r1 .search input { font-size: 13.5px; }
  .r1 .search button { padding: 7px 16px; font-size: 13px; }
  .r1 .user { flex-direction: row; align-items: center; gap: 8px; margin-left: auto; }
  .r1 .avatar { width: 40px; height: 40px; font-size: 16px; }
  .r1 .uname { font-size: 11px; padding: 2px 6px; }
  .r4 { flex-wrap: wrap; padding: 14px; gap: 10px; }
  .r4 .logo { font-size: 18px; }
  .r4 .beian { flex: 1 0 100%; order: 3; text-align: left; }
  .r4 .contact { text-align: left; margin-left: auto; }
}
@media (max-width: 480px) {
  .r1 { padding: 8px 10px; gap: 8px; }
  .r1 .sitname { font-size: 17px; }
  .r1 .search { padding-left: 12px; }
  .r4 { font-size: 12px; }
}

/* ================= 移动端兜底：不允许横向溢出 ================= */
@media (max-width: 1024px) {
  html, body { max-width: 100%; overflow-x: hidden; }
  .r1 .search, .r1 .search input { min-width: 0; }
  .r4 { position: relative !important; margin-top: auto; }      /* 手机上页脚跟随内容，不吸在屏幕底部（不能用 static，否则页脚背景层会失去参照物） */
  .r4 .beian, .r4 .contact { overflow-wrap: anywhere; }
  .card, .cards, .panel, .col, .row, .item, .msg, .post, .c13, .b2-scroll { min-width: 0; }
  .card .meta .t, .wall .msg, .post .ttl, .row h3, .row p,
  .card .cover .c-title, .paper h1 { overflow-wrap: anywhere; word-break: break-word; }
}

/* ================= 桌面端：页眉搜索框不要拉太长 ================= */
@media (min-width: 1025px) {
  .r1 .search { max-width: 520px; margin-left: auto; margin-right: auto; }
}

/* ================= 网站 logo 换成图片时 ================= */
.r1 .logo, .r4 .logo, .d11 { overflow: hidden; }
.r1 .logo img, .r4 .logo img, .d11 img {
  width: 100%; height: 100%; display: block; object-fit: cover; border-radius: inherit;
}
