:root {
    --crop-panel: rgba(18, 21, 32, 0.7);
    --crop-panel-strong: rgba(21, 24, 37, 0.88);
    --crop-line: rgba(255, 255, 255, 0.08);
    --crop-muted: var(--text-sub, #9ea4b5);
    --crop-accent: #62d3c9;
    --crop-accent-2: #e3b76f;
    --crop-rose: #e08bb2;
}

* { box-sizing: border-box; }

body.crop-body {
    min-height: 100svh;
    color: var(--text, #e8e8ee);
    background: var(--bg-gradient, linear-gradient(135deg, #11131a, #1a1d29));
    font-family: "MiSans", "Microsoft YaHei", "Segoe UI", sans-serif;
}

body.crop-body::before { opacity: 0.028; }

.crop-main {
    width: min(1180px, calc(100% - 44px));
    margin: 0 auto;
    padding: 52px 0 70px;
}

.crop-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 28px;
}

.crop-hero-copy { min-width: 0; }

.crop-kicker,
.crop-step {
    margin: 0;
    color: var(--crop-accent);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.8px;
}

.crop-hero h1 {
    margin: 10px 0 0;
    font-size: clamp(36px, 6vw, 66px);
    line-height: 0.98;
    letter-spacing: 0;
}

.crop-subtitle {
    max-width: 660px;
    margin: 16px 0 0;
    color: var(--crop-muted);
    font-size: 14px;
    line-height: 1.7;
}

.crop-hero-note {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 9px;
    padding: 10px 13px;
    border: 1px solid rgba(98, 211, 201, 0.22);
    border-radius: 999px;
    color: #b9eee8;
    background: rgba(47, 164, 153, 0.08);
    font-size: 12px;
    white-space: nowrap;
}

.crop-note-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--crop-accent); box-shadow: 0 0 12px rgba(98, 211, 201, 0.8); }

.crop-upload-panel,
.crop-workspace,
.crop-results {
    border: 1px solid var(--crop-line);
    border-radius: 10px;
    background: var(--crop-panel);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(18px);
}

.crop-upload-panel {
    display: grid;
    grid-template-columns: minmax(200px, 0.36fr) minmax(0, 1fr);
    gap: 24px;
    align-items: center;
    padding: 20px;
}

.crop-upload-copy,
.crop-section-heading > div,
.crop-control-heading { display: flex; align-items: center; gap: 13px; }

.crop-upload-copy h2,
.crop-section-heading h2 {
    margin: 0;
    font-size: 20px;
    line-height: 1.2;
}

.crop-upload-copy p { margin: 7px 0 0; color: var(--crop-muted); font-size: 12px; }

.crop-dropzone {
    min-height: 112px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 5px;
    padding: 20px;
    border: 1px dashed rgba(98, 211, 201, 0.38);
    border-radius: 8px;
    color: var(--text, #e8e8ee);
    background: linear-gradient(135deg, rgba(98, 211, 201, 0.08), rgba(224, 139, 178, 0.07)), rgba(8, 10, 18, 0.3);
    cursor: pointer;
    text-align: center;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.crop-dropzone:hover,
.crop-dropzone.is-dragover { border-color: var(--crop-accent); background: rgba(98, 211, 201, 0.12); transform: translateY(-1px); }
.crop-dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.crop-dropzone strong { font-size: 15px; }
.crop-dropzone small { color: var(--crop-muted); font-size: 12px; }
.crop-drop-icon { color: var(--crop-accent); font-size: 25px; font-weight: 300; line-height: 1; }

.crop-workspace,
.crop-results { margin-top: 18px; padding: 20px; }
.crop-workspace,
.crop-results { scroll-margin-top: 78px; }
.crop-section-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; }
.crop-section-heading .crop-step { display: inline-block; align-self: flex-start; }
.crop-ghost-button,
.crop-download-all {
    width: auto;
    min-height: 38px;
    margin: 0;
    padding: 0 13px;
    border: 1px solid var(--crop-line);
    border-radius: 7px;
    color: var(--crop-muted);
    background: rgba(255, 255, 255, 0.035);
    font-size: 12px;
    cursor: pointer;
}
.crop-ghost-button:hover { color: var(--text); border-color: rgba(224, 139, 178, 0.38); background: rgba(224, 139, 178, 0.09); transform: none; box-shadow: none; }
.crop-download-all { color: #b9eee8; border-color: rgba(98, 211, 201, 0.28); background: rgba(98, 211, 201, 0.08); }
.crop-download-all:hover { background: rgba(98, 211, 201, 0.15); transform: translateY(-1px); box-shadow: none; }

.crop-editor-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(270px, 0.6fr); gap: 18px; align-items: start; }
.crop-canvas-panel { min-width: 0; }
.crop-canvas-topline { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 9px; color: var(--crop-muted); font-size: 12px; }
.crop-canvas { position: relative; width: 100%; aspect-ratio: var(--image-ratio); overflow: hidden; border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; background: #090b11; user-select: none; touch-action: none; }
.crop-canvas > img { display: block; width: 100%; height: 100%; object-fit: fill; }
.crop-zone-tint { position: absolute; left: 0; width: 100%; pointer-events: none; }
.crop-zone-keep-a,
.crop-zone-keep-b,
.crop-zone-keep-c { background: rgba(98, 211, 201, 0.08); }
.crop-zone-remove-a,
.crop-zone-remove-b { background: rgba(224, 139, 178, 0.2); box-shadow: inset 0 0 0 1px rgba(224, 139, 178, 0.28); }
.crop-line { position: absolute; left: 0; width: 100%; height: 0; z-index: 4; border-top: 2px solid currentColor; cursor: ns-resize; touch-action: none; }
.crop-line-a,
.crop-line-b { color: var(--crop-rose); }
.crop-line-c,
.crop-line-d { color: var(--crop-accent-2); }
.crop-line:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
.crop-line-label { position: absolute; left: 10px; top: -13px; display: grid; place-items: center; width: 25px; height: 25px; border-radius: 6px; color: #0e1418; background: currentColor; font-size: 11px; font-weight: 800; }
.crop-line-grip { position: absolute; top: -7px; left: 50%; width: 42px; height: 12px; margin-left: -21px; border: 1px solid currentColor; border-radius: 999px; background: rgba(12, 15, 22, 0.88); box-shadow: 0 4px 12px rgba(0,0,0,0.26); }
.crop-line-grip::before { content: ""; position: absolute; left: 50%; top: 3px; width: 14px; height: 3px; margin-left: -7px; border-top: 1px solid currentColor; border-bottom: 1px solid currentColor; }
.crop-canvas-hint { margin: 9px 0 0; color: var(--crop-muted); font-size: 11px; }

.crop-controls { display: grid; gap: 10px; }
.crop-control-card { padding: 14px; border: 1px solid var(--crop-line); border-radius: 8px; background: rgba(10, 13, 21, 0.34); }
.crop-control-heading { gap: 10px; }
.crop-control-heading strong { display: block; font-size: 13px; }
.crop-control-heading small { display: block; margin-top: 3px; color: var(--crop-muted); font-size: 11px; }
.crop-control-swatch { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 7px; color: #10151a; font-size: 11px; font-weight: 800; }
.crop-control-swatch-a { background: var(--crop-rose); }
.crop-control-swatch-b { background: var(--crop-rose); }
.crop-control-swatch-c { background: var(--crop-accent-2); }
.crop-control-swatch-d { background: #b7a0ff; }
.crop-control-swatch-output { background: var(--crop-accent); }
.crop-range-label { display: flex; justify-content: space-between; gap: 12px; margin: 14px 0 8px; color: var(--crop-muted); font-size: 11px; }
.crop-range-label output { color: var(--text); font-variant-numeric: tabular-nums; }
.crop-control-card input[type="range"] { width: 100%; height: 4px; margin: 0; accent-color: var(--crop-accent); cursor: pointer; }
.crop-control-card:nth-child(2) input[type="range"] { accent-color: var(--crop-rose); }
.crop-control-card:nth-child(3) input[type="range"] { accent-color: var(--crop-accent); }
.crop-control-card:nth-child(4) input[type="range"] { accent-color: var(--crop-accent-2); }
.crop-control-card-last { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.crop-output-card { display: block; }
.crop-output-sizes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 13px; }
.crop-output-sizes span { display: grid; gap: 3px; padding: 8px; border-radius: 6px; background: rgba(255,255,255,0.04); }
.crop-output-sizes b { color: var(--crop-muted); font-size: 10px; font-weight: 700; }
.crop-output-sizes em { color: var(--text); font-size: 10px; font-style: normal; white-space: nowrap; }
.crop-control-summary { text-align: right; }
.crop-control-summary span { display: block; color: var(--crop-muted); font-size: 11px; }
.crop-control-summary strong { display: block; margin-top: 3px; color: var(--crop-accent-2); font-size: 12px; letter-spacing: 1px; }
.crop-primary-button { width: 100%; min-height: 48px; margin: 2px 0 0; border: 1px solid rgba(98, 211, 201, 0.36); border-radius: 8px; color: #0f1719; background: linear-gradient(135deg, #62d3c9, #9bd7ba); font-size: 14px; font-weight: 800; cursor: pointer; transition: transform 0.2s ease, filter 0.2s ease; }
.crop-primary-button:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.06); box-shadow: 0 10px 24px rgba(98, 211, 201, 0.16); }
.crop-primary-button:disabled { opacity: 0.36; cursor: not-allowed; }
.crop-status { min-height: 17px; margin: 0; color: var(--crop-muted); font-size: 11px; line-height: 1.5; }
.crop-status.is-error { color: #f1a1b9; }
.crop-status.is-success { color: #a2e9d8; }

.crop-results.is-hidden,
.crop-workspace.is-hidden { display: none; }
.crop-result-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.crop-result-card { min-width: 0; overflow: hidden; border: 1px solid var(--crop-line); border-radius: 8px; background: var(--crop-panel-strong); }
.crop-result-image-wrap { display: grid; place-items: center; min-height: 130px; max-height: 440px; padding: 10px; background: rgba(5, 7, 12, 0.6); }
.crop-result-image { display: block; width: 100%; max-height: 420px; object-fit: contain; }
.crop-result-meta { display: flex; justify-content: space-between; gap: 12px; padding: 12px 12px 0; }
.crop-result-meta strong { font-size: 13px; }
.crop-result-meta span { color: var(--crop-muted); font-size: 11px; }
.crop-result-download { display: flex; align-items: center; justify-content: center; gap: 6px; width: calc(100% - 24px); min-height: 36px; margin: 10px 12px 12px; border: 1px solid rgba(98, 211, 201, 0.26); border-radius: 6px; color: #b9eee8; background: rgba(98, 211, 201, 0.07); font-size: 12px; text-decoration: none; }
.crop-result-download:hover { background: rgba(98, 211, 201, 0.14); transform: none; }
.crop-footer { margin: 36px 0 0; color: rgba(255,255,255,0.34); font-size: 11px; text-align: center; }

@media (max-width: 860px) {
    .crop-main { width: min(100% - 28px, 720px); padding-top: 34px; }
    .crop-hero { align-items: flex-start; flex-direction: column; gap: 16px; }
    .crop-editor-grid { grid-template-columns: 1fr; }
    .crop-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .crop-control-card-last { grid-column: 1 / -1; }
    .crop-primary-button, .crop-status { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
    .crop-main { width: min(100% - 20px, 540px); padding: 25px 0 78px; }
    .crop-hero h1 { font-size: clamp(34px, 12vw, 48px); }
    .crop-upload-panel { grid-template-columns: 1fr; gap: 16px; padding: 15px; }
    .crop-workspace, .crop-results { padding: 15px; }
    .crop-section-heading { align-items: flex-start; }
    .crop-section-heading h2 { font-size: 18px; }
    .crop-controls { grid-template-columns: 1fr; }
    .crop-control-card-last, .crop-primary-button, .crop-status { grid-column: auto; }
    .crop-result-grid { grid-template-columns: 1fr; }
    .crop-result-image-wrap { max-height: none; }
    .crop-result-image { max-height: 560px; }
}
