/* 响应式设计 */
@media (max-width: 768px) {
    .header {
        flex-direction: row;
        gap: 10px;
        text-align: center;
        flex-wrap: nowrap;
        overflow-x: auto;
    }
    
    .header .nav-links {
        display: flex;
        justify-content: flex-end;
        align-items: center;
        gap: 15px;
        flex-wrap: nowrap !important;
        white-space: nowrap !important;
    }
    
    .header .nav-links a {
        display: inline-flex;
        align-items: center;
        padding: 5px 10px;
    }
    
    .header .nav-links span {
        display: flex;
        align-items: center;
    }
    
    .container {
        padding: 20px;
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        padding: 10px 0;
    }
    
    .sidebar-menu {
        display: flex;
        overflow-x: auto;
    }
    
    .sidebar-menu li {
        margin-bottom: 0;
        margin-right: 5px;
    }
    
    .sidebar-menu a {
        white-space: nowrap;
        padding: 8px 12px;
    }
    
    .welcome-section h2 {
        font-size: 24px;
    }
    
    .info-row,
    .summary-row {
        flex-direction: column;
    }
    
    .info-item input,
    .info-item select,
    .summary-item input {
        width: 100%;
    }
    
    .info-item label,
    .summary-item label {
        width: 100%;
        margin-bottom: 5px;
    }
    
    .product-table {
        font-size: 12px;
    }
    
    .product-table th,
    .product-table td {
        padding: 6px;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: center;
        gap: 12px;
        margin-bottom: 40px;
        padding: 0 15px;
    }
    
    .action-buttons .btn {
        width: 100%;
        max-width: 300px;
        padding: 14px 20px;
        font-size: 14px;
        line-height: 1.4;
        min-height: 48px;
    }
    
    .btn {
        width: 100%;
        max-width: 200px;
    }
    
    .login-container {
        padding: 30px;
        margin: 50px auto;
    }
    
    .sms-code-group {
        flex-direction: column;
    }
    
    .btn-sms {
        padding: 12px;
    }
    
    .btn-get-sms {
        display: block;
        margin: 12px auto 0 auto;
        width: auto;
        min-width: 140px;
        padding: 12px 24px;
    }
}

/* 会员控制台响应式设计 */
@media (max-width: 768px) {
    .member-container {
        padding: 20px 15px;
    }
    
    .member-header h1 {
        font-size: 28px;
    }
    
    .member-nav {
        flex-direction: column;
        align-items: stretch;
        gap: 5px;
    }
    
    .member-nav a {
        text-align: center;
    }
    
    .member-section {
        padding: 20px;
    }
    
    .member-history-item .info {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .member-history-item .price {
        align-self: flex-start;
    }
    
    .member-info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        text-align: left;
    }
    
    .member-info-item .value {
        align-self: stretch;
        text-align: center;
    }
}

/* 首页响应式设计 */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden;
        width: 100%;
        max-width: 100%;
    }
    
    .hero-content h1 {
        font-size: 28px;
        line-height: 1.3;
    }
    
    .hero-content p {
        font-size: 14px;
        line-height: 1.5;
    }
    
    .btn-tech,
    .btn-tech-secondary {
        display: block;
        width: 90%;
        max-width: 300px;
        margin: 10px auto;
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .btn-tech-secondary {
        margin-left: auto;
    }
    
    .quote-system-modern {
        padding: 20px 15px;
        margin: 30px 15px;
        max-width: none;
        width: calc(100% - 30px);
    }
    
    .header-login {
        padding: 15px;
        flex-direction: row !important;
        text-align: center;
        flex-wrap: nowrap !important;
    }
    
    .header-brand h1 {
        font-size: 18px;
    }
    
    .header-logo {
        width: 36px;
        height: 36px;
    }
    
    .header-login .header-logo {
        width: 36px;
        height: 36px;
    }
    
    .footer-logo {
        width: 24px;
        height: 24px;
    }
    
    .footer-logo img {
        filter: brightness(0) invert(1);
    }
    
    .nav-links {
        display: flex;
        margin-top: 10px;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 15px;
    }
    
    .header-login .nav-links {
        display: flex !important;
        flex-wrap: nowrap !important;
        justify-content: flex-end;
        align-items: center;
        gap: 15px;
        flex-shrink: 0 !important;
        min-width: max-content !important;
    }
    
    .header-login .nav-links #user-info.visible {
        display: inline-flex !important;
        align-items: center;
        gap: 10px;
    }
    
    .nav-links a {
        font-size: 13px;
        padding: 5px 10px;
        display: inline-flex;
        align-items: center;
    }
    
    .nav-links span {
        display: flex;
        align-items: center;
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 0 15px;
    }
    
    .feature-card {
        padding: 15px 12px;
        min-height: 120px;
    }
    
    .feature-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
        margin-bottom: 10px;
    }
    
    .feature-card h3 {
        font-size: 13px;
        margin-bottom: 6px;
    }
    
    .feature-card p {
        font-size: 11px;
        line-height: 1.3;
    }
    
    .action-buttons {
        margin-bottom: 40px;
        padding: 0 15px;
    }
    
    .action-buttons .btn {
        font-size: 14px;
        padding: 14px 20px;
        min-width: auto;
        min-height: 48px;
        width: 100%;
        max-width: 300px;
    }
}

