/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 750px;
    margin: 0 auto;
    background-color: #fff;
    min-height: 100vh;
    position: relative;
    padding: 20px;
    padding-bottom: 100px;
}

/* 活动标题 */
.activity-title {
    text-align: center;
    margin: 20px 0 15px 0;
}

.activity-title h1 {
    font-size: 26px;
    margin: 0;
    color: #333;
    font-weight: bold;
}

/* 主图 */
.main-image {
    margin: 15px 0 20px 0;
}

/* 紧凑活动信息 */
.activity-info-compact {
    margin: 0 0 20px 0;
    text-align: center;
}

.main-image img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

.info-row {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.info-badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    white-space: nowrap;
}

.class-badge {
    background-color: #e7f3ff;
    border-color: #b3d9ff;
    color: #0066cc;
}

.time-badge {
    background-color: #fff2e7;
    border-color: #ffcc99;
    color: #cc6600;
}

.badge-icon {
    margin-right: 6px;
    font-size: 12px;
}

.badge-label {
    font-weight: 600;
    margin-right: 4px;
    opacity: 0.8;
}

/* 活动信息 */
.activity-info {
    margin: 15px 0;
}

.info-item {
    margin: 12px 0;
    display: flex;
    align-items: center;
    padding: 8px 0;
}

.label {
    font-weight: bold;
    margin-right: 10px;
    min-width: 90px;
    color: #666;
    font-size: 15px;
}

.value {
    flex: 1;
    color: #333;
    font-size: 15px;
    font-weight: 500;
}

/* 活动描述 */
.activity-description {
    margin: 20px 0;
}

.activity-description h2,
.registration-list h2 {
    font-size: 20px;
    margin-bottom: 10px;
    color: #333;
    border-left: 4px solid #4A90E2;
    padding-left: 10px;
}

.activity-description p {
    color: #666;
    line-height: 1.8;
}

/* 接龙列表 */
.registration-list {
    margin: 20px 0;
}

.registration-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.registration-card {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 15px 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
}

.registration-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.registration-card.completed {
    background-color: #e8f5e9;
    cursor: not-allowed;
}

.registration-card.completed:hover {
    transform: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.user-index {
    position: absolute;
    top: 5px;
    left: 5px;
    font-size: 12px;
    color: #999;
}

.user-name {
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 10px;
    word-break: break-all;
}

.status-badge {
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 10px;
    display: inline-block;
}

.status-badge.completed {
    background-color: #4caf50;
    color: white;
}

.status-badge.pending {
    background-color: #ff9800;
    color: white;
}

.empty {
    color: #999;
    font-style: italic;
    padding: 20px 0;
    text-align: center;
}

/* 浮动按钮 */
.floating-buttons {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    max-width: 710px;
    z-index: 100;
    padding: 0 10px;
}

.buttons-container {
    display: flex;
    gap: 10px;
    background-color: white;
    border-radius: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 5px;
}

.main-button {
    flex: 5;
    padding: 12px 20px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    background-color: #4A90E2;
    color: white;
}

.learn-button {
    flex: 3;
    padding: 12px 10px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    background-color: #9c27b0;
    color: white;
}

.share-button {
    flex: 2;
    padding: 12px 10px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    background-color: #55acee;
    color: white;
}

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

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

.modal-content.video-modal {
    width: 90%;
    max-width: 800px;
}

/* 视频播放器样式 */
.video-modal video {
    width: 100%;
    max-width: 100%;
    border-radius: 8px;
    background: #000;
    object-fit: contain;
}

/* 视频错误提示样式 */
.video-error {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    margin-top: 10px;
}

.video-error ul {
    text-align: left;
    margin: 15px 0;
    padding-left: 20px;
}

.video-error li {
    margin: 8px 0;
    color: #666;
}

/* 微信播放提示 */
.wechat-play-tip {
    background: #e8f4fd;
    border: 1px solid #b3d9f7;
    border-radius: 4px;
    padding: 10px;
    margin: 10px 0;
}

/* 微信分享提示 */
.wechat-share-tip {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0;
    border-radius: 0 0 0 8px;
    animation: slideInFromRight 0.3s ease-out;
}

.share-tip-content {
    padding: 15px;
    max-width: 280px;
}

.share-tip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-weight: bold;
}

.share-tip-header .close-button {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    margin-left: 10px;
}

.share-tip-body p {
    margin: 5px 0;
    font-size: 14px;
}

.share-tip-arrow {
    text-align: right;
    font-size: 24px;
    margin-top: 10px;
}

@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

/* 分享模态框样式 */
.share-modal .modal-content {
    max-width: 500px;
    width: 90%;
}

