:root {
    --text-main: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.85);
    --glass-bg: rgba(255, 255, 255, 0.03); /* 更透彻 */
    --glass-border-top: rgba(255, 255, 255, 0.6);
    --glass-border-left: rgba(255, 255, 255, 0.4);
    --glass-border-bottom: rgba(255, 255, 255, 0.05);
    --glass-border-right: rgba(255, 255, 255, 0.05);
    --glass-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
    --input-bg: rgba(0, 0, 0, 0.15);
    --btn-bg: rgba(255, 255, 255, 0.1);
    --btn-hover: rgba(255, 255, 255, 0.2);
    --btn-text: #ffffff;
    --error-bg: rgba(255, 59, 48, 0.2);
    --error-text: #ffffff;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #1a1a2e; /* Darker background to make glass pop */
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(10, 132, 255, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 85% 30%, rgba(255, 45, 85, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 50% 80%, rgba(48, 209, 88, 0.4) 0%, transparent 50%);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    position: relative;
    overflow-x: hidden;
}

/* Enhanced 3D Orbs for better refraction behind glass */
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    z-index: -1;
    animation: float 20s infinite ease-in-out alternate;
}

.orb-1 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #0a84ff, #0056b3);
    top: 10%;
    left: 20%;
    animation-delay: 0s;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #ff2d55, #c81b3c);
    bottom: 10%;
    right: 15%;
    animation-delay: -5s;
}

.orb-3 {
    width: 250px;
    height: 250px;
    background: linear-gradient(135deg, #30d158, #1a9e3b);
    top: 50%;
    left: 60%;
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1) rotate(0deg); }
    33% { transform: translate(40px, -60px) scale(1.2) rotate(10deg); }
    66% { transform: translate(-30px, 30px) scale(0.8) rotate(-10deg); }
    100% { transform: translate(0, 0) scale(1) rotate(0deg); }
}

.container {
    width: 100%;
    max-width: 540px;
    position: relative;
    z-index: 1;
    perspective: 1000px; /* Enable 3D space */
}

/* Realistic 3D Glassmorphism Panel */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px) saturate(150%);
    -webkit-backdrop-filter: blur(12px) saturate(150%);
    
    /* 3D Border simulating light hitting the edges (thickness) */
    border-top: 1px solid var(--glass-border-top);
    border-left: 1px solid var(--glass-border-left);
    border-bottom: 1px solid var(--glass-border-bottom);
    border-right: 1px solid var(--glass-border-right);
    
    border-radius: 32px;
    padding: 3.5rem 2.5rem;
    box-shadow: 
        var(--glass-shadow), 
        inset 0 0 0 1px rgba(255, 255, 255, 0.05), /* Inner reflection */
        inset 0 20px 30px rgba(255, 255, 255, 0.15); /* Top highlight */
    
    /* Slight 3D rotation for realism */
    transform-style: preserve-3d;
    transform: translateZ(0);
    position: relative;
    overflow: hidden;
}

/* Diagonal specular highlight (Glossy reflection across the glass) */
.glass-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.15) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: skewX(-25deg);
    animation: shine 8s infinite;
    pointer-events: none;
}

@keyframes shine {
    0% { left: -100%; }
    20% { left: 200%; }
    100% { left: 200%; }
}

header {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    transform: translateZ(30px); /* Pop out text in 3D space */
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    color: #fff;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

header p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    font-weight: 300;
}

.input-group {
    display: flex;
    gap: 16px;
    margin-bottom: 2.5rem;
    transform: translateZ(40px); /* Bring inputs closer */
}

.input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 18px;
    width: 22px;
    height: 22px;
    color: rgba(255, 255, 255, 0.6);
}

input[type="text"] {
    width: 100%;
    padding: 18px 18px 18px 52px;
    font-size: 1.05rem;
    /* Engraved glass effect */
    background: var(--input-bg);
    border: 1px solid rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    outline: none;
    color: #fff;
    transition: all 0.3s ease;
    box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.2);
}

input[type="text"]:focus {
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 
        inset 0 3px 6px rgba(0, 0, 0, 0.3),
        0 0 0 2px rgba(255, 255, 255, 0.2);
}

