/* 前端样式 */

/* 全局 box-sizing 设置 */
*, *::before, *::after {
    box-sizing: border-box;
}

/* 基础响应式网格 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.col-12 {
    flex: 0 0 100%;
    max-width: 100%;
    padding: 0 15px;
    box-sizing: border-box;
}

.col-md-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
    padding: 0 15px;
    box-sizing: border-box;
}

.col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
    padding: 0 15px;
    box-sizing: border-box;
}

.col-md-8 {
    flex: 0 0 66.666667%;
    max-width: 66.666667%;
    padding: 0 15px;
    overflow-wrap: break-word;
    word-wrap: break-word;
    box-sizing: border-box;
}

.col-lg-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
    padding: 0 15px;
    box-sizing: border-box;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

@media (max-width: 767px) {
    .col-md-4, .col-md-6, .col-md-8, .col-lg-4 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* 按钮样式 */
.button {
    display: inline-block;
    padding: 10px 20px;
    background: #0073aa;
    color: #fff;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

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

.button-primary {
    background: #0073aa;
}

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

.button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 表单元素 */
input[type="text"],
input[type="url"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="datetime-local"],
textarea,
select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.4;
    transition: border-color 0.2s ease;
    border-color: #1E4F8C !important;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

input[readonly] {
    background: #f9f9f9;
    cursor: not-allowed;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .row {
        flex-direction: column;
    }
    
    .col-md-8,
    .col-md-4 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* 任务归档页面样式 */
.kos-task-archive-container {
    padding: 2rem 0;
    background-color: #f8f9fa;
    min-height: 100vh;
}

.page-header {
    text-align: center;
    margin-bottom: 2rem;
}

.page-title {
    color: #2c3e50;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.page-description {
    color: #7f8c8d;
    font-size: 1.1rem;
}

.task-filters {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 搜索区域 */
.search-section {
    margin-bottom: 1.5rem;
}

.search-form {
    max-width: 400px;
}

.search-input {
    box-sizing: border-box;
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: #1E4F8C;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

/* 状态筛选标签 */
.status-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.status-tag {
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    color: #6c757d;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

.status-tag:hover {
    background: #e9ecef;
    color: #495057;
    text-decoration: none;
}

.status-tag.active {
    background: #1E4F8C;
    color: white;
    border-color: #1E4F8C;
}

.filter-form {
    display: flex;
    gap: 1rem;
    align-items: end;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2c3e50;
}

.filter-group select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-width: 150px;
}

.task-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.task-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.task-card-header {
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid #eee;
    position: relative;
}

.task-title {
    margin: 0;
    font-size: 1.25rem;
    margin-top: 30px;
    margin-bottom: 15px;
}

.task-title a {
    color: #2c3e50;
    text-decoration: none;
}

.task-title a:hover {
    color: #1E4F8C;
}

.task-status-badge {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

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

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

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

.status-expired {
    background: #e2e3e5;
    color: #383d41;
}

.task-card-body {
    padding: 1rem 1.5rem;
    flex-grow: 1;
}

.task-excerpt {
    margin-bottom: 1rem;
    color: #6c757d;
    line-height: 1.5;
}

/* 任务元信息区域 - 统一2x2网格布局 */
.task-meta {
    background: #f8f9fa;
    padding: 0.75rem;
    border-radius: 6px;
    margin-top: 1rem;
    border: 1px solid #e9ecef;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem 1rem;
}

.task-meta > div {
    margin-bottom: 0;
    font-size: 0.9rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.task-participation {
    flex-wrap: wrap;
}

.participation-details {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 0.5rem;
    margin-top: 4px;
}

.participation-text {
    font-size: 0.85rem;
    color: #6c757d;
    white-space: nowrap;
}

/* 统一所有meta项的样式 */
.task-start-time,
.task-end-time,
.task-platforms,
.task-progress {
    margin-bottom: 0;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.task-meta .dashicons {
    color: #6c757d;
    font-size: 16px;
}

/* 时间信息一行显示 */
.task-time-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem !important;
    font-size: 0.85rem;
}

.created-time,
.end-time {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: #6c757d;
}

.end-time {
    color: #e74c3c;
}

.end-time .dashicons {
    color: #e74c3c;
}

.progress-bar-wrapper {
    flex-grow: 1;
    height: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    transition: width 0.3s ease;
}

.task-card-footer {
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    display: inline-block;
}

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

.btn-primary:hover {
    background: #2980b9;
    color: white;
}

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

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

.task-hint {
    font-size: 0.8rem;
    color: #28a745;
    font-weight: 500;
}

.no-tasks-found {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state {
    background: white;
    padding: 3rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    max-width: 400px;
    margin: 0 auto;
}

.empty-state .dashicons {
    font-size: 4rem;
    color: #bdc3c7;
    margin-bottom: 1rem;
}

.empty-state h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.empty-state p {
    color: #7f8c8d;
}

.pagination-wrapper {
    margin-top: 3rem;
    text-align: center;
}

.page-numbers {
    display: inline-flex;
    gap: 0.5rem;
}

.page-numbers a,
.page-numbers span {
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #2c3e50;
}

.page-numbers a:hover,
.page-numbers .current {
    background: #1E4F8C;
    color: white;
    border-color: #1E4F8C;
}

/* ===== 任务归档页面响应式设计 ===== */
@media (max-width: 768px) {
    .filter-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .filter-group select {
        min-width: 100%;
    }
    
    .status-filters {
        justify-content: center;
    }
    
    .status-tag {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    .task-card-footer {
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
    }
    
    .btn {
        text-align: center;
    }
    
    /* 移动端meta区域紧凑布局 - 保持2行2列 */
    .task-meta {
        padding: 0.5rem;
        margin-top: 0.5rem;
        gap: 0.4rem 0.8rem;
    }
    
    .task-meta > div {
        font-size: 0.8rem;
        gap: 0.25rem;
    }
    
    /* 压缩图标和文字间距 */
    .task-meta .dashicons {
        font-size: 14px;
        margin-right: 2px;
    }
}

/* ===== 单任务页面样式 ===== */

/* 任务详情页面布局 */
.nks-task-single {
    margin: 40px auto;
    max-width: 1200px;
}

/* 任务内容容器 */
.task-content {
    overflow-wrap: break-word;
    word-wrap: break-word;
    max-width: 100%;
    box-sizing: border-box;
}

/* 任务头部区域 */
.task-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}


/* 单任务页面的task-meta样式 */
.nks-task-single .task-meta {
    display: flex;
    gap: 20px;
    color: #666;
    font-size: 14px;
    background: none;
    padding: 0;
    border: none;
    margin-top: 0;
    grid-template-columns: none;
}

.nks-task-single .task-meta i {
    margin-right: 5px;
}

/* 任务内容区域 */
.task-description {
    margin-bottom: 30px;
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

/* 任务描述内的所有元素宽度控制 */
.task-description * {
    max-width: 100%;
    box-sizing: border-box;
}

/* 任务描述内的段落样式 */
.task-description p {
    margin-bottom: 1em;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin-left: 0;
    margin-right: 0;
}

/* 任务描述内的长链接处理 */
.task-description a {
    word-break: break-all;
    overflow-wrap: break-word;
}

/* 任务描述内的代码块和预格式化文本 */
.task-description pre,
.task-description code {
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    overflow-x: auto;
}

.task-requirements,
.task-settings {
    margin-bottom: 30px;
}

.task-requirements h3,
.task-settings h3,
.task-description h3 {
    margin-bottom: 15px;
    font-size: 18px;
}

/* 平台列表样式 */
.platform-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.platform-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f9f9f9;
    border-radius: 6px;
    border: 0px solid #ddd;
    transition: all 0.3s ease;
}

.platform-item:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.platform-item.requirement-required {
    border-color: #1E4F8C;
    background: #f8fbff;
}

.platform-item.requirement-optional {
    border-color: #95a5a6;
    background: #f8f9fa;
}

/* 平台要求图标 */
.requirement-icon {
    font-size: 14px;
    font-weight: 600;
    margin-left: auto;
}

.requirement-required .requirement-icon {
    color: #e74c3c;
}

.requirement-optional .requirement-icon {
    color: #95a5a6;
}

.requirement-icon i {
    cursor: help;
    display: inline-block;
    width: 16px;
    height: 16px;
    text-align: center;
    line-height: 16px;
    border-radius: 50%;
}

.requirement-required .requirement-icon i {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
}

.requirement-optional .requirement-icon i {
    background: rgba(149, 165, 166, 0.1);
    color: #95a5a6;
}

/* 设置列表样式 */
.settings-list {
    list-style: none;
    padding: 0;
}

.settings-list li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.setting-label {
    font-weight: 500;
    margin-right: 10px;
}

/* ===== 任务提交模块样式 ===== */

/* 提交表单容器 */
.nks-submission-wrapper {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px;
}

.nks-submission-wrapper h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 18px;
}

/* 任务状态显示 */
.nks-task-status {
    margin-bottom: 20px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
}

/* 任务时间提醒 */
.task-time-notice {
    margin-top: 10px;
    padding: 10px;
    border-radius: 4px;
    border-left: 4px solid;
}

.task-time-notice.task-not-started {
    background: #fff3cd;
    border-left-color: #ffc107;
    color: #856404;
}

.task-time-notice.task-ended {
    background: #f8d7da;
    border-left-color: #dc3545;
    color: #721c24;
}

.task-time-notice p {
    margin: 5px 0;
}

/* 任务状态样式 - 统一状态颜色系统 */
.status-not_started {
    color: #6c757d;
}

.status-in_progress {
    color: #fd7e14;
}

.status-completed {
    color: #28a745;
}

.status-locked {
    color: #dc3545;
}

/* 提交表单布局 */
.nks-unified-submission-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 平台分组样式 */
.nks-platform-group {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

.platform-header h4 {
    margin: 0 0 15px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
}

.required {
    color: #dc3545;
}

/* 提交状态标签 - 复用并扩展状态系统 */
.submission-status {
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 2px;
    color: #fff;
}

.submission-status.status-pending {
    background: #fd7e14;
}

.submission-status.status-approved {
    background: #28a745;
}

.submission-status.status-rejected {
    background: #dc3545;
}

/* ===== 表单元素样式 ===== */

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

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

/* 输入框和文本域样式 */
.form-group input[type="url"],
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s ease;
    resize: vertical;
}

.form-group input[type="url"]:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 1px #007cba;
}

.form-group input[type="url"][readonly],
.form-group textarea[readonly] {
    background-color: #f1f1f1;
    color: #666;
}

.form-group textarea {
    min-height: 80px;
    line-height: 1.4;
}

.form-group input[type="url"][disabled] {
    background-color: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
    border-color: #ced4da;
}

/* 输入框带操作按钮 */
.input-with-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.input-with-actions input[type="url"] {
    flex: 1;
}

/* 审核备注样式 */
.review-notes {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    padding: 10px;
    border-radius: 4px;
    margin-top: 10px;
}

.review-notes label {
    font-weight: 600;
    margin-bottom: 5px;
    display: block;
    color: #856404;
}

.review-notes p {
    margin: 0;
    color: #856404;
    font-size: 13px;
}

/* 表单操作区域 */
.form-actions {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.nks-submit-btn {
    min-width: 120px;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: 500;
}

/* 登录提示 */
.login-notice {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 4px;
}

/* ===== 单任务页面响应式设计 ===== */
@media (max-width: 768px) {
    .row {
        flex-direction: column;
    }

    .col-md-8,
    .col-md-4 {
        width: 100%;
    }

    .task-meta {
        flex-direction: column;
        gap: 10px;
    }

    /* 移动端任务描述样式优化 */
    .task-description {
        font-size: 14px;
        line-height: 1.5;
    }

    .task-description p {
        margin-bottom: 0.8em;
    }

    .input-with-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .input-with-actions input[type="url"] {
        margin-bottom: 10px;
    }
}
