/* =========================================================
 * 回忆时光机 Memoir - 统一蓝紫玻璃主题（PC 门户 & H5 共用） v2
 * 方向：更时尚（精致渐变 / 玻璃卡片 / 柔和阴影 / 圆角 / 排版）
 *       更流畅（过渡 / 悬浮 / 微交互）
 *       骨架屏（页面加载骨架 + 图片占位）
 * 设计令牌与 H5 保持一致，保证全站风格统一。
 * ========================================================= */

/* Alpine 初始化前隐藏，避免 {{ }} / 未绑定内容闪现 */
[x-cloak] { display: none !important; }
/* 记录正文保留换行与长词折行 */
.m-item .txt { white-space: pre-wrap; word-break: break-word; }

:root {
  --brand: #4f6bff;
  --brand-2: #7c5cff;
  --brand-3: #18c8ff;
  --accent: #ff8fc7;
  --glass: rgba(255, 255, 255, .72);
  --glass-2: rgba(255, 255, 255, .5);
  --glass-bd: rgba(120, 130, 170, .16);
  --ink: #1b2138;
  --ink-2: #515a72;
  --sub: #9399ad;
  --line: rgba(120, 130, 170, .16);
  --card: #ffffff;
  --ok: #16a34a;
  --warn: #d97706;
  --danger: #ef4444;
  --r-xl: 26px;
  --r-lg: 20px;
  --r-md: 15px;
  --r-sm: 11px;
  --shadow: 0 8px 28px rgba(40, 52, 110, .08);
  --shadow-lg: 0 18px 48px rgba(40, 52, 110, .14);
  --glow: 0 10px 30px rgba(79, 107, 255, .22);
  --brand-grad: linear-gradient(92deg, var(--brand), var(--brand-2) 55%, var(--brand-3));
  --accent-grad: linear-gradient(92deg, var(--brand-2), var(--accent));
  --header-h: 60px;
  --footer-h: 56px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ============ PC 门户骨架 ============ */
body.m-memoir {
  background:
    radial-gradient(60% 50% at 10% 0%, rgba(124, 92, 255, .14), transparent 60%),
    radial-gradient(52% 46% at 94% 6%, rgba(24, 200, 255, .14), transparent 60%),
    radial-gradient(40% 40% at 50% 100%, rgba(255, 143, 199, .08), transparent 60%),
    radial-gradient(130% 90% at 50% -10%, #f3f6ff 0%, #e9edfb 46%, #e4e9f7 100%);
  background-attachment: fixed;
  min-height: 100vh;
  color: var(--ink);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.m-memoir a { color: inherit; text-decoration: none; }

/* 顶部导航（玻璃拟态） */
.m-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .78);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--glass-bd);
  box-shadow: 0 1px 14px rgba(40, 52, 110, .06);
}
.m-header-in {
  max-width: 1120px; margin: 0 auto; height: var(--header-h);
  display: flex; align-items: center; gap: 18px; padding: 0 18px;
}
.m-brand {
  font-size: 18px; font-weight: 800; letter-spacing: .3px;
  background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  display: flex; align-items: center; gap: 8px; white-space: nowrap;
}
.m-brand .dot {
  width: 22px; height: 22px; border-radius: 7px; background: var(--brand-grad);
  box-shadow: var(--glow); position: relative; overflow: hidden;
}
.m-brand .dot::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, .6) 50%, transparent 70%);
  transform: translateX(-120%); animation: sheen 3.4s var(--ease) infinite;
}
@keyframes sheen { 0% { transform: translateX(-120%); } 60%, 100% { transform: translateX(120%); } }
.m-nav { display: flex; align-items: center; gap: 4px; margin-left: 8px; flex: 1; }
.m-nav a {
  padding: 8px 14px; border-radius: 12px; font-weight: 600; color: var(--ink-2);
  font-size: 14.5px; transition: background .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
  position: relative;
}
.m-nav a:hover { background: #f1f3fb; color: var(--ink); transform: translateY(-1px); }
.m-nav a.active { background: rgba(79, 107, 255, .12); color: var(--brand); }
.m-header .m-user {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px 6px 6px; border-radius: 999px;
  background: #f1f3fb; border: 1px solid var(--line); transition: .2s var(--ease);
}
.m-header .m-user:hover { box-shadow: var(--shadow); }
.m-header .m-user img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.m-header .m-user .nm { font-size: 13.5px; font-weight: 600; color: var(--ink-2); max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 内容容器 */
.m-container { max-width: 1120px; margin: 0 auto; padding: 26px 18px 40px; }

/* 底部 */
.m-footer {
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(180%) blur(18px); -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-top: 1px solid var(--glass-bd); color: var(--sub); font-size: 13px;
}
.m-footer-in { max-width: 1120px; margin: 0 auto; height: var(--footer-h); display: flex; align-items: center; justify-content: center; padding: 0 18px; }

/* ============ 通用组件 ============ */
.m-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--shadow); padding: 20px; margin-bottom: 18px;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease);
}
.m-card:hover { box-shadow: var(--shadow-lg); }
.m-card h1, .m-card h2, .m-card h3, .m-card h4, .m-card h5, .m-card h6 { margin-top: 0; }
.m-section-title {
  display: flex; align-items: center; gap: 8px; margin: 4px 0 16px;
  font-size: 17px; font-weight: 800; color: var(--ink);
}
.m-section-title::before {
  content: ""; width: 4px; height: 18px; border-radius: 4px; background: var(--brand-grad);
  box-shadow: var(--glow);
}

