/*
案件管理系统 通用样式
供所有页面复用
*/

@import url("./variables.css");

/* =========================
   Reset
========================= */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: var(--font-family-base);
  background: var(--color-bg-main);
  color: var(--color-text-main);
}

/* =========================
   页面布局
========================= */

.page {
  height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.content {
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* 旧版页面结构标注已退出正式界面，只保留业务标题。 */
.cmt_taxonomy_label,
.pmt_taxonomy_label {
  display: none !important;
}

/* =========================
   卡片
========================= */

.card {
  background: var(--color-bg-panel);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-soft);
  box-shadow: var(--shadow-sm);
  padding: var(--space-lg);
  transition: var(--transition-fast);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

/* =========================
   Shared File Card
========================= */

.cs_file_card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--ui-border);
  border-radius: 10px;
  background: var(--ui-panel);
  box-shadow: var(--ui-shadow);
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease,
    background 0.15s ease;
}

.cs_file_card:hover {
  border-color: var(--ui-border-strong);
  background: var(--ui-card-hover);
  transform: translateY(-1px);
}

.cs_file_card.cs_file_card--selected,
.cs_file_card.active,
.cs_file_card.selected {
  border-color: var(--ui-accent);
  background: var(--ui-accent-soft);
  box-shadow:
    0 0 0 2px var(--ui-accent-soft),
    var(--ui-shadow);
}

.cs_file_card.cs_file_card--selected:hover,
.cs_file_card.active:hover,
.cs_file_card.selected:hover {
  border-color: var(--ui-accent);
  background: var(--ui-accent-soft);
  box-shadow:
    0 0 0 2px var(--ui-accent-soft),
    var(--ui-shadow);
  transform: translateY(-1px);
}

.cs_file_card:focus-visible {
  outline: none;
  border-color: var(--ui-accent);
  box-shadow: 0 0 0 2px var(--ui-accent-soft);
}

.cs_file_card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.cs_file_card__name {
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ui-text);
  word-break: break-all;
}

.cs_file_card__type {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--ui-border);
  background: var(--ui-panel-soft);
  color: var(--ui-text-soft);
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  flex: 0 0 auto;
}

.cs_file_card__type.is-ocr-todo {
  border-color: var(--ui-border);
  background: var(--ui-panel-soft);
  color: var(--ui-text-soft);
}

.cs_file_card__type.is-ocr-pending {
  border-color: rgba(217, 119, 6, 0.3);
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
}

.cs_file_card__type.is-ocr-reviewed {
  border-color: rgba(22, 163, 74, 0.28);
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
}

.cs_file_card__meta {
  font-size: 12px;
  line-height: 1.45;
  color: var(--ui-text-soft);
}

/* =========================
   面板
========================= */

.panel {
  background: var(--color-bg-panel);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: var(--space-xl);
}

/* =========================
   标题
========================= */

.title-lg {
  font-size: var(--font-size-xxl);
  font-weight: 600;
}

.title-md {
  font-size: var(--font-size-xl);
  font-weight: 600;
}

.title-sm {
  font-size: var(--font-size-lg);
  font-weight: 600;
}

/* =========================
   文本
========================= */

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

.text-secondary {
  color: var(--color-text-secondary);
}

/* =========================
   按钮
========================= */

.btn {
  height: 42px;
  padding: 0 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-bg-panel);
  color: var(--color-text-main);
  cursor: pointer;
  font-size: var(--font-size-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition-fast);
}

.btn:hover {
  background: var(--color-bg-soft);
}

.btn-primary {
  background: var(--color-primary);
  color: white;
  border: none;
}

.btn-primary:hover {
  background: var(--color-primary-hover);
}

.btn-danger {
  background: var(--color-danger);
  color: white;
  border: none;
}

.btn-danger:hover {
  opacity: 0.92;
}

/* =========================
   输入框
========================= */

.input {
  height: 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  padding: 0 12px;
  font-size: var(--font-size-md);
  color: var(--color-text-main);
  background: var(--color-bg-panel);
  transition: var(--transition-fast);
}

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

.input:focus {
  outline: none;
  border-color: var(--color-accent-blue);
  box-shadow: 0 0 0 2px rgba(47,111,237,0.15);
}

/* =========================
   DockBar
========================= */

.dockbar {
  height: var(--dockbar-height);
  border-top: 1px solid var(--color-border-soft);
  background: var(--color-bg-panel);
  display: flex;
  align-items: center;
  padding: 0 var(--space-lg);
  gap: var(--space-md);
}



/* =========================
   滚动条
========================= */

@supports (-moz-appearance: none) {
  * {
    scrollbar-width: thin !important;
    scrollbar-color: transparent transparent !important;
  }

  html.is-global-scrolling,
  html.is-global-scrolling * {
    scrollbar-width: thin !important;
    scrollbar-color: #171717 transparent !important;
  }
}

*::-webkit-scrollbar {
  width: 1px !important;
  height: 1px !important;
}

*::-webkit-scrollbar-thumb {
  min-width: 80px !important;
  min-height: 80px !important;
  background: transparent !important;
  border-radius: 10px !important;
  transition: background-color 0.16s ease;
}

*::-webkit-scrollbar-thumb:vertical {
  min-height: 80px !important;
}

*::-webkit-scrollbar-thumb:horizontal {
  min-width: 80px !important;
}

html.is-global-scrolling *::-webkit-scrollbar-thumb,
html.is-global-scrolling::-webkit-scrollbar-thumb,
.is-global-scrolling::-webkit-scrollbar-thumb,
*::-webkit-scrollbar-thumb:hover {
  background: #171717 !important;
}

body.theme-dark {
  background: #0f0f0f;
  color: var(--color-text-main);
}

body.theme-dark .page {
  background: #111;
}

body.theme-dark .content_main {
  background: transparent;
}

body.theme-dark .placeholder_panel {
  background: #1e1e1e;
  border-color: #2e2e2e;
}

/* =========================
   弹窗定位契约
   所有真正的模态弹窗必须相对可视区域左右居中。
   纵向位置仍由各业务弹窗自行决定（居中、顶部留白或底部停靠）。
========================= */

dialog,
[role="dialog"][aria-modal="true"] {
  margin-left: auto !important;
  margin-right: auto !important;
}

dialog[open] {
  left: 0 !important;
  right: 0 !important;
}
