/* Modern responsive overrides — keeps original Helix look (#08c accent, white content, dark footer) */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

/* theme.css forces min-width:1200px — kill it so the page can shrink */
html, body { min-width: 0 !important; }

body {
  font-family: "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #333;
  line-height: 1.6;
}

img { max-width: 100%; height: auto; }

/* ---- Layout container ---- */
#layout {
  width: auto !important;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---- Header ---- */
#head_wrapper {
  border-bottom: 1px solid #e5e5e5;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}

#account { margin-top: 25px; font-size: 14px; }
#account a.userlink {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 4px;
  text-decoration: none;
}
#account a.userlink:hover { background: #08c; color: #fff; text-decoration: none; }

#nav { padding-right: 0 !important; } /* space was reserved for the removed search bar */
#nav ul li a { border-radius: 4px 4px 0 0; }

/* ---- Hero carousel ---- */
.hero {
  position: relative;
  margin-top: 20px;
  border-radius: 10px;
  background: linear-gradient(135deg, #fafafa 0%, #eef6fb 100%);
  overflow: hidden;
  min-height: 300px;
}

.hero-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 32px 72px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .5s ease, visibility .5s ease;
}
.hero-slide.is-active { position: relative; opacity: 1; visibility: visible; }

.hero-text { flex: 1 1 55%; min-width: 0; }
.hero-text h2 { font-size: 28px; line-height: 1.3; margin-bottom: 12px; }
.hero-text p {
  color: #555;
  margin-bottom: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hero-text a {
  display: inline-block;
  padding: 10px 24px;
  color: #fff;
  background-color: #08c;
  border-radius: 4px;
  text-decoration: none;
  transition: background-color .3s;
}
.hero-text a:hover { background-color: #222; }

.hero-img { flex: 1 1 45%; min-width: 0; text-align: center; }
.hero-img img { max-height: 240px; width: auto; max-width: 100%; }

.hero-arrow {
  position: absolute;
  z-index: 5;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 64px;
  border: 0;
  border-radius: 6px;
  color: #fff;
  background-color: rgba(0, 136, 204, .85);
  font-size: 18px;
  cursor: pointer;
  transition: background-color .3s;
}
.hero-arrow:hover { background-color: #222; }
.hero-prev { left: 12px; }
.hero-next { right: 12px; }

.hero-dots {
  position: absolute;
  z-index: 5;
  left: 0;
  right: 0;
  bottom: 12px;
  text-align: center;
}
.hero-dots button {
  width: 10px;
  height: 10px;
  padding: 0;
  margin: 0 5px;
  border: 0;
  border-radius: 50%;
  background: #bbb;
  cursor: pointer;
  transition: background .3s, transform .3s;
}
.hero-dots button.is-active { background: #08c; transform: scale(1.3); }

/* ---- Content boxes ---- */
.cont_box { margin-top: 30px !important; }

.cont_box h2 {
  font-size: 22px;
  padding-bottom: 10px;
  border-bottom: 2px solid #08c;
  margin-bottom: 20px;
}

/* Content column goes full width; cards arrange themselves in a grid */
.column-7 { width: 100% !important; }

.cont_box:has(> .minibox) {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.cont_box:has(> .minibox) h2 { grid-column: 1 / -1; margin-bottom: 0; }

/* Minibox cards */
.minibox {
  width: 100%;
  float: none !important;
  margin-bottom: 0 !important;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px !important;
  transition: box-shadow .2s ease, transform .2s ease;
}
.minibox:hover {
  box-shadow: 0 4px 14px rgba(0,0,0,.08);
  transform: translateY(-2px);
}
.minibox_img {
  left: 16px !important;
  top: 16px !important;
  border-radius: 8px;
}
.minibox_info { padding-left: 90px; }
.minibox h3 { margin-bottom: 6px; }
.minibox p { color: #666; font-size: 14px; }

/* ---- Footer ---- */
#foot_wrapper { margin-top: 40px !important; }
.footer_info { padding: 30px 0; }
.footer_info p { color: #aaa; font-size: 13px; line-height: 1.8; }
.footer_info a { color: #ccc; }
.footer_info a:hover { color: #fff; }

/* =========================================================
   Responsive breakpoints
   ========================================================= */

/* Tablet */
@media (max-width: 900px) {
  .hero-slide { padding: 28px 60px; }
  .hero-text h2 { font-size: 24px; }
  .hero-img img { max-height: 180px; }
}

/* Phone */
@media (max-width: 600px) {
  #layout { padding: 0 16px; }

  /* Header stacks */
  #account { margin-top: 18px; }

  /* Hero: stack text over image; arrows move to the bottom bar so they
     never overlap the text */
  .hero { min-height: 0; }
  .hero-slide {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 24px 20px 64px;
  }
  .hero-text { flex: none; width: 100%; }
  .hero-text h2 { font-size: 20px; }
  .hero-text p { -webkit-line-clamp: 5; font-size: 14px; }
  .hero-img { display: none; }

  .hero-arrow {
    top: auto;
    bottom: 10px;
    transform: none;
    width: 48px;
    height: 32px;
    font-size: 14px;
    border-radius: 6px;
  }
  .hero-prev { left: 16px; }
  .hero-next { right: 16px; }
  .hero-dots { bottom: 18px; }

  /* Cards: image on top of text is too cramped — keep side layout but smaller */
  .minibox_img { width: 56px !important; height: 56px !important; }
  .minibox_info { padding-left: 76px; }

  .footer_info p { font-size: 12px; }
}
