/* ================================================
   SENYA Portfolio - Responsive Styles
   Breakpoints:
     ≤1200px  large tablet / small laptop
     ≤1024px  tablet
     ≤768px   mobile
     ≤480px   small mobile
================================================ */

/* ---- Remove hard-coded min-width on book page ---- */
@media (max-width: 1200px) {
  body {
    min-width: unset !important;
  }
}

/* ================================================
   LARGE TABLET  ≤1200px
================================================ */
@media (max-width: 1200px) {
  /* Reduce container side-padding */
  .container {
    padding: 0 0.4rem;
  }

  /* Welcome: allow full width */
  .welcome {
    width: calc(100% - 1.11rem);
    background-size: cover;
  }

  /* Project style grid: 3col → 2col */
  .c4dsheji {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
    width: 100%;
  }
  .c4dsheji img {
    width: 100%;
  }

  /* Explore/flip card grids (tsxm/jhsj): 3col → 2col */
  .explore-bd {
    grid-template-columns: 1fr 1fr !important;
    grid-template-rows: auto !important;
  }

  /* Glass grid: 3col → 2col */
  .glass {
    grid-template-columns: 1fr 1fr;
  }
  .glass img {
    width: 100%;
    height: auto;
  }

  /* About work width */
  .work {
    width: 90%;
  }

  /* hd sections: reduce large right padding */
  .hd {
    padding-right: 2rem;
  }

  /* Book box */
  .bookBox {
    width: 95%;
    height: auto;
  }
}

/* ================================================
   TABLET  ≤1024px
================================================ */
@media (max-width: 1024px) {
  /* Container tighter */
  .container {
    padding: 0 0.3rem;
  }

  /* Norm cards: reduce padding */
  .norm-left {
    padding: 0.2rem 0.25rem;
  }
  .norm-left h3 {
    font-size: 0.22rem;
  }

  /* hd sections */
  .hd {
    padding-right: 1.5rem;
  }

  /* About work */
  .work {
    width: 95%;
  }
}

