/* =====================================================================
   密信 MiXin 管理后台样式
   浅灰经典后台风格：侧边栏 + 顶栏 + 内容区，主色 #07C160
   ===================================================================== */

/* ------------------------------ 基础变量 ------------------------------ */
:root {
  --green: #07c160;
  --green-dark: #06a852;
  --green-deep: #058e46;
  --green-soft: #e9f9f0;
  --green-line: #b8ecd1;

  --bg: #f4f5f7;
  --panel: #ffffff;
  --panel-alt: #fafbfc;
  --border: #e5e7eb;
  --border-strong: #d5d9df;

  --text: #1f2329;
  --text-2: #4b5563;
  --muted: #8a919c;
  --muted-2: #a8aeb8;

  --red: #e5484d;
  --red-soft: #fdeced;
  --red-line: #f6c6c8;
  --amber: #d97706;
  --amber-soft: #fef4e6;
  --amber-line: #f5dcb5;
  --blue: #2f6fed;
  --blue-soft: #eaf1fe;
  --purple: #7a5af8;
  --purple-soft: #f1edfe;

  --radius: 10px;
  --radius-sm: 7px;
  --shadow-sm: 0 1px 2px rgba(17, 24, 39, 0.05);
  --shadow-md: 0 6px 20px rgba(17, 24, 39, 0.08);
  --shadow-lg: 0 18px 50px rgba(17, 24, 39, 0.18);

  --sidebar-w: 232px;
  --topbar-h: 64px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
}

.mono {
  font-family: var(--mono);
}

/* ------------------------------ 启动层 ------------------------------ */
.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

.boot-box {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-2);
  font-size: 14px;
}

/* ------------------------------ 登录页 ------------------------------ */
.login-view {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  overflow: hidden;
  background: linear-gradient(160deg, #f2f7f4 0%, #f6f7f9 45%, #eef3f0 100%);
}

.login-decor {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  pointer-events: none;
}

.login-decor-a {
  width: 460px;
  height: 460px;
  top: -180px;
  right: -120px;
  background: radial-gradient(circle at 35% 35%, rgba(7, 193, 96, 0.16), rgba(7, 193, 96, 0));
}

.login-decor-b {
  width: 380px;
  height: 380px;
  bottom: -160px;
  left: -100px;
  background: radial-gradient(circle at 60% 40%, rgba(7, 193, 96, 0.1), rgba(7, 193, 96, 0));
}

.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  padding: 34px 34px 26px;
  background: var(--panel);
  border: 1px solid rgba(229, 231, 235, 0.9);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(23, 39, 31, 0.11);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 28px;
}

.brand-logo {
  width: 36px;
  height: 36px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(145deg, #0ad06a, #06a852);
  box-shadow: 0 4px 12px rgba(7, 193, 96, 0.32);
}

.brand-logo svg {
  width: 22px;
  height: 22px;
}

.brand-logo-lg {
  width: 48px;
  height: 48px;
  border-radius: 13px;
}

.brand-logo-lg svg {
  width: 28px;
  height: 28px;
}

.login-brand-text h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.login-brand-text h1 span {
  color: var(--green);
  font-weight: 600;
}

.login-brand-text p {
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.4px;
}

.login-fields {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-error {
  padding: 9px 12px;
  font-size: 13px;
  color: #b42318;
  background: var(--red-soft);
  border: 1px solid var(--red-line);
  border-radius: var(--radius-sm);
}

.login-foot {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
  font-size: 12px;
  color: var(--muted-2);
  text-align: center;
  line-height: 1.6;
}

/* ------------------------------ 表单控件 ------------------------------ */
.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-field > label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}

.input {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input::placeholder {
  color: var(--muted-2);
}

.input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.13);
}

.textarea {
  height: auto;
  min-height: 92px;
  padding: 10px 12px;
  line-height: 1.65;
  resize: vertical;
}

select.input {
  appearance: none;
  padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a919c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  background-size: 15px;
  cursor: pointer;
}

