:root {
    --bg-deep: #060d16;
    --bg-panel: #0b1525;
    --bg-panel-hover: #111d33;
    --border-cyan: #00b8d4;
    --border-glow: #00d4ff;
    --text-primary: #c8e0f0;
    --text-bright: #e0f0ff;
    --text-dim: #6a8aaa;
    --accent-purple: #9b4dff;
    --accent-cyan: #00c8ff;
    --accent-green: #30d870;
    --accent-orange: #ff8830;
    --danger-red: #e04050;
    --btn-blue: #0078d4;
    --btn-blue-hover: #0098f4;
    --btn-blue-active: #00a8ff;
    --btn-gray: #3a4455;
    --btn-gray-hover: #4a5465;
    --btn-disabled: #2a2f3a;
    --topbar-bg: #2a2d35;
    --bottombar-bg: #0a0a0c;
    --glow-cyan: 0 0 20px rgba(0, 200, 255, 0.3);
    --glow-purple: 0 0 20px rgba(155, 77, 255, 0.3);
    --glow-panel: 0 0 40px rgba(0, 150, 200, 0.08);
    --font-mono: 'SF Mono', 'Cascadia Code', 'JetBrains Mono', 'Consolas', 'Monaco', 'Courier New', monospace;
    --font-ui: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--bg-deep);
    font-family: var(--font-ui);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at 50% 20%, rgba(0, 180, 200, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

#particleCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.7;
}

.scanlines-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0, 180, 220, 0.012) 2px, rgba(0, 180, 220, 0.012) 4px);
    animation: scanlineDrift 8s linear infinite;
}
@keyframes scanlineDrift {
    0% { transform: translateY(0); }
    100% { transform: translateY(4px); }
}

.ambient-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.06;
}
.ambient-glow.g1 {
    width: 500px;
    height: 500px;
    background: #00a0d0;
    top: -15%;
    left: -10%;
    animation: floatGlow1 20s ease-in-out infinite;
}
.ambient-glow.g2 {
    width: 400px;
    height: 400px;
    background: #8030c0;
    bottom: -10%;
    right: -8%;
    animation: floatGlow2 25s ease-in-out infinite;
}
@keyframes floatGlow1 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(60px, 40px); }
    50% { transform: translate(20px, -30px); }
    75% { transform: translate(-40px, 20px); }
}
@keyframes floatGlow2 {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(-50px, -30px); }
    66% { transform: translate(30px, 50px); }
}

.top-bar {
    position: relative;
    z-index: 10;
    background: var(--topbar-bg);
    color: #d0d5dc;
    text-align: center;
    padding: 14px 20px;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    font-family: var(--font-mono);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
    user-select: none;
    text-shadow: 0 0 12px rgba(180, 200, 220, 0.3);
}
.top-bar .brand-icon {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #00c8ff;
    margin-right: 8px;
    box-shadow: 0 0 10px #00c8ff, 0 0 24px rgba(0, 180, 220, 0.5);
    animation: pulseDot 2s ease-in-out infinite;
    vertical-align: middle;
    position: relative;
    top: -1px;
}
@keyframes pulseDot {
    0%, 100% { box-shadow: 0 0 8px #00c8ff, 0 0 18px rgba(0, 180, 220, 0.4); }
    50% { box-shadow: 0 0 18px #00d8ff, 0 0 32px rgba(0, 200, 240, 0.7); }
}

.bottom-bar {
    position: relative;
    z-index: 10;
    background: var(--bottombar-bg);
    color: #8899aa;
    text-align: center;
    padding: 16px 20px;
    font-size: 0.85rem;
    letter-spacing: 0.03em;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.5);
    user-select: none;
    line-height: 1.7;
    font-family: var(--font-mono);
}
.bottom-bar .divider {
    display: inline-block;
    margin: 0 10px;
    color: #445566;
    font-weight: 300;
}
.bottom-bar .highlight {
    color: #b0c8dd;
    font-weight: 600;
}

.main-container {
    position: relative;
    z-index: 10;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
}
.center-panel {
    background: var(--bg-panel);
    border: 1px solid rgba(0, 170, 210, 0.25);
    border-radius: 18px;
    padding: 40px 36px;
    max-width: 580px;
    width: 100%;
    box-shadow: var(--glow-panel), 0 10px 50px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    position: relative;
    overflow: hidden;
}
.center-panel::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 30px;
    right: 30px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 200, 255, 0.5), transparent);
    border-radius: 50%;
}
.center-panel::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 30px;
    right: 30px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(120, 60, 220, 0.35), transparent);
    border-radius: 50%;
}

