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

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f4f6fb;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    transition: background-color 0.2s;
}

.card {
    max-width: 1400px;
    width: 100%;
    background: rgba(255,255,255,0.7);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: 2.5rem;
    box-shadow: 0 20px 40px -12px rgba(0,20,40,0.25), 0 4px 18px rgba(0,0,0,0.05);
    padding: 2rem 2rem 2rem 2rem;
    border: 1px solid rgba(255,255,255,0.5);
}

/* 语言切换 & 头部 */
.header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    background: #1e2b3c;
    width: 40px;
    height: 40px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

h1 {
    font-size: 1.7rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: #1e2b3c;
}

.lang-switch {
    display: flex;
    gap: 6px;
    background: rgba(0,0,0,0.03);
    padding: 4px;
    border-radius: 40px;
    border: 1px solid rgba(0,0,0,0.06);
}

.lang-btn {
    border: none;
    background: transparent;
    padding: 0.5rem 1.2rem;
    border-radius: 32px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: 0.15s;
    color: #3b4a5c;
}

.lang-btn.active {
    background: white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
    color: #111;
    font-weight: 600;
}

/* 上传区域 */
.upload-area {
    margin-bottom: 2rem;
    background: rgba(255,255,255,0.6);
    border-radius: 1.5rem;
    padding: 0.67rem;
    border: 2px dashed #cbd5e1;
    transition: all 0.3s;
    cursor: pointer;
    text-align: center;
}

.upload-area:hover {
    border-color: #94a3b8;
    background: rgba(255,255,255,0.8);
}

.upload-area.drag-over {
    border-color: #1e2f40;
    background: rgba(30,47,64,0.05);
    border-style: solid;
}

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

.upload-icon {
    font-size: 1rem;
    color: #94a3b8;
}

.upload-text {
    font-size: 1.1rem;
    font-weight: 500;
    color: #3b4a5c;
}

.upload-hint {
    font-size: 0.9rem;
    color: #7c8fa1;
}

input[type="file"] {
    display: none;
}

/* 主内容区：预览左侧80% + 右侧面板 */
.main-panel {
    display: flex;
    gap: 1.8rem;
    flex-wrap: nowrap;
    align-items: flex-start;
}

.preview-area {
    flex: 4 1 70%;
    min-width: 300px;
    max-width: calc(80% - 0.9rem);
    background: #fafcff;
    border-radius: 2rem;
    padding: 1.5rem;
    box-shadow: inset 0 2px 10px rgba(55,84,120,0.05), 0 8px 18px -8px rgba(30,40,60,0.15);
    border: 1px solid rgba(255,255,255,0.9);
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    color: #2f3e4e;
    font-weight: 500;
}

.preview-header span:first-child {
    display: flex;
    align-items: center;
    gap: 8px;
}

.image-container {
    width: 100%;
    background: #eef2f7;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 380px;
    border: 2px dashed #cbd5e1;
    transition: border 0.2s;
    overflow: auto;
    padding: 1rem;
}

.image-container.has-image {
    border-style: solid;
    border-color: #a0b8d0;
    background: #f6faff;
}

.preview-img {
    max-width: 100%;
    max-height: 500px;
    width: auto;
    height: auto;
    object-fit: contain;
    box-shadow: 0 10px 25px -10px rgba(0,0,0,0.2);
}

/* 右侧信息卡 */
.info-area {
    flex: 1 1 20%;
    min-width: 240px;
    background: rgba(255,255,255,0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 2rem;
    padding: 1.8rem 1.5rem;
    border: 1px solid rgba(255,255,255,0.8);
    box-shadow: 0 10px 25px -15px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    gap: 1.8rem;
}

.info-group {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    font-size: 1rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.info-label {
    color: #546e7a;
    font-weight: 450;
}

.info-value {
    font-weight: 600;
    color: #0b1e2c;
    background: rgba(200,215,230,0.3);
    padding: 0.2rem 0.8rem;
    border-radius: 40px;
}

.size-options {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.size-btn {
    border: 1.5px solid rgba(200,215,230,0.5);
    background: rgba(255,255,255,0.8);
    color: #3b4a5c;
    padding: 0.35rem 0.8rem;
    border-radius: 24px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.size-btn:hover {
    background: rgba(220,230,240,0.9);
    border-color: #94a3b8;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
}

.size-btn.active {
    background: linear-gradient(135deg, #1e2f40 0%, #2a4055 100%);
    color: white;
    font-weight: 600;
    border-color: #1e2f40;
    box-shadow: 0 4px 8px rgba(30,47,64,0.3);
    transform: translateY(-1px);
}

.url-input-row {
    display: flex;
    gap: 8px;
    margin-top: 0.75rem;
    width: 100%;
    max-width: 460px;
}

.url-input {
    flex: 1;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    border: 1px solid rgba(148,163,184,0.7);
    font-size: 0.9rem;
    outline: none;
    transition: all 0.15s;
}

.url-input:focus {
    border-color: #1e2f40;
    box-shadow: 0 0 0 1px rgba(30,47,64,0.4);
}

.url-btn {
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    border: none;
    background: #1e2f40;
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.url-btn:hover {
    background: #2a4055;
}

.url-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.divider {
    height: 2px;
    background: linear-gradient(90deg, transparent, #b3c7db, transparent);
    margin: 0.5rem 0;
}

.btn-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 1rem;
}

.btn {
    border: none;
    padding: 1rem 0;
    border-radius: 40px;
    font-weight: 600;
    font-size: 1rem;
    background: white;
    color: #1e2b3c;
    box-shadow: 0 5px 12px rgba(0,20,40,0.08);
    cursor: pointer;
    transition: 0.15s;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: #1e2f40;
    color: white;
    box-shadow: 0 10px 18px -8px #1e2f4050;
}

.btn-primary:hover {
    background: #2a4055;
    transform: scale(1.02);
}

.btn-outline {
    background: transparent;
    border: 1.5px solid #b7ccde;
}

.btn-outline:hover {
    background: #eef3f9;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Modal 裁剪弹窗 */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(30,40,55,0.6);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #ffffffec;
    border-radius: 2.5rem;
    max-width: 800px;
    width: 90%;
    padding: 2rem;
    box-shadow: 0 30px 60px rgba(0,10,30,0.3);
    border: 1px solid rgba(255,255,255,0.7);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: #5f7d9c;
    padding: 0 10px;
}

.crop-container {
    width: 100%;
    max-height: 60vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    background: #1e262f0f;
    border-radius: 30px;
    padding: 10px;
}

#cropImage {
    max-width: 100%;
    max-height: 60vh;
    object-fit: contain;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    margin-top: 2rem;
}

.modal-btn {
    padding: 0.9rem 2.2rem;
    border-radius: 40px;
    border: none;
    font-weight: 600;
}

/* 小提示 */
.hint {
    font-size: 0.8rem;
    color: #5b7a99;
    margin-top: 0.6rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

footer {
    margin-top: 2rem;
    text-align: center;
    color: #9aafc4;
    font-size: 0.8rem;
}

@media (max-width: 700px) {
    .card { padding: 1.5rem; }
    .main-panel { 
        flex-direction: column;
        flex-wrap: wrap;
    }
    .preview-area { 
        flex: 1 1 100%;
        max-width: 100%;
    }
    .info-area {
        flex: 1 1 100%;
    }
    .upload-area { padding: 0.67rem; }
}
