/* ==========================================================================
   ESM 产品介绍页样式
   结构：变量 → 基础 → 布局骨架 → 头部 → 主体 → 卡片 → 状态 → 可访问性 → 响应式
   ========================================================================== */

:root {
  --c-text: #333;
  --c-text-sub: #777;
  --c-bg: #eee;
  --c-surface: #fff;
  --c-accent: #1677ff;
  --header-h: 60px;
  --gap: 15px;
  --radius: 16px;
}

/* ---- 基础 ---------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
  font-size: 16px;
  color: var(--c-text);
  -webkit-text-size-adjust: 100%;
}

body {
  height: 100%;
  display: flex;
  flex-direction: column;
  background-color: var(--c-bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

/* ---- 头部 ---------------------------------------------------------------- */
#header {
  flex: 0 0 auto;
  height: var(--header-h);
  background-color: var(--c-surface);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .04);
}

.nav-wrapper {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

.logo {
  display: flex;
  align-items: center;
}

#header .logo img {
  width: 42px;
  height: 42px;
  border-radius: 9px;
  object-fit: cover;
}

.navs {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 1.2rem;
  color: #555;
  transition: color .2s, background-color .2s;
}

.nav:hover {
  color: var(--c-accent);
  background-color: #f2f6ff;
}

/* ---- 主体 ---------------------------------------------------------------- */
#main {
  flex: 1 1 auto;
  min-height: 0;              /* 允许在 flex 容器内正常滚动 */
  margin: var(--gap) auto 0;
  overflow-y: auto;
  background-color: var(--c-surface);
  text-align: center;
}

#main .title {
  margin: 50px auto 30px;
  padding: 0 16px;
  font-size: 2.4rem;
  font-weight: bold;
  line-height: 1.3;
}

#main .logo {
  justify-content: center;
}

#main .logo img {
  width: 120px;
  height: 120px;
  border-radius: 30px;
  object-fit: cover;
}

#main .subtitle {
  margin: 20px auto;
  padding: 0 16px;
  font-size: 1.8rem;
  color: var(--c-text-sub);
}

/* ---- 卡片 ---------------------------------------------------------------- */
.items {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  gap: 20px;
  margin: 100px auto;
  padding: 0 20px;
}

.item {
  display: flex;
  justify-content: center;
  min-width: 200px;
}

.card {
  width: 100%;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px;
  border-radius: var(--radius);
  transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease;
}

a.card:hover {
  transform: translateY(-4px);
  background-color: #fafafa;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .08);
}

.card .icon {
  width: 96px;               /* 原图 200×200，必须显式约束，否则桌面端按原尺寸渲染 */
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
}

.card .name {
  margin-top: 20px;
  font-size: 1.8rem;
  line-height: 1.4;
}

/* ---- 未上线状态 ---------------------------------------------------------- */
.is-disabled .card {
  opacity: .55;
  cursor: not-allowed;
}

.badge {
  margin-top: 8px;
  padding: 2px 10px;
  font-size: .8rem;
  line-height: 1.6;
  color: #8a6d3b;
  background-color: #fff8e6;
  border: 1px solid #ffe1a8;
  border-radius: 999px;
}

/* ---- 可访问性 ------------------------------------------------------------ */
:focus-visible {
  outline: 3px solid var(--c-accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }

  a.card:hover {
    transform: none;
  }
}

/* ---- 响应式（媒体查询统一置于文件末尾） ---------------------------------- */
@media screen and (max-width: 1020px) {
  .items {
    justify-content: center;
  }

  .item {
    flex: 0 0 50%;
    max-width: 320px;
  }
}

@media screen and (max-width: 600px) {
  :root {
    --header-h: 58px;
    --gap: 12px;
  }

  .nav-wrapper {
    padding: 0 12px;
  }

  #header .logo img {
    width: 34px;
    height: 34px;
  }

  .navs {
    gap: 4px;
  }

  .nav {
    height: 32px;
    padding: 0 10px;
    font-size: 1rem;
  }

  #main {
    margin: var(--gap) 0 0;
    max-width: none;
    padding: 0 16px 28px;
    text-align: left;
  }

  #main .title {
    margin: 0;
    padding: 22px 0 0;
    font-size: 1.5rem;
    line-height: 1.35;
    text-align: center;
  }

  #main .logo {
    justify-content: center;
  }

  #main .logo img {
    width: 82px;
    height: 82px;
    margin-top: 18px;
  }

  #main .subtitle {
    margin: 10px auto 0;
    padding: 0;
    font-size: .9rem;
    text-align: center;
  }

  .items {
    margin: 24px auto 0;
    padding: 0;
    gap: 12px;
    justify-content: stretch;
  }

  .item {
    flex: 0 0 calc(50% - 6px);
    min-width: 0;
    max-width: none;
  }

  .card {
    min-height: 126px;
    padding: 14px 6px 12px;
  }

  .card .icon {
    width: 62px;
    height: 62px;
  }

  .card .name {
    margin-top: 8px;
    font-size: 1rem;
    text-align: center;
  }

  .badge {
    font-size: .7rem;
  }
}
