/* 响应式设计增强 - StarPhone */

/* 基础响应式变量 */
:root {
    --mobile-padding: 15px;
    --tablet-padding: 25px;
    --desktop-padding: 40px;
    --mobile-font-size: 14px;
    --tablet-font-size: 16px;
    --desktop-font-size: 18px;
    --mobile-line-height: 1.4;
    --tablet-line-height: 1.5;
    --desktop-line-height: 1.6;
}

/* 通用响应式基础 */
* {
    box-sizing: border-box;
}

img, video, iframe {
    max-width: 100%;
    height: auto;
}

/* 容器响应式 */
.container-fluid {
    width: 100%;
    padding-left: var(--mobile-padding);
    padding-right: var(--mobile-padding);
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding-left: var(--mobile-padding);
    padding-right: var(--mobile-padding);
}

/* 网格系统增强 */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-left: -15px;
    margin-right: -15px;
}

.col {
    flex: 1;
    padding-left: 15px;
    padding-right: 15px;
}

/* 响应式列 */
.col-12 { width: 100%; }
.col-11 { width: 91.666667%; }
.col-10 { width: 83.333333%; }
.col-9 { width: 75%; }
.col-8 { width: 66.666667%; }
.col-7 { width: 58.333333%; }
.col-6 { width: 50%; }
.col-5 { width: 41.666667%; }
.col-4 { width: 33.333333%; }
.col-3 { width: 25%; }
.col-2 { width: 16.666667%; }
.col-1 { width: 8.333333%; }

/* 导航栏响应式增强：已移除覆盖，统一由 common.css 定义和控制 */

/* 按钮响应式 */
/*
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 16px;
    line-height: 1.5;
    min-width: 120px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
    min-width: 100px;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 18px;
    min-width: 150px;
}*/

/* 卡片响应式 */
.card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.card-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.card-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.card-body {
    line-height: 1.6;
}

/* 表单响应式 */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: rgba(255, 255, 255, 0.15);
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

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

.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.table th,
.table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.table th {
    font-weight: 600;
    background: rgba(255, 255, 255, 0.05);
}

/* 模态框响应式（与全站保持一致：默认隐藏，active 时显示） */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none; /* 默认隐藏，避免页面加载时自动显示 */
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal.active {
    display: flex; /* 仅在激活时显示 */
}

