/*!
 * 万能墙（lhuiye.cn） — SPDX-License-Identifier: LicenseRef-Proprietary
 * Copyright (c) 2026 辉夜 <18759765356@163.com> 保留所有权利
 * 第三方组件保留各自许可（见 THIRD_PARTY_NOTICES.md）
 */
/* ==========================================================================
   【平板补正】768px – 1023px（iPad 竖屏 / 小平板 / 折叠屏展开）
   --------------------------------------------------------------------------
   为什么需要单独一层：desktop.css 从 768px 起就按"电脑"排版，
   在 768–1023 这段宽度上容易出现「三列卡片挤在一起、表单两列过窄、
   触控目标偏小、容器留白不足」的问题。本层只在这段宽度生效。
   加载顺序：desktop.css 之后，用同样的选择器覆盖细节。
   ========================================================================== */

@media (min-width: 768px) and (max-width: 1023px) {

    /* ---------- 容器与留白：比电脑略窄、比手机宽松 ---------- */
    body .container { max-width: 100% !important; padding-left: 22px; padding-right: 22px; }
    body.page-detail main, body.page-profile main { padding-left: 18px; padding-right: 18px; }

    /* ---------- 卡片网格：三列改两列（触控目标与文字都更舒服） ---------- */
    body.page-contest .ct-grid,
    body.page-food .food-grid,
    body.page-events .event-grid,
    body.page-listings .listing-grid,
    body.page-hero .hero-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 14px !important; }
    body.page-music .music-library-list { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    body.page-about .contest-showcase-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }

    /* ---------- 表单：两列→一列，避免每列过窄导致换行错位 ---------- */
    .ct-row2, .form-grid, .adm-form-grid { grid-template-columns: 1fr !important; }
    .ct-field input[type="text"], .ct-field textarea, .ct-field select { min-height: 46px; }

    /* ---------- 触控目标：平板以手指为主 ---------- */
    .btn, .gradient-btn, .comment-submit, .ct-submit-btn, .ct-vote-btn,
    .nav-item, .nav-sheet-item, .ct-tab, .ct-filter, .cmt-act { min-height: 42px; }

    /* ---------- 首页/详情：内容列不要贴边，阅读宽度更舒适 ---------- */
    body.page-index #postsContainer, body.page-index .post-card { max-width: 100%; }
    body.page-detail .post-card, body.page-detail .card { border-radius: 16px; }

    /* ---------- 讨论区：平板上一屏能显示更多，但仍保持单列 ---------- */
    .cmt { padding: 13px 12px; }
    .cmt-avatar { flex-basis: 38px; width: 38px; height: 38px; }

    /* ---------- 音乐播放器：面板不要超出屏幕 ---------- */
    #musicPlayer .music-panel { width: 320px; max-width: calc(100vw - 32px); }
}
