/* 我的楼凤页面专用样式 */

/* 页面标题 */
.page-header {
    margin-bottom: 20px;
    padding-bottom: 10px;
}

.page-header h2 {
    font-size: 18px;
    color: #333;
    margin: 0;
    font-weight: normal;
}

/* 信息列表区域 */
.posts-list-section {
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* 信息表格 */
.posts-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.posts-table th {
    background: #f8f9fa;
    color: #333;
    font-weight: bold;
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
    font-size: 14px;
}

.posts-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
    font-size: 14px;
}

.posts-table tbody tr:hover {
    background: #f8f9fa;
}

.posts-table tbody tr:last-child td {
    border-bottom: none;
}

/* 表格列样式 */
.image-col {
    width: 80px;
    padding: 8px !important;
}

.post-image-wrapper {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.title-col {
    width: auto;
    min-width: 200px;
}

.region-col {
    width: 150px;
    color: #666;
}

.status-col {
    width: 100px;
    text-align: center;
}

.date-col {
    width: 120px;
    color: #666;
    font-size: 13px;
}

.views-col {
    width: 80px;
    text-align: center;
    color: #666;
    font-weight: 500;
}

.action-col {
    width: 200px;
    text-align: center;
    padding: 8px !important;
}

/* 操作按钮 */
.action-buttons {
    display: flex;
    gap: 5px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 5px 10px;
    border: none;
    border-radius: 3px;
    font-size: 12px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.btn-view {
    background: #17a2b8;
    color: white;
}

.btn-view:hover,
.btn-view:active {
    background: #138496;
}

.btn-edit {
    background: #ffc107;
    color: #333;
}

.btn-edit:hover,
.btn-edit:active {
    background: #e0a800;
}

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

.btn-delete:hover,
.btn-delete:active {
    background: #c82333;
}

/* 标题链接 */
.post-title {
    color: #333;
    text-decoration: none;
    font-weight: normal;
}

.post-title:hover {
    color: var(--theme-color, #ff1493);
    text-decoration: underline;
}

/* 状态标签 */
.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
    min-width: 60px;
}

.status-published {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.status-offline {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-rejected {
    background: #f5c6cb;
    color: #721c24;
    border: 1px solid #f1aeb5;
}

/* 无数据提示 */
.no-data {
    text-align: center;
    color: #999;
    padding: 40px 15px;
    font-style: italic;
}

/* 分页导航 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin: 20px 0;
    padding: 15px 0;
}

.page-btn {
    display: inline-block;
    padding: 8px 12px;
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
    text-decoration: none;
    border-radius: 3px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.page-btn:hover {
    background: #f8f9fa;
    border-color: #ccc;
}

.page-btn.current {
    background: var(--theme-color, #ff1493);
    color: white;
    border-color: var(--theme-color, #ff1493);
}

.page-btn.current:hover {
    background: var(--theme-color-dark, #e91e63);
    border-color: var(--theme-color-dark, #e91e63);
}

/* 操作提示 */
.operation-tips {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 4px solid var(--theme-color, #ff1493);
}

.operation-tips p {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 14px;
}

.operation-tips ul {
    margin: 0;
    padding-left: 20px;
    color: #666;
}

.operation-tips li {
    margin-bottom: 5px;
    font-size: 13px;
    line-height: 1.5;
}

/* 编辑模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
    padding: 20px 0;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: #fff;
    margin: 0 auto;
    width: 90%;
    max-width: 600px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
    font-weight: 600;
}

.modal-close {
    color: #999;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

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

/* 模态框表单样式 */
.form-group {
    margin-bottom: 15px;
}

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

.required {
    color: #dc3545;
}

.form-input,
.form-textarea,
.form-input select,
select.form-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
    box-sizing: border-box;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

select.form-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--theme-color, #ff1493);
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

.btn-primary {
    background: var(--theme-color, #ff1493);
    color: white;
    padding: 8px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-primary:hover {
    background: var(--theme-color-dark, #e91e63);
}

.btn-secondary {
    background: #6c757d;
    color: white;
    padding: 8px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s;
}

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

/* 服务项目网格 */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 5px;
}

.service-item {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.service-item:hover {
    background: #f8f9fa;
    border-color: var(--theme-color, #ff1493);
}

.service-item input[type="checkbox"] {
    cursor: pointer;
}

.service-item input[type="checkbox"]:checked + span {
    color: var(--theme-color, #ff1493);
    font-weight: 500;
}

/* 图片上传区域 */
.image-upload-area {
    margin-top: 5px;
}

.image-preview-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}

.image-preview-item {
    position: relative;
    width: 100%;
    padding-top: 100%;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.image-preview-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-remove-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.image-remove-btn:hover {
    background: rgba(255, 0, 0, 1);
}

.upload-btn-wrapper {
    margin-top: 10px;
}

.btn-upload {
    padding: 10px 20px;
    background: #17a2b8;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.btn-upload:hover {
    background: #138496;
}

.tip {
    font-size: 12px;
    color: #999;
    font-weight: normal;
}

/* 响应式设计 */
@media (max-width: 768px) {
    /* 表格样式调整 */
    .posts-table {
        font-size: 13px;
    }
    
    .posts-table th,
    .posts-table td {
        padding: 10px 8px;
    }
    
    .image-col {
        width: 70px;
        padding: 6px !important;
    }
    
    .post-image-wrapper {
        width: 50px;
        height: 50px;
    }
    
    .title-col {
        min-width: 150px;
    }
    
    .region-col {
        width: 110px;
        font-size: 12px;
    }
    
    .status-col {
        width: 85px;
    }
    
    .date-col {
        width: 100px;
        font-size: 12px;
    }
    
    .views-col {
        width: 70px;
        font-size: 12px;
    }
    
    .action-col {
        width: 180px;
    }
    
    .action-buttons {
        gap: 4px;
    }
    
    .btn {
        padding: 4px 8px;
        font-size: 11px;
    }
    
    .status-badge {
        font-size: 11px;
        padding: 3px 6px;
        min-width: 50px;
    }
    
    .page-btn {
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .operation-tips {
        padding: 15px;
        font-size: 13px;
    }
    
    .operation-tips li {
        font-size: 12px;
    }
}

/* 小屏幕设备：表格转为卡片模式 */
@media (max-width: 600px) {
    /* 隐藏表头 */
    .posts-table thead {
        display: none;
    }
    
    /* 表格行转为卡片 */
    .posts-table,
    .posts-table tbody,
    .posts-table tr,
    .posts-table td {
        display: block;
        width: 100%;
    }
    
    .posts-table tr {
        margin-bottom: 15px;
        border: 1px solid #e0e0e0;
        border-radius: 6px;
        padding: 15px;
        background: #fff;
        box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    }
    
    .posts-table tr:hover {
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
    
    /* 卡片单元格样式 */
    .posts-table td {
        border: none;
        padding: 8px 0;
        position: relative;
        padding-left: 85px;
        min-height: 30px;
        display: flex;
        align-items: center;
    }
    
    .posts-table td:not(:last-child) {
        border-bottom: 1px solid #f5f5f5;
    }
    
    /* 标签样式 */
    .posts-table td:before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 75px;
        font-weight: 600;
        color: #666;
        font-size: 13px;
    }
    
    /* 操作列特殊处理 */
    .posts-table .action-col {
        padding-left: 0 !important;
        padding-top: 15px !important;
        padding-bottom: 5px !important;
        border-top: 2px solid #f0f0f0 !important;
        border-bottom: none !important;
        margin-top: 10px;
    }
    
    /* 各列特殊样式 */
    .image-col {
        padding: 10px !important;
    }
    
    .post-image-wrapper {
        width: 50px;
        height: 50px;
        margin: 0 auto;
    }
    
    .region-col,
    .date-col,
    .views-col {
        font-size: 13px;
        color: #666;
    }
    
    .title-col {
        font-size: 14px;
    }
    
    .title-col .post-title {
        display: block;
        line-height: 1.4;
        word-break: break-word;
        white-space: normal;
    }
    
    .status-col {
        text-align: left;
    }
    
    .status-badge {
        display: inline-block;
        font-size: 11px;
        padding: 4px 8px;
    }
    
    .action-col {
        padding: 8px 0 !important;
        padding-left: 0 !important;
        display: block;
    }
    
    .action-col:before {
        display: none !important;
    }
    
    .action-buttons {
        display: flex;
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
        width: 100%;
    }
    
    .btn {
        padding: 10px 15px;
        font-size: 14px;
        width: 100%;
        display: block;
        text-align: center;
        box-sizing: border-box;
    }
    
    /* 分页样式 */
    .pagination {
        flex-wrap: wrap;
        gap: 5px;
        padding: 15px 0;
    }
    
    .page-btn {
        padding: 6px 10px;
        font-size: 12px;
        min-width: 36px;
    }
    
    /* 操作提示 */
    .operation-tips {
        padding: 12px;
        margin-top: 20px;
    }
    
    .operation-tips p {
        font-size: 13px;
    }
    
    .operation-tips li {
        font-size: 12px;
        margin-bottom: 4px;
    }
    
    /* 模态框响应式 */
    .modal {
        padding: 10px 0;
    }
    
    .modal-content {
        width: 95%;
        max-height: 95vh;
        border-radius: 8px 8px 0 0;
    }
    
    .modal-header {
        padding: 15px;
    }
    
    .modal-header h3 {
        font-size: 16px;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .modal-footer {
        padding: 12px 15px;
        gap: 8px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .form-group {
        margin-bottom: 12px;
    }
    
    .form-group label {
        font-size: 13px;
    }
    
    .form-input,
    .form-textarea {
        font-size: 14px;
        padding: 10px 12px;
    }
    
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .service-item {
        font-size: 12px;
        padding: 8px 6px;
    }
    
    .image-preview-list {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .btn-primary,
    .btn-secondary {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .btn-upload {
        width: 100%;
        padding: 12px 20px;
    }
}

/* 中小屏幕优化 */
@media (max-width: 480px) {
    /* 模态框 */
    .modal {
        padding: 0;
    }
    
    .modal-content {
        width: 100%;
        max-height: 100vh;
        margin: 0;
        border-radius: 0;
    }
    
    .modal-header {
        padding: 12px 15px;
        position: sticky;
        top: 0;
        background: #fff;
        z-index: 1;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .modal-footer {
        padding: 12px 15px;
        position: sticky;
        bottom: 0;
        background: #fff;
        z-index: 1;
        box-shadow: 0 -2px 4px rgba(0,0,0,0.1);
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    .form-input,
    .form-textarea {
        font-size: 16px; /* 防止iOS自动缩放 */
        padding: 12px;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .service-item {
        padding: 10px;
        font-size: 14px;
    }
    
    .image-preview-list {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .btn-primary,
    .btn-secondary {
        padding: 12px 16px;
        font-size: 15px;
        flex: 1;
    }
}

/* 极小屏幕优化 */
@media (max-width: 400px) {
    .posts-table tr {
        padding: 12px;
        margin-bottom: 12px;
    }
    
    .posts-table td {
        padding: 6px 0;
        padding-left: 75px;
        font-size: 13px;
    }
    
    .posts-table td:before {
        width: 65px;
        font-size: 12px;
    }
    
    .title-col {
        font-size: 13px;
    }
    
    .status-badge {
        font-size: 10px;
        padding: 3px 6px;
        min-width: 45px;
    }
    
    .page-btn {
        padding: 5px 8px;
        font-size: 11px;
        min-width: 32px;
    }
    
    .operation-tips {
        padding: 10px;
    }
    
    /* 模态框 */
    .modal-header h3 {
        font-size: 15px;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .image-preview-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
}
