
    :root {
      --primary: #2563eb;
      --primary-hover: #1d4ed8;
      --bg-base: #f8fafc;
      --bg-card: #ffffff;
      --border: #e2e8f0;
      --text-main: #0f172a;
      --text-muted: #64748b;
      --text-light: #94a3b8;
      --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    }
    * { box-sizing: border-box; margin: 0; padding: 0; }
    body {
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
      background-color: var(--bg-base);
      color: var(--text-main);
      height: 100vh;
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }
    /* 顶部导航 */
    header {
      background: #0f172a;
      color: #fff;
      padding: 0.75rem 1.5rem;
      display: flex;
      align-items: center;
      justify-content: space-between;
      border-bottom: 1px solid #1e293b;
      flex-shrink: 0;
    }
    .brand { display: flex; align-items: center; gap: 0.75rem; }
    .brand-logo {
      width: 28px; height: 28px; background: #3b82f6; border-radius: 6px;
      display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 14px;
    }
    .brand-title { font-size: 1.1rem; font-weight: 600; letter-spacing: 0.5px; }
    .header-stats { font-size: 0.82rem; color: #94a3b8; display: flex; gap: 1.25rem; }

    /* 版本 Tabs */
    .tabs-bar {
      background: #fff;
      border-bottom: 1px solid var(--border);
      padding: 0.5rem 1.5rem 0 1.5rem;
      display: flex;
      gap: 0.5rem;
      flex-shrink: 0;
      overflow-x: auto;
    }
    .tab-btn {
      padding: 0.5rem 1rem;
      border: none;
      background: none;
      font-size: 0.9rem;
      font-weight: 500;
      color: var(--text-muted);
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 0.5rem;
      border-bottom: 2px solid transparent;
      transition: all 0.15s ease;
      white-space: nowrap;
    }
    .tab-btn:hover { color: var(--text-main); }
    .tab-btn.active {
      color: var(--primary);
      border-bottom-color: var(--primary);
      font-weight: 600;
    }
    .tab-badge {
      font-size: 0.75rem;
      padding: 2px 6px;
      border-radius: 10px;
      background: #f1f5f9;
      color: var(--text-muted);
    }
    .tab-btn.active .tab-badge {
      background: #dbeafe;
      color: var(--primary);
    }

    /* 搜索栏与模式 */
    .search-panel {
      background: #fff;
      padding: 0.75rem 1.5rem;
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: center;
      gap: 1rem;
      flex-shrink: 0;
    }
    .search-input-wrap {
      flex: 1;
      position: relative;
    }
    .search-input {
      width: 100%;
      padding: 0.6rem 1rem 0.6rem 2.5rem;
      border: 1px solid #cbd5e1;
      border-radius: 8px;
      font-size: 0.95rem;
      outline: none;
      transition: border-color 0.2s, box-shadow 0.2s;
    }
    .search-input:focus {
      border-color: var(--primary);
      box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    }
    .search-icon {
      position: absolute;
      left: 0.85rem;
      top: 50%;
      transform: translateY(-50%);
      color: var(--text-light);
      pointer-events: none;
    }
    .mode-select {
      display: flex;
      background: #f1f5f9;
      padding: 3px;
      border-radius: 6px;
      gap: 2px;
    }
    .mode-btn {
      border: none;
      padding: 5px 12px;
      font-size: 0.82rem;
      border-radius: 4px;
      cursor: pointer;
      background: transparent;
      color: var(--text-muted);
      font-weight: 500;
    }
    .mode-btn.active {
      background: #fff;
      color: var(--text-main);
      box-shadow: 0 1px 2px rgba(0,0,0,0.06);
    }

    /* 主体双栏区域 */
    .main-body {
      flex: 1;
      display: flex;
      overflow: hidden;
    }
    .tables-sidebar {
      width: 380px;
      border-right: 1px solid var(--border);
      background: #fff;
      display: flex;
      flex-direction: column;
      flex-shrink: 0;
    }
    .sidebar-header {
      padding: 0.6rem 1rem;
      background: #f8fafc;
      border-bottom: 1px solid var(--border);
      font-size: 0.8rem;
      color: var(--text-muted);
      display: flex;
      justify-content: space-between;
      align-items: center;
    }
    .tables-list {
      flex: 1;
      overflow-y: auto;
    }
    .table-card {
      padding: 0.75rem 1rem;
      border-bottom: 1px solid #f1f5f9;
      cursor: pointer;
      transition: background-color 0.15s;
    }
    .table-card:hover { background: #f8fafc; }
    .table-card.active {
      background: #eff6ff;
      border-left: 3px solid var(--primary);
    }
    .tc-name {
      font-family: var(--font-mono);
      font-weight: 600;
      font-size: 0.92rem;
      color: #1e293b;
      margin-bottom: 2px;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }
    .tc-disp {
      font-size: 0.85rem;
      color: var(--text-muted);
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .tc-badge {
      font-size: 0.72rem;
      font-weight: normal;
      background: #e2e8f0;
      color: #475569;
      padding: 1px 6px;
      border-radius: 4px;
      font-family: -apple-system, sans-serif;
    }

    /* 右侧详情面板 */
    .detail-panel {
      flex: 1;
      display: flex;
      flex-direction: column;
      background: #fff;
      overflow: hidden;
    }
    .detail-empty {
      flex: 1;
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--text-light);
      font-size: 0.95rem;
      flex-direction: column;
      gap: 0.75rem;
    }
    .detail-header {
      padding: 1.25rem 1.5rem;
      border-bottom: 1px solid var(--border);
      background: #fafafa;
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      flex-shrink: 0;
    }
    .dh-title {
      font-size: 1.25rem;
      font-weight: 700;
      font-family: var(--font-mono);
      color: #0f172a;
      display: flex;
      align-items: center;
      gap: 0.75rem;
    }
    .dh-disp {
      font-size: 0.92rem;
      color: #475569;
      margin-top: 0.25rem;
    }
    .dh-meta {
      font-size: 0.8rem;
      color: var(--text-muted);
      margin-top: 0.35rem;
      display: flex;
      gap: 1rem;
    }
    .actions-bar {
      display: flex;
      gap: 0.5rem;
    }
    .act-btn {
      background: #fff;
      border: 1px solid #cbd5e1;
      border-radius: 6px;
      padding: 6px 12px;
      font-size: 0.8rem;
      font-weight: 500;
      color: #334155;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 4px;
      transition: all 0.15s;
    }
    .act-btn:hover {
      background: #f1f5f9;
      border-color: #94a3b8;
    }

    /* 字段过滤栏 */
    .column-filter-bar {
      padding: 0.5rem 1.5rem;
      background: #fff;
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: space-between;
      font-size: 0.82rem;
      color: var(--text-muted);
    }
    .col-filter-input {
      padding: 4px 8px;
      border: 1px solid #cbd5e1;
      border-radius: 4px;
      font-size: 0.8rem;
      outline: none;
      width: 220px;
    }
    .col-filter-input:focus { border-color: var(--primary); }

    /* 字段表格 */
    .table-container {
      flex: 1;
      overflow: auto;
      padding: 0;
    }
    table {
      width: 100%;
      border-collapse: collapse;
      font-size: 0.85rem;
      text-align: left;
    }
    th {
      position: sticky;
      top: 0;
      background: #f8fafc;
      padding: 8px 12px;
      font-weight: 600;
      color: #475569;
      border-bottom: 1px solid var(--border);
      z-index: 10;
      white-space: nowrap;
    }
    td {
      padding: 8px 12px;
      border-bottom: 1px solid #f1f5f9;
      color: #1e293b;
      vertical-align: middle;
    }
    tr:hover td { background-color: #f8fafc; }
    .col-name {
      font-family: var(--font-mono);
      font-weight: 600;
      color: #0f172a;
    }
    .badge-pk {
      background: #fee2e2;
      color: #dc2626;
      font-size: 0.7rem;
      padding: 1px 5px;
      border-radius: 4px;
      font-weight: 600;
      margin-left: 4px;
    }
    .type-pill {
      background: #f1f5f9;
      color: #475569;
      padding: 2px 6px;
      border-radius: 4px;
      font-family: var(--font-mono);
      font-size: 0.78rem;
    }

    /* 引用模型跳转按钮样式 */
    .ref-link-btn {
      color: #2563eb;
      background: #eff6ff;
      border: 1px solid #bfdbfe;
      padding: 2px 8px;
      border-radius: 4px;
      font-size: 0.8rem;
      text-decoration: none;
      display: inline-flex;
      align-items: center;
      gap: 3px;
      font-weight: 500;
      transition: all 0.15s ease;
    }
    .ref-link-btn:hover {
      background: #2563eb;
      color: #ffffff;
      border-color: #2563eb;
      box-shadow: 0 1px 3px rgba(37, 99, 235, 0.2);
    }

    /* 提示消息 Toast */
    .toast {
      position: fixed;
      bottom: 24px;
      right: 24px;
      background: #0f172a;
      color: #fff;
      padding: 8px 16px;
      border-radius: 6px;
      font-size: 0.85rem;
      box-shadow: 0 4px 12px rgba(0,0,0,0.15);
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.2s, transform 0.2s;
      transform: translateY(10px);
      z-index: 999;
    }
    .toast.show { opacity: 1; transform: translateY(0); }

    /* 响应式调整 */
    @media (max-width: 900px) {
      .tables-sidebar { width: 100%; height: 40%; border-right: none; border-bottom: 1px solid var(--border); }
      .main-body { flex-direction: column; }
    }
  