.panel-title {
    text-align: center;
    font-size: 1rem;
    letter-spacing: 0.12em;
    color: var(--text-dim);
    margin-bottom: 28px;
    font-family: var(--font-mono);
    text-transform: uppercase;
    position: relative;
    z-index: 1;
}
.panel-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #00b8d4, transparent);
    margin: 10px auto 0;
    border-radius: 1px;
}

.row {
    display: flex;
    gap: 14px;
    margin-bottom: 18px;
    align-items: stretch;
    position: relative;
    z-index: 1;
}
.row:last-child {
    margin-bottom: 0;
}

.row > .ip-display-box,
.row > .key-input-box,
.row > .btn {
    width: 100%;
}

.ip-display-box {
    background: #0d1a28;
    border: 2px solid rgba(0, 180, 210, 0.3);
    border-radius: 12px;
    padding: 14px 18px;
    font-family: var(--font-mono);
    font-size: 1.05rem;
    color: #00d4ff;
    cursor: pointer;
    user-select: all;
    transition: all 0.25s ease;
    text-align: center;
    letter-spacing: 0.06em;
    position: relative;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    word-break: break-all;
    box-shadow: inset 0 0 30px rgba(0, 150, 200, 0.04);
    -webkit-user-select: all;
    -moz-user-select: all;
}
.ip-display-box:hover {
    border-color: rgba(0, 210, 255, 0.6);
    box-shadow: inset 0 0 40px rgba(0, 180, 220, 0.08), 0 0 20px rgba(0, 180, 220, 0.15);
    color: #00e8ff;
    transform: translateY(-1px);
}
.ip-display-box:active {
    border-color: #00e0ff;
    box-shadow: inset 0 0 20px rgba(0, 200, 240, 0.15), 0 0 30px rgba(0, 200, 240, 0.25);
    transform: scale(0.98);
    transition: all 0.08s ease;
}
.ip-display-box .copy-hint {
    position: absolute;
    top: -28px;
    left: 50%;
    transform: translateX(-50%);
    background: #0d1a28;
    color: #00d4ff;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    border: 1px solid rgba(0, 200, 240, 0.4);
    font-family: var(--font-ui);
}
.ip-display-box .copy-hint.visible {
    opacity: 1;
    animation: hintPopIn 0.35s ease-out;
}
@keyframes hintPopIn {
    0% { opacity: 0; transform: translateX(-50%) translateY(8px); }
    100% { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.ip-display-box.loading {
    color: #556678;
    animation: loadingPulse 1.5s ease-in-out infinite;
}
@keyframes loadingPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.key-input-box {
    background: #0d1a28;
    border: 2px solid rgba(120, 80, 200, 0.3);
    border-radius: 12px;
    padding: 14px 18px;
    font-family: var(--font-mono);
    font-size: 1.05rem;
    color: #c8d8f0;
    outline: none;
    text-align: center;
    letter-spacing: 0.08em;
    transition: all 0.25s ease;
    min-height: 50px;
    box-shadow: inset 0 0 30px rgba(100, 50, 180, 0.04);
    caret-color: #b08fff;
}
.key-input-box::placeholder {
    color: #3a5068;
    letter-spacing: 0.06em;
    font-size: 0.9rem;
}
.key-input-box:focus {
    border-color: rgba(150, 100, 230, 0.6);
    box-shadow: inset 0 0 40px rgba(120, 60, 200, 0.08), 0 0 20px rgba(130, 70, 220, 0.15);
    color: #e0e8ff;
}
.key-input-box.error-shake {
    animation: shakeInput 0.5s ease;
    border-color: rgba(255, 80, 80, 0.7) !important;
}
@keyframes shakeInput {
    0%, 100% { transform: translateX(0); }
    15% { transform: translateX(-6px); }
    30% { transform: translateX(6px); }
    45% { transform: translateX(-4px); }
    60% { transform: translateX(4px); }
    75% { transform: translateX(-2px); }
    90% { transform: translateX(2px); }
}

.btn {
    padding: 14px 22px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.05em;
    transition: all 0.2s ease;
    border: none;
    font-family: var(--font-ui);
    white-space: nowrap;
    outline: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}
.btn:active {
    transform: scale(0.98);
    transition: all 0.06s ease;
}

.btn-download {
    background: linear-gradient(135deg, #1a4058, #1a3050);
    color: #7ad8f0;
    border: 1px solid rgba(0, 180, 220, 0.35);
    box-shadow: 0 0 16px rgba(0, 160, 210, 0.12);
}
.btn-download:hover {
    background: linear-gradient(135deg, #1e4d68, #1e3a5c);
    border-color: rgba(0, 200, 240, 0.55);
    box-shadow: 0 0 24px rgba(0, 180, 220, 0.2);
    color: #a0e8ff;
}

.btn-upload {
    background: linear-gradient(135deg, #2a1a48, #221840);
    color: #b890f0;
    border: 1px solid rgba(140, 80, 220, 0.35);
    box-shadow: 0 0 16px rgba(120, 60, 200, 0.12);
}
.btn-upload:hover {
    background: linear-gradient(135deg, #322058, #2a1e50);
    border-color: rgba(160, 100, 240, 0.55);
    box-shadow: 0 0 24px rgba(130, 70, 220, 0.2);
    color: #d0a8ff;
}

.btn-website {
    background: linear-gradient(135deg, #1a4a5a, #1a3a4a);
    color: #80d8f0;
    border: 1px solid rgba(0, 200, 220, 0.35);
    box-shadow: 0 0 16px rgba(0, 180, 210, 0.12);
}
.btn-website:hover {
    background: linear-gradient(135deg, #1e5868, #1e4858);
    border-color: rgba(0, 220, 240, 0.55);
    box-shadow: 0 0 24px rgba(0, 200, 220, 0.2);
    color: #a0f0ff;
}

.btn-steam {
    background: #0a0a0a;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 16px rgba(0, 0, 0, 0.4);
}
.btn-steam:hover {
    background: #1a1a1a;
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 24px rgba(0, 0, 0, 0.6);
    color: #ffffff;
}

.floating-btn {
    position: fixed;
    right: 24px;
    bottom: 100px;
    z-index: 50;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(145deg, #0068b8, #004a90);
    border: 2px solid rgba(0, 200, 255, 0.4);
    box-shadow: 0 0 25px rgba(0, 160, 220, 0.35);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    user-select: none;
}
.floating-btn:hover {
    background: linear-gradient(145deg, #007ad8, #005cb0);
    box-shadow: 0 0 35px rgba(0, 200, 255, 0.55);
    transform: scale(1.06);
}
.floating-btn .doc-icon {
    width: 24px;
    height: 30px;
    background: #fff;
    border-radius: 3px;
    position: relative;
}
.floating-btn .doc-icon::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 6px;
    width: 12px;
    height: 2px;
    background: #0068b8;
    box-shadow: 0 4px 0 #0068b8, 0 8px 0 #0068b8;
    border-radius: 2px;
}
.floating-tooltip {
    position: absolute;
    right: 70px;
    background: #0d1a28;
    color: #b0d0e8;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s;
    border: 1px solid rgba(0, 180, 220, 0.3);
}
.floating-btn:hover .floating-tooltip {
    opacity: 1;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(2, 6, 14, 0.82);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeInOverlay 0.25s ease;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
@keyframes fadeInOverlay { from { opacity: 0; } to { opacity: 1; } }
.modal-overlay.closing { animation: fadeOutOverlay 0.2s ease forwards; }
@keyframes fadeOutOverlay { from { opacity: 1; } to { opacity: 0; } }

.modal-dialog {
    background: #0f1b2d;
    border: 1px solid rgba(0, 170, 220, 0.3);
    border-radius: 16px;
    padding: 28px 26px 22px;
    max-width: 520px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 50px rgba(0, 150, 200, 0.1);
    animation: modalSlideIn 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
    position: relative;
    z-index: 101;
    max-height: 85vh;
    overflow-y: auto;
}
@keyframes modalSlideIn { from { opacity: 0; transform: translateY(30px) scale(0.94); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-dialog.closing { animation: modalSlideOut 0.2s ease forwards; }
@keyframes modalSlideOut { from { opacity: 1; transform: translateY(0) scale(1); } to { opacity: 0; transform: translateY(-20px) scale(0.94); } }

.modal-title { font-size: 1.1rem; color: #c8ddf0; text-align: center; margin-bottom: 18px; font-weight: 600; }
.warning-text { color: #ff6060; font-size: 0.85rem; margin: 12px 0; text-align: center; line-height: 1.5; }
.key-display {
    background: #0a1522;
    border: 2px solid rgba(0, 200, 100, 0.4);
    border-radius: 12px;
    padding: 14px;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: #30d870;
    margin: 10px 0;
    word-break: break-all;
    user-select: all;
    cursor: pointer;
}
.btn-small {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    outline: none;
    margin: 2px;
}
.btn-blue { background: #0078d4; color: white; }
.btn-blue:hover { background: #0088ec; }
.btn-red { background: #c04040; color: white; }
.btn-red:hover { background: #d85050; }
.btn-gray { background: #3a4455; color: #aab8c8; }
.btn-gray:hover { background: #4a5465; }

.manage-item {
    background: #0a1522;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 8px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}
.manage-item .tag { font-weight: 600; color: #7ac8e8; min-width: 60px; }
.manage-item .key { font-family: var(--font-mono); color: #aab8c8; flex: 1; word-break: break-all; }
.status-unused { background: #1a4a2a; color: #40e880; padding: 2px 8px; border-radius: 10px; font-size: 0.75rem; }
.status-used { background: #4a2020; color: #f08080; padding: 2px 8px; border-radius: 10px; font-size: 0.75rem; }

.countdown-btn { background: #2a2f3a; color: #556678; border: 1px solid rgba(255,255,255,0.05); cursor: not-allowed; }
.countdown-btn.active { background: #0078d4; color: white; cursor: pointer; }

.option-group {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}
.option-btn {
    flex: 1;
    padding: 10px 12px;
    background: #0d1a28;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #aab8c8;
    font-size: 0.85rem;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    user-select: none;
}
.option-btn:hover {
    border-color: rgba(0, 180, 220, 0.5);
    color: #c8ddf0;
}
.option-btn.selected {
    border-color: #00b8d4;
    background: rgba(0, 180, 220, 0.12);
    color: #e0f0ff;
    box-shadow: 0 0 12px rgba(0, 180, 220, 0.2);
}

.toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    padding: 12px 24px;
    border-radius: 24px;
    font-size: 0.9rem;
    font-weight: 600;
    pointer-events: none;
    animation: toastIn 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
    white-space: nowrap;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}
.toast.success { background: #0d2a1a; color: #40e880; border: 1px solid rgba(48, 216, 112, 0.4); }
.toast.error { background: #2a0d0d; color: #f06060; border: 1px solid rgba(224, 64, 80, 0.4); }
.toast.info { background: #0d1a2a; color: #60c8f0; border: 1px solid rgba(0, 180, 220, 0.4); }
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(-20px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
.toast.out { animation: toastOut 0.35s ease forwards; }
@keyframes toastOut { from { opacity: 1; transform: translateX(-50%) translateY(0); } to { opacity: 0; transform: translateX(-50%) translateY(-16px); } }

@media (max-width: 600px) {
    .center-panel { padding: 24px 16px; }
    .row { flex-direction: column; gap: 10px; }
    .btn { min-width: auto; }
    .modal-dialog { padding: 20px 16px; }
    .option-group { flex-direction: column; gap: 6px; }
}