/* 智能批改辅助平台 - 任务卡片样式 */

/* ==== 任务卡片 ==== */
.task-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    height: auto;
    min-height: 580px;
    display: flex;
    flex-direction: column;
}

.task-card:hover {
    transform: translateY(-2px);
}

/* ==== 任务头部 ==== */
.task-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.task-title-section {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.task-title {
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
    white-space: nowrap;
}

.student-name-input {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 0.9rem;
    color: #666;
    background: #f8f9fa;
    min-width: 100px;
    max-width: 150px;
    transition: border-color 0.3s ease;
}

.student-name-input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
}

.student-name-input::placeholder {
    color: #aaa;
}

.delete-btn {
    background: #f44336;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s ease;
}

.delete-btn:hover {
    background: #d32f2f;
}

/* ==== 输入区域 ==== */
.input-section {
    margin-bottom: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.input-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #555;
    font-size: 0.875rem;
}

.text-input {
    width: 100%;
    flex: 1;
    min-height: 80px;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.875rem;
    resize: none;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

.text-input:focus {
    outline: none;
    border-color: #667eea;
}

/* ==== 提交按钮 ==== */
.submit-btn {
    width: 100%;
    padding: 8px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease;
    margin-bottom: 12px;
}

.submit-btn:hover:not(:disabled) {
    background: #5a6fd8;
}

.submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* ==== 输出区域 ==== */
.output-section {
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
}

.output-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #555;
    font-size: 0.875rem;
}

.output-content {
    width: 100%;
    height: 200px;
    max-height: 200px;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    background: #f9f9f9;
    font-size: 0.875rem;
    line-height: 1.6;
    font-family: inherit;
    transition: border-color 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
    word-wrap: break-word;
    cursor: text;
}

.output-content:focus {
    outline: none;
    border-color: #667eea;
    background: white;
}

/* Placeholder 样式 */
.output-content.empty::before {
    content: attr(data-placeholder);
    color: #999;
    font-style: italic;
}

/* Markdown 内容样式 */
.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
    margin-top: 16px;
    margin-bottom: 8px;
    font-weight: 600;
    line-height: 1.25;
    color: #2c3e50;
}

.markdown-content h1 {
    font-size: 1.5em;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 8px;
}

.markdown-content h2 {
    font-size: 1.3em;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 6px;
}

.markdown-content h3 {
    font-size: 1.15em;
}

.markdown-content h4 {
    font-size: 1.05em;
}

.markdown-content h5,
.markdown-content h6 {
    font-size: 1em;
}

.markdown-content p {
    margin-top: 0;
    margin-bottom: 12px;
    line-height: 1.6;
}

.markdown-content strong {
    font-weight: 700;
    color: #1a1a1a;
}

.markdown-content em {
    font-style: italic;
}

.markdown-content ul,
.markdown-content ol {
    margin-top: 0;
    margin-bottom: 12px;
    padding-left: 24px;
}

.markdown-content li {
    margin-bottom: 4px;
    line-height: 1.6;
}

.markdown-content ul ul,
.markdown-content ol ul,
.markdown-content ul ol,
.markdown-content ol ol {
    margin-bottom: 0;
    margin-top: 4px;
}

.markdown-content blockquote {
    margin: 12px 0;
    padding: 8px 12px;
    border-left: 4px solid #667eea;
    background: #f5f7fa;
    color: #555;
}

.markdown-content blockquote p {
    margin-bottom: 0;
}

.markdown-content code {
    padding: 2px 6px;
    background: #f0f0f0;
    border-radius: 3px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    color: #e83e8c;
}

.markdown-content pre {
    margin: 12px 0;
    padding: 12px;
    background: #2d2d2d;
    border-radius: 6px;
    overflow-x: auto;
}

.markdown-content pre code {
    padding: 0;
    background: transparent;
    color: #f8f8f2;
    font-size: 0.85em;
    display: block;
}

.markdown-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 12px 0;
    border: 1px solid #e0e0e0;
}

.markdown-content th,
.markdown-content td {
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    text-align: left;
}

.markdown-content th {
    background: #f8f9fa;
    font-weight: 600;
}

.markdown-content tr:nth-child(even) {
    background: #f9f9f9;
}

.markdown-content a {
    color: #667eea;
    text-decoration: none;
}

.markdown-content a:hover {
    text-decoration: underline;
}

.markdown-content hr {
    border: none;
    border-top: 2px solid #e0e0e0;
    margin: 16px 0;
}

.markdown-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 8px 0;
}

/* ==== 复制按钮 ==== */
.copy-btn {
    width: 100%;
    padding: 6px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: background 0.3s ease;
}

.copy-btn:hover:not(:disabled) {
    background: #1976D2;
}

.copy-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* ==== 前置设置区域 ==== */
.preset-section {
    margin-bottom: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.preset-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: #f8f9fa;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid #e0e0e0;
}

.preset-header:hover {
    background: #e9ecef;
}

.preset-label {
    font-weight: 600;
    color: #555;
    font-size: 0.9rem;
}

.toggle-preset-btn {
    background: none;
    border: none;
    font-size: 0.8rem;
    color: #666;
    cursor: pointer;
    padding: 2px 4px;
    transition: transform 0.3s ease;
}

.toggle-preset-btn.collapsed {
    transform: rotate(-90deg);
}

.preset-content {
    padding: 12px;
}

.preset-content:not(.collapsed) {
    display: block;
}

.preset-content.collapsed {
    display: none !important;
}

.preset-field {
    margin-bottom: 12px;
}

.preset-field:last-child {
    margin-bottom: 0;
}

.field-label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
    color: #666;
    font-size: 0.85rem;
}

.original-text-input,
.reference-text-input {
    width: 100%;
    min-height: 60px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.85rem;
    resize: vertical;
    transition: border-color 0.3s ease;
    font-family: inherit;
    line-height: 1.4;
}

.original-text-input:focus,
.reference-text-input:focus {
    outline: none;
    border-color: #667eea;
}

/* ==== 任务信息区域 ==== */
.task-info-section {
    margin-top: 8px;
    padding: 8px 0;
    border-top: 1px solid #f0f0f0;
}

.task-info-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.task-id-info,
.task-time-info {
    font-size: 0.75rem;
    color: #999;
    font-family: 'Courier New', monospace;
    line-height: 1.3;
}

.task-id-info {
    word-break: break-all;
}

.task-time-info {
    font-weight: 500;
}

/* 进度条样式 */
.progress-container {
    margin: 15px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    animation: fadeIn 0.3s ease;
}

.progress-bar {
    width: 100%;
    height: 24px;
    background: #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4169E1, #5B7FEA);
    border-radius: 12px;
    position: relative;
    box-shadow: 0 2px 4px rgba(65, 105, 225, 0.3);
    transition: width 0.3s ease;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.progress-text {
    text-align: center;
    margin-top: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #495057;
}

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