/* 前台样式文件 */

/* 全局样式 */
body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 移动端触摸优化 */
* {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* 页脚样式 */
footer {
    margin-top: 2rem;
}

/* 卡片样式优化 */
.card {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-radius: 0.5rem;
    border: none;
}

.card-header {
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
}

/* 表单样式优化 */
.form-control:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

input, select, textarea, button {
    font-size: 16px; /* 防止iOS缩放 */
}

/* 按钮样式优化 */
.btn {
    border-radius: 0.3rem;
    font-weight: 500;
    min-height: 44px; /* 移动端触摸目标尺寸 */
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background-color: #1e88e5;
    border-color: #1e88e5;
}

.btn-primary:hover {
    background-color: #1976d2;
    border-color: #1976d2;
}

.btn-success {
    background-color: #43a047;
    border-color: #43a047;
}

.btn-success:hover {
    background-color: #388e3c;
    border-color: #388e3c;
}

/* 导航栏样式 */
.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-weight: bold;
}

/* 表格样式 */
.table th {
    background-color: #f8f9fa;
}

/* 徽章样式 */
.badge {
    font-weight: 500;
    padding: 0.4em 0.6em;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    h1, .h1 {
        font-size: 1.8rem;
    }
    
    h2, .h2 {
        font-size: 1.5rem;
    }
    
    h3, .h3 {
        font-size: 1.3rem;
    }
    
    /* 表格响应式处理 */
    .table-responsive {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* 改进表单控件在移动设备上的可用性 */
    .form-control, .form-select, .btn {
        min-height: 44px;
    }
    
    /* 增大移动端复选框和单选框尺寸 */
    input[type="checkbox"], input[type="radio"] {
        width: 20px;
        height: 20px;
    }
}

/* 小屏幕手机 */
@media (max-width: 375px) {
    body {
        font-size: 14px;
    }
    
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    h1, .h1 {
        font-size: 1.6rem;
    }
}

/* 自定义动画 */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 表单验证样式 */
.was-validated .form-control:invalid {
    border-color: #dc3545;
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.was-validated .form-control:valid {
    border-color: #28a745;
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

/* 自定义投诉类型标签 */
.complaint-type {
    display: inline-block;
    padding: 0.25em 0.6em;
    font-size: 0.875em;
    font-weight: 500;
    border-radius: 0.25rem;
    background-color: #e9ecef;
    color: #495057;
}

/* 查询页面样式 */
.query-result {
    margin-top: 2rem;
    animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 闪存消息样式优化 */
.flash-message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1050;
    min-width: 250px;
    max-width: 90%;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: slideInDown 0.3s ease-out;
}

.flash-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.flash-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.flash-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.flash-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.close-btn {
    background: transparent;
    border: none;
    color: inherit;
    font-size: 1.25rem;
    line-height: 1;
    padding: 0;
    margin-left: 15px;
    opacity: 0.7;
    cursor: pointer;
}

.close-btn:hover {
    opacity: 1;
}

@keyframes slideInDown {
    from {
        transform: translate(-50%, -20px);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .flash-message {
        top: 10px;
        padding: 12px 15px;
        font-size: 14px;
    }
} 