/* ============================================================================
 * 企业页样式 · 蓝色皮肤版（2026-11-11 建）
 * ============================================================================
 * 背景：
 *   /company、/company/{名称}、/company/{名称}/notices 三个页面原本只有白色皮肤版
 *   的样式（co-* 类，定义在客户定制版 portal.css 里）。蓝色皮肤（106 自研 / 47 现用）
 *   完全没有这套类，导致 47 上这三个页面 404、106 上裸奔。
 *
 * 本文件原则（很重要）：
 *   1. 只用蓝色皮肤已有的设计变量（--blue / --line / --radius / --shadow …），
 *      不引入新配色、不改整体观感，视觉上与站内其他蓝色页面完全一致。
 *   2. 类名统一前缀 p-co-，与白色皮肤的 co-* 明确区分，两套样式可并存互不干扰。
 *   3. 只包含企业页需要的东西（搜索区、角色切换、活跃榜、画像、关系、公告列表），
 *      不含任何客户定制的品牌元素。
 *   4. 独立文件、独立加载，只在企业页引用，不污染 portal.css。
 *
 * 加载方式：company_*.php 视图顶部通过
 *   <?php echo company_css_tag(); ?>
 * 输出 <link>；或由 layout 按 $__page 条件注入。
 * ========================================================================== */

/* ---------- 面包屑与页头 ---------- */
.p-co-crumb {
  font-size: 13px; color: var(--muted); margin: 0 0 14px;
}
.p-co-crumb a { color: var(--muted); text-decoration: none; }
.p-co-crumb a:hover { color: var(--blue); }
.p-co-crumb i { font-style: normal; margin: 0 6px; opacity: .5; }

.p-co-head { margin-bottom: 18px; }
.p-co-head h1 {
  font-size: 26px; line-height: 1.3; color: var(--blue-deep);
  margin: 0 0 8px; font-weight: 700;
}
.p-co-head p {
  font-size: 14px; color: var(--muted); margin: 0; line-height: 1.7;
}

/* ---------- 搜索卡 ---------- */
.p-co-search-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.p-co-search {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.p-co-search input[type="text"] {
  flex: 1 1 260px; min-width: 180px; height: 40px;
  padding: 0 14px; font-size: 14px; color: var(--text);
  border: 1px solid var(--line); border-radius: 8px;
  background: #fff; outline: none; box-sizing: border-box;
  transition: border-color .15s, box-shadow .15s;
}
.p-co-search input[type="text"]::placeholder { color: #a3aab8; }
.p-co-search input[type="text"]:focus {
  border-color: var(--blue); box-shadow: 0 0 0 3px rgba(11, 91, 215, .10);
}
.p-co-search select {
  height: 40px; padding: 0 12px; font-size: 14px; color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
  outline: none; cursor: pointer; box-sizing: border-box;
}
.p-co-search select:focus { border-color: var(--blue); }
.p-co-search button {
  height: 40px; padding: 0 26px; font-size: 14px; font-weight: 600;
  color: #fff; background: var(--blue); border: 0; border-radius: 8px;
  cursor: pointer; transition: background .15s; box-sizing: border-box;
}
.p-co-search button:hover { background: var(--blue-deep); }

/* ---------- 角色切换 ---------- */
.p-co-roles {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line);
}
.p-co-roles .lb {
  font-size: 13px; color: var(--muted); margin-right: 2px; flex: none;
}
.p-co-roles .chip {
  display: inline-flex; align-items: center; height: 28px; padding: 0 14px;
  font-size: 13px; color: var(--text); background: #fff;
  border: 1px solid var(--line); border-radius: 999px;
  cursor: pointer; text-decoration: none; transition: all .15s; white-space: nowrap;
}
.p-co-roles .chip:hover { border-color: var(--blue); color: var(--blue); }
.p-co-roles .chip.on {
  background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 600;
}

/* ---------- 提示条 ---------- */
.p-co-tip {
  display: flex; align-items: flex-start; gap: 8px;
  margin-top: 12px; padding: 10px 12px; font-size: 12.5px; line-height: 1.75;
  color: #4a5a72; background: var(--blue-bg);
  border: 1px solid #dbe6f8; border-radius: 8px;
}
.p-co-tip b { color: var(--blue-deep); font-weight: 600; }
.p-co-tip a { color: var(--blue); text-decoration: none; }
.p-co-tip a:hover { text-decoration: underline; }

/* ---------- 区块标题 ---------- */
.p-co-sec {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  margin: 22px 0 12px;
}
.p-co-sec h2 {
  font-size: 18px; color: var(--blue-deep); margin: 0; font-weight: 700;
}
.p-co-sec em {
  font-style: normal; font-size: 13px; color: var(--muted);
}
.p-co-sec .more {
  margin-left: auto; font-size: 13px; color: var(--blue); text-decoration: none;
}
.p-co-sec .more:hover { text-decoration: underline; }

/* ---------- 三张活跃榜 ---------- */
.p-co-rank {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px;
}
.p-co-rank-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; min-width: 0; box-sizing: border-box;
}
.p-co-rank-hd {
  display: flex; align-items: baseline; gap: 8px;
  padding-bottom: 10px; margin-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.p-co-rank-hd b {
  font-size: 14.5px; color: var(--text); font-weight: 700;
}
.p-co-rank-hd span {
  font-size: 12px; color: var(--muted);
}

.p-co-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0; border-bottom: 1px dashed #eef1f7;
  text-decoration: none; color: inherit; min-width: 0;
}
.p-co-row:last-child { border-bottom: 0; }
.p-co-row:hover .p-co-name { color: var(--blue); }

