:root {
  --bg: #f0f2f5;
  --panel: #ffffff;
  --ink: #142033;
  --muted: #64748b;
  --accent: #1890ff;
  --accent-2: #096dd9;
  --accent-soft: rgba(24, 144, 255, 0.1);
  --danger: #c0392b;
  --line: #e2e8f0;
  --shadow: 0 8px 28px rgba(20, 32, 51, 0.06);
  --radius: 14px;
  --font-display: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --touch: 44px;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  font-family: var(--font-display);
  background: var(--bg);
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }

.btn-primary {
  --bs-btn-bg: var(--accent);
  --bs-btn-border-color: var(--accent);
  --bs-btn-hover-bg: var(--accent-2);
  --bs-btn-hover-border-color: var(--accent-2);
  --bs-btn-active-bg: #0050b3;
  --bs-btn-active-border-color: #0050b3;
}

.touch-btn {
  min-height: 40px;
  padding-left: 14px;
  padding-right: 14px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(145deg, #1890ff, #40a9ff);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(24, 144, 255, 0.28);
  flex-shrink: 0;
}

.brand-mark-sm {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  font-size: 13px;
}

.auth-wrap {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.22) 0%, rgba(232, 196, 176, 0.2) 100%),
    url("/static/images/auth-bg.jpg") center / cover no-repeat;
  background-color: #e8c4b0;
}

.auth-panel {
  --auth-blue: #4a9fe5;
  --auth-blue-2: #3b8fd4;
  width: 100%;
  max-width: 860px;
  display: grid;
  grid-template-columns: minmax(240px, 0.9fr) 1.2fr;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(60, 40, 30, 0.22);
}

.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 40px 28px;
  text-align: center;
  color: #fff;
  background: linear-gradient(165deg, #5aadef 0%, var(--auth-blue) 55%, var(--auth-blue-2) 100%);
}

.auth-brand-logo {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  background: #fff;
  color: var(--auth-blue);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  box-shadow: 0 8px 20px rgba(20, 70, 120, 0.18);
}

.auth-brand-title {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.35;
}

.auth-brand-desc {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.92;
  letter-spacing: 0.02em;
}

.auth-form {
  padding: 42px 40px 36px;
  background: #fff;
}

.auth-form-title {
  margin: 0 0 6px;
  font-size: 1.55rem;
  font-weight: 700;
  color: #2c3e50;
}

.auth-form-sub {
  margin: 0 0 22px;
  font-size: 0.92rem;
  color: #94a3b8;
}

.auth-field {
  position: relative;
}

.auth-field .form-control {
  min-height: 48px;
  padding: 10px 44px 10px 42px;
  border: none;
  border-radius: 10px;
  background: #eef4fb;
  font-size: 16px;
  color: #334155;
  box-shadow: none;
}

.auth-field .form-control:focus {
  background: #e6eef8;
  box-shadow: 0 0 0 3px rgba(74, 159, 229, 0.22);
}

.auth-field .form-control::placeholder {
  color: #94a3b8;
}

.auth-field-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 1.05rem;
  pointer-events: none;
}

.auth-field-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  cursor: pointer;
}

