/* ============================================================
   归档喵 · 网站版设计系统
   100% 照搬小程序 app.wxss 的青碧色设计语言
   换算：小程序 rpx ÷ 2 = 网页 px（750rpx 设计稿 = 375px 屏宽）
   ============================================================ */

:root {
  --primary: #177f74;          /* 主色 青碧 */
  --primary-dark: #16796a;     /* 按压/强调 */
  --primary-light: #e3f5f0;    /* 轻标签底 */
  --bg: #f2f7f5;               /* 页面底色 */
  --card: #ffffff;
  --text: #22312e;             /* 正文 带绿深灰 */
  --text-sub: #566564;
  --text-weak: #63716d;
  --border: #e6efec;
  --divider: #eef4f1;
  --danger: #b34530;           /* 珊瑚红 */
  --danger-bg: #fbeee9;
  --warn: #8a6524;
  --warn-bg: #fbf3e2;
  --input-bg: #f7faf9;
  --input-border: #e3ece9;
  --radius-card: 12px;         /* 24rpx */
  --radius-btn: 11px;          /* 22rpx */
  --radius-tag: 5px;           /* 10rpx */
  --radius-input: 12px;        /* 24rpx */
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0; height: 100%;
  background: #dfe9e5;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  color: var(--text);
  font-size: 14px;             /* 28rpx */
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* 桌面端手机外壳 */
.phone-shell {
  width: 390px; height: 844px; max-height: 100vh;
  margin: 20px auto; border: 10px solid #1a2623; border-radius: 44px;
  background: #000; overflow: hidden; box-shadow: 0 12px 40px rgba(34,49,46,.28);
}
.phone-screen {
  width: 100%; height: 100%; background: var(--bg);
  position: relative; overflow: hidden; display: flex; flex-direction: column;
}
@media (max-width: 500px) {
  html, body { background: var(--bg); }
  .phone-shell { width: 100%; height: 100%; max-height: none; margin: 0; border: 0; border-radius: 0; box-shadow: none; }
}

/* ---------- 导航栏（网页版：不模拟手机状态栏） ---------- */
.navbar {
  height: 52px; flex: 0 0 52px; background: #fff;
  display: flex; align-items: center; justify-content: center;
  position: relative; border-bottom: 1px solid var(--divider);
}
.nav-title { font-size: 16px; font-weight: 600; letter-spacing: .5px; }
.nav-back {
  position: absolute; left: 14px; top: 0; height: 52px; line-height: 52px;
  font-size: 30px; width: 40px; text-align: left; cursor: pointer; color: var(--text);
  font-family: Arial, sans-serif;
}

/* ---------- 页面容器 ---------- */
.page { flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; position: relative; }
.page-body { padding: 14px 14px 72px; min-height: 100%; }
.page-body-tab { padding-bottom: 80px; }
.page[hidden], .tabbar[hidden], .panel[hidden], .mask[hidden], .toast[hidden], [hidden] { display: none !important; }

/* ---------- Hero（照搬 owner/home hero） ---------- */
.hero {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 4px 20px;
}
.hero-hi { font-size: 13px; color: var(--text-weak); }
.hero-title-row { display: flex; align-items: center; gap: 8px; margin-top: 3px; }
.hero-title { font-size: 21px; font-weight: 600; letter-spacing: .5px; }
.hero-chip {
  font-size: 11px; padding: 2px 9px; border-radius: 5px;
  background: var(--primary-light); color: var(--primary-dark);
}
.hero-right { display: flex; align-items: center; gap: 12px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 19px; background: #fff;
  display: flex; align-items: center; justify-content: center; position: relative; cursor: pointer;
  border: 1px solid var(--border);
}
.icon-btn-svg { width: 19px; height: 19px; display: block; color: var(--primary); }
.icon-btn-svg svg { width: 100%; height: 100%; display: block; }
.badge-dot {
  position: absolute; top: -4px; right: -4px; min-width: 16px; height: 16px;
  border-radius: 8px; background: var(--danger); color: #fff;
  font-size: 10px; line-height: 16px; text-align: center; padding: 0 4px;
}
.avatar-btn {
  width: 38px; height: 38px; border-radius: 19px; background: var(--primary);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600; cursor: pointer;
}

/* ---------- 统计三栏（照搬 .stats） ---------- */
.stats {
  display: flex; align-items: center; background: #fff; border-radius: var(--radius-card);
  padding: 16px 0; margin-bottom: 12px; border: 1px solid #eaf1ef;
  box-shadow: 0 2px 9px rgba(34,49,46,.035);
}
.stat { flex: 1; text-align: center; cursor: pointer; }
.stat-num { display: block; font-size: 21px; font-weight: 600; color: var(--text); }
.stat-label { display: block; font-size: 12px; color: var(--text-weak); margin-top: 2px; }
.stat-line, .stat-sep { width: 1px; height: 28px; background: var(--divider); flex: 0 0 1px; }
.stat:active { background: #f7faf9; border-radius: 8px; }

/* ---------- 空间详情：横向三格统计 ---------- */
/* 旧版三数字横排统计（mk-stats 系列）已废弃，统一改用 stat-row 行式 */
/* 容量行与最近更新已并入 stat-card 的 stat-row / stat-sub 行式布局 */

/* ---------- 容量卡（照搬 .cap-card） ---------- */
.cap-card {
  background: #fff; border-radius: var(--radius-card); padding: 15px;
  margin-bottom: 16px; border: 1px solid #eaf1ef; box-shadow: 0 2px 9px rgba(34,49,46,.035);
}
.cap-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cap-title-wrap { display: flex; align-items: center; gap: 7px; }
.cap-title { font-size: 14px; font-weight: 600; }
.cap-tier { font-size: 11px; background: var(--primary-light); color: var(--primary-dark); padding: 2px 8px; border-radius: 5px; }
.cap-usage { font-size: 12px; color: var(--text-weak); }
.cap-bar { height: 8px; background: #eef4f1; border-radius: 4px; overflow: hidden; }
.cap-bar-fill { height: 100%; background: var(--primary); border-radius: 4px; transition: width .3s; }
.cap-bar-fill.level-warn { background: var(--warn); }
.cap-bar-fill.level-danger { background: var(--danger); }
.cap-foot { display: flex; justify-content: space-between; margin-top: 9px; font-size: 11px; color: var(--text-weak); }
.cap-pct { font-weight: 600; color: var(--primary); }
.cap-pct.level-warn { color: var(--warn); }
.cap-pct.level-danger { color: var(--danger); }

/* ---------- 提醒条（照搬 .alert / .access-warn） ---------- */
.alert {
  display: flex; align-items: center; gap: 9px; background: var(--warn-bg);
  border-radius: 9px; padding: 12px 14px; margin-bottom: 12px; cursor: pointer;
}
.alert-dot { width: 7px; height: 7px; border-radius: 4px; background: var(--warn); }
.alert-text { flex: 1; font-size: 12px; color: var(--warn); }
.alert-go { font-size: 12px; color: var(--warn); }
.access-warn { background: var(--danger-bg); border-radius: 9px; padding: 12px 14px; margin-bottom: 12px; }
.access-warn-head { display: flex; justify-content: space-between; align-items: center; }
.access-warn-title { font-size: 13px; font-weight: 600; color: var(--danger); }
.access-warn-badge { font-size: 11px; background: #fff; color: var(--danger); padding: 1px 8px; border-radius: 5px; }
.access-warn-text { font-size: 11px; color: var(--danger); display: block; margin-top: 5px; }

/* ---------- 区块标题（照搬 .section-head/.section-label） ---------- */
.section-head { display: flex; align-items: center; justify-content: space-between; padding: 11px 5px 7px; }
.section-label { position: relative; padding-left: 9px; font-size: 14px; font-weight: 600; }
.section-label::before {
  content: ""; position: absolute; left: 0; top: 50%; width: 3px; height: 13px;
  margin-top: -6.5px; border-radius: 1.5px; background: var(--primary);
}
.section-title { font-size: 13px; color: var(--text-weak); margin: 15px 5px 7px; }

/* ---------- 卡片（照搬 .card） ---------- */
.card {
  background: var(--card); border-radius: var(--radius-card); padding: 15px;
  margin-bottom: 10px; border: 1px solid #eaf1ef; box-shadow: 0 2px 9px rgba(34,49,46,.035);
}
.card-tight { padding: 11px 13px; }
.card-flat { border: none; box-shadow: none; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; }

/* ---------- 空间卡片列表（照搬 .space-card） ---------- */
.space-list { display: flex; flex-direction: column; gap: 10px; }
.space-card {
  display: flex; align-items: center; gap: 12px; background: #fff;
  border-radius: var(--radius-card); padding: 14px; cursor: pointer;
  border: 1px solid #eaf1ef; box-shadow: 0 2px 9px rgba(34,49,46,.035);
}
.space-badge {
  width: 44px; height: 44px; border-radius: 11px; flex: 0 0 44px;
  background: var(--primary-light); color: var(--primary-dark);
  display: flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 600;
}
.space-info { flex: 1; min-width: 0; }
.space-name-row { display: flex; align-items: center; justify-content: space-between; }
.space-name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.space-arrow { color: var(--text-weak); font-size: 17px; }
.space-meta { font-size: 12px; color: var(--text-weak); margin-top: 3px; }
.space-more { font-size: 12px; color: var(--primary); cursor: pointer; }

/* ---------- 通用列表行 ---------- */
.list { display: flex; flex-direction: column; gap: 10px; }
.row {
  background: #fff; border-radius: var(--radius-card); padding: 12px 14px;
  display: flex; align-items: center; gap: 12px; cursor: pointer;
  border: 1px solid #eaf1ef; box-shadow: 0 2px 9px rgba(34,49,46,.035);
}
.row:active { background: #f7faf9; }
.row-ico {
  width: 40px; height: 40px; border-radius: 10px; flex: 0 0 40px;
  background: var(--primary-light); color: var(--primary-dark);
  display: flex; align-items: center; justify-content: center; font-size: 19px;
}
.row-main { flex: 1; min-width: 0; }
.row-title { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-desc { color: var(--text-weak); font-size: 12px; margin-top: 3px; }
.row-tail { color: var(--text-weak); font-size: 12px; text-align: right; }
.row-ops { display: flex; gap: 6px; }

/* ---------- 文字 ---------- */
.muted { color: var(--text-weak); font-size: 12px; }
.muted-inline { color: var(--text-weak); font-size: 11px; }
.strong { font-weight: 600; }
.danger-text { color: var(--danger); }
.ok-text { color: var(--primary-dark); }
.req { color: var(--danger); font-size: 11px; }
.title-lg { font-size: 20px; font-weight: 600; margin-bottom: 3px; letter-spacing: .5px; }
.mt-12 { margin-top: 12px; }
.mt-20 { margin-top: 20px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; }
.row-center { display: flex; align-items: center; }

/* ---------- 标签（照搬 .tag） ---------- */
.tag {
  display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: var(--radius-tag);
  background: #eef4f1; color: var(--text-sub); line-height: 1.5;
}
.tag-ok { background: var(--primary-light); color: var(--primary-dark); }
.tag-warn { background: var(--warn-bg); color: var(--warn); }
.tag-danger { background: var(--danger-bg); color: var(--danger); }
.tag-points { background: var(--primary-light); color: var(--primary-dark); }

/* ---------- 按钮（照搬 .btn） ---------- */
.btn, .btn-primary, .btn-danger, .btn-ghost {
  display: flex; align-items: center; justify-content: center;
  height: 44px; border-radius: var(--radius-btn); font-size: 14px; font-weight: 500;
  border: 0; cursor: pointer; transition: opacity .15s, transform .15s;
}
.btn { background: #eef4f1; color: var(--text); }
.btn:active { opacity: .82; transform: scale(.985); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 3px 8px rgba(23,127,116,.22); }
.btn-danger { background: var(--danger-bg); color: var(--danger); }
.btn-ghost { background: #fff; border: 1px solid #dbe6e2; color: var(--text); }
.btn-block { width: 100%; }
.btn-sm { height: 32px; font-size: 13px; padding: 0 13px; border-radius: 9px; }
.btn-disabled { opacity: .45; box-shadow: none; }
.btn-row { display: flex; gap: 8px; margin-top: 8px; }
.btn-row > * { flex: 1; }
.btn-text { width: 100%; background: none; border: 0; color: var(--primary); font-size: 14px; margin-top: 12px; cursor: pointer; }
.btn-outline { width: 100%; height: 42px; border: 1px solid var(--primary); border-radius: 21px; background: #fff; color: var(--primary); font-size: 15px; cursor: pointer; }
.logout { color: var(--danger); border-color: #f0d5cd; margin-top: 16px; }
.op-btn { padding: 5px 12px; border-radius: 14px; border: 1px solid var(--border); background: #fff; font-size: 12px; cursor: pointer; color: var(--text); }
.op-danger { color: var(--danger); border-color: #f0d5cd; }

/* ---------- 表单（照搬 .field/.input） ---------- */
.field { margin-bottom: 12px; }
.field-label { display: block; font-size: 13px; color: var(--text-sub); margin-bottom: 5px; }
.field-input {
  width: 100%; height: 44px; background: var(--input-bg); border: 1px solid var(--input-border);
  border-radius: var(--radius-input); padding: 0 12px; font-size: 14px; color: var(--text);
  outline: none; font-family: inherit;
}
.field-input:focus { border-color: var(--primary); background: #fff; }
textarea.field-input { height: auto; min-height: 75px; padding: 10px 12px; resize: vertical; }
select.field-input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%2363716d' stroke-width='1.5' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 30px; }

/* ---------- 空状态/加载 ---------- */
.empty, .loading { padding: 40px 12px; text-align: center; color: var(--text-weak); font-size: 13px; line-height: 2; }
.empty-icon { font-size: 46px; margin-bottom: 8px; }

/* ---------- 提示条 ---------- */
.hint { background: #f2f7f5; border-radius: 9px; padding: 10px 12px; font-size: 12px; line-height: 1.65; color: var(--text-sub); }
.hint-danger { background: var(--danger-bg); color: var(--danger); }
.hint-warn { background: var(--warn-bg); color: var(--warn); }

/* ---------- 登录页 ---------- */
.auth-wrap { padding: 50px 22px 30px; }
.auth-logo { font-size: 54px; text-align: center; }
.auth-title { text-align: center; font-size: 24px; font-weight: 600; margin-top: 8px; }
.auth-sub { text-align: center; color: var(--text-weak); font-size: 13px; margin: 6px 0 26px; }
.auth-hint { text-align: center; color: #8a9994; font-size: 11px; margin-top: 18px; }
.seg { display: flex; background: #eef4f1; border-radius: 20px; padding: 3px; margin-bottom: 18px; }
.seg-item { flex: 1; height: 34px; border: 0; background: none; border-radius: 17px; font-size: 14px; color: var(--text-weak); cursor: pointer; }
.seg-item.active { background: #fff; color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(34,49,46,.08); }

/* ---------- 浮动按钮 ---------- */
.fab {
  position: absolute; right: 18px; bottom: 78px; width: 52px; height: 52px;
  border-radius: 26px; border: 0; background: var(--primary); color: #fff;
  font-size: 30px; line-height: 52px; box-shadow: 0 4px 12px rgba(23,127,116,.4);
  cursor: pointer; z-index: 5;
}

/* ---------- 详情 tabs ---------- */
.seg-tabs { display: flex; gap: 20px; border-bottom: 1px solid var(--divider); margin-bottom: 12px; padding: 0 5px; }
.seg-tab { background: none; border: 0; padding: 8px 0 10px; font-size: 14px; color: var(--text-weak); cursor: pointer; position: relative; }
.seg-tab.active { color: var(--text); font-weight: 600; }
.seg-tab.active::after { content: ''; position: absolute; left: 20%; right: 20%; bottom: 0; height: 3px; background: var(--primary); border-radius: 2px; }
.cat-bar { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 10px; }
.cat-chip { flex: 0 0 auto; padding: 6px 14px; border-radius: 16px; background: #fff; font-size: 13px; color: var(--text-sub); cursor: pointer; border: 1px solid var(--border); }
.cat-chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---------- 邀请码卡 ---------- */
.invite-card {
  background: linear-gradient(135deg, #177f74, #16796a); border-radius: var(--radius-card);
  padding: 20px; color: #fff; text-align: center; margin-bottom: 18px;
}
.invite-label { font-size: 13px; opacity: .85; }
.invite-code { font-size: 34px; font-weight: 600; letter-spacing: 6px; margin: 10px 0 16px; }
.invite-card .btn-outline { background: rgba(255,255,255,.95); border-color: #fff; color: var(--primary-dark); height: 38px; }
.invite-row { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; gap: 10px; }
.invite-row .invite-code { background: var(--bg); color: var(--primary-dark); border-radius: var(--radius-input); padding: 8px 12px; font-size: 18px; letter-spacing: 3px; flex: 1; text-align: center; margin: 0; }
.op { color: var(--primary); font-size: 13px; cursor: pointer; }
.qr-box { text-align: center; padding: 8px 0 4px; }
.qr-img { width: 100%; max-width: 220px; border-radius: var(--radius-card); border: 1px solid var(--border); background: #fff; display: block; margin: 0 auto; }
.qr-box .muted { display: block; margin-top: 8px; font-size: 11px; }
.qr-edit { min-height: 60px; display: flex; align-items: center; justify-content: center; background: var(--bg); border-radius: var(--radius-card); padding: 10px; margin-top: 8px; }
.qr-edit .qr-img { max-width: 160px; }

/* ---------- 我的 ---------- */
.me-head { display: flex; align-items: center; gap: 14px; padding: 16px 4px 20px; }
.avatar { width: 60px; height: 60px; border-radius: 30px; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.me-name { font-size: 18px; font-weight: 600; }
.me-phone { color: var(--text-weak); font-size: 12px; margin-top: 4px; }
.me-stats { display: flex; }
.stat-card .stat-item { flex: 1; text-align: center; }
.stat-card .stat-num { font-size: 20px; font-weight: 600; color: var(--primary); }
.stat-card .stat-label { font-size: 12px; color: var(--text-weak); margin-top: 4px; }
.tier-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--divider); font-size: 12px; }
.tier-row:last-child { border-bottom: 0; }
.tier-row .muted { color: var(--text-weak); }

/* ---------- 底部 tabBar ---------- */
.tabbar {
  flex: 0 0 58px; height: 58px; background: #fff; border-top: 1px solid var(--divider);
  display: flex; padding-bottom: env(safe-area-inset-bottom); box-sizing: content-box;
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; color: #8a9994; font-size: 11px; cursor: pointer;
  transition: color .15s;
}
.tab.active { color: var(--primary); font-weight: 600; }
.tab-ico { width: 20px; height: 20px; display: block; }
.tab-ico svg { width: 100%; height: 100%; display: block; }


/* ---------- 我的页：分组列表（图标 + 主副标题 + 箭头） ---------- */
.menu-card { background: #fff; border-radius: var(--radius-card); overflow: hidden;
  border: 1px solid #eaf1ef; box-shadow: 0 2px 9px rgba(34,49,46,.035); margin-bottom: 10px; }
.menu-item {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 15px; cursor: pointer; position: relative;
  transition: background .12s;
}
.menu-item:active { background: #f7faf9; }
.menu-item + .menu-item::before {
  content: ''; position: absolute; left: 58px; right: 15px; top: 0; height: 1px; background: var(--divider);
}
.menu-ico {
  width: 34px; height: 34px; flex: 0 0 34px; border-radius: 9px;
  background: var(--primary-light); color: var(--primary-dark);
  display: flex; align-items: center; justify-content: center;
}
.menu-ico svg { width: 18px; height: 18px; display: block; }
.menu-ico.warn { background: var(--warn-bg); color: var(--warn); }
.menu-ico.danger { background: var(--danger-bg); color: var(--danger); }
.menu-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.menu-title { display: block; font-size: 14px; color: var(--text); line-height: 1.4; }
.menu-sub { display: block; font-size: 11.5px; color: var(--text-weak); margin-top: 2px; line-height: 1.4; }
.menu-arrow { color: #c2cfca; font-size: 18px; font-family: Arial, sans-serif; flex: 0 0 auto; }

/* 分组标题：更轻、留白更舒服 */
.group-title { display: flex; align-items: center; gap: 7px; padding: 16px 5px 9px; }
.group-title .bar { width: 3px; height: 12px; border-radius: 2px; background: var(--primary); }
.group-title .txt { font-size: 12.5px; font-weight: 600; color: var(--text-sub); letter-spacing: .3px; }

/* ---------- 弹层 / toast ---------- */
.mask { position: absolute; inset: 0; background: rgba(34,49,46,.45); display: flex; align-items: flex-end; z-index: 20; }
.sheet { width: 100%; background: #fff; border-radius: 16px 16px 0 0; padding: 20px; max-height: 85%; overflow-y: auto; }
.sheet-title { font-size: 16px; font-weight: 600; margin-bottom: 12px; }
.sheet-body { font-size: 14px; color: var(--text-sub); line-height: 1.8; }
.sheet-actions { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }
/* 紧凑操作菜单（文件「···」等）：微信风格的白色选项列表，替代大色块按钮 */
.sheet-actions.compact { margin-top: 10px; gap: 0; border-top: 1px solid #eef4f1; }
.sheet-actions.compact .opt {
  width: 100%; height: 46px; background: #fff; border: 0; border-bottom: 1px solid #eef4f1;
  border-radius: 0; box-shadow: none; font-size: 15px; color: var(--text);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.sheet-actions.compact .opt.danger { color: var(--danger); }
.sheet-actions.compact .opt:active { background: #f6faf8; }
.sheet-actions.compact .opt:last-child { border-bottom: 0; }
.toast {
  position: absolute; left: 50%; top: 45%; transform: translate(-50%,-50%);
  background: rgba(34,49,46,.85); color: #fff; padding: 12px 20px; border-radius: 8px;
  font-size: 14px; z-index: 30; max-width: 80%; text-align: center;
}
.build-tag { font-size: 10px; color: #8a9994; text-align: center; padding: 10px 0 20px; }

/* ============ 空间文件页：搜索 / 统计 / 分类 / 文档列表 ============ */
.search-row { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.search-box {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 7px; height: 38px;
  background: #fff; border: 1px solid var(--border); border-radius: 19px; padding: 0 12px;
}
.search-lens { width: 16px; height: 16px; flex: 0 0 16px; color: #9aa8a4; }
.search-input { flex: 1; border: 0; outline: none; background: none; font-size: 13px; color: var(--text); min-width: 0; }
.search-input::placeholder { color: #a6b3af; }
.search-clear { color: #9aa8a4; font-size: 17px; cursor: pointer; padding: 0 2px; }
.pill-btn {
  flex: 0 0 auto; height: 38px; padding: 0 14px; border: 0; border-radius: 19px;
  background: var(--primary); color: #fff; font-size: 13px; font-weight: 500; cursor: pointer;
}
.pill-btn + .pill-btn { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.pill-btn:active { opacity: .85; }

.stat-card {
  background: #fff; border-radius: var(--radius-card); padding: 13px 15px; margin-bottom: 10px;
  border: 1px solid #eaf1ef; box-shadow: 0 2px 9px rgba(34,49,46,.035);
}
.stat-row { display: flex; align-items: baseline; gap: 10px; padding: 4px 0; }
.stat-row .stat-key { flex: 0 0 auto; min-width: 56px; }
.stat-value-wrap { flex: 1; display: flex; align-items: baseline; gap: 5px; min-width: 0; }
/* 共享书友数的显隐开关 */
.share-eye {
  flex: 0 0 auto; width: 22px; height: 22px; padding: 3px;
  border: 0; background: none; color: #a6b3af; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.share-eye svg { width: 100%; height: 100%; }
.share-eye:active { color: var(--primary); }
.share-hidden { color: #c2ccc9; letter-spacing: 2px; }
.stat-key { font-size: 12.5px; color: var(--text-weak); }
.stat-value { font-size: 12.5px; color: var(--text-sub); }
.stat-card .stat-num { display: inline; font-size: 15px; font-weight: 600; color: var(--primary); margin: 0 2px; }
.cap-tier-mini { font-size: 10.5px; background: var(--primary-light); color: var(--primary-dark); border-radius: 4px; padding: 1px 5px; margin-left: 5px; }
.stat-sub { font-size: 11px; color: #a6b3af; margin-top: 6px; padding-top: 7px; border-top: 1px solid var(--divider); }

.cat-bar { display: flex; gap: 7px; overflow-x: auto; padding: 2px 0 6px; -webkit-overflow-scrolling: touch; }
.cat-bar::-webkit-scrollbar { display: none; }
.cat-chip {
  flex: 0 0 auto; padding: 6px 13px; border-radius: 15px; background: #fff;
  font-size: 12.5px; color: var(--text-sub); cursor: pointer; border: 1px solid var(--border);
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
}
.cat-chip em { font-style: normal; font-size: 11px; color: #a6b3af; }
.cat-chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.cat-chip.active em { color: rgba(255,255,255,.8); }
.cat-chip.cat-other { color: var(--text-weak); }
.cat-chip.cat-add { color: var(--primary); border-style: dashed; border-color: #b6d8d2; background: #f7fbfa; }
.cat-hint { font-size: 11px; color: #a6b3af; padding: 2px 2px 10px; line-height: 1.5; }

.sec-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 2px 8px; }
.sec-title { font-size: 13.5px; font-weight: 600; color: var(--text); }
.sec-more { font-size: 11.5px; color: var(--text-weak); }

.doc-list { display: flex; flex-direction: column; gap: 8px; }
.doc-item {
  position: relative;
  display: flex; align-items: center; gap: 11px; background: #fff;
  border: 1px solid #eaf1ef; border-radius: var(--radius-card); padding: 11px 12px;
  box-shadow: 0 2px 8px rgba(34,49,46,.03);
}
.doc-item.open { border-color: var(--primary); z-index: 5; }
/* 「···」点击后在文件右侧弹出的小浮层菜单 */
.doc-pop {
  position: absolute; right: 10px; top: 40px; z-index: 30;
  background: #fff; border-radius: 12px; border: 1px solid #eaf1ef;
  box-shadow: 0 8px 24px rgba(34,49,46,.16);
  padding: 5px; display: flex; flex-direction: column; min-width: 108px;
}
.doc-pop button {
  height: 34px; border: 0; background: none; border-radius: 8px;
  font-size: 13px; color: var(--text-sub); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.doc-pop button:active { background: #f0f5f3; }
.doc-pop button.danger { color: var(--danger); }
.doc-icon {
  width: 38px; height: 38px; flex: 0 0 38px; border-radius: 9px;
  background: var(--primary-light); display: flex; align-items: center; justify-content: center;
}
.doc-ext { font-size: 10px; font-weight: 700; color: var(--primary-dark); letter-spacing: .2px; }
.doc-main { flex: 1; min-width: 0; cursor: pointer; }
.doc-name { font-size: 13.5px; color: var(--text); line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin-top: 4px; font-size: 11px; color: #93a19d; }
.doc-meta .dot { color: #cdd8d4; }
.doc-tag { background: #f0f5f3; color: var(--text-sub); border-radius: 4px; padding: 1px 6px; font-size: 10.5px; }
.doc-tag-none { background: #f7f7f7; color: #b0bab7; }
.doc-tag-pts { background: var(--primary-light); color: var(--primary-dark); }
/* 首页邀请码条（对齐小程序 invite-strip） */
.invite-strip {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border: 1px solid #eaf1ef; border-radius: var(--radius-card);
  padding: 11px 14px; margin-bottom: 10px;
  box-shadow: 0 2px 9px rgba(34,49,46,.035);
}
.invite-main { flex: 1; min-width: 0; }
.invite-label { font-size: 11px; color: var(--text-weak); }
.invite-code {
  font-size: 17px; font-weight: 700; color: var(--primary);
  letter-spacing: 2px; margin-top: 2px; user-select: all;
}
.invite-btn {
  flex: 0 0 auto; height: 32px; padding: 0 15px; border: 0; border-radius: 16px;
  background: var(--primary); color: #fff; font-size: 13px; cursor: pointer;
}
.invite-btn:active { opacity: .85; }
/* 排序切换 */
.sort-row { display: flex; gap: 7px; padding: 0 0 8px; }
.sort-btn {
  height: 28px; padding: 0 12px; border-radius: 14px; cursor: pointer;
  border: 1px solid var(--border); background: #fff; color: var(--text-sub); font-size: 12.5px;
}
.sort-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.space-desc { font-size: 11.5px; color: #9aa8a4; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* ---------- 聊天（对齐小程序 chat 页） ---------- */
.chat-wrap { display: flex; flex-direction: column; height: calc(100vh - 122px); }
.chat-list { flex: 1; overflow-y: auto; padding: 4px 2px 10px; }
.chat-row { display: flex; flex-direction: column; align-items: flex-start; margin-bottom: 12px; }
.chat-row.mine { align-items: flex-end; }
.chat-bubble {
  max-width: 78%; padding: 9px 13px; border-radius: 14px;
  background: #fff; border: 1px solid #eaf1ef; font-size: 13.5px;
  color: var(--text); line-height: 1.55; word-break: break-word;
}
.chat-row.mine .chat-bubble { background: var(--primary); color: #fff; border-color: var(--primary); }
.chat-time { font-size: 10.5px; color: #b3bebb; margin-top: 3px; }
.chat-empty { text-align: center; padding: 40px 0; color: var(--text-sub); font-size: 13px; }
.chat-input-row {
  flex: 0 0 auto; display: flex; gap: 8px; align-items: center;
  padding: 9px 2px 2px; border-top: 1px solid var(--divider);
}
.chat-input {
  flex: 1; min-width: 0; height: 38px; border: 1px solid var(--border); border-radius: 19px;
  padding: 0 14px; font-size: 13.5px; outline: none; background: #fff;
}
.chat-send {
  flex: 0 0 auto; height: 38px; padding: 0 18px; border: 0; border-radius: 19px;
  background: var(--primary); color: #fff; font-size: 13.5px; cursor: pointer;
}
.chat-send:active { opacity: .85; }
.msg-badge {
  display: inline-block; min-width: 16px; height: 16px; line-height: 16px;
  padding: 0 4px; margin-left: 6px; border-radius: 8px;
  background: var(--danger); color: #fff; font-size: 10.5px; text-align: center;
}
.row-time { flex: 0 0 auto; font-size: 10.5px; color: #b3bebb; align-self: flex-start; }
/* 首页/空间页的到期与授权提示卡 */
.access-warn-card {
  background: var(--danger-bg); color: var(--danger);
  border-radius: var(--radius-card); padding: 11px 14px;
  font-size: 12.5px; line-height: 1.6; margin-bottom: 10px;
}
.doc-stat { color: var(--primary); }
.doc-star { color: #e0a63c; letter-spacing: -.5px; font-size: 11px; }
.doc-ops { display: flex; gap: 6px; flex: 0 0 auto; }
.doc-ops .op-btn { padding: 4px 9px; font-size: 11.5px; border-radius: 12px; }

.empty-card { background: #fff; border-radius: var(--radius-card); padding: 40px 20px; text-align: center; border: 1px solid #eaf1ef; }
.empty-title { display: block; font-size: 13.5px; color: var(--text-sub); margin-bottom: 6px; }
.load-more {
  margin: 12px 0 4px; height: 38px; line-height: 38px; text-align: center;
  background: #fff; border: 1px solid var(--border); border-radius: 19px;
  font-size: 13px; color: var(--primary); cursor: pointer;
}

/* 上传进度 */
.upload-progress {
  position: absolute; left: 14px; right: 14px; bottom: 74px; z-index: 10;
  background: rgba(34,49,46,.92); border-radius: 10px; padding: 10px 13px;
}
.up-bar { height: 4px; background: rgba(255,255,255,.22); border-radius: 2px; overflow: hidden; }
.up-fill { height: 100%; width: 0; background: #4fd1a5; border-radius: 2px; transition: width .2s; }
.up-text { color: #fff; font-size: 11.5px; margin-top: 6px; text-align: center; }

/* ============ 站内阅读器 ============ */
.reader { border-radius: var(--radius-card); overflow: hidden; }
.reader-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 12px 14px; background: #fff; border-bottom: 1px solid var(--divider);
}
.reader-title { font-size: 13.5px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.reader-tools { display: flex; gap: 6px; flex: 0 0 auto; }
.reader-btn {
  height: 28px; padding: 0 11px; border-radius: 14px; border: 1px solid var(--border);
  background: #fff; color: var(--text-sub); font-size: 11.5px; cursor: pointer;
}
.reader-body {
  background: #fff; padding: 16px 16px 24px; min-height: 260px;
  font-size: 15px; line-height: 1.9; color: var(--text);
  white-space: pre-wrap; word-break: break-word; max-height: 62vh; overflow-y: auto;
}
.reader-rate { background: #fff; border-top: 1px solid var(--divider); padding: 14px; text-align: center; }
.rate-label { font-size: 12px; color: var(--text-weak); margin-bottom: 7px; }
.rate-stars { display: flex; justify-content: center; gap: 9px; }
.rate-star { font-size: 24px; color: #dde5e2; cursor: pointer; transition: color .15s, transform .1s; }
.rate-star.on { color: #e0a63c; }
.rate-star:active { transform: scale(1.15); }
.rate-info { font-size: 11px; color: #a6b3af; margin-top: 7px; }

/* 夜间模式：根节点带 reader-dark */
body.reader-dark { background: #121614; }
body.reader-dark .reader, body.reader-dark .reader-head,
body.reader-dark .reader-body, body.reader-dark .reader-rate { background: #1b211f; }
body.reader-dark .reader-body { color: #d8e2de; }
body.reader-dark .reader-title { color: #eaf2ef; }
body.reader-dark .reader-head { border-bottom-color: #2a3330; }
body.reader-dark .reader-rate { border-top-color: #2a3330; }
body.reader-dark .reader-btn { background: #232b28; border-color: #313b37; color: #b9c6c1; }
body.reader-dark .rate-label, body.reader-dark .rate-info { color: #8b9a95; }
body.reader-dark .rate-star { color: #3a4541; }
body.reader-dark .rate-star.on { color: #e0a63c; }

/* 邀请码加入 */
.join-row { display: flex; gap: 8px; margin-top: 10px; align-items: center; }
.join-row .field-input { flex: 1; height: 38px; }
.join-row .btn { flex: 0 0 auto; margin: 0; }

/* ============ 空间详情头部：大标题 + 右侧胶囊 + 横向信息 ============ */
.space-hero { padding: 4px 2px 12px; }
.space-hero-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.space-h1 {
  flex: 1; min-width: 0; margin: 0;
  font-size: 21px; font-weight: 700; line-height: 1.32; color: var(--text);
  letter-spacing: .2px;
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.space-hero-actions { display: flex; gap: 7px; flex: 0 0 auto; }
.hero-pill {
  height: 30px; padding: 0 13px; border-radius: 15px; border: 1px solid var(--border);
  background: #fff; color: var(--text-sub); font-size: 12.5px; cursor: pointer;
  display: inline-flex; align-items: center; white-space: nowrap;
}
.hero-pill:active { background: #f2f7f5; }
.hero-pill.active { background: var(--primary); border-color: var(--primary); color: #fff; }
/* 说明信息横向排列，超长省略 */
.space-hero-meta {
  display: flex; align-items: center; gap: 6px; margin-top: 7px;
  font-size: 11.5px; color: var(--text-weak); white-space: nowrap;
  overflow: hidden;
}
.hm-item { flex: 0 0 auto; }
.hm-desc { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.hm-dot { color: #cdd8d4; flex: 0 0 auto; }

/* 文件行「···」按钮：浅灰圆角底 + 内联 SVG 三点 */
.doc-more {
  flex: 0 0 auto; width: 30px; height: 30px; border: 1px solid #eef3f1;
  border-radius: 9px; background: #f7faf9; color: #93a19d;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 6px;
}
.doc-more svg { width: 100%; height: 100%; }
.doc-more:hover { color: var(--primary); border-color: var(--primary-light); }
.doc-more:active { background: #eef6f4; color: var(--primary); }
.doc-item.open .doc-more { background: var(--primary-light); color: var(--primary); border-color: transparent; }