input[type="date"].input {
  padding-right: 8px;
  cursor: pointer;
}

input[type="date"].input::-webkit-calendar-picker-indicator {
  opacity: 0.5;
  cursor: pointer;
}

.password-wrap {
  position: relative;
}

.password-wrap .input {
  padding-right: 56px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  padding: 4px 8px;
  font-size: 12px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 5px;
  cursor: pointer;
}

.password-toggle:hover {
  color: var(--green-deep);
  background: var(--green-soft);
}

.form-error {
  font-size: 12.5px;
  color: #b42318;
}

.form-hint {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}

/* ------------------------------ 按钮 ------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1;
  color: var(--text-2);
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.btn:hover {
  color: var(--text);
  background: #f7f8fa;
  border-color: #c3c8d0;
}

.btn:focus-visible {
  outline: 2px solid rgba(7, 193, 96, 0.45);
  outline-offset: 1px;
}

.btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.btn-primary {
  color: #fff;
  background: var(--green);
  border-color: var(--green);
  box-shadow: 0 1px 2px rgba(7, 193, 96, 0.25);
}

.btn-primary:hover {
  color: #fff;
  background: var(--green-dark);
  border-color: var(--green-dark);
}

.btn-danger {
  color: #fff;
  background: var(--red);
  border-color: var(--red);
}

.btn-danger:hover {
  color: #fff;
  background: #cf3b40;
  border-color: #cf3b40;
}

.btn-danger-ghost {
  color: #c9353a;
  background: #fff;
  border-color: var(--red-line);
}

.btn-danger-ghost:hover {
  color: #b42318;
  background: var(--red-soft);
  border-color: #efacaf;
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
}

.btn-ghost:hover {
  background: #f5f6f8;
  border-color: var(--border-strong);
}

.btn-sm {
  height: 28px;
  padding: 0 10px;
  font-size: 12.5px;
  border-radius: 6px;
}

.btn-block {
  width: 100%;
}

.btn-lg {
  height: 42px;
  font-size: 15px;
  letter-spacing: 2px;
}

.btn .icon {
  width: 15px;
  height: 15px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.icon-btn:hover {
  color: var(--text);
  background: #f1f3f5;
}

.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex: none;
}

.icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* ------------------------------ 主布局 ------------------------------ */
.app {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 30;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-right: 1px solid var(--border);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--topbar-h);
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
  flex: none;
}

.sidebar-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  overflow: hidden;
}

.sidebar-brand-text strong {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.sidebar-brand-text span {
  margin-top: 1px;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 1.5px;
}

.nav {
  flex: 1;
  padding: 12px 10px;
  overflow-y: auto;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 12px;
  margin-bottom: 2px;
  font-size: 13.5px;
  color: var(--text-2);
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
}

.nav-item .icon {
  color: var(--muted);
  transition: color 0.15s;
}

.nav-item:hover {
  color: var(--text);
  background: #f4f6f5;
}

.nav-item:hover .icon {
  color: var(--text-2);
}

.nav-item.active {
  color: var(--green-deep);
  font-weight: 600;
  background: var(--green-soft);
}

.nav-item.active .icon {
  color: var(--green-deep);
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--green);
}

.nav-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: var(--red);
  border-radius: 9px;
  line-height: 1;
}

.sidebar-foot {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 14px 18px;
  font-size: 11.5px;
  color: var(--muted-2);
  border-top: 1px solid var(--border);
  flex: none;
}

.dot-live {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.14);
}

.main {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 26px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(180%) blur(6px);
}

.topbar-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}