.p-co-row .idx {
  flex: none; width: 18px; font-size: 12px; font-weight: 700;
  color: #b6becc; text-align: center;
}
.p-co-row:nth-child(2) .idx { color: var(--blue); }

.p-co-row .p-co-name {
  flex: 1 1 auto; min-width: 0; font-size: 13.5px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: color .15s;
}
.p-co-row .cnt {
  flex: none; font-size: 12px; color: var(--muted);
  background: var(--blue-bg); border-radius: 999px; padding: 2px 9px;
}

/* ---------- 底部说明块 ---------- */
.p-co-why {
  background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--blue);
  border-radius: var(--radius); padding: 16px 20px; margin-top: 20px;
}
.p-co-why h3 {
  font-size: 14.5px; color: var(--blue-deep); margin: 0 0 10px; font-weight: 700;
}
.p-co-why ol {
  margin: 0; padding-left: 20px; font-size: 13px; line-height: 1.95; color: #4a5a72;
}
.p-co-why ol li { margin-bottom: 4px; }
.p-co-why b { color: var(--text); font-weight: 600; }
.p-co-why a { color: var(--blue); text-decoration: none; }
.p-co-why a:hover { text-decoration: underline; }

/* ============================================================================
 * 以下为企业画像页（/company/{名称}）
 * ========================================================================== */

/* 企业头部卡 */
.p-co-profile {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.p-co-profile-top {
  display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap;
}
.p-co-profile-logo {
  flex: none; width: 48px; height: 48px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--blue-deep));
}
.p-co-profile-main { flex: 1 1 260px; min-width: 0; }
.p-co-profile-name {
  font-size: 21px; font-weight: 700; color: var(--blue-deep);
  margin: 0 0 6px; line-height: 1.35; word-break: break-all;
}
.p-co-profile-meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--muted);
}

/* 角色标签 */
.p-co-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.p-co-tags .tag {
  display: inline-flex; align-items: center; height: 22px; padding: 0 9px;
  font-size: 11.5px; font-weight: 600; border-radius: 5px;
  background: var(--blue-bg); color: var(--blue-deep); border: 1px solid #dbe6f8;
}

/* KPI 四格 */
.p-co-kpi {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px;
  margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--line);
}
.p-co-kpi > div {
  text-align: center; min-width: 0; padding: 4px 2px;
}
.p-co-kpi b {
  display: block; font-size: 20px; font-weight: 700; color: var(--blue);
  line-height: 1.3;
}
.p-co-kpi span {
  display: block; font-size: 12px; color: var(--muted); margin-top: 3px;
}

