/* 响应式布局 */

@media (max-width: 1280px) {
  .content {
    padding: 8px 12px 24px 30px;
  }

  .game-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

/* 周表在中等宽度下改为横向滚动，保证每列可读 */
@media (max-width: 1180px) {
  .week-board {
    display: grid;
    grid-template-columns: repeat(7, 168px);
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .week-col {
    scroll-snap-align: start;
  }

  .week-board::-webkit-scrollbar {
    height: 6px;
  }
}

@media (max-width: 1040px) {
  :root {
    --sidebar-w: 216px;
  }

  .sidebar {
    padding: 20px 12px 14px;
  }

  .content {
    padding-left: 24px;
  }

  .nav-en {
    display: none;
  }

  .home-hero {
    grid-template-columns: minmax(0, 1.1fr) minmax(264px, 0.9fr);
    gap: 22px;
    padding: 28px;
  }

  .planner-summary {
    gap: 20px;
    padding: 22px;
  }

  .planner-types {
    display: none;
  }
}

/* ---------- 移动端导航 ---------- */
@media (max-width: 980px) {
  .app-shell {
    display: block;
    padding: 0;
  }

  .sidebar {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    top: auto;
    width: auto;
    height: 64px;
    padding: 7px;
    flex-direction: row;
    align-items: center;
    border-radius: 22px;
    background: rgba(252, 253, 250, 0.88);
    box-shadow: 0 20px 50px -22px rgba(24, 48, 92, 0.42), 0 1px 0 rgba(255, 255, 255, 0.9) inset;
    backdrop-filter: blur(24px) saturate(140%);
    -webkit-backdrop-filter: blur(24px) saturate(140%);
    z-index: 70;
  }

  .sidebar > .brand,
  .nav-label,
  .sidebar-tag,
  .sidebar-foot,
  .sidebar-spacer {
    display: none;
  }

  .nav-block {
    flex: 1;
    margin: 0;
  }

  .nav {
    flex-direction: row;
    gap: 2px;
    width: 100%;
  }

  .nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 50px;
    padding: 4px 2px;
    border-radius: 16px;
  }

  .nav-item.is-active::before {
    display: none;
  }

  .nav-item.is-active {
    background: rgba(37, 99, 235, 0.1);
    box-shadow: none;
  }

  .nav-icon svg {
    width: 18px;
    height: 18px;
  }

  .nav-text {
    font-size: 10.5px;
    letter-spacing: 0.02em;
  }

  .nav-en {
    display: none;
  }

  .nav-badge {
    top: 3px;
    right: calc(50% - 25px);
  }

  .content {
    padding: 0 18px calc(94px + env(safe-area-inset-bottom));
  }

  .mobile-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 55;
    margin: 0 -18px 6px;
    padding: 12px 18px 10px;
    background: linear-gradient(180deg, rgba(244, 245, 241, 0.94) 55%, rgba(244, 245, 241, 0));
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }

  .brand--compact {
    padding: 0;
    gap: 8px;
  }

  .brand--compact .brand-mark {
    width: 30px;
    height: 30px;
  }

  .brand--compact .brand-text strong {
    font-size: 16px;
  }

  .mobile-account {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .mobile-account .btn {
    height: 34px;
    padding: 0 13px;
    font-size: 11.5px;
    border-radius: 11px;
  }

  .mobile-account .avatar {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }

  .page-head {
    margin-top: 10px;
  }

  .page-foot {
    margin-bottom: 6px;
  }

  .toast-root {
    bottom: calc(88px + env(safe-area-inset-bottom));
  }

  .day-panel {
    border-radius: 24px;
    padding: 20px;
  }
}

@media (max-width: 820px) {
  .home-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
  }

  .home-actions {
    padding-bottom: 0;
  }

  .home-hero {
    grid-template-columns: 1fr;
    gap: 22px;
    padding: 26px;
  }

  .hero-art {
    width: 330px;
    top: -90px;
    right: -70px;
    opacity: 0.28;
  }

  .hero-side {
    padding: 0 18px;
  }

  .hero-metric {
    padding: 11px 0;
  }

  .page-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .page-head-actions {
    padding-bottom: 0;
  }

  .section-head {
    margin-top: 28px;
  }

  .game-layout {
    grid-template-columns: 1fr;
  }

  .profile-hero {
    flex-wrap: wrap;
    gap: 18px;
    padding: 22px;
  }

  .profile-stats {
    width: 100%;
    margin-left: 0;
    padding-left: 0;
    padding-top: 16px;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .profile-stat {
    flex: 1;
    min-width: 0;
    padding-right: 14px;
    margin-right: 14px;
  }

  .profile-stat strong {
    font-size: 20px;
  }

  .planner-summary {
    flex-wrap: wrap;
    gap: 18px;
    padding: 20px;
  }

  .progress-ring {
    width: 80px;
    height: 80px;
  }

  .ring-label strong {
    font-size: 20px;
  }

  .planner-summary-main {
    flex: 1 1 200px;
  }

  .planner-stats {
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 13px;
    padding-top: 12px;
  }

  .planner-stat {
    min-width: 60px;
    padding-right: 12px;
    margin-right: 12px;
  }

  .planner-stat strong {
    font-size: 17px;
  }

  .calendar-panel {
    padding: 16px;
    border-radius: 24px;
  }

  .cal-cell {
    min-height: 104px;
    padding: 7px;
    border-radius: 12px;
  }

  .cal-skeleton {
    min-height: 104px;
  }

  .cal-chip {
    font-size: 8.5px;
    padding: 2px 5px;
  }

  .cal-chip:nth-child(2) {
    display: none;
  }

  .cal-more {
    display: block;
    padding-left: 4px;
  }

  .cal-cell-foot {
    font-size: 8px;
  }

  .day-panel-body {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .game-hero {
    min-height: 250px;
    padding: 22px;
    border-radius: 26px;
  }

  .game-hero-content {
    align-items: flex-start;
  }

  .game-hero-title {
    font-size: 38px;
  }

  .game-hero-users strong {
    font-size: 22px;
  }

  .profile-tabs-row {
    align-items: flex-start;
  }

  .profile-tabs {
    max-width: 100%;
    overflow-x: auto;
  }

  .managed-event {
    flex-wrap: wrap;
  }

  .managed-actions {
    width: 100%;
    justify-content: flex-start;
    padding-left: 92px;
  }

  .event-meta-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .content {
    padding-left: 14px;
    padding-right: 14px;
  }

  .mobile-bar {
    margin-left: -14px;
    margin-right: -14px;
    padding-left: 14px;
    padding-right: 14px;
  }

  .page-title {
    font-size: 30px;
  }

  .home-head h1 {
    font-size: 33px;
  }

  .home-actions .btn {
    flex: 1;
  }

  .home-hero {
    padding: 22px;
    border-radius: 26px;
  }

  .hero-title {
    font-size: 32px;
  }

  .hero-sub {
    font-size: 12px;
  }

  .game-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .game-cover {
    height: 142px;
  }

  .section-note {
    display: none;
  }

  .calendar-toolbar {
    align-items: flex-start;
    margin-bottom: 12px;
  }

  .calendar-month {
    font-size: 21px;
  }

  .calendar-legend {
    display: none;
  }

  .calendar-nav .btn {
    height: 32px;
    padding: 0 11px;
    font-size: 11px;
  }

  .calendar-toolbar-right {
    width: 100%;
    justify-content: space-between;
  }

  .weekday-row {
    gap: 3px;
    padding: 0;
  }

  .weekday-cell {
    padding: 3px;
    text-align: center;
    font-size: 8px;
  }

  .calendar-grid {
    gap: 3px;
  }

  .cal-cell {
    min-height: 88px;
    padding: 5px;
    border-radius: 10px;
  }

  .cal-skeleton {
    min-height: 88px;
    border-radius: 10px;
  }

  .cal-day-head {
    margin-bottom: 3px;
    padding: 0 1px;
  }

  .cal-day-num {
    width: 22px;
    height: 22px;
    font-size: 11px;
    border-radius: 7px;
  }

  .cal-day-count {
    display: none;
  }

  .cal-chip {
    display: none;
  }

  .cal-more {
    display: none;
  }

  .cal-empty {
    display: none;
  }

  .cal-cell-foot {
    justify-content: center;
    padding-top: 2px;
    font-size: 7.5px;
  }

  .cal-cell-foot .cal-foot-text {
    display: none;
  }

  .cal-dots {
    display: inline-flex !important;
  }

  .calendar-hint {
    font-size: 9px;
    padding-top: 10px;
    margin-top: 6px;
  }

  .calendar-hint .mono {
    display: none;
  }

  .day-panel {
    margin-top: 10px;
    padding: 17px;
    border-radius: 22px;
  }

  .day-date-text {
    font-size: 21px;
  }

  .planner-toolbar-note {
    display: none;
  }

  .planner-toolbar {
    margin-top: 18px;
  }

  .week-board {
    grid-auto-flow: column;
    grid-auto-columns: minmax(246px, 78vw);
    grid-template-columns: none;
    gap: 9px;
    margin: 0 -14px;
    padding: 0 14px 10px;
    scroll-snap-type: x mandatory;
  }

  .week-col {
    min-height: 340px;
  }

  .planner-summary-title {
    font-size: 18px;
  }

  .profile-name {
    font-size: 21px;
  }

  .avatar--lg {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    font-size: 20px;
  }

  .profile-tab {
    padding: 0 11px;
    font-size: 11.5px;
  }

  .profile-tab .tab-count {
    display: none;
  }

  .managed-cover {
    width: 64px;
    height: 52px;
  }

  .managed-actions {
    padding-left: 0;
  }

  .message-item {
    padding: 14px 16px;
  }

  .profile-panel-head {
    padding: 14px 16px;
  }

  .modal-overlay {
    align-items: flex-end;
    padding: 0;
    background: rgba(17, 29, 24, 0.42);
  }

  .modal,
  .modal--wide,
  .modal--narrow {
    width: 100%;
    max-height: 92vh;
    border-radius: 24px 24px 0 0;
    border-bottom: 0;
    animation: sheet-in 0.32s var(--ease);
  }

  .modal-head {
    padding: 22px 20px 12px;
  }

  .modal-title {
    font-size: 20px;
  }

  .modal-body {
    padding: 8px 20px 22px;
  }

  .modal-body--flush {
    padding: 0 20px 22px;
  }

  .modal-foot {
    padding: 14px 20px calc(18px + env(safe-area-inset-bottom));
    flex-wrap: wrap;
  }

  .modal-foot .btn {
    flex: 1;
  }

  .modal-foot .btn-icon {
    flex: none;
  }

  .modal-foot .spacer {
    display: none;
  }

  .event-detail-banner {
    margin: 0 20px;
    height: 86px;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .month-grid {
    grid-template-columns: repeat(7, 1fr);
  }

  .toast-root {
    bottom: calc(86px + env(safe-area-inset-bottom));
  }

  .game-hero {
    min-height: 224px;
    padding: 18px;
  }

  .game-hero-title {
    font-size: 32px;
    margin-top: 12px;
  }

  .game-hero-desc {
    font-size: 11.5px;
    margin-top: 10px;
  }

  .game-hero-side {
    display: none;
  }

  .game-section {
    padding: 16px;
    border-radius: 20px;
  }

  .game-back {
    margin-bottom: 12px;
  }

  .game-today-bar {
    width: 68px;
  }
}

@keyframes sheet-in {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 560px) {
  .page-sub {
    font-size: 12px;
  }

  .kicker {
    font-size: 8.5px;
  }

  .calendar-panel {
    padding: 12px;
    border-radius: 20px;
  }

  .calendar-toolbar {
    gap: 10px;
  }

  .calendar-month {
    font-size: 19px;
  }

  .calendar-month-en {
    display: none;
  }

  .calendar-toolbar-right {
    gap: 6px;
  }

  .calendar-toolbar-right .btn-soft {
    height: 32px;
    padding: 0 10px;
  }

  .calendar-grid {
    gap: 2px;
  }

  .cal-cell {
    min-height: 60px;
    padding: 3px;
    border-radius: 8px;
    align-items: center;
    justify-content: flex-start;
  }

  .cal-skeleton {
    min-height: 60px;
    border-radius: 8px;
  }

  .cal-day-head {
    justify-content: center;
    width: 100%;
    margin: 0;
    padding-top: 2px;
  }

  .cal-day-num {
    width: 21px;
    height: 21px;
    font-size: 10px;
  }

  .cal-chips,
  .cal-cell-foot {
    display: none;
  }

  .cal-cell.has-items::after {
    content: "";
    position: absolute;
    bottom: 5px;
    left: 50%;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--primary);
    transform: translateX(-50%);
    opacity: 0.75;
  }

  .cal-cell.has-events::after {
    background: var(--coral);
  }

  .cal-cell.is-selected {
    transform: none;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
  }

  .weekday-cell {
    font-size: 7.5px;
    letter-spacing: 0.04em;
  }

  .planner-summary {
    padding: 17px;
    gap: 14px;
    border-radius: 24px;
  }

  .progress-ring {
    width: 70px;
    height: 70px;
  }

  .ring-label strong {
    font-size: 18px;
  }

  .planner-stat {
    min-width: 52px;
    padding-right: 10px;
    margin-right: 10px;
  }

  .planner-stat strong {
    font-size: 15px;
  }

  .week-nav {
    flex-wrap: wrap;
    gap: 5px;
  }

  .week-range {
    font-size: 10px;
  }

  .week-board {
    grid-auto-columns: minmax(236px, 84vw);
  }

  .profile-hero {
    padding: 18px;
  }

  .profile-identity {
    gap: 12px;
  }

  .profile-name {
    font-size: 19px;
  }

  .profile-handle {
    font-size: 9px;
  }

  .profile-stat {
    padding-right: 8px;
    margin-right: 8px;
  }

  .profile-stat strong {
    font-size: 17px;
  }

  .profile-stat span {
    font-size: 8.5px;
  }

  .profile-tabs-row {
    margin-top: 18px;
  }

  .profile-tabs {
    width: 100%;
  }

  .profile-tab {
    flex: 1;
    justify-content: center;
    padding: 0 6px;
  }

  .profile-tabs-actions {
    width: 100%;
  }

  .profile-tabs-actions .btn {
    flex: 1;
  }

  .managed-event {
    padding: 10px;
    gap: 10px;
  }

  .managed-cover {
    width: 56px;
    height: 46px;
  }

  .managed-actions .btn {
    flex: 1;
  }

  .message-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
  }

  .modal-close {
    top: 16px;
    right: 16px;
  }

  .home-actions {
    width: 100%;
  }

  .home-actions .btn {
    flex: 1;
  }

  .hero-actions .btn {
    flex: 1;
  }

  .hero-side {
    padding: 0 14px;
  }

  .hero-title {
    font-size: 29px;
  }

  .day-panel-head {
    flex-wrap: wrap;
  }

  .day-panel-head-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .game-hero-title {
    font-size: 28px;
  }

  .game-hero-tags .tag {
    font-size: 9.5px;
  }

  .event-meta-box strong {
    font-size: 11px;
  }

  .event-reward code {
    font-size: 12px;
  }

  .event-detail-actions .btn {
    flex: 1;
  }

  .btn {
    padding: 0 14px;
  }

  .page-foot {
    margin-top: 32px;
    font-size: 9.5px;
  }
}

@media (max-height: 700px) and (min-width: 981px) {
  .sidebar-tag {
    display: none;
  }

  .nav-block {
    margin-top: 24px;
  }
}


/* ---------- Hyshota iteration responsive ---------- */
@media (max-width: 980px) {
  .brand--compact .brand-text strong {
    font-size: 12.5px;
  }

  .brand--compact .brand-text strong i {
    color: var(--hyshota);
  }

  .calendar-scope button {
    font-size: 9.5px;
  }

  .game-activities-top {
    margin-top: 18px;
  }
}

@media (max-width: 820px) {
  .game-event-grid {
    grid-template-columns: 1fr;
  }

  .profile-hero .profile-stats {
    flex-wrap: wrap;
    gap: 10px 0;
  }

  .profile-hero .profile-stat {
    flex: 1 1 25%;
    min-width: 72px;
    padding-right: 10px;
    margin-right: 10px;
  }

  .profile-signature {
    max-width: none;
  }

  .profile-account-line {
    font-size: 9px;
  }
}

@media (max-width: 720px) {
  .cal-cell {
    min-height: 98px;
  }

  .cal-event-game {
    font-size: 9px;
  }

  .cal-event-desc {
    font-size: 8px;
    -webkit-line-clamp: 2;
  }

  .calendar-toolbar-right {
    flex-wrap: wrap;
    gap: 6px;
  }

  .calendar-scope {
    margin-right: auto;
  }

  .calendar-scope button {
    height: 25px;
    padding: 0 8px;
    font-size: 9px;
  }

  .game-activities-top .game-section-head {
    align-items: flex-start;
  }

  .game-activities-top .game-section-sub {
    max-width: 70%;
  }

  .event-source-row .event-add-calendar,
  .event-source-row .event-in-calendar {
    margin-left: 0;
  }

  .profile-hero .profile-stat strong {
    font-size: 18px;
  }

  .profile-hero .profile-identity {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .cal-cell {
    min-height: 80px;
    padding: 4px;
    border-radius: 9px;
    align-items: stretch;
    justify-content: flex-start;
  }

  .cal-cell.has-items::after {
    display: none;
  }

  .cal-day-head {
    justify-content: space-between;
    width: 100%;
    margin: 0;
    padding: 1px 1px 0;
  }

  .cal-day-num {
    width: 19px;
    height: 19px;
    font-size: 9.5px;
    border-radius: 6px;
  }

  .cal-day-flags {
    gap: 2px;
  }

  .cal-official {
    display: none;
  }

  .cal-count {
    min-width: 14px;
    height: 14px;
    padding: 0 3px;
    border-radius: 5px;
    font-size: 7px;
  }

  .cal-event-lines {
    gap: 1px;
    margin-top: 3px;
    padding: 0 1px;
  }

  .cal-event-game {
    font-size: 7.5px;
    line-height: 1.35;
  }

  .cal-event-desc {
    font-size: 7px;
    line-height: 1.4;
    -webkit-line-clamp: 2;
  }

  .cal-bookmark {
    right: 4px;
    bottom: 4px;
    width: 3px;
    height: 3px;
  }

  .calendar-scope {
    order: -1;
  }

  .calendar-scope button {
    font-size: 8.5px;
    padding: 0 7px;
  }

  .page-head-note {
    display: none;
  }

  .streamer-gate {
    height: 26px;
    font-size: 8.5px;
    padding: 0 8px;
  }

  .profile-hero .profile-stat {
    flex: 1 1 50%;
    min-width: 0;
    padding-right: 8px;
    margin-right: 0;
  }

  .profile-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 0;
  }

  .profile-stat {
    border-right: 0;
    padding-right: 0;
    margin-right: 0;
  }

  .profile-person {
    width: 100%;
  }

  .profile-name-row {
    gap: 5px;
  }

  .profile-account-line {
    gap: 4px;
  }

  .source-pill,
  .streamer-pill {
    height: 19px;
    font-size: 8.5px;
    padding: 0 7px;
  }

  .sso-mock > span {
    width: 100%;
    margin-bottom: 2px;
  }

  .sso-mock button {
    flex: 1;
  }

  .day-activity {
    padding: 13px;
  }

  .day-activity-title {
    font-size: 14px;
  }

  .day-activity-foot .btn {
    flex: 1;
  }
}