.share-url-section {
    margin-bottom: 20px;
}

.share-url-section label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
}

.url-input-group {
    display: flex;
    gap: 10px;
}

.url-input-group input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: #f9f9f9;
}

.share-methods h4 {
    margin: 0 0 15px 0;
    color: #333;
}

.share-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.share-btn {
    flex: 1;
    min-width: 120px;
    padding: 12px 8px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.qq-btn {
    background: #12b7f5;
    color: white;
}

.qq-btn:hover {
    background: #0ea5e9;
}

.weibo-btn {
    background: #e6162d;
    color: white;
}

.weibo-btn:hover {
    background: #dc2626;
}

.qr-btn {
    background: #10b981;
    color: white;
}

.qr-btn:hover {
    background: #059669;
}

.share-icon {
    font-size: 16px;
}

/* 分享成功消息 */
.share-success-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #10b981;
    color: white;
    padding: 15px 25px;
    border-radius: 6px;
    z-index: 10000;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    animation: fadeInOut 0.3s ease-out;
}

@keyframes fadeInOut {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* 家长二维码模态框 */
.parent-qr-modal .modal-content {
    max-width: 400px;
    width: 90%;
}

.qr-loading {
    padding: 40px 20px;
    color: #666;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

/* 加载动画 */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4A90E2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.qr-content img {
    max-width: 280px;
    width: 100%;
    height: auto;
    border: 1px solid #ddd;
}

.qr-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.qr-actions .btn {
    min-width: 100px;
}

.qr-error {
    padding: 20px;
}

.qr-error p:first-child {
    font-size: 16px;
    margin-bottom: 10px;
}

/* 响应式优化 */
@media (max-width: 480px) {
    .share-buttons {
        flex-direction: column;
    }
    
    .share-btn {
        min-width: auto;
    }
    
    .url-input-group {
        flex-direction: column;
    }
    
    .qr-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .qr-actions .btn {
        width: 200px;
    }
}

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

.modal-header h3 {
    margin: 0;
}

.close-button {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.modal-body {
    padding: 20px;
}

.success-message {
    background-color: #e8f5e9;
    color: #4caf50;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    text-align: center;
}

/* 搜索框 */
.search-container {
    margin-bottom: 20px;
}

.search-container input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

/* 用户列表容器 */
.user-list-container {
    max-height: 400px;
    overflow-y: auto;
}

.user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
}

.user-item:hover {
    background-color: #f5f5f5;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: bold;
    font-size: 16px;
}

.user-class {
    font-size: 14px;
    color: #666;
}

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

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

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    font-family: inherit;
}

.form-group input[readonly] {
    background-color: #f5f5f5;
    color: #666;
    cursor: not-allowed;
}

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

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 30px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-secondary {
    background-color: #f5f5f5;
    color: #333;
}

.btn-primary {
    background-color: #4A90E2;
    color: white;
}

/* 视频样式 */
#learningVideo {
    width: 100%;
    height: auto;
    background-color: #000;
}

/* 用户信息显示 */
.registration-card .user-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-grow: 1;
}

.registration-card .user-name {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 4px;
}

.registration-card .learning-count {
    font-size: 12px;
    color: #666;
}

.user-item .learning-count {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
}

/* 操作选择模态框样式 */
.action-modal {
    max-width: 400px;
}

.user-info-display {
    display: flex;
    align-items: center;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 20px;
}

.user-avatar {
    font-size: 32px;
    margin-right: 15px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #e9ecef;
    border-radius: 50%;
}

.user-details {
    flex: 1;
}

.user-name-display {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 4px;
}

.user-class-display {
    font-size: 14px;
    color: #666;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.action-btn {
    display: flex;
    align-items: center;
    padding: 16px;
    border: 2px solid transparent;
    border-radius: 8px;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.complete-btn {
    border-color: #28a745;
}

.complete-btn:hover {
    background-color: #f8fff9;
    border-color: #20c997;
}

.share-btn {
    border-color: #007bff;
}

.share-btn:hover {
    background-color: #f8f9ff;
    border-color: #0056b3;
}

.action-btn .btn-icon {
    font-size: 24px;
    margin-right: 15px;
    min-width: 30px;
    text-align: center;
}

.btn-content {
    flex: 1;
}

.btn-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-bottom: 4px;
}

.btn-desc {
    font-size: 14px;
    color: #666;
}

/* 分享给家长模态框样式 */
.share-tip {
    display: flex;
    align-items: flex-start;
    background-color: #e7f3ff;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #007bff;
}

.tip-icon {
    font-size: 20px;
    margin-right: 10px;
    margin-top: 2px;
}

