/* ============================================================
   东南枝结义门户 —— 国风主题 · 朱印改版（Phase 1 · 纯皮肤）
   仅改视觉层：类名 / CSS 变量名与历史版本保持一致，JS 与 DOM 结构不动。
   回滚方式：用 rollback/2026-10-27-ui/styles.css.bak 覆盖即可。
   ============================================================ */
:root {
  /* —— 主题色（与站点 theme_color 设定一致；JS 会动态注入 --theme-color） —— */
  --theme-color: #a4342c;        /* 朱砂红（主色） */
  --theme-color-soft: #7e2620;   /* 深朱，hover / 强调 */
  --zhu: #a4342c;
  --zhu-deep: #7e2620;
  --zhu-soft: #f5e3e0;           /* 淡朱衬底 */
  --logo-url: none;              /* 后续放 Logo：--logo-url: url('/media/xxx.webp'); */

  /* —— 画面基调 —— */
  --ink: #2c2a26;                /* 墨字 */
  --ink-soft: #5a5145;           /* 次级字 */
  --ink-2: #8a8271;             /* 弱字 / 占位 */
  --ink-3: #b0a892;
  --paper: #f6f0e2;             /* 宣纸底 */
  --paper-2: #efe7d6;
  --paper-3: #e8ddc8;
  --card: #fffdf8;              /* 卡面 */
  --white: #fffdf8;
  --gold: #a9803c;
  --muted: #8a8271;
  --danger: #9e2b25;
  --ok: #4a7c59;

  --radius: 8px;                 /* 朱印：方中带圆 */
  --radius-sm: 7px;
  --shadow: 0 1px 3px rgba(60, 50, 30, .08);
  --shadow-sm: 0 1px 2px rgba(60, 50, 30, .06);
  --maxw: 1080px;
  --font-cn: "Noto Serif SC", "Songti SC", "STSong", "SimSun", "Source Han Serif SC", "PingFang SC", "Microsoft YaHei", serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-cn);
  color: var(--ink);
  background-color: var(--paper);
  /* 宣纸质感：两道极淡的暖光晕，去掉旧版密集噪点，更干净 */
  background-image:
    radial-gradient(circle at 18% 8%, rgba(255,255,255,.55), transparent 42%),
    radial-gradient(circle at 82% 92%, rgba(164,52,44,.05), transparent 45%);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--theme-color); text-decoration: none; }
img { max-width: 100%; display: block; }

