/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
}

/* 导航栏 */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.navbar .container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.3s;
}

.nav-brand:hover {
    opacity: 0.8;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-logout {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    background-color: #e74c3c;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.btn-logout:hover {
    background-color: #c0392b;
}

/* 主内容 */
.main-content {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
    width: 100%;
    box-sizing: border-box;
}

/* 页脚 */
.footer {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 1rem 0;
    margin-top: 2rem;
    box-shadow: 0 -2px 8px rgba(102, 126, 234, 0.3);
}

/* 按钮 */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: #3498db;
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #2980b9;
}

.btn-primary {
    background-color: #3498db;
}

.btn-primary:hover {
    background-color: #2980b9;
}

/* 表单 */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-control:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.options-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.option-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.option-label:hover {
    background-color: #f0f0f0;
}

.option-label input[type="radio"],
.option-label input[type="checkbox"] {
    cursor: pointer;
}

.form-actions {
    margin-top: 2rem;
    text-align: center;
}

/* 用户信息页面 */
.user-info-page {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.user-info-page h1 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.info-tip {
    color: #7f8c8d;
    margin-bottom: 2rem;
}

.user-info-form {
    margin-top: 2rem;
}

/* 消息提示 */
.message {
    padding: 1rem;
    border-radius: 4px;
    margin-top: 1rem;
}

.message-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 首页 */
.home-page {
    max-width: 1000px;
    margin: 0 auto;
}

.home-page h1 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.btn-settings {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

.btn-settings:hover {
    background-color: #2980b9;
}

.settings-icon {
    font-size: 1.1rem;
}

.home-page h2 {
    color: #34495e;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.instruction-box {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.instruction-box p {
    margin-bottom: 0.5rem;
}

.instruction-box p:last-child {
    margin-bottom: 0;
}

/* 任务列表 */
.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 1rem;
}

.task-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.task-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.task-header h3 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.task-description {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.task-instruction {
    margin: 1rem 0;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.task-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 1rem 0;
    font-size: 0.9rem;
    color: #7f8c8d;
}

.task-actions {
    margin-top: 1rem;
    text-align: center;
}

.no-tasks {
    text-align: center;
    padding: 3rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 任务页面 */
.task-page {
    max-width: 1000px;
    margin: 0;
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

@media (min-width: 769px) {
    .task-page {
        margin-left: 0;
    }
}

.task-instruction-box {
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: 4px;
    margin: 1.5rem 0;
}

.upload-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #ddd;
}

/* 进度条 */
.progress-bar {
    width: 100%;
    height: 20px;
    background-color: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-fill {
    height: 100%;
    background-color: #3498db;
    width: 0%;
    transition: width 0.3s;
}

/* 错误页面 */
.error-page {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
}

.error-message {
    color: #e74c3c;
    font-size: 1.1rem;
    margin: 2rem 0;
}

.error-actions {
    margin-top: 2rem;
}

/* 录制页面样式 */
.record-page {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.record-container {
    margin: 2rem 0;
}

.section {
    margin: 2rem 0;
}

.task-video {
    width: 100%;
    max-width: 800px;
    margin: 1rem auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.preview-video {
    width: 100%;
    max-width: 800px;
    margin: 1rem auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.recorded-video {
    width: 100%;
    max-width: 800px;
    margin: 1rem auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.record-prompt {
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: 4px;
    margin: 1.5rem 0;
    font-size: 1.1rem;
    line-height: 1.6;
    text-align: center;
}

.record-controls {
    text-align: center;
    margin: 2rem 0;
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-danger {
    background-color: #e74c3c;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-danger:disabled {
    background-color: #95a5a6;
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-danger:disabled:hover {
    background-color: #95a5a6;
}

.btn-success {
    background-color: #27ae60;
}

.btn-success:hover {
    background-color: #229954;
}

.btn-secondary {
    background-color: #95a5a6;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

/* 任务说明页面样式 - 直接在task-content中，居中显示 */
#task-content.instruction-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem;
    max-width: 1000px;
    margin: 0 auto;
}

/* 移动端优化 */
@media (max-width: 768px) {
    #task-content.instruction-container {
        padding: 1rem;
    }
}

/* 任务说明标题居中 */
.instruction-title {
    color: #2c3e50;
    margin-bottom: 0.75rem;
    font-size: 1.5rem;
    text-align: center;
    width: 100%;
}

.instruction-content {
    margin-bottom: 0.1rem;
    line-height: 1.6;
    width: 100%;
    max-width: 100%;
}

.instruction-content p {
    margin-bottom: 0.1rem;
}

.permission-section {
    margin: 0.5rem 0;
    padding: 0.75rem 1rem;
    background-color: #f8f9fa;
    border-radius: 4px;
    width: 100%;
    max-width: 100%;
}

.permission-section h3 {
    color: #2c3e50;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.permission-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
    max-height: 3em;
}

.permission-list li {
    display: inline;
    margin-right: 0.5rem;
}

.permission-list li:not(:last-child)::after {
    content: '、';
}

.status-info {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #555;
}

.cache-section {
    margin: 0.5rem 0;
    width: 100%;
    max-width: 100%;
}

.cache-section h3 {
    color: #2c3e50;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.cache-item {
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.cache-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.cache-item-name {
    font-size: 0.9rem;
    color: #555;
}

.cache-item-status {
    font-size: 0.85rem;
    color: #7f8c8d;
}

.instruction-actions {
    margin-top: 1rem;
    text-align: center;
    width: 100%;
    max-width: 100%;
}

.instruction-actions .btn {
    min-width: 150px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .tasks-list {
        grid-template-columns: 1fr;
    }
    
    .user-info-page,
    .task-page,
    .record-page {
        padding: 1rem;
    }
    
    .instruction-page {
        padding: 0.75rem 1rem;
    }
    
    .instruction-page h1 {
        font-size: 1.3rem;
        margin-bottom: 0.75rem;
    }
    
    .instruction-content {
        margin-bottom: 0.75rem;
    }
    
    .permission-section {
        margin: 0.75rem 0;
        padding: 0.5rem 0.75rem;
    }
    
    .cache-section {
        margin: 0.75rem 0;
    }
    
    .instruction-actions {
        margin-top: 1rem;
    }
    
    .navbar .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-brand {
        font-size: 1.2rem;
    }
    
    .record-controls {
        flex-direction: column;
    }
    
    .record-controls .btn {
        width: 100%;
    }
}