.modal-dialog {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 30px;
    max-width: 500px;
    width: 100%;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: white;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* 工具类 */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.d-inline { display: inline !important; }
.d-inline-block { display: inline-block !important; }

.justify-content-center { justify-content: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-around { justify-content: space-around; }
.justify-content-start { justify-content: flex-start; }
.justify-content-end { justify-content: flex-end; }

.align-items-center { align-items: center; }
.align-items-start { align-items: flex-start; }
.align-items-end { align-items: flex-end; }

.flex-column { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }

.m-0 { margin: 0 !important; }
.m-1 { margin: 8px !important; }
.m-2 { margin: 16px !important; }
.m-3 { margin: 24px !important; }
.m-4 { margin: 32px !important; }
.m-5 { margin: 40px !important; }

.p-0 { padding: 0 !important; }
.p-1 { padding: 8px !important; }
.p-2 { padding: 16px !important; }
.p-3 { padding: 24px !important; }
.p-4 { padding: 32px !important; }
.p-5 { padding: 40px !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px !important; }
.mt-2 { margin-top: 16px !important; }
.mt-3 { margin-top: 24px !important; }
.mt-4 { margin-top: 32px !important; }
.mt-5 { margin-top: 40px !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 8px !important; }
.mb-2 { margin-bottom: 16px !important; }
.mb-3 { margin-bottom: 24px !important; }
.mb-4 { margin-bottom: 32px !important; }
.mb-5 { margin-bottom: 40px !important; }

.pt-0 { padding-top: 0 !important; }
.pt-1 { padding-top: 8px !important; }
.pt-2 { padding-top: 16px !important; }
.pt-3 { padding-top: 24px !important; }
.pt-4 { padding-top: 32px !important; }
.pt-5 { padding-top: 40px !important; }

.pb-0 { padding-bottom: 0 !important; }
.pb-1 { padding-bottom: 8px !important; }
.pb-2 { padding-bottom: 16px !important; }
.pb-3 { padding-bottom: 24px !important; }
.pb-4 { padding-bottom: 32px !important; }
.pb-5 { padding-bottom: 40px !important; }

/* 平板设备 (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    :root {
        --mobile-padding: var(--tablet-padding);
        --mobile-font-size: var(--tablet-font-size);
        --mobile-line-height: var(--tablet-line-height);
    }
    
    .container {
        padding-left: var(--tablet-padding);
        padding-right: var(--tablet-padding);
    }
    
    .col-md-12 { width: 100%; }
    .col-md-11 { width: 91.666667%; }
    .col-md-10 { width: 83.333333%; }
    .col-md-9 { width: 75%; }
    .col-md-8 { width: 66.666667%; }
    .col-md-7 { width: 58.333333%; }
    .col-md-6 { width: 50%; }
    .col-md-5 { width: 41.666667%; }
    .col-md-4 { width: 33.333333%; }
    .col-md-3 { width: 25%; }
    .col-md-2 { width: 16.666667%; }
    .col-md-1 { width: 8.333333%; }
    
    .d-md-none { display: none !important; }
    .d-md-block { display: block !important; }
    .d-md-flex { display: flex !important; }
    
    .text-md-center { text-align: center; }
    .text-md-left { text-align: left; }
    .text-md-right { text-align: right; }
}

/* 大屏设备 (1025px+) */
@media (min-width: 1025px) {
    :root {
        --mobile-padding: var(--desktop-padding);
        --mobile-font-size: var(--desktop-font-size);
        --mobile-line-height: var(--desktop-line-height);
    }
    
    .container {
        padding-left: var(--desktop-padding);
        padding-right: var(--desktop-padding);
    }
    
    .col-lg-12 { width: 100%; }
    .col-lg-11 { width: 91.666667%; }
    .col-lg-10 { width: 83.333333%; }
    .col-lg-9 { width: 75%; }
    .col-lg-8 { width: 66.666667%; }
    .col-lg-7 { width: 58.333333%; }
    .col-lg-6 { width: 50%; }
    .col-lg-5 { width: 41.666667%; }
    .col-lg-4 { width: 33.333333%; }
    .col-lg-3 { width: 25%; }
    .col-lg-2 { width: 16.666667%; }
    .col-lg-1 { width: 8.333333%; }
    
    .d-lg-none { display: none !important; }
    .d-lg-block { display: block !important; }
    .d-lg-flex { display: flex !important; }
    
    .text-lg-center { text-align: center; }
    .text-lg-left { text-align: left; }
    .text-lg-right { text-align: right; }
}

/* 移动设备 (最大 767px) */
@media (max-width: 767px) {
    /* 导航栏移动端 */
    .navbar-toggler {
        display: block;
    }
    
    .navbar-collapse {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(0, 0, 0, 0.95);
        backdrop-filter: blur(20px);
        border-radius: 0 0 20px 20px;
        padding: 20px;
        flex-direction: column;
        align-items: stretch;
    }
    
    .navbar-collapse.show {
        display: flex;
    }
    
    .navbar-nav {
        flex-direction: column;
        width: 100%;
    }
    
    .navbar-nav .nav-item {
        margin: 5px 0;
        width: 100%;
    }
    
    .navbar-nav .nav-link {
        display: block;
        width: 100%;
        text-align: center;
        padding: 15px;
        border-radius: 10px;
    }
    
    /* 按钮移动端 */
    .btn {
        width: 100%;
        margin-bottom: 10px;
        padding: 15px 20px;
        font-size: 16px;
    }
    
    .btn-group .btn {
        width: auto;
        margin-bottom: 0;
        margin-right: 10px;
    }
    
    .btn-group .btn:last-child {
        margin-right: 0;
    }
    
    /* 卡片移动端 */
    .card {
        padding: 20px;
        margin-bottom: 20px;
        border-radius: 15px;
    }
    
    .card-title {
        font-size: 1.3rem;
    }
    
    /* 表单移动端 */
    .form-control {
        padding: 15px;
        font-size: 16px; /* 防止iOS缩放 */
    }
    
    /* 模态框移动端 */
    .modal {
        padding: 10px;
    }
    
    .modal-dialog {
        padding: 20px;
        margin: 0;
    }
    
    /* 表格移动端 */
    .table-responsive {
        border-radius: 10px;
        overflow: hidden;
    }
    
    .table th,
    .table td {
        padding: 10px 8px;
        font-size: 14px;
    }
    
    /* 移动端专用类 */
    .d-sm-none { display: none !important; }
    .d-sm-block { display: block !important; }
    .d-sm-flex { display: flex !important; }
    
    .text-sm-center { text-align: center; }
    .text-sm-left { text-align: left; }
    .text-sm-right { text-align: right; }
    
    .flex-sm-column { flex-direction: column; }
    .flex-sm-row { flex-direction: row; }
    
    /* 移动端字体大小 */
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    h4 { font-size: 1.25rem; }
    h5 { font-size: 1.1rem; }
    h6 { font-size: 1rem; }
    
    p, li, span {
        font-size: var(--mobile-font-size);
        line-height: var(--mobile-line-height);
    }
    
    /* 移动端间距调整 */
    .container {
        padding-left: var(--mobile-padding);
        padding-right: var(--mobile-padding);
    }
    
    .row {
        margin-left: -10px;
        margin-right: -10px;
    }
    
    .col {
        padding-left: 10px;
        padding-right: 10px;
    }
}

/* 超小屏设备 (最大 480px) */
@media (max-width: 480px) {
    :root {
        --mobile-padding: 10px;
        --mobile-font-size: 13px;
    }
    
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .card {
        padding: 15px;
        border-radius: 10px;
    }
    
    .btn {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .modal-dialog {
        padding: 15px;
    }
    
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    h4 { font-size: 1.1rem; }
    h5 { font-size: 1rem; }
    h6 { font-size: 0.9rem; }
}

/* 横屏模式优化 */
@media (max-height: 500px) and (orientation: landscape) {
    .navbar {
        padding: 5px 0;
    }
    
    .modal {
        padding: 5px;
    }
    
    .card {
        padding: 15px;
    }
    
    .btn {
        padding: 8px 16px;
    }
}

/* 高分辨率屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .btn, .card, .form-control {
        border-width: 0.5px;
    }
}

/* 打印样式 */
@media print {
    * {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
    }
    
    .navbar, .btn, .modal {
        display: none !important;
    }
    
    .card {
        border: 1px solid #ccc;
        page-break-inside: avoid;
    }
}

/* 无障碍访问增强 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1a1a1a;
        --text-color: #ffffff;
        --border-color: rgba(255, 255, 255, 0.2);
    }
}

/* 浅色模式支持 */
@media (prefers-color-scheme: light) {
    :root {
        --bg-color: #ffffff;
        --text-color: #333333;
        --border-color: rgba(0, 0, 0, 0.2);
    }
}