/* ==========================================================================
   财顺通内网 - 全局样式
   视觉风格：商务简洁现代 · 高留白 · 清爽通透
   主色调：#2563eb   字体：Inter 无衬线   不含暗黑模式，动效克制
   ========================================================================== */

/* ------------------------------ 设计令牌 ------------------------------ */
:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #eff6ff;
  --primary-border: #bfdbfe;

  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e5e9f0;
  --border-strong: #d5dce6;

  --text: #16213a;
  --text-2: #5a6478;
  --text-3: #94a0b4;

  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --danger-border: #fecaca;
  --success: #16a34a;
  --success-soft: #f0fdf4;
  --warn: #d97706;
  --warn-soft: #fffbeb;

  --radius: 12px;
  --radius-sm: 9px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow: 0 1px 3px rgba(16, 24, 40, .05), 0 6px 20px rgba(16, 24, 40, .05);
  --shadow-lg: 0 12px 40px rgba(16, 24, 40, .13);

  --nav-h: 60px;
  --transition: .18s ease;
}

/* ------------------------------ 基础重置 ------------------------------ */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
               'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  padding-top: var(--nav-h);
  /* 全局禁止文本选中与长按系统菜单（配合 security.js 的防复制策略） */
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* 表单元素允许正常选中输入 */
input, textarea { -webkit-user-select: text; user-select: text; }

a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4, p { margin: 0; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

.icon { flex: none; vertical-align: middle; }

body.is-locked { overflow: hidden; }

/* ------------------------------ 顶部导航栏 ------------------------------ */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 900;
}

.navbar__inner {
  max-width: 1440px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}

/* 品牌 */
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: none;
}
.brand__logo {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--primary), #3b82f6);
  color: #fff;
}
.brand__name {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: .3px;
  white-space: nowrap;
}

/* 中部搜索 */
.navsearch {
  flex: 1;
  max-width: 420px;
  position: relative;
  display: flex;
  align-items: center;
}
.navsearch__icon {
  position: absolute;
  left: 12px;
  color: var(--text-3);
  display: flex;
}
.navsearch__input {
  width: 100%;
  height: 38px;
  padding: 0 14px 0 36px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 13.5px;
  color: var(--text);
  outline: none;
  transition: var(--transition);
}
.navsearch__input::-webkit-search-cancel-button { -webkit-appearance: none; }
.navsearch__input:focus {
  background: #fff;
  border-color: var(--primary-border);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .09);
}

/* 右侧菜单 */
.navmenu {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 2px;
}
.navmenu__item {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-2);
  transition: var(--transition);
  white-space: nowrap;
}
.navmenu__item:hover { background: var(--surface-2); color: var(--text); }
.navmenu__item.is-active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.navmenu__icon { display: flex; }

.navmenu__divider {
  width: 1px; height: 20px;
  background: var(--border);
  margin: 0 6px;
}

.navmenu__iconbtn {
  position: relative;
  width: 36px; height: 36px;
  display: grid;
  place-items: center;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  cursor: pointer;
  transition: var(--transition);
}
.navmenu__iconbtn:hover { background: var(--surface-2); color: var(--text); }
.navmenu__iconbtn.is-active { background: var(--primary-soft); color: var(--primary); }
.navmenu__iconbtn--danger:hover { background: var(--danger-soft); color: var(--danger); }

.badge {
  position: absolute;
  top: 3px; right: 3px;
  min-width: 16px; height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  line-height: 16px;
  text-align: center;
  border: 1.5px solid #fff;
}

