:root {
    --bg-base: #0f1016;
    --card-bg: rgba(25, 27, 36, 0.6);
    --card-border: rgba(255, 255, 255, 0.08);
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --accent-gradient: linear-gradient(135deg, #6366f1, #8b5cf6, #d946ef);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.1);
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
    line-height: 1.5;
}

/* 动效球体背景 */
.background-orbs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
    pointer-events: none;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 20s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: rgba(99, 102, 241, 0.3);
    top: -10%;
    left: -10%;
    animation-duration: 25s;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: rgba(139, 92, 246, 0.25);
    bottom: -20%;
    right: -10%;
    animation-delay: -5s;
}

.orb-3 {
    width: 300px;
    height: 300px;
    background: rgba(217, 70, 239, 0.2);
    top: 40%;
    left: 60%;
    animation-duration: 18s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 30px) scale(1.1); }
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 3rem;
    background: rgba(15, 16, 22, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--card-border);
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--text-primary);
}

.logo i {
    color: var(--primary-color);
    font-size: 1.8rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.github-link {
    color: var(--text-secondary);
    font-size: 1.5rem;
    transition: color 0.3s ease;
}

.github-link:hover {
    color: var(--text-primary);
}

/* Main Layout */
.main-container {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 3rem 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

@media (min-width: 900px) {
    .main-container {
        grid-template-columns: minmax(500px, 1.5fr) 1fr;
        align-items: start;
        padding: 4rem 2rem;
    }
}

/* Glassmorphism Card System */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 100%;
    background: linear-gradient(115deg, transparent 20%, rgba(255,255,255,0.03) 30%, transparent 40%);
    pointer-events: none;
    transform: translateX(-100%);
    transition: transform 0.8s ease;
}

.glass-card:hover::before {
    transform: translateX(50%);
}

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

.gradient-text {
    font-family: 'Outfit', sans-serif;
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 0.5rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.05rem;
}

/* Forms & Inputs */
.input-group {
    margin-bottom: 2rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.8rem;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.95rem;
}

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

.input-icon {
    position: absolute;
    left: 1rem;
    color: var(--text-secondary);
    font-size: 1.2rem;
}

.input-wrapper input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    padding: 1.2rem 3rem;
    border-radius: 12px;
    font-size: 1rem;
    font-family: 'Inter', monospace;
    transition: all 0.3s ease;
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.clear-btn {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.2rem;
    display: none;
    transition: color 0.2s;
}

.clear-btn:hover {
    color: var(--text-primary);
}

.input-wrapper input:valid + .clear-btn, 
.input-wrapper input:not(:placeholder-shown) + .clear-btn {
    display: block;
}

/* Button */
.submit-btn {
    width: 100%;
    padding: 1.2rem;
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px -10px rgba(99, 102, 241, 0.5);
    position: relative;
    overflow: hidden;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px -10px rgba(99, 102, 241, 0.6);
}

.submit-btn:active {
    transform: translateY(1px);
}

.submit-btn.loading {
    opacity: 0.9;
    cursor: not-allowed;
    background: #334155;
    box-shadow: none;
}

.submit-btn.loading .btn-text,
.submit-btn.loading .btn-icon {
    display: none;
}

.submit-btn.loading .loader {
    display: block;
}

.loader {
    display: none;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

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

/* Result Area */
.result-area {
    margin-top: 2rem;
    border-top: 1px solid var(--card-border);
    padding-top: 2rem;
    animation: fadeIn 0.5s ease;
}

.hidden {
    display: none !important;
}

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

.result-box {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

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

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge.success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success-color);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.token-field {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    border: 1px solid var(--card-border);
    overflow: hidden;
}

.critical-field {
    border-color: rgba(245, 158, 11, 0.4);
    background: rgba(245, 158, 11, 0.05);
}

.field-label {
    padding: 0.8rem 1.2rem;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--card-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 500;
}

.tip {
    font-size: 0.8rem;
    color: var(--success-color);
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.warning-text {
    color: var(--warning-color);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.field-value-wrapper {
    position: relative;
}

.result-textarea {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 1.2rem;
    padding-right: 4rem;
    font-family: 'Inter', monospace;
    font-size: 0.9rem;
    resize: none;
    line-height: 1.5;
}

.result-textarea:focus {
    outline: none;
}

.copy-btn {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
}

.copy-btn:hover {
    background: var(--primary-color);
    color: white;
}

/* Error Message */
.error-msg {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--danger-bg);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    color: var(--error-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: fadeIn 0.3s ease;
}

/* Sidebar Information */
.info-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.info-panel h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--card-border);
}

.feature-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.feature-list li {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.feature-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-color);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.feature-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.feature-text strong {
    display: block;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
    font-weight: 500;
}

/* Toast Configuration */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    z-index: 100;
    pointer-events: none;
}

.toast {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    animation: slideIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
    pointer-events: auto;
}

.toast.success i { color: var(--success-color); }
.toast.error i { color: var(--error-color); }

.toast.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

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

/* 移动端专属优化 (Mobile Optimization) */
@media (max-width: 768px) {
    .app-header {
        padding: 1rem 1.5rem;
    }
    .logo {
        font-size: 1.2rem;
    }
    .lang-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
    .main-container {
        padding: 1.5rem 1rem;
        gap: 1.5rem;
    }
    .glass-card {
        padding: 1.5rem;
        border-radius: 20px;
    }
    .gradient-text {
        font-size: 1.8rem;
    }
    .subtitle {
        font-size: 0.95rem;
    }
    .feature-icon {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
    .feature-icon span {
        font-size: 1.2rem !important;
    }
    .result-textarea {
        font-size: 0.85rem;
        padding-right: 3rem;
    }
    .copy-btn {
        width: 30px;
        height: 30px;
        right: 0.5rem;
    }
    .toast-container {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
    }
}