.topbar-title h2 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.topbar-title > span {
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.avatar {
  width: 34px;
  height: 34px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(145deg, #26d27a, #06a852);
  border-radius: 50%;
  user-select: none;
}

.user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
  margin-right: 4px;
}

.user-meta strong {
  font-size: 13px;
  font-weight: 600;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-meta span {
  font-size: 11px;
  color: var(--muted);
}

.content {
  flex: 1;
  padding: 22px 26px 40px;
  outline: none;
}

/* ------------------------------ 页面头部 ------------------------------ */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.page-head h3 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.page-head p {
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--muted);
}

.page-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ------------------------------ 面板 / 卡片 ------------------------------ */
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.panel-head h4 {
  font-size: 14px;
  font-weight: 600;
}

.panel-head .muted {
  font-size: 12px;
  word-break: break-all;
}

.panel-body {
  padding: 18px;
}

.panel-body.no-pad {
  padding: 0;
}

.panel-foot {
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  background: var(--panel-alt);
}

/* ------------------------------ 统计卡片 ------------------------------ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.stat-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.stat-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.stat-card.clickable {
  cursor: pointer;
}

.stat-card.clickable:hover {
  transform: translateY(-1px);
  border-color: var(--green-line);
}

.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.stat-label {
  font-size: 12.5px;
  color: var(--muted);
}

.stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  color: var(--green-deep);
  background: var(--green-soft);
}

.stat-icon.amber {
  color: var(--amber);
  background: var(--amber-soft);
}

.stat-icon.blue {
  color: var(--blue);
  background: var(--blue-soft);
}

.stat-icon.purple {
  color: var(--purple);
  background: var(--purple-soft);
}

.stat-icon.red {
  color: var(--red);
  background: var(--red-soft);
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
}

.stat-sub {
  font-size: 11.5px;
  color: var(--muted-2);
}

/* ------------------------------ 存储占用 ------------------------------ */
.storage-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.storage-cat {
  padding: 14px 16px;
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.storage-cat-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
}

.storage-cat-head span {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}

.storage-cat-head strong {
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.storage-cat-foot {
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--muted);
}

.bar {
  position: relative;
  height: 7px;
  overflow: hidden;
  background: #eceff2;
  border-radius: 4px;
}

.bar > i {
  display: block;
  height: 100%;
  min-width: 0;
  border-radius: 4px;
  background: linear-gradient(90deg, #21cf78, #07b258);
  transition: width 0.4s ease;
}

.bar.amber > i {
  background: linear-gradient(90deg, #f3ac4b, #e0982f);
}

.bar.blue > i {
  background: linear-gradient(90deg, #5b8ff5, #2f6fed);
}

.bar.purple > i {
  background: linear-gradient(90deg, #9b83fb, #7a5af8);
}

.bar.lg {
  height: 10px;
  border-radius: 6px;
}

.disk-row {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
}

.disk-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.disk-head strong {
  font-size: 13.5px;
  font-weight: 600;
}

.disk-head span {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.disk-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 7px;
  font-size: 11.5px;
  color: var(--muted);
}

/* ------------------------------ 筛选栏 ------------------------------ */
.filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 16px;
  margin-bottom: 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.filter-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.filter-item > label {
  font-size: 11.5px;
  color: var(--muted);
  padding-left: 1px;
}

.filter-item .input {
  height: 34px;
  font-size: 13px;
}

.filter-item.w-140 .input { width: 140px; }
.filter-item.w-160 .input { width: 160px; }
.filter-item.w-200 .input { width: 200px; }
.filter-item.w-220 .input { width: 220px; }
.filter-item.w-260 .input { width: 260px; }

.filter-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* ------------------------------ Tabs ------------------------------ */
.tabs {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: #f0f2f4;
  border-radius: 8px;
}

.tab {
  height: 30px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-2);
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  color: var(--green-deep);
  font-weight: 600;
  background: #fff;
  box-shadow: 0 1px 3px rgba(17, 24, 39, 0.1);
}

.tab-count {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ------------------------------ 表格 ------------------------------ */
.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  min-width: 680px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  text-align: left;
  white-space: nowrap;
  background: var(--panel-alt);
  border-bottom: 1px solid var(--border);
}

.data-table tbody td {
  padding: 12px 14px;
  vertical-align: middle;
  border-bottom: 1px solid #f0f1f3;
  color: var(--text-2);
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr:hover td {
  background: #fafcfb;
}

.data-table .col-check {
  width: 42px;
  padding-left: 16px;
  padding-right: 0;
}

.data-table .col-actions {
  white-space: nowrap;
}

.data-table .cell-nowrap {
  white-space: nowrap;
}

.checkbox {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--green);
  cursor: pointer;
  vertical-align: middle;
}

.checkbox:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.cell-main {
  color: var(--text);
  font-weight: 500;
}

.cell-sub {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--muted);
  word-break: break-all;
}

.cell-reason {
  max-width: 260px;
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.cell-device {
  max-width: 190px;
  font-size: 12px;
  color: var(--text-2);
  word-break: break-all;
}

.ellipsis {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  vertical-align: bottom;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.table-empty {
  padding: 0 !important;
}

/* ------------------------------ 用户单元格 ------------------------------ */
.user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 150px;
}

.user-cell .avatar {
  width: 30px;
  height: 30px;
  font-size: 12px;
}

.user-cell-text {
  display: flex;
  flex-direction: column;
  line-height: 1.35;
  min-width: 0;
}

.user-cell-text strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-cell-text span {
  font-size: 11.5px;
  color: var(--muted);
}

/* ------------------------------ 标签 / 徽章 ------------------------------ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1;
  border-radius: 5px;
  white-space: nowrap;
}

.badge-green {
  color: #067647;
  background: var(--green-soft);
  border: 1px solid var(--green-line);
}

.badge-amber {
  color: #b45309;
  background: var(--amber-soft);
  border: 1px solid var(--amber-line);
}

.badge-red {
  color: #b42318;
  background: var(--red-soft);
  border: 1px solid var(--red-line);
}

.badge-blue {
  color: #1d4ed8;
  background: var(--blue-soft);
  border: 1px solid #c9d9fb;
}

.badge-purple {
  color: #5b3fd4;
  background: var(--purple-soft);
  border: 1px solid #ddd3fd;
}

.badge-gray {
  color: #5b6472;
  background: #f1f3f5;
  border: 1px solid #e2e5e9;
}

.badge-dot::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.online-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
}

.online-state .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #c3c8d0;
}

.online-state.online {
  color: #067647;
}

.online-state.online .dot {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.14);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  font-size: 11px;
  color: var(--text-2);
  background: #f2f4f6;
  border: 1px solid #e6e9ec;
  border-radius: 4px;
  white-space: nowrap;
}

.tag-green {
  color: #067647;
  background: var(--green-soft);
  border-color: var(--green-line);
}

.tag-more {
  color: var(--muted);
  background: transparent;
  border-style: dashed;
}

/* ------------------------------ 批量操作栏 ------------------------------ */
.batch-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 16px;
  margin-bottom: 12px;
  font-size: 12.5px;
  color: var(--text-2);
  background: #fbfcfd;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
}

.batch-bar .selected-count {
  color: var(--green-deep);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.batch-bar .batch-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ------------------------------ 分页 ------------------------------ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
}

.page-total {
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.page-ctrl {
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-info {
  font-size: 12.5px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ------------------------------ 闪图网格 ------------------------------ */
.flash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(236px, 1fr));
  gap: 14px;
}

.flash-card {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.flash-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.flash-thumb {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  height: 148px;
  padding: 0;
  color: #9aa3ad;
  background:
    linear-gradient(135deg, rgba(7, 193, 96, 0.05), rgba(7, 193, 96, 0)),
    repeating-linear-gradient(45deg, #f5f7f8, #f5f7f8 10px, #f1f4f5 10px, #f1f4f5 20px);
  border: 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  overflow: hidden;
  transition: color 0.15s, background 0.15s;
}

.flash-thumb:hover {
  color: var(--green-deep);
}

.flash-thumb .icon {
  width: 34px;
  height: 34px;
  padding: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--border);
}

.flash-thumb-text {
  font-size: 12px;
  font-weight: 500;
}

.flash-thumb-status {
  position: absolute;
  top: 9px;
  left: 9px;
}

.flash-thumb-shots {
  position: absolute;
  top: 9px;
  right: 9px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 20px;
  padding: 0 6px;
  font-size: 10.5px;
  color: #b42318;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--red-line);
  border-radius: 4px;
}

.flash-card-body {
  padding: 12px 14px 6px;
  flex: 1;
}

.flash-pair {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  min-width: 0;
}

.flash-pair .arrow {
  color: var(--muted-2);
  font-weight: 400;
  flex: none;
}

.flash-pair .name {
  max-width: 88px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flash-meta {
  margin-top: 7px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 11.5px;
  color: var(--muted);
}

.flash-card .tags {
  margin-top: 9px;
  min-height: 20px;
}

.flash-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid #f0f1f3;
}

.flash-foot-btns {
  display: flex;
  gap: 6px;
}

.link-btn {
  padding: 0;
  font-size: 12.5px;
  color: var(--green-deep);
  background: transparent;
  border: 0;
  cursor: pointer;
}

.link-btn:hover {
  text-decoration: underline;
}

.link-btn.danger {
  color: #c9353a;
}

/* ------------------------------ 空状态 / 加载 ------------------------------ */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 46px 20px;
  color: var(--muted-2);
  font-size: 13px;
  text-align: center;
}

.empty .icon {
  width: 34px;
  height: 34px;
  color: #c7ccd3;
}

.empty p {
  line-height: 1.6;
  word-break: break-word;
}

.loading-block {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 42px 20px;
  color: var(--muted);
  font-size: 13px;
}

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  flex: none;
  border: 2px solid #d8dee4;
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.spinner-lg {
  width: 22px;
  height: 22px;
  border-width: 2.5px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.skeleton {
  background: linear-gradient(90deg, #eef1f3 25%, #f6f8f9 37%, #eef1f3 63%);
  background-size: 400% 100%;
  border-radius: 5px;
  animation: shimmer 1.3s ease infinite;
}

@keyframes shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

.skeleton-card {
  height: 116px;
}

.skeleton-block {
  height: 160px;
  border-radius: var(--radius);
}

/* ------------------------------ 提示条 ------------------------------ */
.notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 13px;
  font-size: 12.5px;
  line-height: 1.6;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--panel-alt);
  color: var(--text-2);
}

.notice .icon {
  width: 16px;
  height: 16px;
  margin-top: 1px;
  flex: none;
}

.notice-warn {
  color: #8a5200;
  background: #fff9ef;
  border-color: var(--amber-line);
}

.notice-info {
  color: #1d4ed8;
  background: var(--blue-soft);
  border-color: #c9d9fb;
}

.notice-success {
  color: #067647;
  background: var(--green-soft);
  border-color: var(--green-line);
}

/* ------------------------------ 详情 / 时间线 ------------------------------ */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 22px;
  margin-bottom: 16px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.detail-item dt {
  font-size: 11.5px;
  color: var(--muted);
}

.detail-item dd {
  margin: 0;
  font-size: 13px;
  color: var(--text);
  word-break: break-word;
}

.detail-item.full {
  grid-column: 1 / -1;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 4px 0 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
}

.section-title::before {
  content: "";
  width: 3px;
  height: 12px;
  border-radius: 2px;
  background: var(--green);
}

.timeline {
  list-style: none;
  margin: 0 0 16px;
  padding: 0 0 0 4px;
}

.timeline li {
  position: relative;
  padding: 0 0 12px 18px;
  font-size: 12.5px;
  color: var(--text-2);
}

.timeline li:last-child {
  padding-bottom: 0;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d5d9df;
}

.timeline li.done::before {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.13);
}

.timeline li::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 14px;
  bottom: 0;
  width: 1px;
  background: #e8ebee;
}

.timeline li:last-child::after {
  display: none;
}

.timeline .tl-label {
  margin-right: 8px;
  color: var(--muted);
}

.timeline .tl-time {
  font-variant-numeric: tabular-nums;
}

/* ------------------------------ 闪图预览 ------------------------------ */
.preview-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 260px;
  max-height: 56vh;
  padding: 12px;
  background:
    repeating-linear-gradient(45deg, #f7f8f9, #f7f8f9 10px, #f2f4f5 10px, #f2f4f5 20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: auto;
}

.preview-img {
  max-width: 100%;
  max-height: calc(56vh - 26px);
  border-radius: 6px;
  box-shadow: 0 4px 18px rgba(17, 24, 39, 0.18);
  background: #fff;
}

.preview-meta {
  margin-top: 16px;
}

.hash-text {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-2);
  word-break: break-all;
}

/* ------------------------------ 弹窗 ------------------------------ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: rgba(17, 24, 39, 0.42);
  opacity: 0;
  transition: opacity 0.16s ease;
  overflow-y: auto;
}

.modal-overlay.show {
  opacity: 1;
}

.modal {
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  transform: translateY(8px) scale(0.99);
  transition: transform 0.18s ease;
}

.modal-overlay.show .modal {
  transform: translateY(0) scale(1);
}

.modal-md { max-width: 540px; }
.modal-lg { max-width: 780px; }
.modal-sm { max-width: 400px; }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
  flex: none;
}

.modal-head h3 {
  font-size: 15px;
  font-weight: 600;
}

.modal-close {
  width: 28px;
  height: 28px;
}

.modal-body {
  padding: 18px;
  overflow-y: auto;
}

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 13px 18px;
  border-top: 1px solid var(--border);
  background: var(--panel-alt);
  border-radius: 0 0 12px 12px;
  flex: none;
  flex-wrap: wrap;
}

.modal-foot .left {
  margin-right: auto;
}

/* ------------------------------ 临时密码 ------------------------------ */
.code-box {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
  padding: 12px 14px;
  background: #f7f9f8;
  border: 1px dashed var(--green-line);
  border-radius: var(--radius-sm);
}

.code-box code {
  flex: 1;
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--green-deep);
  word-break: break-all;
}

