/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #ffffff;
    color: #1f2937;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

/* 导航栏 */
.navbar {
    background-color: #ffffff;
    border-bottom: 1px solid #e5e7eb;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.5rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-title {
    font-size: 1.25rem;
    font-weight: bold;
    color: #111827;
}

.nav-description {
    font-size: 0.875rem;
    color: #4b5563;
    margin-top: 0.25rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: #4b5563;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: #3b82f6;
}

.btn-home {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    color: #374151;
    transition: all 0.3s ease;
}

.btn-home:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}

/* 主内容区 */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
}

/* 上传区域 */
.upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 0.75rem;
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-area:hover, .upload-area.dragover {
    border-color: #3b82f6;
    background-color: #eff6ff;
}

.upload-icon {
    font-size: 4rem;
    color: #9ca3af;
    margin-bottom: 1rem;
}

.upload-text {
    font-size: 1.125rem;
    color: #4b5563;
    margin-bottom: 0.5rem;
}

.upload-hint {
    font-size: 0.875rem;
    color: #6b7280;
}

/* 卡片网格 */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
}

.tool-card {
    display: block;
    background-color: #ffffff;
    border-radius: 0.75rem;
    padding: 2rem;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}

.tool-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.tool-icon-wrapper {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    background-color: #eff6ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.tool-card:hover .tool-icon-wrapper {
    background-color: #dbeafe;
}

.tool-icon {
    font-size: 1.5rem;
    color: #3b82f6;
}

.tool-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.5rem;
    text-align: center;
}

.tool-desc {
    font-size: 0.875rem;
    color: #4b5563;
    text-align: center;
}

/* 按钮样式 */
.btn {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background-color: #3b82f6;
    color: #ffffff;
}

.btn-primary:hover {
    background-color: #2563eb;
}

.btn-success {
    background-color: #10b981;
    color: #ffffff;
}

.btn-success:hover {
    background-color: #059669;
}

.btn-info {
    background-color: #06b6d4;
    color: #ffffff;
}

.btn-info:hover {
    background-color: #0891b2;
}

.btn-outline {
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    color: #374151;
}

.btn-outline:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}

.btn-danger {
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    color: #374151;
}

.btn-danger:hover {
    border-color: #ef4444;
    color: #ef4444;
}

/* 表单元素 */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.3s ease;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: #3b82f6;
}

.form-textarea {
    font-family: "Consolas", "Monaco", "Courier New", monospace;
    resize: vertical;
    min-height: 200px;
}

.form-range {
    width: 100%;
    height: 0.5rem;
    background-color: #e5e7eb;
    border-radius: 0.5rem;
    appearance: none;
    cursor: pointer;
}

.form-range::-webkit-slider-thumb {
    appearance: none;
    width: 1rem;
    height: 1rem;
    background-color: #3b82f6;
    border-radius: 50%;
    cursor: pointer;
}

/* 面板/卡片 */
.panel {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    overflow: hidden;
}

.panel-header {
    background-color: #f9fafb;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 500;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.panel-body {
    padding: 1rem;
}

.panel-gray {
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.5rem;
}

/* 网格布局 */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

@media (max-width: 1024px) {
    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }
}

/* 状态栏 */
.status-bar {
    margin-top: 1.5rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    display: none;
}

.status-bar.success {
    display: block;
    background-color: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.status-bar.error {
    display: block;
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Canvas */
.canvas-container {
    position: relative;
    min-height: 400px;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

canvas {
    max-width: 100%;
    cursor: crosshair;
}

.crop-overlay {
    position: absolute;
    border: 2px solid #3b82f6;
    background-color: rgba(59, 130, 246, 0.1);
    cursor: move;
}

/* 预览容器 */
.preview-container {
    min-height: 500px;
    background-color: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.preview-image {
    max-width: 100%;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.placeholder-text {
    text-align: center;
    color: #9ca3af;
}

.placeholder-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.loading-indicator {
    text-align: center;
}

.spinner {
    font-size: 2.5rem;
    color: #3b82f6;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 工具栏 */
.toolbar {
    margin-bottom: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* 信息文本 */
.info-text {
    font-size: 0.75rem;
    color: #6b7280;
}

.file-info {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.file-info-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.file-info-item {
    font-size: 0.75rem;
    color: #4b5563;
    margin-bottom: 0.25rem;
}

/* 隐藏类 */
.hidden {
    display: none !important;
}

/* 页脚 */
.footer {
    background-color: #f9fafb;
    border-top: 1px solid #e5e7eb;
    margin-top: 5rem;
    padding: 2rem 0;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    text-align: center;
    color: #4b5563;
    font-size: 0.875rem;
}

/* 标题区域 */
.hero-section {
    text-align: center;
    margin-bottom: 4rem;
}

.hero-title {
    font-size: 2.25rem;
    font-weight: bold;
    color: #111827;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: #4b5563;
}
