/**
 * 响应式设计样式
 * PC端保持原有样式，移动端自适应
 */

/* ========== 基础响应式设置 ========== */
* {
    -webkit-tap-highlight-color: transparent;
}

/* ========== 移动端导航菜单 ========== */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
}

.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 998;
}

.mobile-overlay.active {
    display: block;
}

/* ========== 表格响应式 ========== */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-responsive table {
    min-width: 600px;
}

/* 移动端卡片式表格 */
@media screen and (max-width: 768px) {
    .table-card-view {
        display: block;
    }
    
    .table-card-view thead {
        display: none;
    }
    
    .table-card-view tbody {
        display: block;
    }
    
    .table-card-view tr {
        display: block;
        background: white;
        margin-bottom: 15px;
        padding: 15px;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
    
    .table-card-view td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 0;
        border-bottom: 1px solid #eee;
    }
    
    .table-card-view td:last-child {
        border-bottom: none;
    }
    
    .table-card-view td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #666;
        margin-right: 10px;
    }
}

/* ========== 移动端适配 (max-width: 768px) ========== */
@media screen and (max-width: 768px) {
    /* 隐藏PC端菜单，显示移动端菜单按钮 */
    .mobile-menu-toggle {
        display: block;
    }
    
    /* 头部调整 */
    .header {
        padding: 10px 15px;
        position: relative;
    }
    
    .header h1 {
        font-size: 16px;
    }
    
    .header-nav {
        display: none;
    }
    
    /* 容器调整 */
    .container {
        padding: 10px;
        margin: 10px auto;
    }
    
    /* 侧边栏变为底部导航 */
    .sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: auto;
        z-index: 999;
        border-radius: 0;
        padding: 0;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    }
    
    .sidebar .user-info {
        display: none;
    }
    
    .menu-list {
        display: flex;
        justify-content: space-around;
        padding: 5px 0;
    }
    
    .menu-item {
        flex: 1;
        flex-direction: column;
        align-items: center;
        padding: 8px 5px;
        border-left: none;
        border-bottom: 3px solid transparent;
        font-size: 12px;
    }
    
    .menu-item.active {
        border-left-color: transparent;
        border-bottom-color: #2c68c8;
    }
    
    .menu-icon {
        font-size: 20px;
        margin-bottom: 4px;
    }
    
    /* 主内容区调整 */
    .main-content {
        padding: 15px;
        margin-bottom: 70px; /* 为底部导航留出空间 */
    }
    
    /* 价格卡片调整 */
    .price-cards {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .price-card {
        padding: 20px;
    }
    
    /* 表单调整 */
    .form-group {
        margin-bottom: 15px;
    }
    
    .form-control {
        padding: 12px;
        font-size: 16px; /* 防止iOS缩放 */
    }
    
    /* 按钮调整 */
    .btn {
        padding: 12px 20px;
        font-size: 16px;
        width: 100%;
        margin-bottom: 10px;
    }
    
    .btn + .btn {
        margin-left: 0;
    }
    
    /* 信息卡片调整 */
    .info-card {
        padding: 15px;
    }
    
    .info-row {
        flex-direction: column;
        padding: 10px 0;
    }
    
    .info-label {
        width: 100%;
        margin-bottom: 5px;
    }
    
    /* 表格容器 */
    .table-wrapper {
        overflow-x: auto;
        margin: 0 -15px;
        padding: 0 15px;
    }
    
    /* 分页调整 */
    .pagination {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .pagination a,
    .pagination span {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    /* 激活码显示调整 */
    .code-display .code {
        font-size: 18px;
        word-break: break-all;
    }
    
    /* 弹窗调整 */
    #editModal > div {
        width: 95%;
        padding: 20px;
    }
}

/* ========== 小屏幕手机适配 (max-width: 480px) ========== */
@media screen and (max-width: 480px) {
    .header h1 {
        font-size: 14px;
    }
    
    .section-title {
        font-size: 18px;
        padding-bottom: 10px;
        margin-bottom: 15px;
    }
    
    .menu-item {
        font-size: 11px;
        padding: 5px 2px;
    }
    
    .menu-icon {
        font-size: 18px;
    }
    
    .price-card h3 {
        font-size: 16px;
    }
    
    .price-card .price {
        font-size: 24px;
    }
    
    .stat-value {
        font-size: 20px;
    }
}

/* ========== 平板适配 (768px - 1024px) ========== */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    .container {
        padding: 15px;
    }
    
    .sidebar {
        width: 200px;
    }
    
    .price-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ========== PC端保持原有样式 ========== */
@media screen and (min-width: 769px) {
    .mobile-menu-toggle {
        display: none !important;
    }
    
    .sidebar {
        display: block !important;
    }
}