.share-tip p {
    margin: 0;
    color: #0056b3;
    font-size: 14px;
    line-height: 1.5;
}

.share-actions .btn .btn-icon {
    margin-right: 8px;
}

/* 分享表单提示样式 */
.share-tip-form {
    display: flex;
    align-items: center;
    background-color: #e8f5e8;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #28a745;
}

.share-tip-form .tip-icon {
    font-size: 20px;
    margin-right: 10px;
}

.share-tip-form p {
    margin: 0;
    color: #155724;
    font-size: 14px;
    line-height: 1.5;
}

.share-tip-form strong {
    color: #0f5132;
    font-weight: bold;
}

/* 搜索高亮样式 */
mark {
    background-color: #fff3cd;
    color: #856404;
    padding: 1px 2px;
    border-radius: 2px;
    font-weight: bold;
}

/* 搜索容器样式优化 */
.search-container {
    position: relative;
    margin-bottom: 15px;
}

.search-container input {
    width: 100%;
    padding: 10px 35px 10px 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.search-container input:focus {
    outline: none;
    border-color: #4A90E2;
    box-shadow: 0 0 5px rgba(74, 144, 226, 0.3);
}

.clear-search {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 18px;
    color: #999;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 50%;
    line-height: 1;
}

.clear-search:hover {
    background-color: #f0f0f0;
    color: #666;
}

/* 学习成功提示样式 */
.learning-success-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #28a745;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    z-index: 10000;
    animation: slideInRight 0.3s ease-out, fadeOut 0.3s ease-in 2.7s forwards;
}

.learning-success-toast .toast-icon {
    font-size: 20px;
    margin-right: 10px;
}

.learning-success-toast .toast-text {
    font-size: 14px;
    font-weight: bold;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

.share-info {
    margin: 20px 0;
}

.info-row {
    margin: 15px 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.info-row label {
    font-weight: bold;
    margin-right: 10px;
    min-width: 80px;
}

.link-container {
    display: flex;
    flex: 1;
    gap: 10px;
    align-items: center;
}

.link-container input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.link-container button {
    padding: 8px 15px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.link-container button:hover {
    background-color: #0056b3;
}

.share-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: center;
}

.share-actions .btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    min-width: 120px;
}

.share-actions .btn-primary {
    background-color: #28a745;
    color: white;
}

.share-actions .btn-primary:hover {
    background-color: #218838;
}

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

.share-actions .btn-secondary:hover {
    background-color: #545b62;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
        padding-bottom: 100px;
    }
    
    .activity-title h1 {
        font-size: 22px;
    }
    
    .activity-title {
        margin: 15px 0 10px 0;
    }
    
    .main-image {
        margin: 10px 0 15px 0;
    }
    
    .activity-info-compact {
        margin: 0 0 15px 0;
    }
    
    .info-row {
        gap: 10px;
    }
    
    .info-badge {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .badge-icon {
        font-size: 11px;
        margin-right: 4px;
    }
    
    .main-image img {
        border-radius: 10px;
    }
    
    .info-item {
        flex-direction: column;
        gap: 5px;
    }
    
    .label {
        min-width: auto;
    }
    
    .registration-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 10px;
    }
    
    .registration-card {
        padding: 10px 5px;
    }
    
    .user-name {
        font-size: 12px;
    }
    
    .buttons-container {
        gap: 5px;
        padding: 5px;
    }
    
    .main-button,
    .learn-button,
    .share-button {
        padding: 10px 5px;
        font-size: 14px;
    }
    
    .modal-content.video-modal {
        width: 95%;
        max-width: 95%;
    }
    
    .video-modal video {
        height: auto;
        min-height: 200px;
    }
    
    .video-error {
        padding: 15px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .action-modal {
        max-width: 95%;
        margin: 0 10px;
    }
    
    .user-info-display {
        padding: 15px;
    }
    
    .user-avatar {
        width: 40px;
        height: 40px;
        font-size: 24px;
        margin-right: 12px;
    }
    
    .user-name-display {
        font-size: 16px;
    }
    
    .user-class-display {
        font-size: 13px;
    }
    
    .action-btn {
        padding: 14px;
    }
    
    .action-btn .btn-icon {
        font-size: 20px;
        margin-right: 12px;
        min-width: 25px;
    }
    
    .btn-title {
        font-size: 15px;
    }
    
    .btn-desc {
        font-size: 13px;
    }
    
    .info-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .info-row label {
        margin-bottom: 5px;
    }
    
    .link-container {
        width: 100%;
    }
    
    .share-actions {
        flex-direction: column;
    }
    
    .share-actions .btn {
        width: 100%;
    }
}