/* ArtCert 统一响应式基础样式 */

/* 响应式断点 */
/* 超小设备 (< 576px) */
/* 小设备 (576px - 768px) */
/* 中等设备 (768px - 992px) */
/* 大设备 (992px - 1200px) */
/* 超大设备 (> 1200px) */

/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f3ef;
    min-height: 100vh;
    color: #2c2c2c;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 响应式容器 */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

@media (min-width: 576px) {
    .container {
        padding: 0 24px;
    }
}

@media (min-width: 768px) {
    .container {
        padding: 0 32px;
    }
}

/* 响应式栅格 */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -12px;
}

.col {
    flex: 1;
    padding: 0 12px;
}

.col-12 { flex: 0 0 100%; max-width: 100%; padding: 0 12px; }
.col-6 { flex: 0 0 50%; max-width: 50%; padding: 0 12px; }
.col-4 { flex: 0 0 33.333%; max-width: 33.333%; padding: 0 12px; }
.col-3 { flex: 0 0 25%; max-width: 25%; padding: 0 12px; }

@media (max-width: 768px) {
    .col-6, .col-4, .col-3 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

@media (min-width: 769px) and (max-width: 992px) {
    .col-4 {
        flex: 0 0 50%;
        max-width: 50%;
    }
    .col-3 {
        flex: 0 0 33.333%;
        max-width: 33.333%;
    }
}

/* 响应式排版 */
h1 { font-size: 28px; font-weight: 600; line-height: 1.3; }
h2 { font-size: 24px; font-weight: 600; line-height: 1.3; }
h3 { font-size: 20px; font-weight: 600; line-height: 1.4; }
h4 { font-size: 18px; font-weight: 500; line-height: 1.4; }
h5 { font-size: 16px; font-weight: 500; line-height: 1.4; }
h6 { font-size: 14px; font-weight: 500; line-height: 1.4; }

@media (min-width: 768px) {
    h1 { font-size: 36px; }
    h2 { font-size: 28px; }
    h3 { font-size: 24px; }
    h4 { font-size: 20px; }
}

p {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 16px;
}

@media (min-width: 768px) {
    p {
        font-size: 15px;
    }
}

/* 响应式卡片 */
.card {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
    transition: all 0.3s ease;
}

@media (min-width: 768px) {
    .card {
        padding: 28px;
    }
}

.card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.06);
}

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

@media (min-width: 768px) {
    .form-group {
        margin-bottom: 20px;
    }
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #444;
    margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    background: #fafafa;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 4px;
    color: #1a1a1a;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: all 0.3s ease;
}

@media (min-width: 768px) {
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 14px 16px;
        font-size: 15px;
    }
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #999;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    background: #fff;
    border-color: #8b7355;
    box-shadow: 0 0 0 3px rgba(139, 115, 85, 0.1);
}

/* 响应式按钮 */
.btn {
    width: 100%;
    padding: 12px 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-family: inherit;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

@media (min-width: 768px) {
    .btn {
        width: 200px;
        padding: 12px 24px;
        font-size: 14px;
        margin: 0 auto;
        display: block;
    }
}

.btn-primary {
    background: #1a1a1a;
    color: #fff;
}

.btn-primary:hover {
    background: #333;
}

.btn-secondary {
    background: #fff;
    color: #2c2c2c;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.btn-secondary:hover {
    background: #f5f3ef;
    border-color: rgba(0, 0, 0, 0.12);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

th, td {
    padding: 12px 16px;
    text-align: left;
    font-size: 13px;
}

@media (min-width: 768px) {
    th, td {
        padding: 16px 20px;
        font-size: 14px;
    }
}

th {
    background: #f5f3ef;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 11px;
}

@media (min-width: 768px) {
    th {
        font-size: 12px;
    }
}

/* 响应式模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

@media (min-width: 768px) {
    .modal-content {
        padding: 32px;
    }
}

/* 响应式导航 */
.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    flex-wrap: wrap;
    gap: 12px;
}

@media (min-width: 768px) {
    .nav {
        padding: 20px 0;
        gap: 0;
    }
}

.nav-links {
    display: none;
    gap: 16px;
}

@media (min-width: 768px) {
    .nav-links {
        display: flex;
    }
}

.nav-toggle {
    display: block;
    padding: 8px;
    background: none;
    border: none;
    cursor: pointer;
}

@media (min-width: 768px) {
    .nav-toggle {
        display: none;
    }
}

/* 响应式徽章 */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

@media (min-width: 768px) {
    .badge {
        padding: 4px 12px;
        font-size: 12px;
    }
}

/* 响应式间距 */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mt-5 { margin-top: 48px; }

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

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

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

/* 响应式文本 */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-xs { font-size: 12px; }
.text-sm { font-size: 13px; }
.text-base { font-size: 14px; }
.text-lg { font-size: 16px; }
.text-xl { font-size: 18px; }
.text-2xl { font-size: 24px; }

@media (min-width: 768px) {
    .text-sm { font-size: 14px; }
    .text-base { font-size: 15px; }
    .text-lg { font-size: 18px; }
    .text-xl { font-size: 20px; }
    .text-2xl { font-size: 28px; }
}

/* 移动端专用类 */
.hide-mobile {
    display: none;
}

.show-mobile {
    display: block;
}

@media (min-width: 768px) {
    .hide-mobile {
        display: block;
    }
    
    .show-mobile {
        display: none;
    }
}

/* Flexbox 工具 */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }
.gap-4 { gap: 32px; }

/* 移动端优化 */
@media (max-width: 576px) {
    body {
        font-size: 15px;
    }
    
    .container {
        padding: 0 12px;
    }
    
    .card {
        padding: 16px;
        border-radius: 6px;
    }
    
    .btn {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    h1 { font-size: 24px; }
    h2 { font-size: 20px; }
    h3 { font-size: 18px; }
    
    .modal-content {
        padding: 20px;
        border-radius: 6px;
    }
    
    table {
        font-size: 12px;
    }
    
    th, td {
        padding: 10px 12px;
    }
}

/* 隐藏滚动条但保持滚动功能 */
.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}

/* 触摸优化 */
@media (hover: none) {
    .btn:hover,
    .card:hover,
    input:hover,
    select:hover,
    textarea:hover {
        transform: none;
    }
    
    .btn:active,
    .card:active {
        transform: scale(0.98);
    }
}

/* 安全区域适配 (iPhone X 及以上) */
@supports (padding: max(0px)) {
    .container {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
    }
    
    .modal-content {
        padding-bottom: max(24px, env(safe-area-inset-bottom));
    }
}