input[type="text"]::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.btn {
    padding: 0 32px;
    font-size: 1.05rem;
    font-weight: 600;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    
    /* 3D Glass Button */
    background: var(--btn-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.5);
    border-left: 1px solid rgba(255, 255, 255, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15), inset 0 1px 1px rgba(255, 255, 255, 0.2);
    color: var(--btn-text);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.btn:hover {
    background: var(--btn-hover);
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.2), inset 0 1px 2px rgba(255, 255, 255, 0.3);
}

.btn:active {
    transform: scale(0.95) translateY(0);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.btn:disabled {
    background: rgba(255, 255, 255, 0.05);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    color: rgba(255, 255, 255, 0.3);
}

.error-message {
    color: var(--error-text);
    background: var(--error-bg);
    border-radius: 16px;
    padding: 14px;
    margin-bottom: 1.5rem;
    text-align: center;
    font-weight: 500;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 59, 48, 0.4);
    box-shadow: 0 10px 20px rgba(255, 59, 48, 0.15);
    transform: translateZ(20px);
}

.results-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    transform: translateZ(20px); /* 3D pop */
}

/* Base state for animation */
.results-container:not(.hidden) .result-card {
    animation: jellyPop 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    opacity: 0;
    transform-origin: center center;
}

/* Staggered delays for each card to create a fluid wave effect */
.results-container:not(.hidden) .result-card:nth-child(1) { animation-delay: 0.05s; }
.results-container:not(.hidden) .result-card:nth-child(2) { animation-delay: 0.15s; }
.results-container:not(.hidden) .result-card:nth-child(3) { animation-delay: 0.25s; }

@keyframes jellyPop {
    0% {
        opacity: 0;
        transform: translateY(40px) scaleY(0.8) scaleX(0.9) translateZ(20px);
    }
    40% {
        opacity: 1;
        transform: translateY(-10px) scaleY(1.05) scaleX(1.02) translateZ(30px);
    }
    70% {
        transform: translateY(5px) scaleY(0.98) scaleX(0.98) translateZ(25px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scaleY(1) scaleX(1) translateZ(20px);
    }
}

.result-card {
    /* Glass card on top of glass panel */
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.4);
    border-left: 1px solid rgba(255, 255, 255, 0.3);
    border-bottom: 1px solid rgba(0, 0, 0, 0.2);
    border-right: 1px solid rgba(0, 0, 0, 0.2);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.result-card:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-3px) translateZ(10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.copy-btn {
    /* Engraved/Pushed-in button for copying */
    background: rgba(0, 0, 0, 0.2);
    color: #fff;
    border: none;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border-top: 1px solid rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.copy-btn:hover {
    background: rgba(0, 0, 0, 0.3);
}

.copy-btn.copied {
    background: rgba(52, 199, 89, 0.4);
    border-top-color: rgba(52, 199, 89, 0.6);
    box-shadow: 0 0 10px rgba(52, 199, 89, 0.3), inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.result-value {
    font-family: "SF Mono", Monaco, Consolas, monospace;
    font-size: 1.2rem;
    color: #fff;
    word-break: break-all;
    font-weight: 500;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.hidden {
    display: none !important;
}

/* Loader */
.loader {
    width: 22px;
    height: 22px;
    border: 3px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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

/* Toast Notification - 3D Glass Style */
.toast {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%) translateY(100px) scale(0.9);
    background: rgba(30, 30, 40, 0.6);
    backdrop-filter: blur(30px) saturate(150%);
    -webkit-backdrop-filter: blur(30px) saturate(150%);
    color: #fff;
    padding: 14px 32px;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 500;
    
    /* Extreme 3D Edges */
    border-top: 1px solid rgba(255, 255, 255, 0.4);
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    border-bottom: 1px solid rgba(0, 0, 0, 0.3);
    border-right: 1px solid rgba(0, 0, 0, 0.3);
    
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3), inset 0 2px 3px rgba(255, 255, 255, 0.1);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.toast.show {
    transform: translateX(-50%) translateY(0) scale(1);
    opacity: 1;
}

.toast.error {
    background: rgba(255, 59, 48, 0.4);
    border-top-color: rgba(255, 100, 100, 0.5);
}

.toast.success {
    background: rgba(52, 199, 89, 0.4);
    border-top-color: rgba(100, 255, 130, 0.5);
}

@media (max-width: 480px) {
    body {
        padding: 1rem;
    }

    .glass-panel {
        padding: 2rem 1.5rem;
        border-radius: 28px;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .btn {
        padding: 18px;
        width: 100%;
    }
}