:root {
    --page-bg: rgba(255, 255, 255, 0.18);
    --panel-bg: rgba(255, 255, 255, 0.26);
    --panel-border: rgba(255, 255, 255, 0.48);
    --soft-bg: rgba(255, 255, 255, 0.2);
    --text-main: #1f2937;
    --text-soft: #475569;
    --accent: #2563eb;
    --accent-strong: #1d4ed8;
    --success: #16a34a;
    --danger: #dc2626;
    --shadow: 0 20px 48px rgba(15, 23, 42, 0.16);
}

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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    padding: 20px;
    padding-top: 112px;
    color: var(--text-main);
    background: url('https://rustfs.sctserver.top:448/pearl-config-web/background-image.png') center/cover fixed no-repeat;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff22;
    z-index: -1;
    pointer-events: none;
}

.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--panel-border);
    background: rgba(255, 255, 255, 0.32);
    backdrop-filter: blur(18px) saturate(170%);
    -webkit-backdrop-filter: blur(18px) saturate(170%);
    box-shadow: var(--shadow);
    z-index: 20;
}

.brand {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: 0.02em;
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.nav-link {
    padding: 9px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.36);
    background: rgba(255, 255, 255, 0.18);
    color: var(--text-main);
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.nav-link:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.32);
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.12);
}

.nav-link.is-active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.92), rgba(37, 99, 235, 0.84));
    color: #fff;
    border-color: rgba(191, 219, 254, 0.84);
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.18);
}

.container {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

header {
    position: relative;
    text-align: center;
    color: #2d3748;
    margin-bottom: 24px;
    padding: 28px 32px;
    border-radius: 20px;
    border: 1px solid var(--panel-border);
    background: rgba(255, 255, 255, 0.24);
    backdrop-filter: blur(14px) saturate(170%);
    -webkit-backdrop-filter: blur(14px) saturate(170%);
    box-shadow: var(--shadow);
    text-shadow: 0 2px 4px rgba(255,255,255,0.8);
}

h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    color: #1a202c;
}

.subtitle {
    color: #4a5568;
    font-size: 1.1em;
    font-weight: 500;
}

.page-jump-btn {
    position: absolute;
    right: 0;
    top: 0;
    border: 1px solid rgba(255, 255, 255, 0.44);
    border-radius: 10px;
    padding: 8px 14px;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.86), rgba(22, 163, 74, 0.78));
    color: #fff;
    font-size: 0.9em;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 12px 24px rgba(22, 163, 74, 0.18);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.page-jump-btn:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.6), rgba(22, 163, 74, 0.42));
    box-shadow: 0 16px 28px rgba(22, 163, 74, 0.22);
}

.glass-card {
    background: var(--panel-bg);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    box-shadow: var(--shadow);
    transform: translateZ(0);
    will-change: transform;
    transition: backdrop-filter 0.3s ease;
}

.glass-card.no-blur {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(255, 255, 255, 0.85);
}

.upload-section {
    padding: 40px;
    margin-bottom: 20px;
}

.drop-zone {
    border: 3px dashed rgba(255, 255, 255, 0.6);
    border-radius: 16px;
    padding: 60px 40px;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.15);
    position: relative;
    overflow: hidden;
}