/* 双列布局 */
.p-co-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px;
  align-items: start;
}
.p-co-cell {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; min-width: 0; box-sizing: border-box;
}
.p-co-cell-hd {
  display: flex; align-items: baseline; gap: 8px;
  padding-bottom: 10px; margin-bottom: 8px; border-bottom: 1px solid var(--line);
}
.p-co-cell-hd h2 {
  font-size: 15px; color: var(--blue-deep); margin: 0; font-weight: 700;
}
.p-co-cell-hd span { font-size: 12px; color: var(--muted); }

/* 双向关系列表（谁→谁） */
.p-co-rel {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 0; border-bottom: 1px dashed #eef1f7; min-width: 0;
}
.p-co-rel:last-child { border-bottom: 0; }
.p-co-rel .from,
.p-co-rel .to {
  flex: 1 1 0; min-width: 0; font-size: 13px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.p-co-rel .to { text-align: right; color: var(--muted); }
.p-co-rel .arrow {
  flex: none; font-size: 12px; color: var(--blue); opacity: .7;
}
.p-co-rel .cnt {
  flex: none; font-size: 11.5px; color: var(--muted);
  background: var(--blue-bg); border-radius: 999px; padding: 1px 8px;
}

/* 关系图谱（纯 CSS + 内联 SVG 承载） */
.p-co-graph {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; margin-bottom: 14px; overflow-x: auto;
}
.p-co-graph svg,
.p-co-graph-svg { display: block; max-width: 100%; height: auto; }
.p-co-graph-legend {
  display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px;
  font-size: 12px; color: var(--muted);
}
.p-co-graph-legend i {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  margin-right: 5px; vertical-align: middle;
}

/* 公告列表（画像页 / 公告页共用） */
.p-co-list { margin: 0; padding: 0; list-style: none; }
.p-co-list li {
  border-bottom: 1px solid var(--line);
}
.p-co-list li:last-child { border-bottom: 0; }
.p-co-list a {
  display: block; padding: 12px 2px; text-decoration: none; color: inherit;
  transition: background .15s;
}
.p-co-list a:hover { background: #fafcff; }
.p-co-list p {
  margin: 0 0 5px; font-size: 14px; line-height: 1.6; color: var(--text);
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; word-break: break-all;
}
.p-co-list a:hover p { color: var(--blue); }
.p-co-list span {
  font-size: 12px; color: var(--muted);
}

/* 空状态 */
.p-co-empty {
  padding: 36px 20px; text-align: center; color: var(--muted); font-size: 13.5px;
}
.p-co-empty b { display: block; color: var(--text); margin-bottom: 6px; font-size: 15px; }

/* ============================================================================
 * 响应式
 * ========================================================================== */

/* 平板：三榜改两列，KPI 改两列 */
@media (max-width: 1000px) {
  .p-co-rank { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .p-co-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 手机：全部单列 */
@media (max-width: 720px) {
  .p-co-head h1 { font-size: 21px; }
  .p-co-head p { font-size: 13px; }

  .p-co-search-card { padding: 14px 15px; }
  .p-co-search { gap: 8px; }
  .p-co-search input[type="text"],
  .p-co-search select,
  .p-co-search button {
    flex: 1 1 100%; width: 100%; height: 42px;
  }
  /* 触控目标不低于 44px（移动端人机规范） */
  .p-co-roles .chip { height: 32px; padding: 0 13px; font-size: 12.5px; }

  .p-co-rank { grid-template-columns: 1fr; }
  .p-co-grid { grid-template-columns: 1fr; }
  .p-co-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .p-co-profile { padding: 16px; }
  .p-co-profile-name { font-size: 17px; }
  .p-co-profile-logo { width: 40px; height: 40px; font-size: 17px; }

  .p-co-sec h2 { font-size: 16px; }
  .p-co-why { padding: 14px 16px; }
  .p-co-why ol { padding-left: 18px; font-size: 12.5px; }

  /* 关系行在窄屏改成上下两行，避免挤成一团 */
  .p-co-rel { flex-wrap: wrap; row-gap: 2px; }
  .p-co-rel .from { flex: 1 1 100%; }
  .p-co-rel .to { flex: 1 1 100%; text-align: left; padding-left: 16px; }
  .p-co-rel .arrow { display: none; }
}

/* 超窄屏（360 及以下）：KPI 也改单列 */
@media (max-width: 400px) {
  .p-co-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .p-co-kpi b { font-size: 17px; }
  .p-co-kpi span { font-size: 11px; }
}