/* ================================================
   MOBILE  ≤768px
================================================ */
@media (max-width: 768px) {

  /* ---- HEADER / NAV ---- */
  header {
    height: auto !important;
    min-height: 40px;
    padding: 6px 14px !important;
    flex-wrap: wrap;
  }
  .logo img,
  .you img {
    height: 26px !important;
  }
  /* Nav scrolls horizontally on mobile */
  nav {
    order: 3;
    width: 100%;
    margin: 0 !important;
    padding: 5px 0 3px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
  }
  nav::-webkit-scrollbar {
    display: none;
  }
  nav a {
    font-size: 11px !important;
    margin: 0 3px !important;
    flex-shrink: 0;
  }
  nav a div {
    padding: 4px 8px !important;
    font-size: 11px !important;
    white-space: nowrap;
    border-radius: 4px !important;
  }
  .you {
    margin-left: auto;
  }

  /* ---- INDEX - WELCOME SECTION ---- */
  .welcome {
    width: calc(100% - 24px) !important;
    height: auto !important;
    margin: 8px 12px 0 !important;
    padding: 20px 16px 16px !important;
    background-size: cover !important;
    display: flex !important;
    flex-direction: column;
    gap: 0;
  }
  .welcome-right {
    display: none !important;
  }
  .welcome-Left {
    display: flex !important;
    flex-direction: column;
    gap: 10px;
  }
  .welcome-Left h1 {
    font-size: 20px !important;
    line-height: 1.35 !important;
    letter-spacing: 0.05em !important;
  }
  .welcome-Left p {
    font-size: 12px !important;
    line-height: 1.6 !important;
    letter-spacing: 0.04em !important;
  }
  .callme {
    padding-right: 0 !important;
  }
  .welcome-Left button {
    width: auto !important;
    height: auto !important;
    padding: 7px 18px !important;
    font-size: 12px !important;
  }

  /* ---- INDEX - TOP NAV BAR ---- */
  .topnav {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    gap: 8px;
    padding-bottom: 4px;
    margin-top: 12px !important;
    margin-bottom: 6px !important;
  }
  .topnav::-webkit-scrollbar {
    display: none;
  }
  .topnav a {
    margin-right: 0 !important;
    flex-shrink: 0;
  }
  .topnavbar {
    width: auto !important;
    height: auto !important;
    padding: 5px 12px !important;
    font-size: 11px !important;
    border-radius: 14px !important;
    white-space: nowrap;
  }

  /* ---- INDEX - CONTAINER / CONTENT ---- */
  .container {
    padding: 0 12px !important;
  }
  .content {
    padding-top: 20px !important;
  }
  .content-hd p {
    font-size: 36px !important;
    line-height: 1 !important;
  }
  .content-hd div {
    font-size: 12px !important;
    height: auto !important;
    line-height: 1 !important;
    padding: 7px 14px !important;
    margin-top: -16px !important;
    margin-left: -46px !important;
    border-radius: 14px !important;
  }

  /* 项目风格稿: 3col → 2col */
  .c4dsheji {
    width: 100% !important;
    grid-template-columns: 1fr 1fr !important;
    column-gap: 10px !important;
    row-gap: 10px !important;
  }
  .c4dsheji img {
    width: 100% !important;
    border-radius: 6px !important;
  }

  /* 设计规范: stack horizontally-split card */
  .norm a {
    grid-template-columns: 1fr !important;
    border-radius: 10px !important;
    margin-bottom: 12px !important;
  }
  .norm-left {
    padding: 16px !important;
  }
  .norm-left h3 {
    font-size: 16px !important;
    line-height: 1.4 !important;
  }
  .norm-left p {
    font-size: 12px !important;
    letter-spacing: 0 !important;
    margin-top: 8px !important;
  }
  .norm-left ul {
    position: static !important;
    left: unset !important;
    bottom: unset !important;
    margin-top: 10px !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
  }
  .norm-left ul li {
    font-size: 11px !important;
    margin-right: 0 !important;
  }
  .norm-right {
    height: 130px !important;
    overflow: hidden;
  }
  .norm-right img {
    width: 100% !important;
    height: 130px !important;
    object-fit: cover !important;
  }

  /* 探索项目 (index): 2col → 1col */
  .explore {
    grid-template-columns: 1fr !important;
    grid-row-gap: 12px !important;
  }
  .explore a {
    width: 100% !important;
    height: 160px !important;
  }
  .explore a img {
    height: 160px !important;
    left: 50% !important;
    transform: translate(-50%, 0) !important;
  }
  .explore-text {
    font-size: 16px !important;
  }

  /* 玻璃拟物: 3col → 1col */
  .glass {
    grid-template-columns: 1fr !important;
    grid-column-gap: 0 !important;
    row-gap: 12px !important;
  }
  .glass img {
    width: 100% !important;
    height: 180px !important;
    object-fit: cover !important;
  }

  /* 装饰性 footer 线 - 隐藏 */
  .content-footer {
    display: none !important;
  }

  /* ---- HD SECTIONS (about / tsxm / jhsj) ---- */
  .hd {
    height: auto !important;
    min-height: 100px;
    padding: 18px 16px 14px !important;
    background-size: cover !important;
  }
  .hd h2 {
    font-size: 18px !important;
    line-height: 1.3 !important;
  }
  .hd p {
    font-size: 12px !important;
    margin-top: 6px !important;
  }

  /* ---- TSXM / JHSJ - CARD GRID ---- */
  .explore-bd {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto !important;
    grid-row-gap: 12px !important;
  }
  .card {
    border-radius: 8px !important;
  }
  .card a .card-img {
    height: 160px !important;
  }
  .card-img {
    height: 160px !important;
  }
  .card-img img {
    height: 160px !important;
    left: 50% !important;
    transform: translate(-50%, 0) !important;
  }
  .card a h4 {
    font-size: 15px !important;
    padding: 0 10px !important;
  }
  .card a > p {
    font-size: 11px !important;
    padding: 4px 10px 0 !important;
  }
  .card-t {
    font-size: 11px !important;
    padding: 10px 10px 4px !important;
  }
  .card-f {
    padding: 14px 10px 10px !important;
    font-size: 11px !important;
  }

  /* ---- JHSJ - 3D FLIP CARD GRID ---- */
  .wrapper {
    max-width: 100% !important;
    padding: 0 12px 20px !important;
  }
  .cols {
    grid-template-columns: 1fr !important;
    max-width: 100% !important;
  }
  .front,
  .back {
    min-height: 220px !important;
  }

  /* ---- JHSJ - INTERACTIVE COMPONENT GRIDS ---- */
  .hanbao {
    width: 100% !important;
    grid-template-columns: 1fr !important;
    grid-column-gap: 0 !important;
    grid-row-gap: 10px !important;
  }
  .hanbao a {
    width: 100% !important;
    height: 160px !important;
  }
  .hanbao a img {
    height: 160px !important;
    left: 50% !important;
    transform: translate(-50%, 0) !important;
  }

  .xiazai {
    width: 100% !important;
    grid-template-columns: 1fr 1fr !important;
    grid-column-gap: 8px !important;
    grid-row-gap: 10px !important;
  }
  .xiazai a {
    width: 100% !important;
    height: auto !important;
    overflow: hidden;
  }
  .xiazai a img {
    width: 100% !important;
    height: auto !important;
    position: static !important;
    transform: none !important;
  }

  .tabbar {
    width: 100% !important;
    grid-template-columns: 1fr 1fr !important;
    grid-column-gap: 8px !important;
    grid-row-gap: 10px !important;
  }
  .tabbar a {
    width: 100% !important;
    height: auto !important;
    overflow: hidden;
  }
  .tabbar a img {
    width: 100% !important;
    height: auto !important;
    position: static !important;
    transform: none !important;
  }

  .sidebar {
    width: 100% !important;
    grid-template-columns: 1fr 1fr !important;
    grid-column-gap: 8px !important;
    grid-row-gap: 10px !important;
  }
  .sidebar a {
    width: 100% !important;
    height: auto !important;
    overflow: hidden;
  }
  .sidebar a div {
    filter: none !important;
  }
  .sidebar a img {
    width: 100% !important;
    height: auto !important;
    position: static !important;
    transform: none !important;
    margin: 0 !important;
  }

  /* ---- ABOUT PAGE ---- */
  .work {
    width: 100% !important;
    padding: 0 16px;
  }
  .work h3 {
    font-size: 14px !important;
    margin-top: 24px !important;
    letter-spacing: 0.05em !important;
  }
  .work p {
    font-size: 12px !important;
    letter-spacing: 0.04em !important;
  }
  .work2 div {
    flex-wrap: wrap !important;
    gap: 8px !important;
  }
  .work2 div img {
    width: calc(50% - 4px) !important;
    height: auto !important;
    margin-right: 0 !important;
    margin-top: 0 !important;
    border-radius: 6px !important;
  }
  .work0 span {
    font-size: 20px !important;
  }
  .work1-text p {
    padding: 14px !important;
    border-radius: 14px !important;
    font-size: 12px !important;
    margin-bottom: 10px !important;
  }
  .about-like {
    width: 100% !important;
    margin-left: 0 !important;
  }
  .live1 {
    width: 100% !important;
  }

  /* ---- BOOK PAGE ---- */
  .bookBox {
    width: calc(100vw - 16px) !important;
    height: 56vw !important;
    margin: 8px auto !important;
    background-size: 100% 100% !important;
    perspective: 100vw !important;
    -webkit-perspective: 100vw !important;
  }
  .bookPage {
    width: 50% !important;
    height: 95% !important;
  }

  /* ---- XMFP PAGE - Full-page sections ---- */
  .section1 h3 {
    font-size: 16px !important;
    top: 1.8rem !important;
    left: 0.4rem !important;
  }
  .section1 p {
    font-size: 12px !important;
    left: 0.4rem !important;
    top: 2.4rem !important;
  }
  .divleft {
    width: 100% !important;
  }
  .divleft a h2 {
    font-size: 24px !important;
    opacity: 1 !important;
  }
  .divleft a h3 {
    font-size: 18px !important;
    opacity: 1 !important;
  }
  .divleft a p {
    font-size: 13px !important;
    left: 0 !important;
  }
  .divleft a h4 {
    font-size: 12px !important;
    left: 0 !important;
  }

  /* ---- BEIAN ---- */
  .beian a {
    font-size: 11px !important;
  }
}

/* ================================================
   SMALL MOBILE  ≤480px
================================================ */
@media (max-width: 480px) {
  .content-hd p {
    font-size: 28px !important;
  }

  /* 项目风格稿: 2col → 1col */
  .c4dsheji {
    grid-template-columns: 1fr !important;
  }

  /* Interactive component grids: 2col → 1col */
  .xiazai,
  .tabbar,
  .sidebar {
    grid-template-columns: 1fr !important;
  }

  /* Book box */
  .bookBox {
    height: 62vw !important;
  }

  /* Welcome text even more compact */
  .welcome-Left h1 {
    font-size: 18px !important;
  }
}
