/* ============================================================
 * Ops KB · 离线响应式框架层（framework.css）
 * ------------------------------------------------------------
 * 零依赖的"Bootstrap 类"布局层：响应式栅格、断点、Flex 工具、
 * 间距/文本/显示工具类。视觉主题见 style.css。
 * 若日后想替换为真正的 Bootstrap/Tailwind，替换本文件并在
 * style.css 顶部同步令牌即可。
 * ============================================================ */

/* ---------- 断点 ----------
 * sm 576 / md 768 / lg 992 / xl 1200
 * 移动优先：基础样式作用于全部，md-/lg-/xl- 前缀覆盖更大屏
 */

/* ---------- 容器 ---------- */
.container, .container-wide {
  width: 100%;
  margin-inline: auto;
  padding-inline: 20px;
}
.container { max-width: 780px; }
.container-wide { max-width: 1040px; }

/* ---------- 栅格 ---------- */
.row {
  display: flex;
  flex-wrap: wrap;
  margin-inline: -10px;
}
.row > * { padding-inline: 10px; box-sizing: border-box; }

.col, .col-1, .col-2, .col-3, .col-4, .col-5, .col-6,
.col-7, .col-8, .col-9, .col-10, .col-11, .col-12,
.col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6,
.col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12,
.col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6,
.col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12 {
  flex: 0 0 auto;
  width: 100%;
}
.col { flex: 1 0 0%; }
.col-1 { width: 8.333333%; } .col-2 { width: 16.666667%; }
.col-3 { width: 25%; }      .col-4 { width: 33.333333%; }
.col-5 { width: 41.666667%; } .col-6 { width: 50%; }
.col-7 { width: 58.333333%; } .col-8 { width: 66.666667%; }
.col-9 { width: 75%; }      .col-10 { width: 83.333333%; }
.col-11 { width: 91.666667%; } .col-12 { width: 100%; }

@media (min-width: 768px) {
  .col-md { flex: 1 0 0%; }
  .col-md-1 { width: 8.333333%; } .col-md-2 { width: 16.666667%; }
  .col-md-3 { width: 25%; }      .col-md-4 { width: 33.333333%; }
  .col-md-5 { width: 41.666667%; } .col-md-6 { width: 50%; }
  .col-md-7 { width: 58.333333%; } .col-md-8 { width: 66.666667%; }
  .col-md-9 { width: 75%; }      .col-md-10 { width: 83.333333%; }
  .col-md-11 { width: 91.666667%; } .col-md-12 { width: 100%; }
}
@media (min-width: 992px) {
  .col-lg { flex: 1 0 0%; }
  .col-lg-1 { width: 8.333333%; } .col-lg-2 { width: 16.666667%; }
  .col-lg-3 { width: 25%; }      .col-lg-4 { width: 33.333333%; }
  .col-lg-5 { width: 41.666667%; } .col-lg-6 { width: 50%; }
  .col-lg-7 { width: 58.333333%; } .col-lg-8 { width: 66.666667%; }
  .col-lg-9 { width: 75%; }      .col-lg-10 { width: 83.333333%; }
  .col-lg-11 { width: 91.666667%; } .col-lg-12 { width: 100%; }
}

/* ---------- Flex 工具 ---------- */
.d-flex { display: flex; }
.d-inline-flex { display: inline-flex; }
.d-block { display: block; }
.d-grid { display: grid; }
.d-none { display: none; }
.flex-row { flex-direction: row; }
.flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-nowrap { flex-wrap: nowrap; }
.flex-grow-1 { flex-grow: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.align-items-center { align-items: center; }
.align-items-start { align-items: flex-start; }
.align-items-end { align-items: flex-end; }
.align-items-stretch { align-items: stretch; }
.justify-content-start { justify-content: flex-start; }
.justify-content-center { justify-content: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-end { justify-content: flex-end; }
.align-self-center { align-self: center; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; }
.gap-4 { gap: 16px; } .gap-5 { gap: 24px; }

/* ---------- 间距工具 ---------- */
.m-0 { margin: 0; } .p-0 { padding: 0; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; } .mt-5 { margin-top: 24px; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; } .mb-5 { margin-bottom: 24px; }
.ms-1 { margin-left: 4px; } .ms-2 { margin-left: 8px; } .ms-3 { margin-left: 12px; }
.me-1 { margin-right: 4px; } .me-2 { margin-right: 8px; } .me-3 { margin-right: 12px; }
.mx-auto { margin-inline: auto; }
.px-0 { padding-inline: 0; } .px-2 { padding-inline: 8px; } .px-3 { padding-inline: 12px; }
.py-1 { padding-block: 4px; } .py-2 { padding-block: 8px; } .py-3 { padding-block: 12px; }
.py-4 { padding-block: 16px; } .py-5 { padding-block: 24px; }

/* ---------- 文本工具 ---------- */
.text-start { text-align: left; }
.text-center { text-align: center; }
.text-end { text-align: right; }
.text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.text-muted { color: var(--ink-3); }
.text-accent { color: var(--accent); }
.text-danger { color: var(--danger); }
.fw-normal { font-weight: 400; }
.fw-bold { font-weight: 700; }
.fs-sm { font-size: 13px; }
.fs-md { font-size: 15px; }
.fs-lg { font-size: 18px; }
.fs-xl { font-size: 22px; }
.text-nowrap { white-space: nowrap; }
.word-break-all { word-break: break-all; }

/* ---------- 显示断点 ---------- */
@media (max-width: 767.98px) {
  .d-md-none { display: none !important; }
  .d-md-block { display: block !important; }
}
@media (min-width: 768px) {
  .d-md-none { display: none !important; }
  .d-md-block { display: block !important; }
  .d-md-flex { display: flex !important; }
}
@media (min-width: 992px) {
  .d-lg-none { display: none !important; }
  .d-lg-block { display: block !important; }
  .d-lg-flex { display: flex !important; }
}

/* ---------- 通用组件基础 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-size: 14px;
  font-family: inherit;
  line-height: 1.4;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
  user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-2); text-decoration: none; color: #fff; }
.btn-outline {
  background: transparent;
  border-color: var(--line);
  color: var(--ink-2);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.card {
  background: var(--surface, #fff);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-hover { transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s; }
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--accent); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.6;
  padding: 1px 10px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--ink-2);
  white-space: nowrap;
}
.badge-accent { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.badge-danger { background: var(--danger-soft); border-color: transparent; color: var(--danger); }

/* 筛选条 */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink-2);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.chip .cnt { font-size: 11px; opacity: 0.75; }
.chip.active .cnt { opacity: 0.85; }

/* 下拉 */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 50;
  min-width: 180px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  display: none;
}
.dropdown.open .dropdown-menu { display: block; }
.dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 7px 12px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink-2);
  cursor: pointer;
}
.dropdown-item:hover { background: var(--bg-soft); color: var(--ink); }
.dropdown-item.active { color: var(--accent); font-weight: 600; }