.auth-field-toggle:hover {
  color: var(--auth-blue, #4a9fe5);
  background: rgba(74, 159, 229, 0.08);
}

.auth-submit {
  --bs-btn-bg: #4a9fe5;
  --bs-btn-border-color: #4a9fe5;
  --bs-btn-hover-bg: #3b8fd4;
  --bs-btn-hover-border-color: #3b8fd4;
  --bs-btn-active-bg: #2f7fc0;
  --bs-btn-active-border-color: #2f7fc0;
  --bs-btn-color: #fff;
  --bs-btn-hover-color: #fff;
  min-height: 48px;
  border-radius: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  margin-top: 4px;
}

.auth-footer {
  margin-top: 18px;
  text-align: center;
  font-size: 0.9rem;
  color: #94a3b8;
}

.auth-footer a {
  color: #4a9fe5;
  font-weight: 500;
}

.auth-footer a:hover {
  color: #3b8fd4;
}

@media (max-width: 720px) {
  .auth-panel {
    grid-template-columns: 1fr;
    max-width: 440px;
  }

  .auth-brand {
    padding: 28px 22px 24px;
    gap: 10px;
  }

  .auth-brand-logo {
    width: 52px;
    height: 52px;
    font-size: 24px;
  }

  .auth-brand-title {
    font-size: 1.35rem;
  }

  .auth-form {
    padding: 28px 22px 24px;
  }
}

.topbar {
  background: #1890ff;
  border-bottom: none;
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: 56px;
  padding: 0;
}

.topbar-primary .topbar-inner {
  min-height: 56px;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 0;
  flex: 1;
}

.topbar .navbar-brand {
  font-weight: 700;
  color: #fff;
  font-size: 1.05rem;
  margin: 0;
  min-width: 0;
  white-space: nowrap;
}

.topbar .navbar-brand:hover {
  color: #fff;
  opacity: 0.92;
}

.brand-icon {
  font-size: 1.25rem;
}

.top-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.top-link,
.top-link-btn {
  display: inline-flex;
  align-items: center;
  color: rgba(255, 255, 255, 0.88);
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 6px;
  border: 0;
  background: transparent;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.top-link:hover,
.top-link-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

.top-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
  font-weight: 600;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.btn-upload {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 6px 16px rgba(24, 144, 255, 0.22);
}

.btn-upload:hover,
.btn-upload:focus {
  background: var(--accent-2);
  color: #fff;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
}

.btn-ghost:hover {
  background: #f8fafc;
  color: var(--accent);
  border-color: rgba(24, 144, 255, 0.25);
}

.account-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  max-width: 220px;
  padding: 2px 10px 2px 2px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: #fff;
  transition: background 0.15s ease;
}

.account-trigger-light:hover,
.account-trigger-light[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.14);
  border-color: transparent;
}

.account-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

.account-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  line-height: 1.15;
}

.account-name {
  font-size: 13px;
  font-weight: 600;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #fff;
}

.account-role {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.75);
}

.account-caret {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
  margin-left: 2px;
}

.account-dropdown {
  min-width: 180px;
  margin-top: 8px !important;
  z-index: 2000;
}

.hero-card {
  background: #fafafa;
  border: 1px solid #f0f0f0;
  border-radius: 8px;
  padding: 36px 28px 32px;
  text-align: center;
  margin-bottom: 28px;
}

.hero-title {
  margin: 0 0 10px;
  font-size: 1.75rem;
  font-weight: 700;
  color: #1f2937;
}

.hero-sub {
  margin: 0;
  color: #8c8c8c;
  font-size: 0.98rem;
}

.hero-divider {
  margin: 22px auto 18px;
  max-width: 100%;
  border-color: #e8e8e8;
  opacity: 1;
}

.hero-welcome {
  margin: 0 0 16px;
  color: #595959;
  font-size: 1rem;
}

.hero-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 18px;
  border-radius: 6px;
  font-weight: 500;
}

.latest-section {
  margin-bottom: 24px;
}

.latest-title {
  margin: 0 0 16px;
  font-size: 1.15rem;
  font-weight: 650;
  color: #1f2937;
}

.latest-table {
  background: #fff;
  border-radius: 8px;
  border: 1px solid var(--line);
  overflow: hidden;
}

.latest-more {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.latest-more .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  border-radius: 6px;
}

.app-footer {
  text-align: center;
  padding: 20px 16px 28px;
  color: #bfbfbf;
  font-size: 13px;
}

@media (max-width: 991px) {
  .topbar-left {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 10px 0;
  }

  .top-links {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .hero-card {
    padding: 28px 18px 24px;
  }

  .hero-title {
    font-size: 1.4rem;
  }
}

.top-nav-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px 0 4px;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f1f5f9;
  border: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
  max-width: 100%;
}

.user-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-shell {
  max-width: 1320px;
  margin: 0 auto;
}

.workspace,
.admin-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: visible; /* 避免「更多」下拉被裁切 */
}

.workspace-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfd 100%);
}

.filter-form {
  display: flex;
  flex: 1 1 100%;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.filter-search {
  flex: 1 1 100%;
  min-width: 0;
}

.filter-search .form-control {
  font-size: 16px;
  min-height: 42px;
}

.filter-search .input-group-text {
  background: #fff;
  border-right: 0;
  color: var(--muted);
}

.filter-search .form-control {
  border-left: 0;
  box-shadow: none !important;
}

.filter-search .input-group:focus-within {
  box-shadow: 0 0 0 3px var(--accent-soft);
  border-radius: 0.375rem;
}

.filter-search .input-group:focus-within .input-group-text,
.filter-search .input-group:focus-within .form-control {
  border-color: rgba(24, 144, 255, 0.35);
}

.filter-cat {
  flex: 1 1 140px;
  min-width: 0;
  min-height: 42px;
  font-size: 16px;
}

.filter-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
}

