/* ============================================================
   ARSI 门户前台样式（portal.css）
   ------------------------------------------------------------
   来源：原主站模板内联样式，集中到本文件便于缓存与维护
     1. template/dafeult/head.html  第 15-108 行  基础重置 + 语言下拉
     2. template/dafeult/index.html 第 2-282 行   首页 banner + 卡片等高
     3. template/dafeult/productlist.html 第 38-102 行 认证课程列表
   依赖：assets/portal/css/css.css（@import ui/pc/swiper/iconfont）
   栅格类（xs*/sm*/md*/lg*）与组件类（.header/.section/.list-1/.list-2/
   .in-news/.in-pro/.info-content/.about/.footer）都在 ui.css / pc.css 里，
   本文件只做覆盖与补充，不重复定义。
   ============================================================ */

/* ---------- 1. 基础重置（原 head.html 内联） ---------- */
html, body {
  max-width: 100%;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
* { box-sizing: border-box; }
table {
  width: 100% !important;
  max-width: 100% !important;
  table-layout: fixed !important;
  border-collapse: collapse !important;
}
td, th {
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
  word-break: break-all !important;
  white-space: normal !important;
}
p, div, h1, h2, h3, h4, h5, h6, span, li, ol, ul {
  max-width: 100% !important;
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
}
img {
  max-width: 100% !important;
  height: auto !important;
}

/* ---------- 2. 语言切换按钮与下拉（原 head.html 内联） ---------- */
.lang {
  position: relative !important;
  display: inline-block;
}
.lang > a {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #fff;
  text-decoration: none;
}
.lang > a i { transition: transform 0.3s ease; }
.lang.active > a i { transform: rotate(180deg); }
.lang-box {
  position: absolute;
  top: 100%;
  left: auto !important;
  right: 0 !important;
  background: #1a1a1a;
  min-width: 180px;
  max-width: calc(100vw - 30px);
  white-space: normal;
  word-break: break-word;
  z-index: 99999;
  border-radius: 4px;
  overflow-y: auto;
  max-height: 70vh;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .3);
  display: none;
}
.lang-box a {
  display: block;
  padding: 10px 18px;
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  white-space: normal;
  word-break: break-word;
  text-align: left;
  transition: background .2s ease;
}
.lang-box a:hover { background: #333; }
.lang.active .lang-box { display: block; }
.lang-box a.highlight {
  background: #ffc107 !important;
  color: #000 !important;
}
/* 语种圆点（复用考试系统的 .lang-xx 配色，将来加语种自动生效） */
.lang-box a .lang-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 8px;
  border-radius: 50%;
  vertical-align: middle;
  background: #666;
}
.lang-en      { background: #002B5C; }
.lang-en-gb   { background: #012169; }
.lang-en-us   { background: #B22234; }
.lang-tw      { background: #A10046; }
.lang-zh      { background: #D92121; }
.lang-cn      { background: #DE2910; }
.lang-de      { background: #000; }
.lang-fr      { background: #0055A4; }
.lang-es      { background: #AA151B; }
.lang-it      { background: #009246; }
.lang-jp      { background: #BC002D; }
.lang-ko      { background: #003478; }
.lang-pt      { background: #006600; }
.lang-ru      { background: #0039A6; }

/* ---------- 3. 响应式：桌面导航居中（原 head.html 内联） ---------- */
@media screen and (max-width: 1023px) {
  .lang-box a {
    font-size: 13px;
    padding: 9px 16px;
  }
}
@media screen and (min-width: 1024px) {
  .nav ul {
    text-align: center !important;
    width: 100% !important;
  }
  .nav ul li {
    display: inline-block !important;
    float: none !important;
    text-align: center !important;
  }
  .nav ul li a {
    text-align: center !important;
    display: block !important;
    line-height: inherit !important;
  }
  .lang > a { text-align: center !important; }
}

/* ---------- 4. 首页 banner：高度控制 + 垂直居中（原 index.html 内联） ---------- */
.banner {
  position: relative;
  background-size: cover !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
  background-color: #1a1a1a;
  overflow: hidden;
  display: flex;
  align-items: center;
  min-height: 450px;
  max-height: 650px;
}
.banner::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(0, 0, 0, .3) 0%, rgba(0, 0, 0, .5) 100%);
  z-index: 1;
}
.banner .text {
  max-width: 1000px;
  width: 100%;
  padding: 0 20px;
  box-sizing: border-box;
  margin: 0 auto;
  position: relative;
  z-index: 2;
  text-align: center;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp .8s ease forwards;
}
@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.banner .text h3 {
  font-size: 14px !important;
  font-weight: 300;
  color: rgba(255, 255, 255, .8);
  text-align: center !important;
  margin: 0 auto 16px !important;
  padding: 0;
  line-height: 1.4;
}
.banner .text h2 {
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 auto 24px;
  letter-spacing: .5px;
  color: #fff;
}
.banner .text p {
  word-break: normal;
  overflow-wrap: break-word;
  white-space: normal;
  line-height: 1.8;
  margin: 0 auto 32px;
  font-size: 16px;
  max-width: 800px;
  color: rgba(255, 255, 255, .9);
}
.banner .btns {
  margin-top: 0;
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}
.banner .btns a {
  display: inline-block;
  padding: 14px 36px;
  background-color: #ffc107;
  color: #000;
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
  text-align: center;
  border-radius: 4px;
  transition: all .3s ease;
}
.banner .btns a:nth-child(2) {
  background-color: transparent;
  color: #ffc107;
  border: 2px solid #ffc107;
}
.banner .btns a:hover {
  opacity: 1;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 193, 7, .3);
}
.banner .btns a:nth-child(2):hover {
  background-color: #ffc107;
  color: #000;
}

/* ---------- 5. 卡片等高 + 底部对齐（原 index.html 内联） ---------- */
.clearfix::after {
  content: "";
  display: block;
  clear: both;
}
.in-news ul,
.in-pro ul,
.portal-cards ul {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
}
.in-news ul li,
.in-pro ul li,
.portal-cards ul li { margin-bottom: 30px; }
.in-news ul li a,
.in-pro ul li a,
.portal-cards ul li a {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
}
.img-cover {
  width: 100%;
  height: 180px;
  overflow: hidden;
  margin-bottom: 15px;
  flex-shrink: 0;
}
.img-cover span {
  display: block;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
}
.in-news .text,
.in-pro .text,
.portal-cards .text {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.in-news .text h2,
.in-pro .text h2,
.portal-cards .text h2 {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: unset !important;
  display: block !important;
  line-height: 1.5;
  font-size: 16px;
  margin: 0 0 10px 0;
  -webkit-line-clamp: unset !important;
  -webkit-box-orient: unset !important;
  flex-shrink: 0;
}
.in-news .text .date,
.in-pro .text .btns,
.portal-cards .text .btns { margin-top: auto; }

/* 区块条数不足一整行时列宽自适应（首页官方公告只有 2 条，不再空两格） */
.in-news ul.auto-fit,
.in-pro ul.auto-fit {
  justify-content: center;
}
.in-news ul.auto-fit li,
.in-pro ul.auto-fit li {
  width: auto !important;
  flex: 1 1 0;
  min-width: 220px;
  max-width: 420px;
}
/* 区块「更多」链接 */
.section-more {
  text-align: center;
  margin-top: 5px;
}
.section-more a {
  display: inline-block;
  padding: 8px 26px;
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: 3px;
  color: #fff !important;
  font-size: 14px;
}
.section-more a:hover {
  background: #ffc107;
  border-color: #ffc107;
  color: #000 !important;
}
.section-in-light .section-more a {
  color: #333 !important;
  border-color: #ccc;
}

/* ---------- 6. 认证课程列表（原 productlist.html 内联，改 id 选择器为 class） ---------- */
.portal-cert-list .list-1 .img-cover {
  height: 240px !important;
  margin-bottom: 20px !important;
}
.portal-cert-list .list-1 .img-cover span {
  background-size: cover !important;
  background-position: center !important;
}
.portal-cert-list .list-1 .text h2 {
  font-size: 19px !important;
  line-height: 1.4 !important;
  margin-bottom: 12px !important;
  color: #111 !important;
}
.portal-cert-list .list-1 .text p {
  font-size: 14px !important;
  line-height: 1.7 !important;
  color: #666 !important;
  margin-bottom: 18px !important;
}
.portal-cert-list .list-1 .btns span {
  font-size: 13px !important;
  padding: 8px 20px !important;
}
.portal-cert-list .list-1 li {
  margin-bottom: 40px !important;
  padding: 0 20px !important;
}

/* ---------- 7. 移动端（原 index.html / productlist.html 内联） ---------- */
@media (max-width: 768px) {
  .container,
  .section,
  .main,
  .wrapper,
  .header-con,
  body > div {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  .banner {
    min-height: 500px;
    max-height: 650px;
    margin: 0;
    padding: 0;
  }
  .banner .text {
    padding: 0 5%;
    max-width: 100%;
    margin: 0 auto;
  }
  .banner .text h2,
  .banner .text h3,
  .banner .text p {
    margin-left: 0;
    margin-right: 0;
    max-width: 100% !important;
  }
  .banner .text h2 { font-size: 24px; }
  .banner .text p {
    font-size: 14px;
    line-height: 1.7;
  }
  .banner .btns {
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
  }
  .banner .btns a {
    box-sizing: border-box;
    font-size: 15px;
    padding: 12px 20px;
    white-space: normal;
    word-break: break-word;
    text-align: center;
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
  }
  .banner .btns a:nth-child(2) {
    background-color: transparent;
    color: #ffc107;
    border: 2px solid #ffc107;
  }
  .portal-cert-list .list-1 .img-cover {
    height: 200px !important;
    margin-bottom: 15px !important;
  }
  .portal-cert-list .list-1 .text h2 { font-size: 17px !important; }
  .portal-cert-list .list-1 .text p {
    font-size: 13px !important;
    line-height: 1.6 !important;
    color: #666 !important;
  }
  .portal-cert-list .list-1 .btns span {
    font-size: 12px !important;
    padding: 7px 18px !important;
  }
  .portal-cert-list .list-1 li {
    padding: 0 10px !important;
    margin-bottom: 30px !important;
  }
  .portal-cert-list .container {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }
}
@media (min-width: 769px) {
  .banner {
    min-height: 550px;
    max-height: 650px;
  }
  .banner .text p {
    font-size: 18px;
    max-width: 70%;
  }
  .banner .btns a {
    padding: 16px 45px;
    font-size: 17px;
  }
}

/* ---------- 8. 门户补充：回退提示条 / 分页 / 表单 / 面包屑 ---------- */
/* 该语种无内容、按 fallback_code 回退到另一语种时的提示条 */
.portal-fallback-tip {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 15px;
  font-size: 13px;
  color: #6b5900;
  background: #fff6d9;
  border: 1px solid #ffe9a8;
  border-radius: 4px;
}
.portal-fallback-tip a { color: #6b5900; text-decoration: underline; }

/* 分页（.pages 基础样式在 pc.css） */
.pages .current {
  background-color: #ffc800;
  color: #fff;
}
.pages .disabled {
  color: #bbb;
  background: #f5f5f5;
  cursor: not-allowed;
}
.pages .empty {
  display: block;
  padding: 10px;
  color: #999;
  background: none;
}

/* 留言表单里的验证码行 */
.in-contact-con .form .label .req { color: #ffc107; }
.portal-captcha {
  display: flex;
  align-items: center;
  gap: 10px;
}
.portal-captcha input { flex: 1; }
.portal-captcha img {
  /* 顶部重置里有 img{height:auto!important}，这里必须带 !important 才能和 31px 高的 input 对齐 */
  width: 104px !important;
  height: 31px !important;
  cursor: pointer;
  border: none;
  /* 点击图片刷新验证码 */
}
/* 蜜罐：视觉隐藏但仍在 DOM 里（机器人会填） */
.portal-honeypot {
  position: absolute !important;
  left: -9999px !important;
  top: -9999px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.portal-form-msg {
  margin-top: 15px;
  padding: 10px 14px;
  border-radius: 4px;
  font-size: 14px;
  display: none;
}
.portal-form-msg.ok {
  display: block;
  background: rgba(255, 200, 0, .15);
  border: 1px solid #ffc800;
  color: #fff;
}
.portal-form-msg.err {
  display: block;
  background: rgba(191, 0, 0, .15);
  border: 1px solid #bf0000;
  color: #fff;
}

/* 面包屑 */
.portal-crumb {
  max-width: 1200px;
  margin: 0 auto 20px;
  padding: 0 15px;
  font-size: 13px;
  color: #999;
}
.portal-crumb a { color: #666; }

/* 详情页发布时间（show / show_card 共用；.info-pic .text 里已有行高，这里只压掉标题与正文之间的空隙） */
.portal-meta {
  margin: 6px 0 14px;
  font-size: 13px;
  line-height: 1.6;
  color: #999;
}

/* 内容页图片/视频自适应（正文来自数据库 HTML） */
.portal-body img,
.portal-body video,
.portal-body iframe {
  max-width: 100% !important;
  height: auto !important;
}
.portal-body table { margin: 15px 0; }

/* 单页（關於ARSI）：.portal-page 只是 <body> 上的类型钩子，本文件不再给它任何版式。
   ⚠️ 千万不要在这里写 max-width / margin:auto：head.html 把它挂在 body 上，
      而 body 不在第 1 节那条 `p,div,…{max-width:100%!important}` 重置的选择器里，
      宽度限制会**真的生效**，于是页头 .header-con、内页 banner 一起被缩成窄栏
      （原缺陷：整页限 1200 居中，其它页仍是全宽 —— 交接文档 §5.31）。
   ⚠️ 也别试图给 .about 补 max-width:1200px 来"恢复原站列宽"：
      pc.css 的 .about{max-width:1200px} 和 .header-con{max-width:1390px} 一样，
      早就被上面那条继承自原站 head.html 第 20 行的重置压成 100% 了（实测 computed=100%），
      即原站的正文本来就是通栏的。要保持"和之前一致"就必须保持通栏，不要再加限宽。 */

/* ============================================================
   证书查询（portal/cert/index.html + result.html）
   pc.css 里的 .chaxun / .result 是原站样式，这里只补缺的部分，
   不改 pc.css —— 它是搬运来的公共样式，动一处会影响所有语种版式。
   ============================================================ */

/* 结果页提示条：原站只有绿色 .result .desc，撤销/过频/查不到需要另两种语气 */
.portal-cert .result .desc { color: #333; }
.portal-cert .result .desc-warn { background: #fdf0d5; }
.portal-cert .result .desc-bad  { background: #fbe3e4; }

/* 表单字段级提示（姓名/编号为空时显示在表单上方，不跳整页报错） */
.portal-form-error {
  margin: 0 0 20px;
  padding: 10px 14px;
  border-left: 4px solid #e6a23c;
  background: #fdf6ec;
  color: #b26a1d;
  font-size: 14px;
}

/* 移动端：原站 .chaxun 只有 max-width，窄屏下按钮文字偏小，抬高点击区域 */
@media (max-width: 767px) {
  .chaxun button { height: 44px; }
  .result { padding: 24px 15px; }
  .result h2 { font-size: 22px; }
  .result .desc h3 { font-size: 18px; }
  .result li { height: auto; padding: 12px 0 12px 16px; flex-wrap: wrap; }
}

/* ---------- 404 页（模板 application/index/view/portal/index/404.html） ---------- */
.portal-404 {
  padding: 20px 0 80px;
  text-align: center;
}
.portal-404 .code {
  font-size: 88px;
  line-height: 1;
  font-weight: 700;
  color: #e6e9ef;
  letter-spacing: 4px;
}
.portal-404 .section-title {
  text-align: center;
}
.portal-404 .section-title::after {
  left: 50%;
  transform: translateX(-50%);
}
.portal-404 .back-home {
  display: inline-block;
  margin-top: 26px;
  padding: 11px 34px;
  border: 1px solid #002B5C;
  color: #002B5C;
  font-size: 14px;
  letter-spacing: 1px;
  transition: all .25s;
}
.portal-404 .back-home:hover {
  background: #002B5C;
  color: #fff;
}
