* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
    background: #f0f2f5;
    color: #333;
    font-size: 14px;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: #1890ff;
}

a:hover {
    color: #40a9ff;
}

/* 通用按钮样式 */
.btn {
    display: inline-block;
    padding: 8px 20px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    text-align: center;
}

.btn:hover {
    opacity: 0.8;
}

.btn-primary {
    background: #1890ff;
    border-color: #1890ff;
    color: #fff;
}

.btn-success {
    background: #52c41a;
    border-color: #52c41a;
    color: #fff;
}

.btn-warning {
    background: #faad14;
    border-color: #faad14;
    color: #fff;
}

.btn-danger {
    background: #ff4d4f;
    border-color: #ff4d4f;
    color: #fff;
}

.btn-small {
    padding: 4px 12px;
    font-size: 12px;
}

.btn-large {
    padding: 12px 30px;
    font-size: 16px;
}

/* 通用表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-input, .form-select, .form-textarea, .form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus, .form-control:focus {
    outline: none;
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

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

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

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

/* 表格样式 */
.table-container {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

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

.data-table th {
    background: #fafafa;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
}

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

.data-table .actions {
    display: flex;
    gap: 8px;
}

/* 状态标签 */
.status-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.status-success {
    background: #f6ffed;
    color: #52c41a;
    border: 1px solid #b7eb8f;
}

.status-warning {
    background: #fffbe6;
    color: #faad14;
    border: 1px solid #ffe58f;
}

.status-error {
    background: #fff2f0;
    color: #ff4d4f;
    border: 1px solid #ffccc7;
}

.status-info {
    background: #e6f7ff;
    color: #1890ff;
    border: 1px solid #91d5ff;
}

.status-default {
    background: #fafafa;
    color: #666;
    border: 1px solid #d9d9d9;
}

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

.pagination a, .pagination .current {
    display: inline-block;
    padding: 6px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    background: #fff;
    color: #333;
}

.pagination .current {
    background: #1890ff;
    border-color: #1890ff;
    color: #fff;
}

.pagination a:hover {
    border-color: #1890ff;
    color: #1890ff;
}

/* 卡片 */
.card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-body {
    padding: 20px;
}

/* 提示消息 */
.alert {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.alert-success {
    background: #f6ffed;
    border: 1px solid #b7eb8f;
    color: #52c41a;
}

.alert-error {
    background: #fff2f0;
    border: 1px solid #ffccc7;
    color: #ff4d4f;
}

.alert-info {
    background: #e6f7ff;
    border: 1px solid #91d5ff;
    color: #1890ff;
}

.alert-warning {
    background: #fffbe6;
    border: 1px solid #ffe58f;
    color: #faad14;
}

/* 搜索栏 */
.search-bar {
    background: #fff;
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}

.search-bar .form-group {
    margin-bottom: 0;
    min-width: 180px;
}

/* 工具条 */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.toolbar-left, .toolbar-right {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* 弹窗遮罩 */
.modal-mask {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal {
    background: #fff;
    border-radius: 8px;
    width: 500px;
    max-width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-content {
    background: #fff;
    border-radius: 8px;
    width: 500px;
    max-width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    font-weight: 600;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid #f0f0f0;
    text-align: right;
}

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

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

.stat-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.stat-card-title {
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
}

.stat-card-value {
    font-size: 28px;
    font-weight: 600;
    color: #333;
}

.stat-card-icon {
    float: right;
    font-size: 36px;
    opacity: 0.3;
}

/* 隐藏类 */
.hidden {
    display: none !important;
}

/* 文本对齐 */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* margin */
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }

/* ===== 工作台布局 ===== */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.stat-cards-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* ===== 响应式适配 ===== */
@media screen and (max-width: 768px) {
    body {
        font-size: 14px;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .search-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-bar .form-group {
        min-width: auto;
        width: 100%;
    }

    .toolbar {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }

    .toolbar-left, .toolbar-right {
        flex-wrap: wrap;
    }

    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .data-table {
        min-width: auto;
        width: 100%;
        font-size: 13px;
    }

    .data-table.responsive-card thead {
        display: none;
    }

    .data-table.responsive-card,
    .data-table.responsive-card tbody,
    .data-table.responsive-card tr,
    .data-table.responsive-card td {
        display: block;
        width: 100%;
    }

    .data-table.responsive-card tr {
        padding: 12px;
        border-bottom: 8px solid #f5f7fa;
        background: #fff;
    }

    .data-table.responsive-card tr:last-child {
        border-bottom: none;
    }

    .data-table.responsive-card td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        padding: 8px 4px;
        border: none;
        border-bottom: 1px dashed #f0f0f0;
        text-align: right;
        gap: 12px;
    }

    .data-table.responsive-card td:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

    .data-table.responsive-card td:first-child {
        padding-top: 0;
    }

    .data-table.responsive-card td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #666;
        text-align: left;
        flex-shrink: 0;
        min-width: 72px;
    }

    .data-table.responsive-card td .status-tag,
    .data-table.responsive-card td .btn {
        flex-shrink: 0;
    }

    .data-table.responsive-card td .actions {
        width: auto;
    }

    .data-table.responsive-card tr.empty-row td.empty-state {
        display: block;
        text-align: center;
        padding: 30px 12px !important;
        border: none;
    }

    .data-table.responsive-card tr.empty-row td.empty-state::before {
        display: none;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .stat-cards-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .card-header {
        flex-wrap: wrap;
        gap: 10px;
    }

    .card-body {
        padding: 15px;
    }

    .btn-large {
        padding: 10px 20px;
        font-size: 15px;
    }

    .modal {
        width: 95%;
        max-width: 95%;
        margin: 10px;
    }

    .stat-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .stat-card {
        padding: 15px;
    }

    .stat-card-value {
        font-size: 22px;
    }

    .stat-card-icon {
        font-size: 28px;
    }

    .pagination {
        flex-wrap: wrap;
    }

    .data-table .actions {
        flex-wrap: wrap;
    }
}

@media screen and (max-width: 480px) {
    .stat-cards {
        grid-template-columns: 1fr;
    }

    .stat-cards-3 {
        grid-template-columns: 1fr;
    }

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

    .card-header {
        padding: 12px 15px;
        font-size: 15px;
    }

    .card-body {
        padding: 12px;
    }

    .data-table th, .data-table td {
        padding: 10px 8px;
        font-size: 13px;
    }

    .btn {
        padding: 6px 14px;
        font-size: 13px;
    }

    .btn-large {
        padding: 10px 16px;
        font-size: 14px;
    }

    .form-input, .form-select, .form-textarea, .form-control {
        font-size: 16px;
    }

    .modal-content {
        width: 95% !important;
        max-width: 95% !important;
        max-height: 85vh;
    }
}