.filter-actions .btn {
  flex: 1;
  min-height: 42px;
}

.workspace-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}

.meta-left {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 4px;
}

.toast-stack {
  position: fixed;
  top: 72px;
  right: 16px;
  z-index: 1080;
  width: min(360px, calc(100vw - 32px));
  display: grid;
  gap: 8px;
}

.flash {
  border: 0;
  border-radius: 12px;
  box-shadow: var(--shadow);
  margin: 0;
}

.table {
  margin: 0;
  --bs-table-bg: transparent;
}

.table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f1f5f9;
  color: #334155;
  font-weight: 650;
  font-size: 12px;
  letter-spacing: 0.02em;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  padding: 10px 14px;
}

.table tbody td {
  padding: 12px 14px;
  border-bottom-color: #eef2f6;
  vertical-align: middle;
}

.table tbody tr:last-child td { border-bottom: 0; }

.table tbody tr:hover {
  background: rgba(24, 144, 255, 0.03);
}

.file-name {
  max-width: 320px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.type-badge,
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
}

.type-badge {
  background: #f8fafc;
  border-color: var(--line);
  color: var(--muted);
}

.status-on {
  background: rgba(24, 144, 255, 0.12);
  color: #096dd9;
  border-color: rgba(24, 144, 255, 0.18);
}

.status-off {
  background: #eef2f6;
  color: #64748b;
  border-color: #dbe3ec;
}

.remark-cell {
  max-width: 160px;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ops {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.op-btn {
  width: var(--touch);
  height: var(--touch);
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: #64748b;
  transition: background 0.15s ease, color 0.15s ease;
}

.op-btn:hover,
.op-btn:focus {
  background: var(--accent-soft);
  color: var(--accent);
}

.dropdown-menu {
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 6px;
  min-width: 168px;
  z-index: 2000;
}

/* table-responsive 默认 overflow 会裁切菜单，改为仅横向滚动且允许纵向溢出 */
.desktop-table.table-responsive,
.admin-panel .table-responsive {
  overflow-x: auto;
  overflow-y: visible;
}

.dropdown-item {
  border-radius: 8px;
  font-size: 14px;
  padding: 10px 12px;
  min-height: 40px;
}

.dropdown-item i { width: 18px; }

.empty-state {
  padding: 48px 20px;
  text-align: center;
  color: var(--muted);
}

.empty-state i {
  font-size: 2.2rem;
  opacity: 0.35;
  display: block;
  margin-bottom: 10px;
}

/* 手机 / Pad 卡片列表 */
.file-cards {
  padding: 12px;
  display: grid;
  gap: 10px;
}

.file-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}

.file-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.file-card-title {
  font-weight: 650;
  line-height: 1.35;
  word-break: break-word;
  flex: 1;
  min-width: 0;
}

.file-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.file-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}

.file-card-remark {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
  background: #f8fafc;
  border-radius: 8px;
  padding: 8px 10px;
  word-break: break-word;
}

.admin-panel .table-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
  padding: 10px 14px;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}

.user-cards {
  padding: 12px;
  display: grid;
  gap: 10px;
}

.user-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
}