/* ------------------------------ 开关 ------------------------------ */
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 15px 0;
  border-bottom: 1px solid #f0f1f3;
  cursor: pointer;
}

.switch-row:first-child {
  padding-top: 0;
}

.switch-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.switch-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.switch-text strong {
  font-size: 13.5px;
  font-weight: 600;
}

.switch-text span {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.55;
}

.switch {
  position: relative;
  display: inline-flex;
  flex: none;
  width: 42px;
  height: 24px;
}

.switch-input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  z-index: 2;
}

.switch-track {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: #d5d9df;
  transition: background 0.18s;
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(17, 24, 39, 0.25);
  transition: transform 0.18s;
}

.switch-input:checked + .switch-track {
  background: var(--green);
}

.switch-input:checked + .switch-track::after {
  transform: translateX(18px);
}

.switch-input:focus-visible + .switch-track {
  box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.22);
}

/* ------------------------------ 审计详情 ------------------------------ */
.json-toggle summary {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--green-deep);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.json-toggle summary::-webkit-details-marker {
  display: none;
}

.json-toggle summary::before {
  content: "▸";
  font-size: 10px;
  transition: transform 0.15s;
}

.json-toggle[open] summary::before {
  transform: rotate(90deg);
}

.json-pre {
  max-width: 420px;
  max-height: 220px;
  margin: 8px 0 0;
  padding: 10px 12px;
  overflow: auto;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--text-2);
  background: #f7f8fa;
  border: 1px solid var(--border);
  border-radius: 6px;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ------------------------------ Toast ------------------------------ */