/* 管理中心响应式设计 */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
        flex-shrink: 0;
        position: relative;
        z-index: 2;
        margin-right: 6px;
    }

    .admin-sidebar {
        position: fixed;
        left: -140px;
        top: 0;
        width: 130px;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
    }

    .admin-sidebar.mobile-open {
        left: 0;
    }

    .admin-sidebar .logo {
        padding: 12px;
    }

    .admin-sidebar .logo .logo-icon {
        width: 24px;
        height: 24px;
    }
    
    .admin-sidebar .nav-menu {
        list-style: none;
        padding: 0;
        margin: 0;
    }
    
    .admin-sidebar .nav-menu li {
        margin-bottom: 1px !important;
    }
    
    .admin-sidebar .nav-menu li a {
        display: block;
        padding: 5px 8px !important;
        color: rgba(255,255,255,0.8);
        text-decoration: none;
        transition: all 0.3s ease;
        border-left: 3px solid transparent;
        font-size: 11px !important;
        line-height: 1.2 !important;
        height: auto !important;
    }
    
    .admin-sidebar .nav-menu li a:hover {
        background: rgba(255,255,255,0.1);
        color: white;
    }
    
    .admin-sidebar .nav-menu li a.active {
        background: rgba(26, 188, 156, 0.2);
        color: #1abc9c;
        border-left-color: #1abc9c;
    }
    
    .admin-sidebar .nav-menu li a i {
        margin-right: 4px !important;
        font-size: 12px !important;
    }
    
    .admin-main {
        margin-left: 0;
        padding: 15px;
        padding-top: 50px;
    }
    
    .admin-header {
        padding: 12px 15px;
        gap: 10px;
    }

    .admin-header h1 {
        font-size: 16px;
        flex: 1;
        min-width: 0;
        padding-left: 4px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        position: relative;
        z-index: 1;
    }
    
    .admin-header .user-info {
        gap: 6px;
        font-size: 12px;
        flex-shrink: 0;
    }

    .admin-header .user-info span {
        font-size: 12px;
        max-width: 60px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .admin-header .user-info a {
        font-size: 12px;
    }
    
    .admin-card {
        padding: 20px;
    }
    
    .admin-card h2 {
        font-size: 16px;
    }
    
    /* 数据表格移动端滚动 */
    .data-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .data-table-wrapper::-webkit-scrollbar {
        height: 4px;
    }
    
    .data-table-wrapper::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 2px;
    }
    
    .data-table-wrapper::-webkit-scrollbar-thumb {
        background: #c1c1c1;
        border-radius: 2px;
    }
    
    .data-table-wrapper::-webkit-scrollbar-thumb:hover {
        background: #a1a1a1;
    }
    
    /* 让表格在移动端更紧凑 */
    .data-table-wrapper .data-table {
        min-width: auto;
        width: 100%;
        font-size: 11px;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px 5px;
        font-size: 11px;
    }
    
    /* 缩短表格列标题 */
    .data-table th {
        white-space: nowrap;
    }
    
    /* 按钮组在表格中更小 */
    .data-table .btn {
        font-size: 10px;
        padding: 4px 8px;
    }
    
    .data-table .btn-group {
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .data-table .btn-sm {
        padding: 4px 8px;
        font-size: 10px;
    }
    
    /* 按钮组移动端优化 */
    .btn-group {
        flex-wrap: wrap;
    }
    
    .btn-group .btn {
        flex: 1;
        min-width: calc(50% - 5px);
        font-size: 12px;
        padding: 8px 10px;
    }
    
    /* API申请按钮 */
    #show-api-form-btn {
        width: 100%;
        font-size: 14px;
    }
    
    /* 表单优化 */
    .form-group label {
        font-size: 13px;
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 14px;
        padding: 10px 12px;
    }
    
    /* 统计卡片移动端 */
    .stat-cards {
        grid-template-columns: 1fr;
    }
    
    /* 统计图表 */
    .trend-chart {
        gap: 5px;
    }
    
    .chart-bar-wrapper {
        max-width: 40px;
    }
    
    .chart-label {
        font-size: 10px;
    }
    
    /* 应用状态卡片 */
    .application-status-card {
        padding: 15px;
    }
    
    /* 会员信息卡片移动端 */
    .member-profile-card {
        padding: 20px;
    }
    
    .username {
        font-size: 22px;
    }
    
    .profile-details {
        grid-template-columns: 1fr;
    }
    
    /* API信息移动端 */
    .api-url-info {
        padding: 15px;
    }
    
    .api-url-info p {
        font-size: 12px;
        word-wrap: break-word;
        overflow-wrap: break-word;
        word-break: break-all;
    }
    
    /* 账户设置和会员信息移动端移除左边距 */
    #account-settings .api-form,
    #member-info .api-form {
        margin-left: 0;
    }
}

/* 移动端适配 - 简易计算器 */
@media (max-width: 768px) {
    .custom-keyboard {
        padding: 5px !important;
    }
    
    .keyboard-grid {
        max-width: 300px !important;
        gap: 5px !important;
    }
    
    .keyboard-key {
        padding: 10px 5px !important;
        font-size: 17px !important;
        min-height: 40px !important;
    }
    
    .keyboard-header {
        padding: 3px 5px !important;
    }
    
    .keyboard-header button {
        padding: 5px 12px !important;
        font-size: 12px !important;
    }
}

/* 响应式 - 数据操作按钮组 */
@media (max-width: 768px) {
    .data-actions {
        grid-template-columns: 1fr;
    }
    
    .data-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}
