:root {
    --bg-deep: #0a0a0f;
    --card-bg: rgba(14, 14, 22, 0.85);
    --border-color: rgba(60, 140, 160, 0.35);
    --accent: #3c8ca0;
    --text-primary: #c8d6d8;
    --text-secondary: #7a8a8f;
    --input-bg: rgba(10, 12, 18, 0.75);
    --input-border: rgba(50, 70, 80, 0.6);
    --gold: #d4a850;
    --gold-glow: rgba(212, 168, 80, 0.6);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Courier New', 'Source Code Pro', 'Consolas', monospace;
    background: var(--bg-deep);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    user-select: none;
    position: relative;
}

.bg-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.5;
}

.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    background: repeating-linear-gradient(0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.015) 2px,
            rgba(0, 0, 0, 0.015) 4px);
}

.main-container {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 90%;
    max-width: 600px;
    padding: 20px;
}

/* 标题 */
.header {
    text-align: center;
    margin-bottom: 10px;
}

.project-badge {
    display: inline-block;
    font-size: 0.65rem;
    letter-spacing: 0.35em;
    color: #5a9aaa;
    border: 1px solid rgba(70, 130, 150, 0.4);
    padding: 4px 14px;
    border-radius: 2px;
    margin-bottom: 10px;
    text-transform: uppercase;
    background: rgba(20, 35, 45, 0.4);
}

.title {
    font-size: 1.3rem;
    font-weight: 400;
    letter-spacing: 0.2em;
    color: #bccdd4;
    text-shadow: 0 0 20px rgba(70, 140, 165, 0.3);
    margin-bottom: 2px;
}

.subtitle {
    font-size: 0.6rem;
    letter-spacing: 0.3em;
    color: #5a7a85;
    text-transform: uppercase;
}

/* 输入区域 */
.input-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 28px 24px 20px;
    width: 100%;
    backdrop-filter: blur(10px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.input-section.fading {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.95);
}

.input-group {
    margin-bottom: 16px;
}

.input-label {
    display: block;
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    color: #6a8a95;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.key-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 3px;
    color: #c8d8dd;
    font-family: inherit;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    outline: none;
    transition: all 0.3s ease;
}

.key-input:focus {
    border-color: rgba(80, 170, 190, 0.8);
    box-shadow: 0 0 18px rgba(60, 150, 175, 0.2);
}

.merge-btn {
    width: 100%;
    padding: 14px;
    background: rgba(30, 50, 60, 0.7);
    border: 1px solid rgba(80, 150, 170, 0.5);
    border-radius: 3px;
    color: #b0c8d0;
    font-family: inherit;
    font-size: 0.9rem;
    letter-spacing: 0.25em;
    cursor: pointer;
    transition: all 0.35s ease;
    text-transform: uppercase;
    margin-top: 4px;
}

.merge-btn:hover {
    background: rgba(50, 90, 105, 0.75);
    border-color: rgba(100, 180, 200, 0.65);
    box-shadow: 0 0 22px rgba(80, 170, 200, 0.35);
}

.merge-btn:active {
    transform: scale(0.97);
}

.hint-text {
    text-align: center;
    font-size: 0.6rem;
    color: #4a6875;
    letter-spacing: 0.1em;
    margin-top: 12px;
}

/* Canvas容器 */
.canvas-container {
    width: 100%;
    display: flex;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.8s ease;
    margin-top: 10px;
}

.canvas-container.visible {
    opacity: 1;
}

#taijiCanvas {
    max-width: 100%;
    height: auto;
}

/* 结果区域 */
.result-section {
    text-align: center;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.7s cubic-bezier(0.22, 0.61, 0.36, 1);
    pointer-events: none;
    margin-top: 10px;
}

.result-section.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.copy-btn {
    padding: 12px 28px;
    background: rgba(40, 35, 20, 0.7);
    border: 1px solid rgba(200, 150, 50, 0.5);
    border-radius: 3px;
    color: #d4c080;
    font-family: inherit;
    font-size: 0.85rem;
    letter-spacing: 0.2em;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.copy-btn:hover {
    background: rgba(60, 50, 25, 0.8);
    border-color: rgba(220, 180, 60, 0.7);
    box-shadow: 0 0 20px rgba(200, 160, 50, 0.3);
}

.result-text {
    font-size: 0.7rem;
    color: #7a8a8f;
    letter-spacing: 0.1em;
    line-height: 1.6;
    margin-top: 8px;
}

.copy-success {
    font-size: 0.7rem;
    color: #4db8a0;
    letter-spacing: 0.1em;
    margin-top: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.copy-success.show {
    opacity: 1;
}

/* 响应式 */
@media (max-width: 500px) {
    .main-container {
        padding: 12px;
        gap: 14px;
    }
    .input-section {
        padding: 20px 16px 14px;
    }
    .title {
        font-size: 1.1rem;
        letter-spacing: 0.15em;
    }
    #taijiCanvas {
        width: 320px;
        height: 320px;
    }
}