/* 按钮 */
.m-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: 12px; border: 1px solid var(--line);
  background: #fff; color: var(--ink-2); font-weight: 700; cursor: pointer;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease), filter .18s var(--ease), color .18s var(--ease);
  font-size: 14.5px;
}
.m-btn:hover { background: #f6f8ff; transform: translateY(-1px); }
.m-btn:active { transform: translateY(0); }
.m-btn-primary { background: var(--brand-grad); color: #fff; border: none; box-shadow: var(--glow); }
.m-btn-primary:hover { filter: brightness(1.06); color: #fff; box-shadow: 0 14px 34px rgba(79, 107, 255, .34); }
.m-btn-block { width: 100%; }
.m-btn-ghost { background: transparent; }
.m-btn-danger { color: var(--danger); border-color: rgba(239, 68, 68, .4); }
.m-btn-danger:hover { background: rgba(239, 68, 68, .08); }

/* 表单 */
.m-field { margin-bottom: 16px; }
.m-label { display: block; font-size: 13.5px; font-weight: 700; color: var(--ink-2); margin-bottom: 7px; }
.m-input, .m-textarea, .m-select {
  width: 100%; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); font-size: 15px; outline: none; transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.m-input:focus, .m-textarea:focus, .m-select:focus { border-color: rgba(79, 107, 255, .5); box-shadow: 0 0 0 3px rgba(79, 107, 255, .14); }
.m-textarea { resize: vertical; min-height: 92px; }
.m-hint { font-size: 12.5px; color: var(--sub); margin-top: 6px; }

/* 覆盖 Bootstrap 默认外观，融入蓝紫玻璃主题 */
body.m-memoir .navbar { margin: 0; padding: 0; background: transparent !important; }
body.m-memoir .navbar .container { display: contents; }
body.m-memoir .card { border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow); background: var(--card); transition: box-shadow .25s var(--ease); }
body.m-memoir .card:hover { box-shadow: var(--shadow-lg); }
body.m-memoir .card-header { background: transparent; border-bottom: 1px solid var(--line); font-weight: 700; }
body.m-memoir .btn-primary { background: var(--brand-grad); border: none; box-shadow: var(--glow); }
body.m-memoir .btn-primary:hover { filter: brightness(1.06); color: #fff; }
body.m-memoir .text-primary, body.m-memoir a.text-primary { color: var(--brand) !important; }
body.m-memoir .footer { background: transparent !important; color: var(--sub); }
body.m-memoir .badge { background: rgba(79, 107, 255, .12); color: var(--brand); border-radius: 999px; padding: 4px 10px; }
body.m-memoir .user-avatar, body.m-memoir .profile-user-img { border-radius: 50%; }

/* 统计卡 */
.m-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.m-stat {
  background: linear-gradient(180deg, #fff, #fbfcff);
  border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--shadow); padding: 18px; text-align: center;
  transition: transform .22s var(--ease), box-shadow .22s var(--ease);
}
.m-stat:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.m-stat .num { font-size: 26px; font-weight: 800; background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.m-stat .lab { font-size: 13px; color: var(--sub); margin-top: 4px; }

/* 响应式：窄屏导航折叠 */
@media (max-width: 720px) {
  .m-nav { gap: 0; overflow-x: auto; }
  .m-nav a { padding: 8px 10px; font-size: 13.5px; }
  .m-header .m-user .nm { display: none; }
  .m-container { padding: 18px 14px 32px; }
  .m-card { padding: 16px; }
}

/* ============ 门户内容组件（首页 / 会员中心 / 账户） ============ */
/* 标签胶囊（情绪 / 标签 / 里程碑），颜色由 memoir_chip_style() 内联覆盖 */
.m-chip {
  display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: 12px;
  margin: 6px 6px 0 0; background: #eef1fb; color: var(--brand);
  transition: transform .15s var(--ease), background .15s var(--ease);
}
.m-chip:hover { transform: translateY(-1px); }

/* Hero 渐变卡 */
.m-hero {
  position: relative; overflow: hidden; text-align: center; color: #fff;
  border-radius: var(--r-lg); padding: 54px 30px; margin-bottom: 22px;
  background: linear-gradient(120deg, var(--brand) 0%, var(--brand-2) 52%, var(--brand-3) 100%);
  box-shadow: 0 18px 40px rgba(79, 107, 255, .28);
}
.m-hero::before {
  content: ''; position: absolute; inset: -40% -10% auto; height: 200%;
  background: radial-gradient(40% 40% at 30% 20%, rgba(255, 255, 255, .22), transparent 60%),
              radial-gradient(36% 36% at 80% 30%, rgba(255, 255, 255, .16), transparent 60%);
  pointer-events: none;
}
.m-hero::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 42px;
  background: radial-gradient(120% 100% at 50% 100%, transparent 60%, var(--card) 61%);
}
.m-hero h1 { font-size: 36px; font-weight: 800; margin: 0 0 12px; letter-spacing: .5px; position: relative; }
.m-hero .sub { font-size: 17px; opacity: .96; position: relative; }
.m-hero .tip { font-size: 14px; opacity: .85; margin-top: 6px; position: relative; }
.m-hero .actions { margin-top: 26px; position: relative; z-index: 2; }
.m-hero .m-btn { margin: 0 6px 10px; }

/* 特性卡 */
.m-feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.m-feature {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--shadow); padding: 22px; transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.m-feature:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.m-feature .ico { font-size: 30px; }
.m-feature h5 { font-size: 16px; font-weight: 800; margin: 10px 0 8px; }
.m-feature p { font-size: 13px; color: var(--ink-2); line-height: 1.75; margin: 0; }

/* 记录墙 */
.m-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.m-rcard {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--shadow); padding: 14px; display: flex; flex-direction: column;
  transition: transform .22s var(--ease), box-shadow .22s var(--ease);
}
.m-rcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.m-rcard .who { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.m-rcard .who img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: #eee; }
.m-rcard .who .n { font-size: 13px; font-weight: 700; }
.m-rcard .who .t { font-size: 11px; color: var(--sub); }
.m-rcard .txt { font-size: 14px; color: var(--ink); line-height: 1.7; flex: 1; word-break: break-word; }
.m-rcard .thumbs { margin-top: 10px; }
.m-rcard .thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; margin: 0 8px 0 0; }

/* 我的发布 - 日期列表（间距已收紧为正常密度） */
.m-item {
  display: flex; gap: 14px; padding: 10px 0; border-bottom: 1px dashed var(--line);
  transition: background .18s var(--ease);
}
.m-item:last-child { border-bottom: 0; }
.m-item:hover { background: linear-gradient(90deg, rgba(79, 107, 255, .04), transparent 70%); border-radius: 10px; }
.m-date {
  flex: 0 0 76px; text-align: center; border-radius: 12px; padding: 8px 4px;
  background: linear-gradient(180deg, #eef1ff, #fff); border: 1px solid var(--line); height: fit-content;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.m-item:hover .m-date { box-shadow: var(--shadow); transform: translateY(-2px); }
.m-date .d { font-size: 20px; font-weight: 800; background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1.1; }
.m-date .m { font-size: 12px; color: var(--sub); margin-top: 2px; }
.m-main { flex: 1; min-width: 0; }
.m-main .txt { font-size: 15px; color: var(--ink); line-height: 1.7; word-break: break-word; white-space: pre-wrap; }
.m-main .meta { font-size: 12px; color: var(--sub); margin-top: 8px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.m-thumbs img {
  width: 96px; height: 96px; object-fit: cover; border-radius: 10px; margin: 10px 10px 0 0; cursor: zoom-in;
  background: linear-gradient(90deg, #eef1f8, #f6f8ff, #eef1f8);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.m-thumbs img:hover { transform: scale(1.03); box-shadow: var(--shadow); }
.m-del { color: var(--sub); font-size: 12px; white-space: nowrap; transition: color .15s var(--ease); }
.m-del:hover { color: var(--danger); }

/* 时间线 */
.m-timeline { position: relative; padding-left: 18px; margin-top: 6px; }
.m-timeline::before { content: ''; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--brand), var(--brand-3)); }
.m-tl-item { position: relative; padding: 0 0 14px 12px; }
.m-tl-item::before {
  content: ''; position: absolute; left: -18px; top: 5px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--brand); border: 2px solid #fff; box-shadow: 0 0 0 2px rgba(79, 107, 255, .25);
  transition: transform .2s var(--ease);
}
.m-tl-item:hover::before { transform: scale(1.25); }
.m-tl-item .t { font-size: 12px; color: var(--sub); }
.m-tl-item .n { font-size: 14px; color: var(--ink); font-weight: 700; }

/* 群组 */
.m-group {
  display: flex; justify-content: space-between; align-items: center; padding: 12px 0;
  border-bottom: 1px dashed var(--line); transition: background .18s var(--ease); border-radius: 10px;
}
.m-group:last-child { border-bottom: 0; }
.m-group:hover { background: linear-gradient(90deg, rgba(79, 107, 255, .04), transparent 70%); }
.m-group .name { font-size: 14px; font-weight: 700; }
.m-group .sub { font-size: 12px; color: var(--sub); }

/* 空态 */
.m-empty { text-align: center; color: var(--sub); padding: 40px 10px; font-size: 14px; }
.m-empty .big { font-size: 40px; display: block; margin-bottom: 12px; }

/* 概览问候卡 */
.m-greet {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px;
  border-radius: var(--r-lg); padding: 24px 26px; color: #fff; margin-bottom: 18px; position: relative; overflow: hidden;
  background: linear-gradient(120deg, var(--brand) 0%, var(--brand-2) 52%, var(--brand-3) 100%);
  box-shadow: 0 14px 30px rgba(79, 107, 255, .24);
}
.m-greet::before {
  content: ''; position: absolute; inset: -40% -10% auto; height: 200%;
  background: radial-gradient(40% 40% at 20% 20%, rgba(255, 255, 255, .20), transparent 60%),
              radial-gradient(36% 36% at 85% 30%, rgba(255, 255, 255, .14), transparent 60%);
  pointer-events: none;
}
.m-greet > div { position: relative; z-index: 1; }
.m-greet h4 { font-weight: 800; margin: 0 0 6px; font-size: 20px; }
.m-greet p { margin: 0; opacity: .92; font-size: 14px; }

/* 筛选行 */
.m-filter { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; align-items: center; }
.m-filter .m-input, .m-filter .m-select { width: auto; flex: 1 1 180px; }

/* 分页 */
.m-pager { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 22px; }
.m-pager a, .m-pager span { font-size: 13px; padding: 7px 16px; border-radius: 999px; text-decoration: none; transition: .18s var(--ease); }
.m-pager a { background: #fff; border: 1px solid var(--line); color: var(--ink-2); }
.m-pager a:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-1px); }
.m-pager .cur { color: var(--sub); }
.m-pager .disabled { background: #f5f6f8; border: 1px solid #eee; color: var(--sub); }

/* 账户信息 */
.m-account-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.m-account-head img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; box-shadow: var(--shadow); }
.m-account-head h5 { margin: 0; font-size: 18px; }
.m-info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.m-info { background: #f7f8ff; border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px; transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.m-info:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.m-info .k { font-size: 13px; color: var(--sub); }
.m-info .v { font-size: 17px; font-weight: 800; color: var(--brand); margin-top: 4px; }

/* 让 layui 表单组件融入主题 */
body.m-memoir .layui-form-label { color: var(--ink-2); font-weight: 700; width: 110px; }
body.m-memoir .layui-input, body.m-memoir .layui-textarea, body.m-memoir .layui-select { border-radius: 12px; border-color: var(--line); }
body.m-memoir .layui-btn-default { background: var(--brand-grad); color: #fff; border: none; box-shadow: var(--glow); }
body.m-memoir .layui-btn-default:hover { color: #fff; filter: brightness(1.06); }
body.m-memoir .layui-btn-primary.layui-border-orange { border-color: var(--brand) !important; color: var(--brand) !important; }

/* ============ 骨架屏（页面加载骨架 + 图片占位） ============ */
@keyframes shimmer {
  0% { background-position: -480px 0; }
  100% { background-position: 480px 0; }
}
.skeleton {
  background: linear-gradient(90deg, #e9edf6 25%, #f5f7ff 37%, #e9edf6 63%);
  background-size: 960px 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: 10px;
}
.skeleton-text { height: 12px; margin: 8px 0; }
.skeleton-img { width: 96px; height: 96px; border-radius: 12px; }
.skeleton-card { height: 120px; border-radius: var(--r-md); margin-bottom: 18px; }

/* 图片占位骨架（加载前先显示微光，避免空白跳变） */
.m-thumbs img.is-loading { min-height: 96px; }

/* 页面级骨架屏覆盖层：加载完成后由脚本淡出（CSS 兜底自动隐藏） */
.m-page-skeleton {
  position: fixed; inset: 0; z-index: 999;
  background: rgba(244, 246, 252, .96);
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  padding-top: var(--header-h); overflow: hidden;
  animation: skFade 1.5s var(--ease) forwards;
}
@keyframes skFade {
  0% { opacity: 1; }
  62% { opacity: 1; }
  100% { opacity: 0; visibility: hidden; }
}
.m-page-skeleton .sk-inner { max-width: 1120px; margin: 0 auto; padding: 26px 18px; }
.m-page-skeleton .sk-card { height: 132px; border-radius: var(--r-md); margin-bottom: 18px; }
.m-page-skeleton .sk-line { height: 14px; border-radius: 8px; margin: 10px 0; }
.m-page-skeleton .sk-line.w40 { width: 40%; }
.m-page-skeleton .sk-line.w70 { width: 70%; }
.m-page-skeleton .sk-line.w90 { width: 90%; }