.toast-container {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 9px;
  pointer-events: none;
  max-width: min(360px, calc(100vw - 36px));
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 14px;
  font-size: 13px;
  line-height: 1.55;
  color: #fff;
  background: #2b3138;
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(17, 24, 39, 0.22);
  opacity: 0;
  transform: translateX(16px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: auto;
}

.toast.show {
  opacity: 1;
  transform: translateX(0);
}

.toast .icon {
  width: 16px;
  height: 16px;
  margin-top: 1px;
  flex: none;
}

.toast-success .icon { color: #4ade80; }
.toast-error .icon { color: #fca5a5; }
.toast-info .icon { color: #93c5fd; }

.toast-msg {
  word-break: break-word;
}

/* ------------------------------ 其他 ------------------------------ */
.noscript-tip {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
  font-size: 15px;
  color: #b42318;
  background: #fff;
  text-align: center;
}

.section-gap {
  margin-top: 16px;
}

.kv-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.kv-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 13px;
}

.kv-row:last-child {
  border-bottom: 0;
}

.kv-row .k {
  color: var(--muted);
  flex: none;
}

.kv-row .v {
  color: var(--text);
  text-align: right;
  word-break: break-all;
  font-variant-numeric: tabular-nums;
}

.copy-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.copy-box .input,
.copy-box .textarea {
  flex: 1;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-2);
  background: #fafbfc;
}

.copy-box .textarea {
  min-height: 96px;
  resize: vertical;
  word-break: break-all;
}

/* ------------------------------ 存储概要 ------------------------------ */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

@media (max-width: 900px) {
  .summary-grid {
    grid-template-columns: 1fr;
  }
}

/* ------------------------------ 响应式 ------------------------------ */
@media (max-width: 1360px) {
  .stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1080px) {
  :root {
    --sidebar-w: 204px;
  }

  .content {
    padding: 18px 18px 34px;
  }

  .topbar {
    padding: 0 18px;
  }

  .storage-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }
}

/* 窄屏：侧边栏收起为顶部横向菜单 */
@media (max-width: 900px) {
  .app {
    flex-direction: column;
  }

  .sidebar {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    bottom: auto;
    width: 100%;
    max-width: 100vw;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    padding: 0 12px;
    overflow: hidden;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    z-index: 40;
  }

  .sidebar-brand {
    height: 52px;
    padding: 0 10px 0 0;
    border-bottom: 0;
    flex: none;
  }

  .sidebar-brand-text span {
    display: none;
  }

  .sidebar-brand-text strong {
    font-size: 14px;
  }

  .nav {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 7px 0;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav-item {
    height: 36px;
    margin-bottom: 0;
    padding: 0 11px;
    flex: none;
  }

  .nav-item.active::before {
    display: none;
  }

  .nav-item .icon {
    width: 16px;
    height: 16px;
  }

  .nav-label {
    flex: none;
  }

  .nav-badge {
    position: static;
  }

  .sidebar-foot {
    display: none;
  }

  .main {
    margin-left: 0;
  }

  .topbar {
    position: static;
    height: 56px;
    padding: 0 16px;
  }

  .topbar-title > span {
    display: none;
  }

  .topbar-user .user-meta span {
    display: none;
  }

  .content {
    padding: 16px 16px 32px;
  }

  .storage-grid {
    grid-template-columns: 1fr;
  }

  .page-head {
    align-items: flex-start;
  }

  .filter-actions {
    margin-left: 0;
    width: 100%;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .preview-stage {
    min-height: 200px;
    max-height: 46vh;
  }

  .preview-img {
    max-height: calc(46vh - 26px);
  }
}

@media (max-width: 640px) {
  .topbar-user .user-meta {
    display: none;
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .stat-card {
    padding: 13px;
  }

  .stat-value {
    font-size: 22px;
  }

  .login-card {
    padding: 26px 20px 20px;
  }

  .flash-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
  }

  .flash-thumb {
    height: 124px;
  }

  .modal {
    max-height: calc(100vh - 24px);
  }

  .modal-foot {
    justify-content: stretch;
  }

  .modal-foot .btn {
    flex: 1;
  }
}