.navtoggle {
  display: none;
  width: 36px; height: 36px;
  border: none;
  background: transparent;
  color: var(--text-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

/* ------------------------------ 主内容区 ------------------------------ */
.main {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px;
  min-height: calc(100vh - var(--nav-h));
}

.page { animation: fadeIn .22s ease; }
.page--narrow { max-width: 860px; }
.page__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.page__title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -.2px;
}
.page__title .icon { color: var(--primary); }
.page__sub { margin-top: 5px; font-size: 13px; color: var(--text-3); }
.page__actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.section__title {
  display: flex; align-items: center; gap: 7px;
  font-size: 15px; font-weight: 620;
}
.count {
  margin-left: 4px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
}

/* ------------------------------ 按钮 ------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn--sm { height: 30px; padding: 0 11px; font-size: 12.5px; }
.btn--block { width: 100%; }

.btn--primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-sm); }
.btn--primary:hover:not(:disabled) { background: var(--primary-hover); }

.btn--ghost { background: #fff; border-color: var(--border); color: var(--text-2); }
.btn--ghost:hover:not(:disabled) { border-color: var(--border-strong); color: var(--text); background: var(--surface-2); }

.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover:not(:disabled) { background: #b91c1c; }

.btn--done { background: var(--success-soft); color: var(--success); border-color: #bbf7d0; }

.btn--text {
  height: auto; padding: 4px 6px;
  background: none; border: none;
  color: var(--primary);
  font-weight: 550;
}
.btn--text:hover { background: var(--primary-soft); border-radius: 6px; }
.btn--danger-text { color: var(--danger); }
.btn--danger-text:hover { background: var(--danger-soft); }

.iconbtn {
  width: 30px; height: 30px;
  display: inline-grid; place-items: center;
  border: none; background: transparent;
  border-radius: 8px;
  color: var(--text-3);
  cursor: pointer;
  transition: var(--transition);
}
.iconbtn:hover { background: var(--surface-2); color: var(--text); }
.iconbtn--danger:hover { background: var(--danger-soft); color: var(--danger); }

/* ------------------------------ 表单控件 ------------------------------ */
.form { display: flex; flex-direction: column; gap: 16px; }
.form-row { display: flex; flex-direction: column; gap: 7px; }
.form-row > label { font-size: 13px; font-weight: 550; color: var(--text-2); }
.form-row--inline { flex-direction: row; align-items: center; gap: 12px; flex-wrap: wrap; }
.form-row--inline > label:first-child { min-width: 100px; }
.form-row--end { flex-direction: row; justify-content: flex-end; gap: 10px; }
.req { color: var(--danger); }

.input {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--text);
  outline: none;
  transition: var(--transition);
}
.input:focus { border-color: var(--primary-border); box-shadow: 0 0 0 3px rgba(37, 99, 235, .09); }
.input--area { height: auto; padding: 10px 12px; line-height: 1.65; resize: vertical; }
.input--sm { width: auto; height: 32px; font-size: 13px; }

.checkbox, .radio {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13.5px; color: var(--text-2); cursor: pointer;
}
.checkbox input, .radio input { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; }
.radiogroup { display: flex; flex-wrap: wrap; gap: 18px; padding-bottom: 4px; }

.switch { position: relative; width: 40px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span {
  position: absolute; inset: 0;
  background: var(--border-strong);
  border-radius: 999px;
  transition: var(--transition);
}
.switch span::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  left: 2px; top: 2px;
  background: #fff;
  border-radius: 50%;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::before { transform: translateX(18px); }

.searchbar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}
.searchbar > .icon:first-child { position: absolute; left: 11px; color: var(--text-3); pointer-events: none; }
.searchbar .input { padding-left: 34px; width: 100%; }
.searchbar--lg .input { height: 44px; font-size: 14px; padding-left: 38px; }
.searchbar--lg > .icon:first-child { left: 13px; }

.hint { font-size: 12.5px; color: var(--text-3); line-height: 1.7; }
.hint--danger { color: var(--danger); }