.user-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.user-card-actions form {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.user-card-actions .form-control {
  flex: 1;
  min-width: 0;
  font-size: 16px;
  min-height: 42px;
}

.preview-main {
  position: relative;
  overflow: hidden;
  height: calc(100vh - 58px);
  height: calc(100dvh - 58px);
  display: grid;
  place-items: center;
  padding: 12px;
  background: #111827;
}

.preview-watermark {
  position: absolute;
  inset: 0;
  z-index: 50;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
}

.preview-watermark-inner {
  position: absolute;
  left: -50%;
  top: -50%;
  width: 200%;
  height: 200%;
  display: grid;
  grid-template-columns: repeat(6, minmax(180px, 1fr));
  gap: 48px 64px;
  align-content: start;
  justify-items: center;
  transform: rotate(-28deg);
  transform-origin: center center;
}

.preview-watermark-item {
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: 36px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(0, 0, 0, 0.22);
  text-shadow: 0 0 1px rgba(255, 255, 255, 0.35);
}

.preview-main-pdf .preview-watermark-item,
.preview-main-office .preview-watermark-item,
.preview-main-video .preview-watermark-item,
.preview-main:not(.preview-main-text):not(.preview-main-generic):not(.preview-main-audio) .preview-watermark-item {
  color: rgba(226, 232, 240, 0.22);
  text-shadow: none;
}

.preview-main-text .preview-watermark-item,
.preview-main-generic .preview-watermark-item,
.preview-main-audio .preview-watermark-item {
  color: rgba(15, 23, 42, 0.12);
}

.preview-main > :not(.preview-watermark) {
  position: relative;
  z-index: 1;
}

.preview-main-text,
.preview-main-generic,
.preview-main-audio {
  background: #f5f6f8;
}

.preview-main-office,
.preview-main-pdf,
.preview-main-video {
  padding: 0;
  place-items: stretch;
}

.preview-topbar {
  background: #2c3e50 !important;
  border-bottom: 0 !important;
}

.preview-topbar .navbar-brand,
.preview-topbar .brand-text {
  color: #fff !important;
}

.preview-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

.preview-frame,
.preview-pdf {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.preview-office-wrap {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background: #fff;
}

.preview-office-wrap .preview-frame {
  flex: 1;
  min-height: 0;
}

.preview-hint {
  margin: 0;
  padding: 8px 12px;
  font-size: 13px;
  color: #666;
  background: #f8fafc;
  border-top: 1px solid #e5e7eb;
}

.preview-media {
  max-width: min(960px, 100%);
  max-height: calc(100% - 24px);
  width: 100%;
  background: #000;
}

.preview-audio-box {
  width: min(520px, 100%);
  background: #fff;
  border-radius: 12px;
  padding: 28px 24px;
  text-align: center;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
}

.preview-audio-icon {
  font-size: 2.4rem;
  color: #1890ff;
}

.preview-audio-name {
  margin: 10px 0 18px;
  font-weight: 600;
  word-break: break-all;
}

.preview-audio {
  width: 100%;
}

.preview-text-wrap {
  width: min(960px, 100%);
  max-height: 100%;
  overflow: auto;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.preview-text {
  margin: 0;
  padding: 16px 18px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 13px;
  line-height: 1.55;
  color: #1f2937;
}

.preview-generic {
  width: min(480px, 100%);
  background: #fff;
  border-radius: 12px;
  padding: 32px 24px;
  text-align: center;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
}

.preview-generic-icon {
  font-size: 3rem;
  color: #94a3b8;
  display: block;
  margin-bottom: 10px;
}

.preview-name {
  max-width: 45vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Pad 横屏 / 小桌面 */
@media (min-width: 768px) {
  .filter-search {
    flex: 1 1 260px;
  }

  .filter-cat {
    flex: 0 1 160px;
  }

  .filter-actions {
    width: auto;
    margin-left: auto;
  }

  .filter-actions .btn {
    flex: 0 0 auto;
  }

  .file-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* PC */
@media (min-width: 992px) {
  .filter-form {
    flex-wrap: nowrap;
  }

  .op-btn {
    width: 34px;
    height: 34px;
  }
}

/* 手机窄屏 */
@media (max-width: 575.98px) {
  .brand-text {
    font-size: 0.95rem;
  }

  .account-meta {
    display: none;
  }

  .account-trigger {
    padding: 4px;
    max-width: none;
  }

  .account-caret {
    display: none;
  }

  .btn-upload span {
    display: none;
  }

  .btn-upload {
    width: 40px;
    padding: 0;
    justify-content: center;
  }

  .meta-legend {
    width: 100%;
  }

  .toast-stack {
    top: auto;
    bottom: 16px;
    right: 12px;
    left: 12px;
    width: auto;
  }

  .workspace,
  .admin-panel {
    border-radius: 12px;
  }

  .page-shell.py-3 {
    padding-top: 0.75rem !important;
    padding-bottom: 1rem !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

/* ========== 博客分类布局 ========== */
.blog-layout {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #f5f5f5;
}

.blog-topbar {
  background: #1890ff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(24, 144, 255, 0.25);
}

.blog-topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.blog-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  white-space: nowrap;
}

.blog-brand:hover { color: #fff; opacity: 0.92; }

.blog-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
}

.blog-nav-link,
.blog-nav-btn {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 4px;
  border: 0;
  background: transparent;
  white-space: nowrap;
  cursor: pointer;
}

.blog-nav-link:hover,
.blog-nav-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

.blog-nav-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.22);
  font-weight: 600;
}

.blog-user { margin-left: auto; }

.blog-user-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  background: transparent;
  border: 0;
  padding: 6px 8px;
  border-radius: 4px;
  font-size: 14px;
}

.blog-user-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

.blog-body { flex: 1; }

.blog-footer {
  text-align: center;
  padding: 20px 16px 28px;
  color: #bfbfbf;
  font-size: 13px;
}

.blog-flash {
  max-width: 1100px;
  margin: 16px auto 0;
  padding: 0 16px;
}

.blog-main {
  max-width: 1100px;
  margin: 20px auto 24px;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 20px;
  align-items: start;
}

.blog-home {
  max-width: 900px;
  margin: 20px auto 24px;
  padding: 0 16px;
}

.cat-sidebar {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 6px;
  overflow: hidden;
  position: sticky;
  top: 72px;
}

.cat-sidebar-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: #1890ff;
  color: #fff;
  font-weight: 600;
}

.cat-list {
  display: flex;
  flex-direction: column;
}

.cat-item {
  display: block;
  padding: 12px 16px;
  color: #333;
  text-decoration: none;
  border-bottom: 1px solid #f0f0f0;
  font-size: 14px;
}

.cat-item:last-child { border-bottom: 0; }

.cat-item:hover {
  background: #f5f9ff;
  color: #1890ff;
}

.cat-item.active {
  background: #e6f4ff;
  color: #1890ff;
  font-weight: 600;
}

.blog-list-panel { min-width: 0; }

.blog-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.blog-list-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: #1f2937;
}

.blog-publish-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.blog-search {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.blog-search .form-control {
  max-width: 360px;
}

.post-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.post-card {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 6px;
  padding: 18px 20px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.post-title {
  display: inline-block;
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-weight: 650;
  color: #1890ff;
  text-decoration: none;
  word-break: break-all;
}

.post-title:hover {
  color: #096dd9;
  text-decoration: underline;
}

.post-summary {
  margin: 0 0 14px;
  color: #666;
  font-size: 14px;
  line-height: 1.6;
  word-break: break-word;
}

.post-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: #8c8c8c;
  font-size: 13px;
}

.post-meta i { margin-right: 4px; }

.post-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.post-more {
  white-space: nowrap;
}

.post-empty {
  background: #fff;
  border: 1px dashed #d9d9d9;
  border-radius: 6px;
  padding: 48px 20px;
  text-align: center;
  color: #999;
}

.post-empty i {
  font-size: 2rem;
  display: block;
  margin-bottom: 8px;
}

.admin-card-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (max-width: 800px) {
  .blog-topbar-inner {
    flex-wrap: wrap;
    padding: 10px 12px;
    gap: 8px;
  }

  .blog-nav {
    order: 3;
    width: 100%;
  }

  .blog-user { margin-left: 0; }

  .blog-main {
    grid-template-columns: 1fr;
  }

  .cat-sidebar {
    position: static;
  }

  .cat-list {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .cat-item {
    white-space: nowrap;
    border-bottom: 0;
    border-right: 1px solid #f0f0f0;
  }
}

/* ========== 文件上传管理（产品管理风格） ========== */
.pm-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  min-height: 100vh;
  min-height: 100dvh;
  background: #f0f2f5;
}

.pm-sidebar {
  background: #2f80ed;
  color: #fff;
  min-height: 100vh;
  min-height: 100dvh;
}

.pm-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 18px 16px;
  font-weight: 700;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.pm-side-nav {
  display: flex;
  flex-direction: column;
  padding: 10px 0;
}

.pm-side-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  font-size: 14px;
}

.pm-side-link:hover,
.pm-side-link.active {
  background: rgba(0, 0, 0, 0.12);
  color: #fff;
}

.pm-main {
  min-width: 0;
  padding: 0 0 28px;
}

.pm-crumb {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: #e9ecef;
  color: #555;
  font-size: 13px;
  border-bottom: 1px solid #dde1e6;
}

.pm-crumb-toggle {
  display: none;
  border: 0;
  background: transparent;
  font-size: 1.2rem;
}

.pm-crumb-user {
  margin-left: auto;
  color: #888;
}

.pm-flash {
  padding: 12px 20px 0;
}

.pm-title {
  margin: 16px 20px 12px;
  font-size: 1.4rem;
  font-weight: 700;
  color: #333;
}

.pm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 20px 14px;
}