/* ---------- 顶部导航 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(6px);
  background: rgba(246,240,226,.92);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { max-width: var(--maxw); margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 14px; }
.brand { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.brand .logo {
  width: 40px; height: 40px; border-radius: var(--radius); flex: 0 0 auto;
  background: var(--logo-url) center/cover no-repeat,
              linear-gradient(135deg, var(--zhu), var(--zhu-deep));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 19px;
  box-shadow: var(--shadow-sm);
}
.brand .names { display: flex; flex-direction: column; line-height: 1.15; padding-left: 10px; border-left: 3px solid var(--zhu); }
.brand .gname { font-size: 18px; font-weight: 700; letter-spacing: 2px; }
.brand .gsub { font-size: 11px; color: var(--ink-2); letter-spacing: 1px; }
.nav { display: flex; gap: 2px; margin-left: auto; flex-wrap: wrap; }
.nav a {
  padding: 8px 14px; border-radius: var(--radius); color: var(--ink-soft); font-size: 14px;
  border: 1px solid transparent; transition: .18s;
}
.nav a:hover { background: var(--paper-2); color: var(--ink); }
.nav a.active { color: var(--zhu); background: var(--zhu-soft); border-color: var(--zhu-soft); font-weight: 600; }
.nav-toggle { display: none; }

/* 用户区 */
.user-box { display: flex; align-items: center; gap: 10px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--paper-3); border: 1px solid var(--line); }
.avatar-sm { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; background: var(--paper-3); border: 1px solid var(--line); }
.btn {
  font-family: inherit; cursor: pointer; border: 1px solid var(--line);
  background: var(--white); color: var(--ink); padding: 8px 16px; border-radius: var(--radius);
  font-size: 14px; transition: .18s; display: inline-flex; align-items: center; gap: 6px;
}
.btn:hover { border-color: var(--zhu); color: var(--zhu); }
.btn-primary { background: var(--zhu); color: #fff; border-color: var(--zhu); }
.btn-primary:hover { background: var(--zhu-deep); color: #fff; border-color: var(--zhu-deep); }
.btn-ghost { background: transparent; }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-sm { padding: 5px 11px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 布局 ---------- */
.container { max-width: var(--maxw); margin: 0 auto; padding: 22px 16px 80px; }
.page-title { display: flex; align-items: baseline; gap: 12px; margin: 6px 0 18px; }
.page-title h1 { font-size: 25px; margin: 0; letter-spacing: 3px; position: relative; }
.page-title h1::after {
  content: ""; display: block; width: 44px; height: 3px; margin-top: 6px;
  background: var(--zhu); border-radius: 2px;
}
.page-title .sub { color: var(--muted); font-size: 13px; }

.grid { display: grid; gap: 18px; }
.cols-2 { grid-template-columns: 1fr 1fr; }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }

/* 卡片 */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.card-pad { padding: 16px; }
.card-hover:hover { transform: translateY(-2px); box-shadow: var(--shadow); transition: .2s; cursor: pointer; }

/* 印章风小标签 */
.seal {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px;
  color: var(--zhu); border: 1px solid var(--zhu); border-radius: 6px;
  padding: 2px 8px; background: var(--zhu-soft); letter-spacing: 1px;
}
.tag { display: inline-block; font-size: 12px; color: var(--ink-2); background: var(--paper-2); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; margin: 2px 4px 2px 0; }
.muted { color: var(--muted); }
.center { text-align: center; }
.divider { height: 1px; background: var(--line); margin: 14px 0; }

/* ---------- 首页 Hero ---------- */
.hero {
  position: relative; border-radius: var(--radius); overflow: hidden;
  background: linear-gradient(120deg, #2c2a26, #3e352a 55%, var(--zhu-deep));
  color: #fff; padding: 34px 30px; box-shadow: var(--shadow-sm);
}
.hero::after {
  content: "義"; position: absolute; right: -10px; bottom: -40px; font-size: 220px;
  color: rgba(255,255,255,.05); font-weight: 700; line-height: 1; pointer-events: none;
}
.hero .gname { font-size: 40px; letter-spacing: 8px; margin: 0 0 6px; }
.hero .gsub { font-size: 15px; color: rgba(255,255,255,.82); letter-spacing: 2px; }
.hero .intro { margin-top: 14px; max-width: 640px; color: rgba(255,255,255,.9); }
.hero-meta { margin-top: 18px; display: flex; gap: 26px; flex-wrap: wrap; }
.hero-meta .item .v { font-size: 24px; font-weight: 700; }
.hero-meta .item .k { font-size: 12px; color: rgba(255,255,255,.72); letter-spacing: 1px; }

/* 倒计时 */
.countdown { display: flex; gap: 12px; flex-wrap: wrap; }
.cd-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; min-width: 150px; box-shadow: var(--shadow-sm); }
.cd-card .name { font-size: 13px; color: var(--muted); }
.cd-card .days { font-size: 30px; font-weight: 700; color: var(--zhu); }
.cd-card .date { font-size: 12px; color: var(--muted); }

/* ---------- 日志卡片 ---------- */
.post-card { display: flex; flex-direction: column; }
.post-card .cover { aspect-ratio: 16/9; background: var(--paper-3) center/cover no-repeat; }
.post-card .body { padding: 14px 16px; flex: 1; display: flex; flex-direction: column; }
.post-card h3 { margin: 0 0 6px; font-size: 17px; letter-spacing: 1px; }
.post-card .excerpt { color: var(--ink-soft); font-size: 14px; flex: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-meta { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.post-meta .author { display: flex; align-items: center; gap: 6px; }
.pin-badge { background: var(--zhu); color: #fff; font-size: 11px; padding: 1px 7px; border-radius: 5px; }

/* ---------- 相册 ---------- */
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.album-item { position: relative; aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--paper-3); }
.album-item img { width: 100%; height: 100%; object-fit: cover; cursor: pointer; transition: .25s; }
.album-item img:hover { transform: scale(1.05); }
.album-item .play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.25); color: #fff; font-size: 34px; }
.album-item .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 6px 8px; font-size: 11px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.6)); }
/* 无封面占位（视频抽帧失败时不再出现破图） */
.album-item .ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 30px; color: var(--ink-3); cursor: pointer; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--ink-soft); margin-bottom: 6px; letter-spacing: 1px; }
.input, .textarea, select.input {
  width: 100%; font-family: inherit; font-size: 14px; color: var(--ink);
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 12px; transition: .18s;
}
.input:focus, .textarea:focus { outline: none; border-color: var(--zhu); box-shadow: 0 0 0 3px var(--zhu-soft); }
.textarea { min-height: 120px; resize: vertical; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 0; }

