/* 信达远 ERP - 全局样式 */
:root {
  --bg-base: #f3f6f8;
  --bg-card: #fff;
  --bg-header: #fff;
  --text-primary: #172033;
  --text-regular: #4b5563;
  --text-secondary: #7b8794;
  --border-light: #ebeef5;
  --border-base: #dcdfe6;
  --shadow-card: 0 12px 28px rgba(15,23,42,.06);
  --brand-primary: #0f766e;
  --brand-secondary: #2563eb;
  --brand-accent: #d97706;
  --brand-danger: #dc2626;
  --brand-ink: #172033;
  --brand-surface: #f3f6f8;
  --el-color-primary: #0f766e;
  --el-color-primary-light-3: #4ea49d;
  --el-color-primary-light-5: #87c4bf;
  --el-color-primary-light-7: #b7ddd9;
  --el-color-primary-light-8: #d2ebe8;
  --el-color-primary-light-9: #e8f5f3;
  --el-color-primary-dark-2: #0b5f59;
}

body.dark-mode {
  --bg-base: #161920;
  --bg-card: #1e222a;
  --bg-header: #1a1e26;
  --text-primary: #c8cad0;
  --text-regular: #8e929a;
  --text-secondary: #5e636c;
  --border-light: #2a2e36;
  --border-base: #323840;
  --shadow-card: 0 1px 4px rgba(0,0,0,.4);
}

