/* 住建局隐患上报系统 - 通用样式 */

/* 性能优化：减少布局偏移 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 性能优化：图片懒加载支持 */
img.lazy {
    opacity: 0;
    transition: opacity 0.3s;
}

img.lazy.loaded {
    opacity: 1;
}

/* 性能优化：使用content-visibility提升渲染性能 */
.optimize-render {
    content-visibility: auto;
}

/* 性能优化：减少重绘和回流 */
.no-transform {
    transform: translateZ(0);
    will-change: transform;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    color: #333;
    background-color: #f5f5f5;
    line-height: 1.5;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 头部样式 */
.header {
    background-color: #1a73e8;
    color: white;
    padding: 10px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header .logo {
    font-size: 18px;
    font-weight: bold;
    text-decoration: none;
    color: white;
}

.header .nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header .nav-links {
    display: flex;
    gap: 20px;
}

.header .nav-links a {
    color: white;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.header .nav-links a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* 底部菜单 */
.footer-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: white;
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.footer-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #666;
    text-decoration: none;
    font-size: 12px;
}

.footer-nav-item.active {
    color: #1a73e8;
}

.footer-nav-item i {
    font-size: 20px;
    margin-bottom: 4px;
}

/* 首页样式 */
.banner-carousel {
    position: relative;
    height: 200px;
    overflow: hidden;
    margin-bottom: 0;
    width: 100%;
}

.banner-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s;
}

.banner-item.active {
    opacity: 1;
}

.banner-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.banner-indicators {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.banner-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
}

.banner-indicator.active {
    background-color: white;
}

.report-section {
    background-color: #1a73e8; /* 确保背景色正确 */
    border-radius: 12px;
    padding: 16px;
    margin: 16px;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.report-section h2 {
    font-size: 20px;
    color: white;
    margin: 0;
}

/* 布局工具类 */
.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.w-full {
    width: 100%;
}

.h-full {
    height: 100%;
}

.mx-4 {
    margin-left: 16px;
    margin-right: 16px;
}

.my-4 {
    margin-top: 16px;
    margin-bottom: 16px;
}

.mb-8 {
    margin-bottom: 32px;
}

.mt-4 {
    margin-top: 16px;
}

.px-4 {
    padding-left: 16px;
    padding-right: 16px;
}

.last\:border-0:last-child {
    border-bottom: none;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 响应式网格 */
.grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 768px) {
    .md\:grid-cols-2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 通用样式类 */
.font-bold {
    font-weight: bold;
}

.text-gray-800 {
    color: #1f2937;
}

.text-lg {
    font-size: 18px;
}

.mr-2 {
    margin-right: 8px;
}

.rounded-xl {
    border-radius: 12px;
}

.overflow-hidden {
    overflow: hidden;
}

.shadow-sm {
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.shadow-md {
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.transition-colors {
    transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

.transition-shadow {
    transition-property: box-shadow;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

.hover\:bg-gray-50:hover {
    background-color: #f9fafb;
}

.hover\:shadow-md:hover {
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.block {
    display: block;
}

.border-b {
    border-bottom-width: 1px;
    border-bottom-color: #e5e7eb;
}

.p-4 {
    padding: 16px;
}

.flex-1 {
    flex: 1 1 0%;
}

.min-w-0 {
    min-width: 0px;
}

.font-medium {
    font-weight: 500;
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.text-sm {
    font-size: 14px;
}

.text-gray-500 {
    color: #6b7280;
}

.ml-3 {
    margin-left: 12px;
}

.whitespace-nowrap {
    white-space: nowrap;
}

.text-xs {
    font-size: 12px;
}

.text-gray-400 {
    color: #9ca3af;
}

.mb-1 {
    margin-bottom: 4px;
}

.bg-white {
    background-color: white;
}

/* 主内容区域需要有底部边距，避免被导航栏遮挡 */
main {
    padding-bottom: 60px;
}

.news-section, .completed-section {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.section-title {
    font-size: 18px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.news-item, .completed-item {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.news-item:last-child, .completed-item:last-child {
    border-bottom: none;
}

.news-item .title {
    font-weight: 500;
    margin-bottom: 5px;
}

.news-item .date {
    color: #999;
    font-size: 12px;
}

.completed-item .info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.completed-item .status {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
}

/* 表单样式 */
.form-container {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 60px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #1a73e8;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

.form-tips {
    color: #999;
    font-size: 12px;
    margin-top: 5px;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background-color: #1a73e8;
    color: white;
}

.btn-primary:hover {
    background-color: #1557b0;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

/* 文件上传样式 */
.file-upload {
    border: 2px dashed #ddd;
    border-radius: 4px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.3s;
}

.file-upload:hover {
    border-color: #1a73e8;
}

.file-upload input[type="file"] {
    display: none;
}

.file-upload .upload-icon {
    font-size: 40px;
    color: #999;
    margin-bottom: 10px;
}

.upload-preview {
    margin-top: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.preview-item {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 4px;
    overflow: hidden;
}

.preview-item img, .preview-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-remove {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* 状态标签样式 */
.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
}

.status-pending {
    background-color: #fff3cd;
    color: #856404;
}

.status-processing {
    background-color: #cce5ff;
    color: #004085;
}

.status-completed {
    background-color: #d4edda;
    color: #155724;
}

.status-rejected {
    background-color: #f8d7da;
    color: #721c24;
}

/* 登录页面样式 */
.login-container {
    max-width: 400px;
    margin: 50px auto;
    background-color: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.login-header {
    text-align: center;
    margin-bottom: 20px;
}

.login-header h1 {
    font-size: 24px;
    color: #333;
}

.login-tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 20px;
}

.login-tab {
    flex: 1;
    text-align: center;
    padding: 10px 0;
    cursor: pointer;
    color: #666;
}

.login-tab.active {
    color: #1a73e8;
    border-bottom: 2px solid #1a73e8;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form .btn {
    width: 100%;
    padding: 12px;
    font-size: 16px;
}

.wechat-login {
    text-align: center;
    padding: 20px 0;
}

.wechat-qrcode {
    width: 200px;
    height: 200px;
    margin: 0 auto 15px;
    border: 1px solid #ddd;
    padding: 10px;
}

.wechat-qrcode img {
    width: 100%;
    height: 100%;
}

/* 我的上报页面样式 */
.reports-container {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 60px;
}

.report-tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 20px;
}

.report-tab {
    flex: 1;
    text-align: center;
    padding: 10px 0;
    cursor: pointer;
    color: #666;
}

.report-tab.active {
    color: #1a73e8;
    border-bottom: 2px solid #1a73e8;
}

.report-card {
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    transition: box-shadow 0.3s;
}

.report-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.report-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.report-card-title {
    font-weight: 500;
    flex: 1;
}

.report-card-info {
    color: #999;
    font-size: 12px;
    margin-bottom: 10px;
}

.report-card-images {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.report-card-image {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    overflow: hidden;
}

.report-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.report-card-feedback {
    font-size: 12px;
    color: #666;
    background-color: #f5f5f5;
    padding: 8px;
    border-radius: 4px;
}

/* 管理员后台样式 */
.admin-container {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 200px;
    background-color: #2c3e50;
    color: white;
    padding: 20px 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.admin-sidebar-brand {
    padding: 0 20px;
    margin-bottom: 30px;
    font-size: 18px;
    font-weight: bold;
    border-bottom: 1px solid #34495e;
    padding-bottom: 20px;
}

.admin-menu {
    list-style: none;
}

.admin-menu-item {
    margin-bottom: 5px;
}

.admin-menu-item a {
    display: block;
    padding: 12px 20px;
    color: #bdc3c7;
    text-decoration: none;
    transition: all 0.3s;
}

.admin-menu-item a:hover {
    background-color: #34495e;
    color: white;
}

.admin-menu-item.active a {
    background-color: #1a73e8;
    color: white;
}

.admin-content {
    flex: 1;
    margin-left: 200px;
    padding: 20px;
}

.admin-header {
    background-color: white;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-title {
    font-size: 20px;
    font-weight: 500;
}

.admin-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 统计卡片样式 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.stat-value {
    font-size: 36px;
    font-weight: bold;
    color: #1a73e8;
    margin-bottom: 10px;
}

.stat-label {
    color: #666;
    font-size: 14px;
}

/* 表格样式 */
.table-container {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th, .data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.data-table th {
    background-color: #f8f9fa;
    font-weight: 500;
    color: #555;
}

.data-table tr:hover {
    background-color: #f8f9fa;
}

/* 搜索和筛选样式 */
.search-filter {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-filter .form-control {
    flex: 1;
    min-width: 200px;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
    gap: 5px;
}

.pagination-btn {
    padding: 5px 10px;
    border: 1px solid #ddd;
    background-color: white;
    color: #666;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s;
}

.pagination-btn:hover {
    background-color: #f8f9fa;
}

.pagination-btn.active {
    background-color: #1a73e8;
    color: white;
    border-color: #1a73e8;
}

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

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s;
}

.modal.active {
    visibility: visible;
    opacity: 1;
}

.modal-content {
    background-color: white;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s;
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 18px;
    font-weight: 500;
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #999;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* 按钮组样式 */
.btn-group {
    display: flex;
    gap: 10px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .admin-container {
        flex-direction: column;
    }
    
    .admin-sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .admin-content {
        margin-left: 0;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .banner-carousel {
        height: 150px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-nav-item i {
        font-size: 18px;
    }
    
    .form-container {
        margin-bottom: 70px;
    }
    
    /* 增强移动端适配 */
    .header .nav {
        flex-direction: column;
        gap: 10px;
    }
    
    .header .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    
    .container {
        padding: 0 10px;
    }
    
    .report-card {
        padding: 12px;
    }
    
    .report-section, .news-section, .completed-section {
        padding: 15px;
    }
    
    .search-filter {
        flex-direction: column;
    }
    
    .modal-content {
        width: 95%;
    }
    
    /* 移动端表格优化 */
    .table-container {
        overflow-x: auto;
    }
    
    .data-table {
        min-width: 500px;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #1a73e8;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 工具提示 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 120px;
    background-color: #333;
    color: white;
    text-align: center;
    border-radius: 4px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* 地图容器 */
.map-container {
    width: 100%;
    height: 300px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-top: 10px;
}

/* 打印样式 */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background-color: white;
    }
    
    .container {
        max-width: 100%;
    }
}