* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 1200px;
    margin: 0 auto;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background-color: #4a90e2;
    color: white;
}

.settings-btn {
    background-color: transparent;
    border: 1px solid white;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.settings-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

main {
    display: flex;
    flex: 1;
}

.sidebar {
    width: 250px;
    background-color: #f9f9f9;
    border-right: 1px solid #eee;
    padding: 1rem;
}

.exercise-types {
    list-style: none;
    margin-top: 1rem;
}

.exercise-types li {
    padding: 0.75rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 0.5rem;
    transition: background-color 0.2s;
}

.exercise-types li:hover {
    background-color: #eee;
}

.exercise-types li.active {
    background-color: #4a90e2;
    color: white;
}

.content {
    flex: 1;
    padding: 1rem 2rem;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.image-card {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.2s;
}

.image-card:hover {
    transform: translateY(-5px);
}

.image-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.image-card .image-info {
    padding: 0.75rem;
    background-color: #fff;
}

.image-card h3 {
    font-size: 0.9rem;
    color: #000;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upload-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #4a90e2;
    color: white;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

.upload-btn:hover {
    background-color: #3a80d2;
}

.upload-btn::after {
    content: "+";
}

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

.dialog.active {
    display: flex;
}

.dialog-content {
    background-color: white;
    border-radius: 8px;
    padding: 2rem;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

.form-actions button {
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
}

.form-actions button[type="button"] {
    background-color: #f5f5f5;
    border: 1px solid #ddd;
}

.form-actions button[type="submit"] {
    background-color: #4a90e2;
    color: white;
    border: none;
}

/* 图片查看器样式 */
.image-viewer {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.image-viewer.active {
    display: flex;
}

.viewer-content {
    position: relative;
    width: 90%;
    height: 90%;
    display: flex;
    align-items: center;
}

.image-container {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.image-container img {
    max-width: 100%;
    max-height: 80%;
    object-fit: contain;
}

.image-info {
    margin-top: 1rem;
    color: white;
    text-align: center;
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    z-index: 2001;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s;
}

.nav-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.prev-btn {
    margin-right: 1rem;
}

.next-btn {
    margin-left: 1rem;
}

.loading {
    color: #999;
    font-style: italic;
}


/* 粘贴区域样式 */
.paste-area {
    width: 100%;
    height: 150px;
    border: 2px dashed #ddd;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    background-color: #f9f9f9;
    transition: border-color 0.3s;
}

.paste-area:hover, .paste-area:focus {
    border-color: #4a90e2;
}

.paste-placeholder {
    color: #999;
    text-align: center;
    padding: 1rem;
}

.paste-preview {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* 添加响应式设计 */
@media (max-width: 768px) {
    main {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #eee;
    }
    
    .content {
        padding: 1rem;
    }
    
    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .upload-btn {
        bottom: 1rem;
        right: 1rem;
    }
    
    .dialog-content {
        width: 95%;
        padding: 1.5rem;
    }
    
    .image-viewer .image-container {
        max-width: 95%;
    }
    
    .nav-btn {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }
    
    .config-dialog {
        width: 95%;
        max-width: none;
        padding: 1rem;
    }
}

/* 针对更小屏幕的设备 */
@media (max-width: 480px) {
    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    .image-card img {
        height: 150px;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .form-actions button {
        width: 100%;
    }
    
    .paste-area {
        height: 120px;
    }
}