/* ICO 生成器样式 */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #111827;
    background-color: #f9fafb;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 1.5rem 1rem 2.5rem;
}

.header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.page-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-size: 2rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 0.5rem;
}

.page-subtitle {
    margin: 0;
    font-size: 0.975rem;
    color: #6b7280;
}

.card {
    background: #ffffff;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1), 0 1px 2px rgba(15, 23, 42, 0.06);
    border: 1px solid #e5e7eb;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eef2ff;
}

.section-title svg {
    color: #4f46e5;
}

.upload-area {
    border: 2px dashed #c7d2fe;
    border-radius: 0.75rem;
    padding: 1.5rem 1.25rem;
    text-align: center;
    background: #f9fafb;
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.upload-area.dragover {
    border-color: #4f46e5;
    background: #eff6ff;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.upload-icon {
    width: 48px;
    height: 48px;
    border-radius: 999px;
    background: #eef2ff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4f46e5;
}

.upload-text p {
    margin: 0;
}

.upload-text p:first-child {
    font-size: 0.95rem;
    font-weight: 500;
    color: #111827;
}

.upload-subtext {
    font-size: 0.82rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

.file-info {
    font-size: 0.82rem;
    color: #4b5563;
    margin-top: 0.25rem;
}

.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1rem;
}

.btn {
    padding: 0.6rem 1.4rem;
    border-radius: 999px;
    border: none;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(79, 70, 229, 0.35);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #4338ca, #4f46e5);
    box-shadow: 0 10px 22px rgba(79, 70, 229, 0.45);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.35);
}

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

.btn-secondary:hover {
    background: #e5e7eb;
}

.main-actions {
    margin-top: 1.25rem;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.option-group {
    background: #f9fafb;
    border-radius: 0.75rem;
    padding: 0.9rem 0.9rem 0.8rem;
    border: 1px solid #e5e7eb;
}

.option-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.option-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.option-items-select {
    display: block;
}

.select-input {
    width: 100%;
    padding: 0.4rem 0.6rem;
    border-radius: 0.375rem;
    border: 1px solid #d1d5db;
    font-size: 0.85rem;
    color: #374151;
    background-color: #ffffff;
}

.select-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.option-chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    font-size: 0.8rem;
    color: #374151;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.option-chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.option-chip span {
    pointer-events: none;
}

.option-chip:hover {
    border-color: #c7d2fe;
    background: #eff6ff;
}

.option-chip input:checked + span,
.option-chip input:checked ~ span {
    color: #4338ca;
    font-weight: 600;
}

.option-chip input:checked ~ span::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 999px;
    border: 2px solid rgba(129, 140, 248, 0.7);
    pointer-events: none;
}

.preview-card {
    margin-top: 0.25rem;
}

.preview-wrapper {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 1.5rem;
    align-items: center;
}

#previewCanvas {
    width: 128px;
    height: 128px;
    border-radius: 0;
    background: transparent;
}

.preview-tip {
    margin-top: 0.75rem;
    font-size: 0.82rem;
    color: #6b7280;
}

/* 大图裁剪区域 */
.crop-container {
    margin-top: 1.2rem;
}

.crop-image-wrapper {
    position: relative;
    width: 100%;
    max-height: 420px;
    overflow: hidden;
    background: #e5e7eb;
}

.crop-image {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    user-select: none;
    -webkit-user-drag: none;
}

.crop-box {
    position: absolute;
    top: 0;
    left: 0;
    width: 160px;
    height: 160px;
    cursor: move;
    pointer-events: none;
}

.crop-box-mask,
.crop-box-border,
.crop-handle {
    pointer-events: auto;
}

.crop-box-mask {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.15);
}

.crop-box-border {
    position: absolute;
    inset: 0;
    border: 2px solid #3b82f6;
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.4);
}

.crop-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: #3b82f6;
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.3);
    cursor: nwse-resize;
}

.crop-handle-br {
    right: -6px;
    bottom: -6px;
}

.crop-tip {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #6b7280;
}

.preview-canvas-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    border-radius: 1rem;
    background: radial-gradient(circle at top left, #eef2ff, #e5e7eb);
}

.preview-meta {
    font-size: 0.88rem;
    color: #4b5563;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.preview-meta span:first-child {
    color: #6b7280;
}

.preview-meta strong {
    color: #111827;
}

.guide-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: #4b5563;
}

.guide-item {
    display: flex;
    gap: 0.6rem;
}

.guide-number {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: #eef2ff;
    color: #4f46e5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}

.guide-text code {
    background: #f3f4f6;
    padding: 0.05rem 0.25rem;
    border-radius: 0.25rem;
    font-size: 0.82rem;
}

/* 消息样式 */
.message {
    margin-top: 1rem;
    padding: 0.75rem 0.85rem;
    border-radius: 0.75rem;
    border-left: 4px solid;
    font-size: 0.86rem;
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    animation: slideIn 0.25s ease-out;
}

.message svg {
    flex-shrink: 0;
}

.message-error {
    background-color: #fef2f2;
    border-left-color: #ef4444;
    color: #b91c1c;
}

.message-success {
    background-color: #f0fdf4;
    border-left-color: #22c55e;
    color: #15803d;
}

.message-info {
    background-color: #eff6ff;
    border-left-color: #3b82f6;
    color: #1d4ed8;
}

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

/* 响应式 */
@media (max-width: 768px) {
    .container {
        padding: 1.25rem 0.85rem 2rem;
    }

    .page-title {
        font-size: 1.5rem;
    }

    .preview-wrapper {
        grid-template-columns: 1fr;
    }

    #previewCanvas {
        width: 96px;
        height: 96px;
    }
}