body.dark-mode {
  background: var(--bg-base) !important;
  color: var(--text-primary);
}
body.dark-mode .el-header, body.dark-mode .app-header { background: var(--bg-header) !important; border-color: var(--border-light) !important; }
body.dark-mode .el-main, body.dark-mode .app-main { background: var(--bg-base) !important; }
body.dark-mode .el-card, body.dark-mode .page-card, body.dark-mode .el-dialog { background: var(--bg-card) !important; color: var(--text-primary) !important; }
body.dark-mode .el-table, body.dark-mode .el-table th, body.dark-mode .el-table td { background: var(--bg-card) !important; color: var(--text-primary) !important; border-color: var(--border-light) !important; }
body.dark-mode .el-table--striped .el-table__body tr.el-table__row--striped td { background: var(--bg-base) !important; }
body.dark-mode .el-input__wrapper, body.dark-mode .el-select__wrapper { background: var(--bg-base) !important; box-shadow: 0 0 0 1px var(--border-base) inset !important; }
body.dark-mode .el-input__inner { color: var(--text-primary) !important; }
body.dark-mode .tab-bar { background: var(--bg-header) !important; border-color: var(--border-light) !important; }
body.dark-mode .tab-item { color: var(--text-secondary) !important; }
body.dark-mode .tab-item.active { background: #5b7a99 !important; color: #fff !important; }
body.dark-mode .el-tabs__item { color: var(--text-regular) !important; }
body.dark-mode .el-tabs__item.is-active { color: #409eff !important; }
body.dark-mode footer, body.dark-mode .el-footer { background: var(--bg-header) !important; color: var(--text-secondary) !important; }
body.dark-mode .el-pagination button, body.dark-mode .el-pager li { background: var(--bg-card) !important; color: var(--text-regular) !important; }
body.dark-mode .el-dialog { background: var(--bg-card) !important; }
body.dark-mode .el-dialog__header { color: var(--text-primary) !important; }
body.dark-mode .el-dialog__body { color: var(--text-primary) !important; }
body.dark-mode .el-form-item__label { color: var(--text-regular) !important; }
body.dark-mode .el-tag { border-color: var(--border-base) !important; }
body.dark-mode .el-radio-button__inner { background: var(--bg-card) !important; color: var(--text-regular) !important; border-color: var(--border-base) !important; }
body.dark-mode .el-radio-button__original-radio:checked+.el-radio-button__inner { background: #409eff !important; color: #fff !important; }
body.dark-mode .el-collapse-item__header { background: var(--bg-card) !important; color: var(--text-primary) !important; }
body.dark-mode .el-collapse-item__content { background: var(--bg-card) !important; color: var(--text-primary) !important; }
body.dark-mode .el-empty__description p { color: var(--text-secondary) !important; }
body.dark-mode .el-popover { background: var(--bg-card) !important; color: var(--text-primary) !important; border-color: var(--border-base) !important; }
body.dark-mode .workspace-menu-toolbar { border-bottom-color: var(--border-base) !important; }
body.dark-mode .workspace-menu-mode-text { color: var(--text-secondary) !important; }
body.dark-mode .workspace-menu-toggle { background: var(--bg-base) !important; border-color: var(--border-base) !important; }
body.dark-mode .workspace-menu-toggle button { color: var(--text-regular) !important; }
body.dark-mode .workspace-menu-toggle button.active { color: #fff !important; }
body.dark-mode .workspace-menu-title { color: var(--text-primary) !important; }
body.dark-mode .workspace-menu-item { color: var(--text-regular) !important; }
body.dark-mode .workspace-menu-item:hover { background: var(--bg-base) !important; color: #409eff !important; }
body.dark-mode .case-item { background: var(--bg-card) !important; border-color: var(--border-light) !important; }
body.dark-mode .case-item-title { color: var(--text-primary) !important; }
body.dark-mode .case-item-meta { color: var(--text-secondary) !important; }
body.dark-mode .filter-row { color: var(--text-regular) !important; }
body.dark-mode h2, body.dark-mode h3, body.dark-mode h4 { color: var(--text-primary) !important; }
body.dark-mode .el-divider { border-color: var(--border-light) !important; }
body.dark-mode .el-button--default { background: var(--bg-card) !important; color: var(--text-regular) !important; border-color: var(--border-base) !important; }
body.dark-mode .el-dropdown-menu { background: var(--bg-card) !important; }
body.dark-mode .el-dropdown-menu__item { color: var(--text-regular) !important; }
body.dark-mode .el-dropdown-menu__item:hover { background: var(--bg-base) !important; color: #409eff !important; }
body.dark-mode .el-message-box { background: var(--bg-card) !important; }
body.dark-mode .el-notification { background: var(--bg-card) !important; }
body.dark-mode .nav-link { color: var(--text-primary) !important; }
body.dark-mode .el-table__header-wrapper th { background: #1a1e26 !important; color: #8e929a !important; }
body.dark-mode .el-table__body-wrapper { background: var(--bg-card) !important; }
body.dark-mode .el-table__fixed-right { background: var(--bg-card) !important; }
body.dark-mode .el-select-dropdown { background: var(--bg-card) !important; }
body.dark-mode .el-select-dropdown__item { color: var(--text-regular) !important; }
body.dark-mode .el-select-dropdown__item.hover { background: var(--bg-base) !important; }
body.dark-mode .el-date-picker { background: var(--bg-card) !important; }
body.dark-mode .el-picker-panel { background: var(--bg-card) !important; color: var(--text-primary) !important; }
body.dark-mode .el-textarea__inner { background: var(--bg-base) !important; color: var(--text-primary) !important; border-color: var(--border-base) !important; }
body.dark-mode .el-input-number { background: var(--bg-base) !important; }
body.dark-mode .el-table .el-table__cell { border-color: var(--border-light) !important; }
body.dark-mode .el-card { border-color: var(--border-light) !important; }
body.dark-mode strong { color: var(--text-primary) !important; }
body.dark-mode p { color: var(--text-regular) !important; }
body.dark-mode .el-tabs__nav-wrap::after { background: var(--border-light) !important; }
body.dark-mode .el-tabs__active-bar { background: #409eff !important; }
body.dark-mode .page-card { background: var(--bg-card) !important; }
body.dark-mode .el-table--border::after, body.dark-mode .el-table--group::after { background: var(--border-light) !important; }
body.dark-mode .el-button--primary { background: #3a6fa0 !important; border-color: #3a6fa0 !important; }
body.dark-mode .el-button--success { background: #3a7a3a !important; border-color: #3a7a3a !important; }
body.dark-mode .el-button--danger { background: #8a3a3a !important; border-color: #8a3a3a !important; }
body.dark-mode .el-button--warning { background: #8a6a3a !important; border-color: #8a6a3a !important; }
/* 深度覆盖：所有白色背景改深灰 */
body.dark-mode, body.dark-mode * { color-scheme: dark; }
body.dark-mode div[style*="background:#fff"], body.dark-mode div[style*="background: #fff"],
body.dark-mode div[style*="background:white"] { background: var(--bg-card) !important; }
body.dark-mode .el-table__empty-block { background: var(--bg-card) !important; }
body.dark-mode .el-table__empty-text { color: var(--text-secondary) !important; }
body.dark-mode .el-switch { --el-switch-off-color: #4a4e56; }
body.dark-mode .el-checkbox__inner { background: var(--bg-base) !important; border-color: var(--border-base) !important; }
body.dark-mode .el-radio-button__inner { background: var(--bg-card) !important; border-color: var(--border-base) !important; color: var(--text-regular) !important; }
body.dark-mode .el-alert { background: var(--bg-card) !important; border-color: var(--border-base) !important; }
body.dark-mode .el-table__body-wrapper, body.dark-mode .el-table__header-wrapper { scrollbar-color: #3a4048 transparent; }
body.dark-mode .el-overlay { background: rgba(0,0,0,.6) !important; }
body.dark-mode .el-dialog { border: 1px solid var(--border-base) !important; }
body.dark-mode .el-dialog__title { color: var(--text-primary) !important; }
body.dark-mode .el-form-item__content { color: var(--text-primary) !important; }
body.dark-mode .el-statistic { color: var(--text-primary) !important; }
body.dark-mode .case-list-header h2 { color: var(--text-primary) !important; }
body.dark-mode .empty { color: var(--text-secondary) !important; }
body.dark-mode .el-tag--light { background: var(--bg-base) !important; }
body.dark-mode .survey-mindmap { color: var(--text-primary) !important; }

* {
  box-sizing: border-box;
}

html, body, #app {
  margin: 0;
  padding: 0;
  height: 100%;
  max-width: 100%;
  overflow-x: hidden;
  font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.75;
  background: var(--brand-surface);
  color: var(--text-primary);
}

.layout {
  min-height: 100vh;
}

/* ========== Header ========== */
.app-header {
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid #dce5ea;
  padding: 0 !important;
  height: 48px !important;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.05);
  backdrop-filter: blur(10px);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  height: 48px;
  padding: 0 24px;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  font-size: 18px;
  font-weight: 700;
  color: var(--brand-ink);
  flex: 0 0 auto;
}

.xdy-brand {
  gap: 9px;
  min-width: 132px;
  padding: 4px 0;
}

.xdy-logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.22);
}

.xdy-logo-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.05;
  letter-spacing: 0;
}

.xdy-logo-copy strong {
  display: block;
  font-size: 17px;
  color: var(--brand-ink);
  letter-spacing: 0;
}

.xdy-logo-copy small {
  display: block;
  margin-top: 3px;
  font-size: 10px;
  color: var(--brand-primary);
  font-weight: 700;
  letter-spacing: 0;
}

.nav {
  display: flex;
  gap: 16px;
  flex: 1;
}

.nav-link {
  color: var(--text-regular);
  text-decoration: none;
  font-size: 14px;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.nav-link:hover,
.nav-link.router-link-exact-active {
  color: var(--brand-primary);
  border-bottom-color: var(--brand-primary);
}

.nav-dropdown {
  display: flex;
  align-items: center;
  gap: 2px;
  cursor: pointer;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 20px;
  transition: background 0.2s;
}

.user-chip:hover {
  background: #eef7f5;
}

.avatar {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent)) !important;
  color: #fff !important;
}

.nickname {
  font-size: 14px;
  color: #303133;
}

/* ========== Tab Bar ========== */
.tab-bar {
  background: #fff;
  border-bottom: 1px solid #e4e7ed;
  padding: 0 8px 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
  min-height: 24px;
  scrollbar-width: thin;
  scrollbar-color: #dcdfe6 transparent;
}
.tab-bar::-webkit-scrollbar { height: 4px; }
.tab-bar::-webkit-scrollbar-thumb { background: #c0c4cc; border-radius: 2px; }
.tab-bar::-webkit-scrollbar-track { background: transparent; }
.tab-list {
  display: flex;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
  flex: 1;
}
.tab-actions {
  display: none !important;
}
.tab-actions-visible {
  justify-content: flex-end;
}
.tab-actions-inline {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  margin-left: 8px;
}
.tab-action-icon {
  width: 20px;
  height: 20px;
  min-height: 20px;
  padding: 0 !important;
  color: #606266;
}
.tab-action-icon:hover {
  color: var(--brand-primary);
  background: #e8f5f3;
}
.tab-action-danger:hover {
  color: #e74c3c;
  background: #fff1f0;
}
.tab-item {
  padding: 3px 8px;
  font-size: 12px;
  cursor: pointer;
  border-radius: 4px 4px 0 0;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  flex-shrink: 0;
  color: #606266;
  transition: background 0.2s, color 0.2s;
}
.tab-item:hover {
  background: #eef3f6;
}
.tab-item.active {
  background: var(--brand-primary);
  color: #fff;
}
.tab-close {
  cursor: pointer;
  font-size: 10px;
  line-height: 1;
  border-radius: 50%;
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tab-close:hover {
  background: rgba(0,0,0,0.1);
}

/* ========== Main ========== */
.app-main {
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  padding: 24px !important;
  overflow-x: hidden;
}

/* ========== Footer ========== */
.app-footer {
  text-align: center;
  color: #909399;
  font-size: 12px;
  height: 50px !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ========== 卡片 ========== */
.page-card {
  background: #fff;
  border-radius: 8px;
  padding: 24px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: var(--shadow-card);
  min-height: 220px;
  max-width: 100%;
  overflow-x: auto;
}

.page-card > h2:first-child,
.page-card h2 {
  line-height: 1.35;
}

.page-card .el-table__body tr.el-table__row {
  cursor: pointer;
}

.page-card .el-table__body tr.el-table__row:hover > td.el-table__cell {
  background-color: #f1f8f7;
}

.page-card .el-pagination {
  justify-content: flex-end;
}

/* ========== Auth 页面 ========== */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.88), rgba(37, 99, 235, 0.74)),
    linear-gradient(90deg, #f3f6f8 0%, #e8f5f3 100%);
  padding: 24px;
}

.auth-card {
  background: #fff;
  border-radius: 8px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.auth-card h1 {
  text-align: center;
  margin-bottom: 8px;
  font-size: 28px;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-card .subtitle {
  text-align: center;
  color: #909399;
  margin-bottom: 32px;
  font-size: 14px;
}

.auth-card .el-button {
  width: 100%;
}

.auth-switch {
  text-align: center;
  margin-top: 16px;
  color: #909399;
  font-size: 14px;
}

.auth-switch a {
  color: var(--brand-primary);
  text-decoration: none;
  margin-left: 4px;
}

/* ========== 问题列表 ========== */
.case-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.case-list-header h2 {
  margin: 0;
  font-size: 20px;
}

.case-filters {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.case-item {
  background: #fff;
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.case-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-left-color: var(--brand-primary);
  transform: translateX(2px);
}

.case-item-title {
  font-size: 16px;
  font-weight: 500;
  color: #303133;
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.case-item-meta {
  font-size: 12px;
  color: #909399;
  display: flex;
  gap: 16px;
  align-items: center;
}

.case-item-meta .stat {
  display: flex;
  align-items: center;
  gap: 4px;
}

.empty {
  text-align: center;
  padding: 60px 20px;
  color: #909399;
}

.term-with-help {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  vertical-align: middle;
  cursor: help;
}

.term-help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  margin-left: 2px;
  border: 1px solid #dcdfe6;
  border-radius: 50%;
  background: #f0f2f5;
  color: #909399;
  font-size: 11px;
  font-style: normal;
  line-height: 14px;
  cursor: help;
}

.term-with-help:hover .term-help-icon {
  border-color: #409eff;
  background: #ecf5ff;
  color: #409eff;
}

.pagination-wrap {
  margin-top: 24px;
  display: flex;
  justify-content: center;
}

/* ========== 问题详情 ========== */
.case-detail-card {
  background: #fff;
  border-radius: 8px;
  padding: 32px;
  margin-bottom: 16px;
}

.case-detail-card .case-title {
  margin: 0 0 12px;
  font-size: 24px;
  font-weight: 600;
}

.case-detail-card .case-meta {
  color: #909399;
  font-size: 13px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.case-detail-card .case-content {
  font-size: 15px;
  line-height: 1.8;
  color: #303133;
  white-space: pre-wrap;
  word-break: break-word;
}

.case-actions {
  margin-top: 24px;
  display: flex;
  gap: 12px;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid #ebeef5;
}

/* 回复区 */
.replies-section {
  background: #fff;
  border-radius: 8px;
  padding: 24px 32px;
}

.replies-header {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 16px;
  color: #303133;
}

.reply-item {
  padding: 16px 0;
  border-bottom: 1px solid #f0f2f5;
  position: relative;
}

.reply-item:last-child {
  border-bottom: none;
}

.reply-item.accepted {
  background: linear-gradient(90deg, rgba(103, 194, 58, 0.06), transparent);
  padding: 16px;
  border-radius: 6px;
  border-bottom: none;
  margin-bottom: 8px;
}

.reply-author {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
  color: #606266;
}

.reply-content {
  font-size: 14px;
  line-height: 1.7;
  color: #303133;
  white-space: pre-wrap;
  word-break: break-word;
}

.reply-actions {
  margin-top: 8px;
  display: flex;
  gap: 8px;
}

.accepted-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #67c23a;
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
}

.reply-form {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid #ebeef5;
}

.reply-form .el-button {
  margin-top: 12px;
}

.case-inline-reply-box {
  margin-top: 8px;
  padding: 8px 12px;
  background: #f5f7fa;
  border-radius: 6px;
}

.case-child-reply {
  margin-left: 36px;
  margin-top: 8px;
  padding: 10px 14px;
  background: #f9fafb;
  border-left: 3px solid #dcdfe6;
  border-radius: 0 6px 6px 0;
}

.case-rich-editor {
  width: 100%;
  min-height: 144px;
  padding: 12px 14px;
  border: 1px solid #dcdfe6;
  border-radius: 8px;
  background: #fff;
  color: #303133;
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: hidden;
  overflow-y: auto;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.case-rich-editor:focus {
  border-color: #409eff;
  box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.12);
}

.case-rich-editor:empty::before {
  content: attr(data-placeholder);
  color: #c0c4cc;
}

.case-main-reply-editor {
  min-height: 152px;
}

.case-inline-editor {
  min-height: 104px;
}

.case-content-editor {
  min-height: 220px;
}

.case-rich-editor .case-editor-image,
.case-rich-editor img.case-editor-image {
  display: block;
  max-width: min(240px, 100%);
  max-height: 240px;
  margin: 8px 0;
  border-radius: 8px;
  border: 1px solid #dcdfe6;
  background: #fff;
  object-fit: contain;
}

.case-rich-editor img.case-editor-image[contenteditable="false"] {
  user-select: none;
  -webkit-user-drag: none;
}

.upload-bar .el-button {
  margin-top: 0 !important;
}

/* 状态标签 */
.status-tag {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
}

.status-tag.open {
  background: #ecf5ff;
  color: #409eff;
}

.status-tag.resolved {
  background: #f0f9eb;
  color: #67c23a;
}

/* 个人中心 */
.profile-section {
  margin-bottom: 32px;
}

.profile-section h3 {
  margin: 0 0 16px;
  font-size: 16px;
  color: #303133;
}

.profile-form {
  max-width: 400px;
}

/* 邀请码管理 */
.invite-code {
  font-family: "Consolas", "Monaco", monospace;
  background: #f5f7fa;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 13px;
}

/* 图片上传栏 */
.upload-bar {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.upload-bar .upload-hint {
  font-size: 12px;
  color: #909399;
}

/* 正文/回复中的图片 */
.case-content,
.reply-content {
  white-space: pre-wrap;
  word-break: break-word;
}

.case-content .content-image,
.reply-content .content-image {
  display: block;
  max-width: 100%;
  max-height: 480px;
  margin: 12px 0;
  border-radius: 6px;
  border: 1px solid #ebeef5;
  cursor: zoom-in;
  background: #fafafa;
}

.case-content .content-image:hover,
.reply-content .content-image:hover {
  border-color: var(--brand-primary);
}

/* el-image 的容器也要限制宽度 */
.case-content .el-image,
.reply-content .el-image {
  max-width: 100%;
}

.rich-content {
  white-space: pre-wrap;
  word-break: break-word;
}

.rich-content .content-image {
  display: block;
  max-width: 100%;
  max-height: 480px;
  margin: 12px 0;
  border-radius: 6px;
  border: 1px solid #ebeef5;
  cursor: zoom-in;
  background: #fafafa;
}

.rich-content .content-image:hover {
  border-color: var(--brand-primary);
}

.rich-content .el-image {
  max-width: 100%;
}

/* 审计日志 */
.filter-row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.mono {
  font-family: "Consolas", "Monaco", "Courier New", monospace;
}

/* 财务汇总卡片 */
.stat-card {
  background: #f5f7fa;
  border-radius: 8px;
  padding: 12px 20px;
  min-width: 120px;
}

.stat-label {
  font-size: 12px;
  color: #909399;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 18px;
  font-weight: 600;
  color: #303133;
}

/* ========== 看板 ========== */
.dashboard-welcome {
  background: var(--welcome-bg, linear-gradient(135deg, #0f766e 0%, #2563eb 58%, #d97706 100%));
  border-radius: 8px;
  padding: 28px 32px;
  color: #fff;
  margin-bottom: 20px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 18px 38px rgba(15, 118, 110, 0.16);
  position: relative;
  overflow: hidden;
}

.dashboard-welcome h2 {
  color: #fff;
}

.dashboard-welcome p {
  color: rgba(255, 255, 255, 0.85) !important;
}

.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
  min-height: 168px;
}

.kpi-card {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  border-left: 3px solid #dcdfe6;
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 138px;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.09);
  border-color: rgba(15, 118, 110, 0.24);
}

.kpi-icon {
  color: inherit;
}

.kpi-body {
  flex: 1;
}

.kpi-value {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
}

.kpi-label {
  font-size: 13px;
  color: #909399;
  margin-top: 4px;
}

.kpi-sub {
  font-size: 12px;
  color: #909399;
}

/* KPI 语义色：严格 4 色，卡片左边框和数字都使用单色 */
.kpi-blue  { border-left-color: var(--brand-secondary); }
.kpi-blue  .kpi-icon { color: var(--brand-secondary); }
.kpi-blue  .kpi-value { color: var(--brand-secondary); }

.kpi-orange { border-left-color: var(--brand-accent); }
.kpi-orange .kpi-icon { color: var(--brand-accent); }
.kpi-orange .kpi-value { color: var(--brand-accent); }

.kpi-green  { border-left-color: var(--brand-primary); }
.kpi-green  .kpi-icon { color: var(--brand-primary); }
.kpi-green  .kpi-value { color: var(--brand-primary); }

.kpi-red    { border-left-color: var(--brand-danger); }
.kpi-red    .kpi-icon { color: var(--brand-danger); }
.kpi-red    .kpi-value { color: var(--brand-danger); }

.kpi-skeleton-card {
  pointer-events: none;
  cursor: default;
}

.skeleton-line {
  height: 14px;
  background: linear-gradient(90deg, #f5f7fa 25%, #e4e7ed 50%, #f5f7fa 75%);
  background-size: 400% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
  border-radius: 4px;
  margin-bottom: 8px;
}

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

.table-first-skeleton {
  border: 1px solid #ebeef5;
  border-radius: 8px;
  background: #fff;
  padding: 18px 20px;
  min-height: 300px;
}

/* 快捷操作 */
.dashboard-shortcuts {
  background: linear-gradient(180deg, #ffffff 0%, #fbfdfd 100%);
  border-radius: 8px;
  padding: 22px 24px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.06);
  min-height: 164px;
}

.dashboard-highlight-card {
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(10px);
}

.dashboard-highlight-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.dashboard-highlight-note {
  margin-top: 8px;
  font-size: 12px;
  color: #5f766e;
  line-height: 1.6;
}

.dashboard-cleaning-card {
  position: relative;
  overflow: hidden;
}

.dashboard-lottery-card,
.dashboard-lottery-result-card,
.dashboard-poll-card {
  position: relative;
  overflow: hidden;
}

.dashboard-poll-card {
  background: linear-gradient(135deg, #ecfeff 0%, #f0fdf4 100%);
  border: 1px solid rgba(16, 185, 129, 0.16);
  padding: 16px 20px;
}

.dashboard-vote-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  margin-top: 12px;
}

.dashboard-vote-option {
  display: flex;
  align-items: center;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(15, 118, 110, 0.12);
  transition: all 0.2s ease;
  cursor: pointer;
}

.dashboard-vote-option:hover {
  transform: translateY(-1px);
  border-color: rgba(15, 118, 110, 0.24);
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.08);
}

.dashboard-vote-option.is-selected {
  border-color: rgba(15, 118, 110, 0.45);
  background: rgba(240, 253, 250, 0.95);
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.1);
}

.dashboard-vote-option .el-radio {
  width: 100%;
  margin-right: 0;
}

.dashboard-vote-option .el-radio__label {
  white-space: normal;
  line-height: 1.5;
}

.dashboard-vote-results {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.dashboard-vote-result-item {
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(15, 23, 42, 0.05);
}

.dashboard-vote-result-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: #334155;
  margin-bottom: 8px;
}

.dashboard-vote-bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
  overflow: hidden;
}

.dashboard-vote-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #14b8a6 0%, #22c55e 100%);
  transition: width 0.3s ease;
}

.dashboard-vote-bar-fill.is-winner {
  background: linear-gradient(90deg, #f59e0b 0%, #fb7185 100%);
}

.shortcut-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}

.shortcut-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 13px;
  color: #606266;
}

.shortcut-btn:hover {
  background: #f5f7fa;
}

/* 表情选择器 */
.emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
  max-height: 300px;
  overflow-y: auto;
}

.emoji-item {
  font-size: 22px;
  padding: 6px 4px;
  text-align: center;
  cursor: pointer;
  border-radius: 4px;
  user-select: none;
  line-height: 1;
  transition: background 0.15s;
}

.emoji-item:hover {
  background: #f5f7fa;
}

/* ========== 工作区弹出菜单网格 ========== */
.workspace-menu-popper { max-width: calc(100vw - 24px) !important; pointer-events: auto; }
.workspace-menu-popper::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 0;
  right: 0;
  height: 12px;
}
.workspace-menu-popper.xh-force-hidden-popper,
[id^="el-popper-container-"].xh-force-hidden-popper {
  display: none !important;
  pointer-events: none !important;
}
.workspace-menu-panel { max-width: 100%; }
.workspace-menu-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 10px; margin-bottom: 12px; border-bottom: 1px solid #ebeef5; }
.workspace-menu-mode-text { font-size: 12px; color: #909399; white-space: nowrap; }
.workspace-menu-toggle { display: inline-flex; padding: 2px; border: 1px solid #dcdfe6; border-radius: 6px; background: #f5f7fa; }
.workspace-menu-toggle button { border: 0; background: transparent; color: #606266; padding: 4px 10px; border-radius: 4px; font-size: 12px; line-height: 18px; cursor: pointer; }
.workspace-menu-toggle button.active { background: var(--brand-primary); color: #fff; box-shadow: 0 1px 4px rgba(15, 118, 110, .24); }
.workspace-menu-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 16px; max-width: 100%; overflow-x: hidden; }
.workspace-menu-col { transition: opacity .18s ease, filter .18s ease; }
.workspace-menu-col-muted { opacity: .35; filter: grayscale(.2); }
.workspace-menu-col-muted:hover { opacity: 1; filter: none; }
.workspace-menu-title { font-weight: 600; color: #303133; font-size: 13px; margin-bottom: 8px; padding-bottom: 4px; border-bottom: 2px solid var(--brand-primary); }
.workspace-menu-item { font-size: 13px; color: #606266; padding: 6px 0; cursor: pointer; transition: color 0.2s; }
.workspace-menu-item:hover { color: var(--brand-primary); }
/* 多级菜单 */
.workspace-menu-sub { position: relative; }
.workspace-menu-sub-title { font-size: 13px; color: #303133; padding: 6px 0; cursor: default; font-weight: 500; }
.workspace-menu-sub-panel { display: none; position: absolute; left: 100%; top: -8px; background: #fff; border: 1px solid #ebeef5; border-radius: 6px; padding: 8px 12px; min-width: 160px; box-shadow: 0 4px 12px rgba(0,0,0,.1); z-index: 100; }
.workspace-menu-sub:hover > .workspace-menu-sub-panel { display: block; }
.workspace-menu-sub-panel .workspace-menu-sub-title { font-size: 12px; color: #909399; font-weight: 600; padding: 4px 0; border-bottom: 1px solid #f0f0f0; margin-bottom: 4px; }
.workspace-menu-sub-panel .workspace-menu-item { font-size: 12px; padding: 4px 0; white-space: nowrap; }

/* Wing注册商品区块 */
.wing-section { margin-bottom: 24px; padding-bottom: 24px; border-bottom: 1px solid #ebeef5; }
.wing-section:last-child { border-bottom: none; }
.wing-section-title { font-size: 16px; font-weight: 600; color: #303133; margin-bottom: 4px; }
.wing-section-desc { font-size: 13px; color: #909399; margin-bottom: 12px; }
.wing-required { color: #f56c6c; font-size: 12px; font-weight: normal; margin-left: 4px; }

/* ========== 打印/PDF导出 ========== */
@media print {
  .app-header, .app-footer, .nav, .user-chip, .el-pagination, .filter-row button { display: none !important; }
  .app-main { padding: 0 !important; max-width: 100% !important; }
  .page-card { box-shadow: none !important; }
}

/* ========== 手机适配 ========== */
@media (max-width: 768px) {
  .header-inner {
    padding: 0 12px;
    gap: 8px;
    max-width: 100%;
    overflow-x: hidden;
  }
  .xdy-brand { min-width: 42px; }
  .xdy-logo-copy { display: none; }
  .nav { gap: 6px; overflow-x: auto; min-width: 0; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav-link { font-size: 13px; }
  .nickname { display: none; }

  .app-main { padding: 12px !important; max-width: 100vw; overflow-x: hidden; }

  .page-card { padding: 12px; min-height: 180px; overflow-x: auto; }

  .dashboard-welcome { padding: 16px; }
  .dashboard-cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    min-height: 296px;
  }
  .kpi-card { padding: 14px; min-height: 132px; }
  .kpi-value { font-size: 22px; }
  .dashboard-shortcuts { padding: 16px; border-radius: 8px; }
  .dashboard-highlight-header { flex-direction: column; align-items: stretch; }
  .dashboard-poll-card { padding: 14px 16px; }
  .dashboard-vote-result-head { flex-direction: column; gap: 4px; }
  .shortcut-grid { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .shortcut-btn { padding: 10px 4px; font-size: 12px; }

  .case-list-header { flex-direction: column; gap: 8px; align-items: flex-start; }
  .case-filters { flex-wrap: wrap; }

  .filter-row { flex-wrap: wrap; gap: 8px; }

  .el-table { font-size: 12px; max-width: 100%; }
  .el-table__inner-wrapper,
  .el-table__body-wrapper,
  .el-table__header-wrapper { overflow-x: auto !important; }
  .el-table-column { min-width: auto; }

  .el-dialog { width: 95% !important; margin: 8px auto !important; }
  .el-dialog__body { padding: 12px 16px; }
  .workspace-menu-popper { width: calc(100vw - 24px) !important; max-width: calc(100vw - 24px) !important; }
  .workspace-menu-toolbar { align-items: flex-start; flex-direction: column; gap: 8px; }
  .workspace-menu-toggle { width: 100%; }
  .workspace-menu-toggle button { flex: 1; }
  .workspace-menu-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .workspace-menu-sub-panel { position: static; display: block; min-width: 0; box-shadow: none; margin: 4px 0 8px; }
  [style*="right:-20px"][style*="width:80px"],
  [style*="right: -20px"][style*="width: 80px"] {
    top: 8px !important;
    right: 8px !important;
    width: 48px !important;
    height: 48px !important;
  }

  .el-pagination { flex-wrap: wrap; justify-content: center; }
}

/* ============== 外部展示模式 V1.98 ============== */
body.demo-mode::before {
  content: '⚠ 外部展示模式 - 数据匿名化展示';
  position: fixed;
  top: 0; left: 0; right: 0;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  color: #fff;
  text-align: center;
  font-size: 12px;
  padding: 4px 8px;
  z-index: 9999;
  font-weight: 600;
  letter-spacing: 1px;
}
body.demo-mode .layout { padding-top: 22px; }
body.demo-mode .demo-mask {
  filter: blur(5px);
  user-select: none;
  pointer-events: none;
}

/* ============== Sandbox外部展示模式 V1.99 ============== */
body.sandbox-mode::before {
  content: '🔒 SANDBOX 外部展示模式 - 所有数据已清空，禁止写入操作（切换视角可退出）';
  position: fixed;
  top: 0; left: 0; right: 0;
  background: linear-gradient(135deg, #f56c6c, #e6a23c);
  color: #fff;
  text-align: center;
  font-size: 12px;
  padding: 5px 8px;
  z-index: 9999;
  font-weight: 600;
  letter-spacing: 1px;
}
body.sandbox-mode .layout { padding-top: 24px; }
/* 屏蔽左上角logo（避免外部用户识别品牌） */
body.sandbox-mode .brand,
body.sandbox-mode .brand img { display: none !important; }

.onboarding-overlay {
  position: fixed;
  inset: 0;
  z-index: 5000;
  background: transparent;
}

.onboarding-highlight {
  position: fixed;
  border: 2px solid #ff8a2a;
  border-radius: 8px;
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, .48), 0 8px 24px rgba(255, 122, 26, .32);
  pointer-events: none;
  transition: left .18s ease, top .18s ease, width .18s ease, height .18s ease;
}

.onboarding-card {
  position: fixed;
  width: 320px;
  max-width: calc(100vw - 40px);
  background: #fff;
  color: #1f2937;
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, .22);
  padding: 18px 18px 16px;
}

.onboarding-count {
  color: #ff7a1a;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.onboarding-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.45;
  font-weight: 600;
}

.onboarding-card p {
  margin: 0 0 16px;
  color: #4b5563;
  font-size: 15px;
  line-height: 1.8;
}

.onboarding-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.onboarding-primary,
.onboarding-secondary {
  border-radius: 6px;
  border: 1px solid transparent;
  padding: 9px 14px;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 600;
  cursor: pointer;
}

.onboarding-primary {
  background: #ff7a1a;
  color: #fff;
}

.onboarding-primary:disabled {
  opacity: .65;
  cursor: not-allowed;
}

.onboarding-secondary {
  background: #fff;
  color: #606266;
  border-color: #dcdfe6;
}

body.dark-mode .onboarding-card {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-base);
}

body.dark-mode .onboarding-card p {
  color: var(--text-regular);
}

.mobile-warning-overlay {
  display: none;
}

@media (max-width: 767px) {
  .mobile-warning-overlay {
    position: fixed;
    inset: 0;
    z-index: 4000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 72px 18px 18px;
    background: rgba(17, 24, 39, .48);
  }

  .mobile-warning-modal {
    width: min(100%, 420px);
    background: #fff;
    color: var(--text-primary);
    border-radius: 8px;
    box-shadow: 0 18px 48px rgba(15, 23, 42, .24);
    padding: 22px 20px 18px;
  }

  .mobile-warning-title {
    font-size: 18px;
    line-height: 1.4;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 10px;
  }

  .mobile-warning-body {
    font-size: 15px;
    line-height: 1.8;
    color: #4b5563;
    margin-bottom: 18px;
  }

  .mobile-warning-url-box {
    border: 1px solid #fed7aa;
    border-radius: 6px;
    background: #fff7ed;
    padding: 12px;
    margin-bottom: 14px;
  }

  .mobile-warning-url-label {
    font-size: 13px;
    color: #9a3412;
    margin-bottom: 6px;
  }

  .mobile-warning-url {
    font-size: 13px;
    line-height: 1.5;
    color: #1f2937;
    word-break: break-all;
    margin-bottom: 10px;
  }

  .mobile-warning-copy {
    border: 1px solid #fdba74;
    border-radius: 6px;
    background: #fff;
    color: #c2410c;
    font-size: 14px;
    line-height: 1.4;
    font-weight: 600;
    padding: 8px 12px;
    cursor: pointer;
  }

  .mobile-warning-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .mobile-warning-primary,
  .mobile-warning-secondary {
    flex: 1;
    min-width: 0;
    border: 0;
    border-radius: 6px;
    font-size: 15px;
    line-height: 1.4;
    font-weight: 600;
    padding: 11px 12px;
    cursor: pointer;
  }

  .mobile-warning-primary {
    background: #ff7a1a;
    color: #fff;
  }

  .mobile-warning-secondary {
    width: 100%;
    border: 1px solid #ff7a1a;
    background: #fff;
    color: #c2410c;
  }

  .mobile-warning-primary:active {
    background: #e8680d;
  }

  .mobile-warning-secondary:active,
  .mobile-warning-copy:active {
    background: #fff7ed;
  }

  body.dark-mode .mobile-warning-modal {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-base);
  }

  body.dark-mode .mobile-warning-title {
    color: var(--text-primary);
  }

  body.dark-mode .mobile-warning-body {
    color: var(--text-regular);
  }

  body.dark-mode .mobile-warning-url-box {
    background: rgba(255, 122, 26, .12);
    border-color: rgba(255, 122, 26, .35);
  }

  body.dark-mode .mobile-warning-url,
  body.dark-mode .mobile-warning-url-label {
    color: var(--text-primary);
  }

  body.dark-mode .mobile-warning-secondary,
  body.dark-mode .mobile-warning-copy {
    background: var(--bg-card);
    color: #ffb077;
    border-color: rgba(255, 122, 26, .5);
  }
}