/* ------------------------------ 卡片 / 面板 ------------------------------ */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.panel--narrow { max-width: 640px; }
.panel__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px; flex-wrap: wrap;
}
.panel__title { display: flex; align-items: center; gap: 8px; font-size: 15.5px; font-weight: 620; }
.panel__title .icon { color: var(--primary); }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.card:hover { box-shadow: var(--shadow); border-color: var(--border-strong); }
.card--content.is-pinned { border-color: var(--primary-border); background: linear-gradient(180deg, #f8fbff, #fff 60%); }
.card__body { padding: 16px 16px 12px; flex: 1; }
.card__top { display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap; }
.card__title { font-size: 15.5px; font-weight: 620; line-height: 1.45; flex: 1; min-width: 0; }
.card__desc {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card__meta {
  display: flex; flex-wrap: wrap; gap: 14px;
  margin-top: 14px;
  font-size: 12px; color: var(--text-3);
}
.card__meta span { display: inline-flex; align-items: center; gap: 5px; }
.card__foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}
.card__ops { display: flex; gap: 2px; }

/* ------------------------------ 首页 ------------------------------ */
.hero {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  padding: 22px 24px;
  margin-bottom: 18px;
  background: linear-gradient(120deg, #2563eb, #3b82f6 65%, #60a5fa);
  border-radius: var(--radius-lg);
  color: #fff;
  box-shadow: 0 8px 28px rgba(37, 99, 235, .18);
}
.hero__title { font-size: 22px; font-weight: 650; letter-spacing: -.3px; }
.hero__sub { margin-top: 6px; font-size: 13px; opacity: .9; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hero__sub .tag { background: rgba(255,255,255,.22); color: #fff; border-color: rgba(255,255,255,.3); }
.hero__secure {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .26);
  border-radius: 999px;
  font-size: 12.5px;
}

.shortcuts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.shortcut {
  display: flex; flex-direction: column; gap: 5px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.shortcut:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--primary-border); }
.shortcut__icon {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: var(--primary-soft);
  color: var(--primary);
  margin-bottom: 6px;
}
.shortcut__title { font-size: 14.5px; font-weight: 620; }
.shortcut__desc { font-size: 12.5px; color: var(--text-3); }

.homecols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
}

.minilist li { border-bottom: 1px dashed var(--border); }
.minilist li:last-child { border-bottom: none; }
.minilist a, .minilist > li > a {
  display: flex; flex-direction: column; gap: 3px;
  padding: 11px 2px;
  transition: var(--transition);
}
.minilist a:hover { padding-left: 6px; }
.minilist a:hover .minilist__title { color: var(--primary); }
.minilist__title { font-size: 13.5px; font-weight: 550; }
.minilist__desc { font-size: 12px; color: var(--text-3); }
.minilist__time { font-size: 11.5px; color: var(--text-3); }

.minigrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.minicard {
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: var(--transition);
}
.minicard:hover { border-color: var(--primary-border); box-shadow: var(--shadow-sm); }
.minicard__cover {
  height: 96px;
  display: grid; place-items: center;
  background: var(--surface-2);
  color: var(--text-3);
  overflow: hidden;
}
.minicard__cover img { width: 100%; height: 100%; object-fit: cover; }
.minicard__name {
  display: block; padding: 9px 10px 2px;
  font-size: 13px; font-weight: 550;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.minicard__meta { display: block; padding: 0 10px 10px; font-size: 11.5px; color: var(--text-3); }

/* ------------------------------ 文件夹网格（每行 4 个） ------------------------------ */
.foldergrid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.foldercard {
  position: relative;
  padding: 22px 16px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}
.foldercard:hover { border-color: var(--primary-border); box-shadow: var(--shadow); transform: translateY(-2px); }
.foldercard__icon {
  width: 52px; height: 52px;
  margin: 0 auto 12px;
  display: grid; place-items: center;
  border-radius: 13px;
  background: var(--primary-soft);
  color: var(--primary);
}
.foldercard__name {
  font-size: 14.5px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.foldercard__meta { margin-top: 5px; font-size: 12px; color: var(--text-3); }
.foldercard__ops {
  position: absolute; top: 8px; right: 8px;
  display: flex; gap: 2px;
  opacity: 0; transition: var(--transition);
}
.foldercard:hover .foldercard__ops { opacity: 1; }

/* ------------------------------ 文件列表 ------------------------------ */
.filepanel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.filepanel__head {
  display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.filepanel__ops { margin-left: auto; display: flex; align-items: center; gap: 6px; }

.filetable { display: flex; flex-direction: column; }
.fileitem {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 6px;
  border-bottom: 1px dashed var(--border);
}
.filetable .fileitem:last-child { border-bottom: none; }
.fileitem__name {
  flex: 1; min-width: 0;
  font-size: 13.5px; font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fileitem__size, .fileitem__time, .fileitem__uploader {
  font-size: 12px; color: var(--text-3); white-space: nowrap;
}
.fileitem__ops { display: flex; align-items: center; gap: 4px; flex: none; }
.filelist { display: flex; flex-direction: column; gap: 4px; }
.filelist .fileitem { border-bottom: 1px solid var(--border); }

/* ------------------------------ 集市：卡片瀑布流 ------------------------------ */
.waterfall { column-count: 4; column-gap: 14px; }
.mcard {
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  display: inline-block;
  width: 100%;
  margin-bottom: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.mcard:hover { box-shadow: var(--shadow); border-color: var(--border-strong); }
.mcard__media { position: relative; cursor: pointer; }
.mcard__cover {
  height: 168px;
  display: grid; place-items: center;
  background: var(--surface-2);
  overflow: hidden;
}
.mcard__cover img { width: 100%; height: 100%; object-fit: cover; }
.mcard__cover--empty { color: var(--text-3); }
.mcard__media .tag { position: absolute; top: 10px; left: 10px; }
.mcard__body { padding: 13px 14px 14px; }
.mcard__name {
  font-size: 14.5px; font-weight: 600;
  cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mcard__name:hover { color: var(--primary); }
.mcard__desc {
  margin-top: 6px;
  font-size: 12.5px; color: var(--text-2); line-height: 1.65;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mcard__meta {
  display: flex; gap: 12px;
  margin: 10px 0 12px;
  font-size: 12px; color: var(--text-3);
}
.mcard__meta span { display: inline-flex; align-items: center; gap: 4px; }
.mcard__ops {
  display: flex; gap: 4px; justify-content: flex-end;
  margin-top: 8px; padding-top: 8px;
  border-top: 1px dashed var(--border);
}

/* ------------------------------ 详情页 ------------------------------ */
.article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}
.article__title { font-size: 22px; font-weight: 660; line-height: 1.4; letter-spacing: -.3px; }
.article__meta {
  display: flex; flex-wrap: wrap; gap: 16px;
  margin: 14px 0 22px; padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px; color: var(--text-3);
}
.article__meta span { display: inline-flex; align-items: center; gap: 5px; }
.article__body { font-size: 14.5px; line-height: 1.95; color: #23304b; white-space: pre-wrap; word-break: break-word; }
.article__files { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--border); }

.detail__gallery { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.detail__gallery img {
  width: 100%; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface-2);
}
.detail__noimg {
  height: 200px; display: grid; place-items: center;
  background: var(--surface-2); border-radius: var(--radius-sm); color: var(--text-3);
}
.detail__title { font-size: 20px; font-weight: 650; }
.detail__meta {
  display: flex; flex-wrap: wrap; gap: 14px;
  margin: 10px 0 16px;
  font-size: 12.5px; color: var(--text-3);
}
.detail__meta span { display: inline-flex; align-items: center; gap: 5px; }
.detail__desc {
  padding: 14px 16px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  font-size: 13.5px; line-height: 1.8; color: var(--text-2);
  white-space: pre-wrap;
}
.detail__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 20px; }

/* ------------------------------ 上传 ------------------------------ */
.uploader {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 18px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text-3);
}
.uploader--drop { cursor: pointer; transition: var(--transition); }
.uploader--drop:hover, .uploader--drop.is-over {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}
.uploader__main { font-size: 13.5px; color: var(--text-2); }
.uploader__tip { font-size: 12px; color: var(--text-3); }
.uploader .btn { margin-top: 6px; }

.imglist { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.imgthumb { position: relative; width: 84px; height: 84px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
.imgthumb img { width: 100%; height: 100%; object-fit: cover; }
.imgthumb button {
  position: absolute; top: 3px; right: 3px;
  width: 20px; height: 20px;
  display: grid; place-items: center;
  border: none; border-radius: 50%;
  background: rgba(15, 23, 42, .66);
  color: #fff; cursor: pointer;
}

.progress { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.progress__bar { flex: 1; height: 6px; background: var(--border); border-radius: 999px; overflow: hidden; }
.progress__inner { height: 100%; width: 0; background: var(--primary); border-radius: 999px; transition: width .2s ease; }
.progress__text { font-size: 12px; color: var(--text-3); min-width: 48px; }

/* ------------------------------ 预览 ------------------------------ */
.preview { min-height: 300px; }
.preview__img { display: grid; place-items: center; background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px; }
.preview__img img { max-height: 62vh; object-fit: contain; }
.preview__frame { width: 100%; height: 66vh; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; }
.preview__text {
  max-height: 62vh; overflow: auto;
  padding: 16px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  font-size: 12.5px; line-height: 1.7;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  white-space: pre-wrap; word-break: break-all;
}
.preview__office { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 40px 20px; text-align: center; }

/* ------------------------------ 标签 ------------------------------ */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 11.5px; font-weight: 550;
  color: var(--text-2);
  white-space: nowrap;
}
.tag--hq { background: var(--primary-soft); border-color: var(--primary-border); color: var(--primary); }
.tag--sub { background: #f5f3ff; border-color: #ddd6fe; color: #7c3aed; }
.tag--pin { background: var(--warn-soft); border-color: #fde68a; color: var(--warn); }
.tag--off { background: var(--danger-soft); border-color: var(--danger-border); color: var(--danger); }
.tag--on { background: var(--success-soft); border-color: #bbf7d0; color: var(--success); }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px;
  border: 1px solid var(--primary-border);
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12.5px;
}
.chip button { border: none; background: none; color: inherit; cursor: pointer; display: grid; place-items: center; }
.chip--warn { border-color: #fde68a; background: var(--warn-soft); color: var(--warn); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }

/* ------------------------------ 管理后台 ------------------------------ */
.tabs {
  display: flex; gap: 4px;
  margin-bottom: 18px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
}
.tabs__item {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13.5px; font-weight: 550;
  color: var(--text-2);
  white-space: nowrap;
  transition: var(--transition);
}
.tabs__item:hover { background: var(--surface-2); }
.tabs__item.is-active { background: var(--primary); color: #fff; }

.statgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.statcard {
  display: flex; flex-direction: column; gap: 2px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.statcard__icon { color: var(--primary); margin-bottom: 6px; }
.statcard__value { font-size: 24px; font-weight: 660; letter-spacing: -.5px; }
.statcard__label { font-size: 12.5px; color: var(--text-3); }
.statcard.is-warn { border-color: var(--danger-border); background: var(--danger-soft); }
.statcard.is-warn .statcard__icon, .statcard.is-warn .statcard__value { color: var(--danger); }

.tablewrap { overflow-x: auto; margin: 0 -4px; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left;
  padding: 10px 10px;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px; font-weight: 600; color: var(--text-3);
  white-space: nowrap;
}
.table td { padding: 11px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:hover { background: var(--surface-2); }
.table tr.is-warn { background: #fffdf5; }
.table tr.is-danger { background: var(--danger-soft); }
.nowrap { white-space: nowrap; }
.ellipsis { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.filterbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 14px;
  margin-bottom: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.filterbar .searchbar { min-width: 220px; flex: 1; }

.pager {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  padding-top: 14px;
}
.pager__nums { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pager__num {
  min-width: 30px; height: 30px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
}
.pager__num:hover { border-color: var(--primary-border); color: var(--primary); }
.pager__num.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pager__gap { padding: 0 4px; color: var(--text-3); }

.shotrank { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border); }
.shotrank .section__title { margin-right: 6px; }

.segmented {
  display: inline-flex;
  padding: 3px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 14px;
}
.segmented__item {
  padding: 6px 14px;
  border: none; background: transparent;
  border-radius: 7px;
  font-size: 13px; font-weight: 550;
  color: var(--text-2);
  cursor: pointer;
  transition: var(--transition);
}
.segmented__item.is-active { background: #fff; color: var(--primary); box-shadow: var(--shadow-sm); }

.searchpanel { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.searchpanel .searchbar { flex: 1; min-width: 260px; }
.resultgroup { margin-bottom: 14px; }

.permcols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; align-items: start; }
.permcols .searchbar { margin-bottom: 12px; }

/* 部门树 */
.tree { max-height: 420px; overflow-y: auto; padding: 4px 0; }
.tree__node { padding: 3px 0; }
.tree__label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13.5px; padding: 3px 0; }
.tree__label input { accent-color: var(--primary); cursor: pointer; }
.tree__name { font-weight: 500; }
.tree__children { border-left: 1px dashed var(--border); margin-left: 7px; }
.tree--static .tree__node { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 13.5px; }

.userlist { display: flex; flex-direction: column; max-height: 280px; overflow-y: auto; }
.userlist__item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 8px;
  border-radius: 8px;
  cursor: pointer;
}
.userlist__item:hover { background: var(--surface-2); }
.userlist__item input { accent-color: var(--primary); }
.userlist__name { font-size: 13.5px; font-weight: 550; }
.userlist__dept { font-size: 12px; color: var(--text-3); margin-left: auto; }
.userlist__row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 9px 2px;
  border-bottom: 1px dashed var(--border);
}
.userlist__row:last-child { border-bottom: none; }
.userlist__row .hint { flex-basis: 100%; }

.scopepicker__panel {
  margin-top: 14px; padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* ------------------------------ 消息中心 ------------------------------ */
.msgitem {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
}
.msgitem.is-unread { border-color: var(--primary-border); background: linear-gradient(180deg, #f8fbff, #fff); }
.msgitem__dot {
  width: 8px; height: 8px; margin-top: 7px;
  border-radius: 50%;
  background: var(--border-strong);
  flex: none;
}
.msgitem.is-unread .msgitem__dot { background: var(--primary); }
.msgitem__body { flex: 1; min-width: 0; }
.msgitem__title { font-size: 14px; font-weight: 600; }
.msgitem__content { margin-top: 4px; font-size: 13px; color: var(--text-2); line-height: 1.7; }
.msgitem__time { margin-top: 6px; font-size: 12px; color: var(--text-3); }

/* ------------------------------ 个人中心 ------------------------------ */
.profile { display: flex; align-items: center; gap: 16px; padding-bottom: 16px; margin-bottom: 6px; border-bottom: 1px solid var(--border); }
.profile__avatar {
  width: 64px; height: 64px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  overflow: hidden;
  flex: none;
}
.profile__avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile__name { font-size: 18px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.profile__sub { font-size: 13px; color: var(--text-3); margin-top: 3px; }

.infolist { display: flex; flex-direction: column; }
.infolist__row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 12px 2px;
  border-bottom: 1px dashed var(--border);
}
.infolist__row:last-child { border-bottom: none; }
.infolist__label { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-3); flex: none; }
.infolist__label .icon { color: var(--text-3); }
.infolist__value { font-size: 13.5px; font-weight: 550; text-align: right; word-break: break-all; }

.tiplist { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.tiplist li { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; color: var(--text-2); }
.tiplist .icon { color: var(--success); margin-top: 2px; }

/* ------------------------------ 弹窗 ------------------------------ */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, .42);
  backdrop-filter: blur(2px);
  display: grid; place-items: center;
  padding: 20px;
  z-index: 2000;
  opacity: 0;
  transition: opacity .2s ease;
}
.modal-mask.is-show { opacity: 1; }
.modal {
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  transform: translateY(8px) scale(.985);
  transition: transform .2s ease;
  overflow: hidden;
}
.modal-mask.is-show .modal { transform: none; }
.modal--lg { max-width: 760px; }
.modal--xl { max-width: 95vw; }
.modal--danger { border: 2px solid var(--danger); }
.modal__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.modal__title { font-size: 15.5px; font-weight: 620; }
.modal__close {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border: none; background: transparent;
  border-radius: 8px; color: var(--text-3);
  cursor: pointer;
}
.modal__close:hover { background: var(--surface-2); color: var(--text); }
.modal__body { padding: 18px; overflow-y: auto; flex: 1; }
.modal__foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}
.confirm-text { font-size: 14px; line-height: 1.8; color: var(--text-2); white-space: pre-line; }

/* 安全警告卡片：白底红框 */
.warncard { text-align: left; }
.warncard__head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.warncard__icon {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--danger-soft);
  color: var(--danger);
  flex: none;
}
.warncard__title { font-size: 16px; font-weight: 650; color: var(--danger); }
.warncard__meta {
  display: flex; flex-direction: column; gap: 8px;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
}
.warncard__meta li { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.warncard__meta span { color: var(--text-3); flex: none; }
.warncard__meta b { font-weight: 600; text-align: right; word-break: break-all; }
.warncard__msg {
  padding: 12px 14px;
  border: 1px solid var(--danger-border);
  background: var(--danger-soft);
  border-radius: var(--radius-sm);
  font-size: 13px; line-height: 1.8; color: #991b1b;
}

/* ------------------------------ Toast ------------------------------ */
.toast-root {
  position: fixed;
  left: 50%; bottom: 32px;
  transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px;
  z-index: 1200;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 16px;
  background: #16213a;
  color: #fff;
  border-radius: 999px;
  font-size: 13.5px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .22s ease, transform .22s ease;
  max-width: 90vw;
}
.toast.is-show { opacity: 1; transform: none; }
.toast--success .icon { color: #4ade80; }
.toast--error .icon, .toast--warn .icon { color: #fca5a5; }

/* ------------------------------ 页面溯源水印 ------------------------------ */
.watermark {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  background-repeat: repeat;
  background-size: 300px 170px;
}

/* ------------------------------ 加载 / 空状态 ------------------------------ */
.loading {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 48px 0;
  font-size: 13.5px; color: var(--text-3);
}
.spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.empty {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 56px 20px;
  color: var(--text-3);
}
.empty__icon { opacity: .5; }
.empty__text { font-size: 13.5px; }

.page-loading {
  position: fixed; inset: 0;
  display: grid; place-items: center;
  background: rgba(246, 248, 251, .6);
  z-index: 1100;
}
.page-loading[hidden] {
  display: none !important;
}

/* 骨架屏 */
.skeleton-page { display: flex; flex-direction: column; gap: 14px; padding: 8px 0; }
.skeleton {
  border-radius: var(--radius);
  background: linear-gradient(90deg, #eef1f6 25%, #f6f8fb 37%, #eef1f6 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease infinite;
}
.skeleton--title { height: 34px; width: 220px; }
.skeleton--card { height: 130px; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ------------------------------ 响应式 ------------------------------ */
@media (max-width: 1180px) {
  .waterfall { column-count: 3; }
  .foldergrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .shortcuts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .permcols { grid-template-columns: 1fr; }
  .navsearch { max-width: 240px; }
}

@media (max-width: 860px) {
  .navbar__inner { padding: 0 14px; gap: 10px; }
  .navsearch { display: none; }
  .brand__name { font-size: 15px; }
  .navtoggle { display: grid; place-items: center; margin-left: auto; }

  /* 移动端导航：抽屉式 */
  .navmenu {
    position: fixed;
    top: var(--nav-h); left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px 14px 18px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 890;
  }
  body.nav-open .navmenu { transform: none; opacity: 1; visibility: visible; }
  .navmenu__item { height: 44px; font-size: 15px; padding: 0 14px; }
  .navmenu__icon { display: none; }
  .navmenu__divider { width: 100%; height: 1px; margin: 6px 0; }
  .navmenu__iconbtn { width: 44px; height: 44px; align-self: flex-start; }
  .navmenu__iconbtn .badge { position: static; margin-left: 6px; }
  .navmenu__iconbtn::after { content: attr(title); font-size: 14px; margin-left: 4px; }

  .main { padding: 16px 14px; }
  .page__head { align-items: flex-start; flex-direction: column; }
  .page__actions { width: 100%; }
  .page__actions .searchbar { flex: 1; }

  .waterfall { column-count: 2; }
  .foldergrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shortcuts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cards { grid-template-columns: 1fr; }
  .statgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .minigrid { grid-template-columns: 1fr; }

  .article { padding: 18px 16px; }
  .article__title { font-size: 19px; }

  .fileitem__time, .fileitem__uploader { display: none; }

  .modal { max-height: 92vh; }
  .modal--lg, .modal { max-width: 100%; }
  .modal__foot { flex-direction: row-reverse; }
  .modal__foot .btn { flex: 1; }
}

@media (max-width: 520px) {
  .waterfall { column-count: 1; }
  .foldergrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shortcuts { grid-template-columns: 1fr; }
  .hero { padding: 18px; }
  .hero__title { font-size: 19px; }
  .toast-root { bottom: 20px; }
  .filterbar { flex-direction: column; align-items: stretch; }
  .filterbar .input--sm { width: 100%; }
}