/* ---------- 评论 ---------- */
.comment { display: flex; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.comment .c-body { flex: 1; min-width: 0; }
.comment .c-head { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.comment .c-name { font-weight: 600; }
.comment .c-time { color: var(--muted); font-size: 12px; }
.comment .c-content { margin-top: 4px; white-space: pre-wrap; word-break: break-word; }
.comment .c-actions { margin-top: 4px; display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); }
.comment .c-actions a { cursor: pointer; }
.comment .children { margin-left: 34px; }
.sticker-img { width: 28px; height: 28px; vertical-align: middle; display: inline-block; }
.sticker-pop { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; max-height: 220px; overflow: auto; padding: 8px; }
.sticker-pop img { width: 40px; height: 40px; cursor: pointer; object-fit: contain; }

/* ---------- 成员 ---------- */
.member-card { text-align: center; padding: 18px 12px; }
.member-card .avatar { width: 64px; height: 64px; margin: 0 auto 10px; }
.member-card .mname { font-size: 16px; font-weight: 700; }
.member-card .mrole { font-size: 12px; color: var(--zhu); }
.member-card .msect { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* ---------- 表格（后台） ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line-soft); }
.table th { color: var(--muted); font-weight: 600; background: var(--paper-2); }
.table tr:hover td { background: var(--paper); }

/* ---------- 弹窗 / 提示 ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(40,30,20,.45); display: none; align-items: flex-start; justify-content: center; z-index: 100; padding: 40px 16px; overflow: auto; }
.modal-mask.open { display: flex; }
.modal { background: var(--card); border-radius: var(--radius); width: 100%; max-width: 620px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { margin: 0; font-size: 18px; letter-spacing: 1px; }
.modal-body { padding: 20px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.close-x { cursor: pointer; font-size: 22px; color: var(--muted); line-height: 1; border: none; background: none; }

.toast { position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 22px; border-radius: 999px; z-index: 200; box-shadow: var(--shadow); font-size: 14px; opacity: 0; pointer-events: none; transition: .25s; }
.toast.show { opacity: 1; }

.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs .tab { padding: 8px 16px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; font-size: 14px; }
.tabs .tab.active { color: var(--zhu); border-color: var(--zhu); font-weight: 600; }

.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.empty .big { font-size: 40px; opacity: .4; }

/* 媒体上传进度 */
.upload-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.progress { flex: 1; height: 8px; background: var(--paper-3); border-radius: 999px; overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: var(--zhu); transition: width .2s; }

/* 灯箱 */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.85); display: none; align-items: center; justify-content: center; z-index: 300; padding: 20px; }
.lightbox.open { display: flex; }
.lightbox img, .lightbox video, .lightbox audio { max-width: 100%; max-height: 88vh; border-radius: var(--radius); }
.lightbox .lb-close { position: absolute; top: 18px; right: 24px; color: #fff; font-size: 34px; cursor: pointer; }
.lightbox .lb-tip { margin-top: 12px; }
.lightbox .lb-tip a { color: var(--zhu-soft); font-size: 13px; text-decoration: underline; }

/* 头像选区裁剪 */
.cropper-card { background: var(--card); border-radius: 12px; padding: 18px; width: min(92vw, 380px); box-shadow: var(--shadow); }
.cropper-title { font-size: 15px; font-weight: 700; margin-bottom: 12px; }
.cropper-stage { position: relative; width: 100%; aspect-ratio: 1 / 1; height: auto; max-height: 60vh; margin: 0 auto; overflow: hidden; background: #000; border-radius: 8px; touch-action: none; cursor: grab; }
.cropper-stage:active { cursor: grabbing; }
.cropper-stage img { position: absolute; left: 0; top: 0; transform-origin: 0 0; max-width: none; -webkit-user-drag: none; user-select: none; }
.cropper-grid { position: absolute; inset: 0; pointer-events: none; background-image: linear-gradient(rgba(255,255,255,.25) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.25) 1px, transparent 1px); background-size: 33.33% 33.33%; opacity: .6; }
.cropper-zoomrow { display: flex; align-items: center; gap: 10px; margin: 14px 0 6px; }
.cropper-zoomrow input[type=range] { flex: 1; }
.cropper-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }

/* 响应式 */
@media (max-width: 860px) {
  .cols-3, .cols-4 { grid-template-columns: 1fr 1fr; }
  .hero .gname { font-size: 30px; }
  .nav { display: none; position: absolute; top: 62px; right: 12px; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; box-shadow: var(--shadow); }
  .nav.open { display: flex; }
  .nav-toggle { display: inline-flex; }
}
@media (max-width: 560px) {
  .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; }
  .container { padding: 16px 12px 70px; }
  .hero { padding: 24px 18px; }
  .comment .children { margin-left: 16px; }
}