.drop-zone:hover {
    border-color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.drop-zone.drag-over {
    border-color: rgba(66, 153, 225, 0.8);
    background: rgba(66, 153, 225, 0.15);
    border-style: solid;
}

.drop-zone::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.drop-zone:hover::before {
    left: 100%;
}

.upload-icon {
    font-size: 64px;
    margin-bottom: 20px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.drop-text {
    font-size: 1.3em;
    color: #2d3748;
    margin-bottom: 10px;
    font-weight: 600;
}

.drop-hint {
    color: #4a5568;
    font-size: 0.95em;
}

.file-input {
    display: none;
}

.result-section {
    padding: 30px;
    display: none;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.4);
}

.result-title {
    font-size: 1.3em;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.status-badge {
    background: rgba(72, 187, 120, 0.9);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
}

.output-container {
    position: relative;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.output-header {
    background: rgba(255, 255, 255, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.4);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.output-label {
    color: #2d3748;
    font-size: 0.9em;
    font-family: monospace;
    font-weight: 600;
}

.copy-btn {
    background: rgba(72, 187, 120, 0.9);
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85em;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.copy-btn:hover {
    background: rgba(66, 153, 225, 0.9);
    transform: translateY(-1px);
}

.copy-btn.copied {
    background: rgba(72, 187, 120, 0.9);
}

pre {
    margin: 0;
    padding: 20px;
    color: #2d3748;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    background: rgba(255, 255, 255, 0.15);
    max-height: 70vh;
    min-height: 300px;
    overflow-y: auto;
}

.json-key {
    color: #2b6cb0;
    font-weight: 600;
}

.json-string {
    color: #c05621;
}

.json-number {
    color: #276749;
}

.error-section {
    background: rgba(254, 215, 215, 0.9);
    border-left: 4px solid #e53e3e;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
    display: none;
    color: #c53030;
}

.file-info {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    color: #2d3748;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.file-icon {
    font-size: 24px;
}

.clear-btn {
    background: rgba(229, 62, 62, 0.9);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.clear-btn:hover {
    background: rgba(197, 48, 48, 0.95);
    transform: translateY(-1px);
}

.upload-status {
    background: rgba(235, 248, 255, 0.9);
    border-left: 4px solid #4299e1;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    display: none;
    color: #2b6cb0;
    animation: slideUp 0.3s ease;
}

.upload-status.uploading {
    background: rgba(254, 252, 191, 0.9);
    border-left-color: #d69e2e;
    color: #975a16;
}

.upload-status.success {
    background: rgba(198, 246, 213, 0.9);
    border-left-color: #48bb78;
    color: #276749;
}

.upload-status.error {
    background: rgba(254, 215, 215, 0.9);
    border-left-color: #e53e3e;
    color: #c53030;
}

.cannon-input-section {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.cannon-input-title {
    font-size: 1.1em;
    color: #2d3748;
    margin-bottom: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.4);
}

.cannon-input-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.coords-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-group label {
    font-size: 0.85em;
    color: #4a5568;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-group input {
    padding: 12px 16px;
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.5);
    font-size: 1.1em;
    color: #2d3748;
    transition: all 0.2s;
    font-family: 'Consolas', 'Monaco', monospace;
    font-weight: 600;
}

.input-group input:focus {
    outline: none;
    border-color: #4299e1;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 4px rgba(66, 153, 225, 0.15);
    transform: translateY(-1px);
}

.input-group input::placeholder {
    color: #a0aec0;
    font-weight: 400;
}

.button-row {
    display: flex;
    justify-content: flex-end;
    padding-top: 8px;
}

.apply-btn {
    background: linear-gradient(135deg, rgba(66, 153, 225, 0.9), rgba(49, 130, 206, 0.95));
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 15px rgba(66, 153, 225, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
}

.apply-btn:hover {
    background: linear-gradient(135deg, rgba(49, 130, 206, 0.95), rgba(41, 112, 182, 0.95));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(66, 153, 225, 0.4);
}

.apply-btn:active {
    transform: translateY(0);
}

.apply-btn:disabled {
    background: rgba(160, 174, 192, 0.6);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.modified-badge {
    background: rgba(237, 137, 54, 0.9);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.author-section {
    margin-top: 40px;
    padding: 20px;
    text-align: center;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.author-text {
    color: #4a5568;
    font-size: 0.9em;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.author-name {
    color: #2d3748;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@media (max-width: 640px) {
    .coords-row {
        grid-template-columns: 1fr;
    }

    .button-row {
        justify-content: stretch;
    }

    .apply-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 600px) {
    body {
        padding: 10px;
        padding-top: 108px;
    }

    .topbar {
        padding: 12px;
        align-items: flex-start;
        flex-direction: column;
    }

    .nav-links {
        width: 100%;
        justify-content: flex-start;
    }

    .upload-section {
        padding: 20px;
    }

    pre {
        max-height: 60vh;
        min-height: 200px;
    }

    .cannon-input-section {
        padding: 16px;
    }

    .author-section {
        margin-top: 30px;
        padding: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}