/* 购买按钮样式 */
.purchase-work-button,
.swm-purchase-button {
    background: #28a745;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s ease;
    margin-left: 10px;
}

.purchase-work-button:hover,
.swm-purchase-button:hover {
    background: #218838;
}

.free-work {
    background: #17a2b8;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.work-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

/* 模态框样式 */
.swm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

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

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

.modal-header h3 {
    margin: 0;
}

.modal-close {
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.modal-body {
    padding: 20px;
}

/* 购买表单样式 */
.swm-purchase-form .purchase-details {
    margin-bottom: 20px;
}

.swm-purchase-form .work-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.swm-purchase-form .purchase-terms {
    margin-bottom: 20px;
}

.swm-purchase-form .purchase-terms ul {
    margin: 10px 0;
    padding-left: 20px;
}

.swm-purchase-form .purchase-actions {
    display: flex;
    gap: 10px;
}

/* 订单表格样式 */
.swm-orders-table,
.swm-sales-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.swm-orders-table th,
.swm-orders-table td,
.swm-sales-table th,
.swm-sales-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e1e1e1;
}

.swm-orders-table th,
.swm-sales-table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

/* 订单状态标签 */
.order-status {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

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

.status-completed {
    background: #d1ecf1;
    color: #0c5460;
}

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

/* 标签页样式 */
.swm-tabs {
    margin-bottom: 20px;
}

.swm-tab-nav {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    border-bottom: 1px solid #ddd;
}

.swm-tab-item {
    padding: 12px 24px;
    margin-right: 2px;
    cursor: pointer;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.swm-tab-item:hover {
    background: #e9ecef;
}

.swm-tab-item.active {
    background: #fff;
    border-bottom: 1px solid #fff;
    margin-bottom: -1px;
}

.swm-tab-content {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 0 4px 4px 4px;
    padding: 20px;
}

.swm-tab-pane {
    display: none;
}

.swm-tab-pane.active {
    display: block;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .work-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .purchase-work-button {
        margin-left: 0;
        margin-top: 10px;
    }
    
    .swm-orders-table,
    .swm-sales-table {
        font-size: 14px;
    }
    
    /* 标签页响应式设计 */
    .swm-tab-nav {
        flex-direction: column;
    }
    
    .swm-tab-item {
        margin-right: 0;
        margin-bottom: -1px;
        border-radius: 4px;
        border-bottom: 1px solid #ddd;
    }
    
    .swm-tab-item.active {
        border-bottom: 1px solid #fff;
    }
}

.student-works-dashboard,
.student-work-submission,
.student-works-gallery {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.works-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

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

.works-table th {
    background-color: #f8f9fa;
    font-weight: bold;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

/* 复选框标签样式 */
.form-group label.checkbox-label {
    display: inline-block;
    margin-bottom: 0;
    margin-right: 10px;
    font-weight: 500;
}

/* 将两个字段放到一行的容器样式 */
.form-row {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 20px;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

/* 为复选框组添加特殊样式，使其垂直居中对齐 */
.form-row .form-group.checkbox-group {
    display: flex;
    align-items: center;
    min-width: 200px;
}

/* 确保复选框和标签在同一行 */
.checkbox-group input[type="checkbox"] {
    display: inline-block;
    vertical-align: middle;
    margin-top: -1px;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group textarea,
.form-group input[type="file"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.submit-button {
    background-color: #6266ef;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.submit-button:hover {
    background-color: #005a87;
}

.works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.work-item {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: white;
}

.work-image {
    height: 200px;
    overflow: hidden;
}

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

.no-image {
    height: 100%;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
}

.work-details {
    padding: 15px;
}

.work-details h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
}

.work-excerpt {
    color: #666;
    margin-bottom: 10px;
}

.work-meta {
    margin-bottom: 15px;
}

.work-meta p {
    margin: 5px 0;
}

.for-sale-badge {
    background: #28a745;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    margin-left: 5px;
}

.view-work-button {
    display: inline-block;
    background: #007cba;
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 4px;
}

.view-work-button:hover {
    background: #005a87;
}

.swm-login-required {
    text-align: center;
    padding: 40px;
    background: #f8f9fa;
    border-radius: 8px;
}

.button {
    display: inline-block;
    padding: 8px 16px;
    background: #6c757d;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    margin-right: 10px;
}

.button:hover {
    background: #545b62;
    color: white;
}

.delete-work {
    background: #dc3545;
}

.delete-work:hover {
    background: #c82333;
}

/* WooCommerce集成样式 */
.accepted-payments {
    margin-top: 10px;
    font-size: 12px;
    color: #666;
}

.payment-method {
    display: inline-block;
    background: #f8f9fa;
    padding: 2px 8px;
    margin: 2px;
    border-radius: 3px;
    border: 1px solid #dee2e6;
}

.payment-methods-info {
    margin-top: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 4px solid #007cba;
}

/* 购物车中学生作品信息样式 */
.wc-item-meta {
    font-size: 0.875em;
    margin: 0.5em 0 0;
    padding: 0;
    list-style: none;
}

.wc-item-meta li {
    margin: 0.5em 0 0;
    padding: 0;
}

.wc-item-meta li strong {
    float: left;
    margin-right: 0.25em;
    clear: both;
}

/* 订单详情页样式 */
.woocommerce-order-details__student-work {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    margin: 20px 0;
    border-left: 4px solid #007cba;
}

.student-work-info h4 {
    margin: 0 0 10px 0;
    color: #2c3338;
}

.student-work-meta {
    margin: 10px 0;
}

.student-work-meta p {
    margin: 5px 0;
    font-size: 14px;
}