.pm-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  border-radius: 3px;
  padding: 8px 14px;
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

.pm-btn-add { background: #5cb85c; }
.pm-btn-batch { background: #5bc0de; }
.pm-btn-show { background: #5cb85c; }
.pm-btn-hide { background: #f0ad4e; }
.pm-btn-del { background: #d9534f; }
.pm-btn-update { background: #5cb85c; }

.pm-btn:hover { filter: brightness(1.05); color: #fff; }

.pm-table-wrap {
  margin: 0 20px;
  background: #fff;
  border: 1px solid #e5e5e5;
  overflow: auto;
}

.pm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin: 0;
}

.pm-table thead th {
  background: #fafafa;
  color: #333;
  font-weight: 600;
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid #e8e8e8;
  white-space: nowrap;
}

.pm-table tbody td {
  padding: 12px 10px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
  background: #fff;
}

.pm-table tbody tr:nth-child(even) td {
  background: #fcfcfc;
}

.pm-table .col-check {
  width: 42px;
  text-align: center;
}

.pm-sort {
  width: 52px;
  height: 28px;
  border: 1px solid #ddd;
  border-radius: 2px;
  text-align: center;
  padding: 2px 4px;
}

.pm-thumb {
  width: 48px;
  height: 48px;
  border: 1px solid #eee;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #f7f7f7;
  color: #888;
  font-size: 1.35rem;
}

.pm-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pm-name {
  color: #5cb85c;
  font-weight: 600;
  text-decoration: none;
  word-break: break-all;
}

.pm-name:hover {
  color: #449d44;
  text-decoration: underline;
}

.pm-empty {
  text-align: center;
  color: #999;
  padding: 40px 12px !important;
}

.pm-folder-panel {
  margin-top: 18px;
  padding: 12px 14px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.pm-folder-title {
  font-size: 12px;
  color: #9aa3af;
  margin-bottom: 8px;
  letter-spacing: 0.04em;
}

.pm-folder-link {
  display: block;
  color: #c9d1d9;
  text-decoration: none;
  font-size: 13px;
  padding: 5px 8px;
  border-radius: 4px;
}

.pm-folder-link:hover,
.pm-folder-link.active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.pm-folder-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pm-folder-row .pm-folder-link {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pm-folder-ops {
  display: flex;
  align-items: center;
  gap: 2px;
}

.pm-folder-ops form {
  margin: 0;
}

.pm-folder-icon {
  border: 0;
  background: transparent;
  color: #8b949e;
  padding: 2px 4px;
  cursor: pointer;
  line-height: 1;
}

.pm-folder-icon:hover {
  color: #fff;
}

.pm-folder-create {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.pm-folder-create .form-control {
  flex: 1;
  min-width: 0;
}

.pm-row-ops {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.pm-inline-form {
  display: inline;
  margin: 0;
}

.pm-row-btn {
  border: 0;
  border-radius: 3px;
  padding: 4px 8px;
  font-size: 12px;
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
}

.pm-row-show { background: #5cb85c; }
.pm-row-hide { background: #f0ad4e; }
.pm-row-move { background: #5bc0de; }
.pm-row-del { background: #d9534f; }

.pm-row-btn:hover { filter: brightness(1.05); color: #fff; }

.upload-progress {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #eee;
}

.upload-progress .progress {
  height: 12px;
  border-radius: 6px;
  background: #eef2f6;
}

.upload-progress .progress-bar {
  transition: width 0.15s ease;
}

.upload-progress [data-progress-text] {
  word-break: break-all;
  line-height: 1.4;
}

@media (max-width: 900px) {
  .pm-layout {
    grid-template-columns: 1fr;
  }

  .pm-sidebar {
    display: none;
  }

  .pm-crumb-toggle {
    display: inline-flex;
  }

  .pm-layout.sidebar-open .pm-sidebar {
    display: block;
    position: fixed;
    inset: 0 auto 0 0;
    width: 220px;
    z-index: 200;
  }
}
