/* ============================================
   QNT Calculator - 收益计算器样式表
   ============================================ */

:root {
    --color-bg: #0a0a1a;
    --color-bg-secondary: #1a1a2e;
    --color-bg-card: rgba(10, 10, 26, 0.9);
    --color-primary: #e2b04a;
    --color-primary-dim: rgba(226, 176, 74, 0.15);
    --color-secondary: #9d4edd;
    --color-secondary-dim: rgba(157, 78, 221, 0.15);
    --color-accent: #00f5d4;
    --color-accent-dim: rgba(0, 245, 212, 0.1);
    --color-text: #ffffff;
    --color-text-secondary: #b0b0d0;
    --color-border: rgba(226, 176, 74, 0.25);
    --color-input-bg: rgba(255, 255, 255, 0.06);
    --font-heading: 'Orbitron', sans-serif;
    --font-body: 'Noto Sans SC', sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.7;
    overflow-x: hidden;
    min-height: 100vh;
}

#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ========== Language Selector ========== */
.lang-selector {
    position: relative;
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: var(--color-text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-body);
}

.lang-btn:hover, .lang-btn.active {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: var(--color-primary-dim);
}

.lang-btn i:first-child {
    font-size: 14px;
}

.lang-btn i:last-child {
    font-size: 10px;
    transition: transform 0.2s;
}

.lang-btn.active i:last-child {
    transform: rotate(180deg);
}

.lang-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 140px;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 6px;
    z-index: 200;
    list-style: none;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}

.lang-dropdown.show {
    display: block;
    animation: fadeInDown 0.2s ease-out;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.lang-dropdown li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.lang-dropdown li:hover {
    background: var(--color-primary-dim);
}

.lang-dropdown li.selected {
    background: var(--color-primary-dim);
    color: var(--color-primary);
}

.lang-name {
    font-size: 13px;
    font-weight: 500;
}

.lang-code {
    font-size: 11px;
    font-family: var(--font-heading);
    opacity: 0.6;
}

/* ========== Navbar ========== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(10, 10, 26, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--color-border);
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 600;
    color: var(--color-primary);
}

.logo-icon {
    font-size: 20px;
    color: var(--color-primary);
}

.nav-btn {
    padding: 8px 24px;
    border-radius: 50px;
    background: linear-gradient(135deg, var(--color-primary) 0%, #d4a03a 100%);
    color: var(--color-bg);
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition);
}

.nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(226, 176, 74, 0.4);
}

/* ========== Header ========== */
.calc-header {
    padding: 120px 24px 48px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.header-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 20px;
    border-radius: 50px;
    background: var(--color-primary-dim);
    border: 1px solid var(--color-border);
    font-family: var(--font-heading);
    font-size: 11px;
    letter-spacing: 3px;
    color: var(--color-primary);
    margin-bottom: 24px;
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-primary);
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.header-title {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}

.title-en {
    font-family: var(--font-heading);
    font-size: clamp(14px, 2vw, 18px);
    letter-spacing: 6px;
    color: var(--color-text-secondary);
    font-weight: 500;
}

.title-cn {
    font-family: var(--font-heading);
    font-size: clamp(32px, 5vw, 56px);
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff 0%, var(--color-primary) 50%, #f0c060 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.header-subtitle {
    color: var(--color-text-secondary);
    font-size: 15px;
    letter-spacing: 2px;
}

/* ========== Main ========== */
.calc-main {
    padding: 0 24px 80px;
    position: relative;
    z-index: 1;
}

.calc-container {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 768px) {
    .calc-container {
        grid-template-columns: 1fr;
    }
}

/* ========== Panels ========== */
.calc-panel {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    padding: 32px;
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.panel-title {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 2px;
    color: var(--color-primary);
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel-title i {
    font-size: 18px;
}

/* ========== Input Group ========== */
.input-group {
    margin-bottom: 24px;
}

.input-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--color-text-secondary);
    margin-bottom: 10px;
    font-weight: 500;
}

.input-label i {
    color: var(--color-primary);
}

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

.input-field {
    width: 100%;
    padding: 14px 50px 14px 18px;
    background: var(--color-input-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--color-text);
    font-size: 18px;
    font-family: var(--font-heading);
    font-weight: 600;
    transition: var(--transition);
    outline: none;
}

.input-field:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(226, 176, 74, 0.15);
}

.input-field::placeholder {
    color: rgba(255, 255, 255, 0.3);
    font-family: var(--font-body);
    font-weight: 400;
}

.input-unit {
    position: absolute;
    right: 18px;
    color: var(--color-primary);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 16px;
}

/* ========== Mode Cards ========== */
.mode-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mode-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: var(--color-input-bg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.mode-card:hover {
    border-color: rgba(226, 176, 74, 0.3);
    background: rgba(226, 176, 74, 0.05);
}

.mode-card.active {
    border-color: var(--color-primary);
    background: var(--color-primary-dim);
    box-shadow: 0 0 20px rgba(226, 176, 74, 0.15);
}

.mode-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--color-primary);
    flex-shrink: 0;
    transition: var(--transition);
}

.mode-card.active .mode-icon {
    background: var(--color-primary);
    color: var(--color-bg);
}

.mode-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mode-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--color-text);
}

.mode-desc {
    font-size: 12px;
    color: var(--color-text-secondary);
}

.mode-rate {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    color: var(--color-accent);
    background: var(--color-accent-dim);
    padding: 4px 10px;
    border-radius: 8px;
}

/* ========== Team Section & Slider ========== */
.team-section {
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.team-label .optional-tag {
    font-size: 11px;
    background: rgba(157, 78, 221, 0.2);
    color: #c89dff;
    padding: 2px 8px;
    border-radius: 20px;
    margin-left: auto;
    font-weight: 400;
}

/* Slider Component */
.slider-group {
    margin-bottom: 20px;
}

.slider-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.slider-label {
    font-size: 13px;
    color: var(--color-text-secondary);
}

.slider-value {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 600;
    color: var(--color-secondary);
    background: var(--color-secondary-dim);
    padding: 2px 10px;
    border-radius: 6px;
}

.team-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.team-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-secondary) 0%, #7b2cbf 100%);
    cursor: pointer;
    box-shadow: 0 0 12px rgba(157, 78, 221, 0.5);
    transition: transform 0.15s, box-shadow 0.15s;
}

.team-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 0 20px rgba(157, 78, 221, 0.7);
}

.team-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-secondary) 0%, #7b2cbf 100%);
    cursor: pointer;
    border: none;
    box-shadow: 0 0 12px rgba(157, 78, 221, 0.5);
}

.team-slider::-moz-range-progress {
    background: linear-gradient(90deg, var(--color-secondary), #7b2cbf);
    height: 6px;
    border-radius: 3px;
}

.team-slider::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
}

.slider-ticks {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    padding: 0 2px;
}

.slider-ticks span {
    font-size: 10px;
    color: rgba(176, 176, 208, 0.4);
    font-family: var(--font-heading);
}

/* ========== Calc Button ========== */
.calc-btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--color-primary) 0%, #d4a03a 100%);
    color: var(--color-bg);
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 2px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 8px;
}

.calc-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(226, 176, 74, 0.45);
}

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

/* ========== Result Panel ========== */
.result-hero {
    text-align: center;
    padding: 28px 20px;
    background: linear-gradient(135deg, rgba(226, 176, 74, 0.12) 0%, rgba(157, 78, 221, 0.08) 100%);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    margin-bottom: 24px;
}

.result-hero-label {
    font-size: 13px;
    color: var(--color-text-secondary);
    letter-spacing: 2px;
    margin-bottom: 8px;
}

.result-hero-value {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 6px;
    margin-bottom: 8px;
}

.result-hero-value #totalMonthlyIncome {
    font-family: var(--font-heading);
    font-size: clamp(36px, 6vw, 52px);
    font-weight: 800;
    background: linear-gradient(135deg, var(--color-primary) 0%, #f0c060 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.result-hero-unit {
    font-family: var(--font-heading);
    font-size: 20px;
    color: var(--color-text-secondary);
}

.result-hero-note {
    font-size: 12px;
    color: var(--color-text-secondary);
}

/* Result Details */
.result-details {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.detail-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--color-input-bg);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.detail-row.highlight {
    background: var(--color-accent-dim);
    border-color: rgba(0, 245, 212, 0.15);
}

.detail-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--color-text-secondary);
}

.detail-label i {
    color: var(--color-primary);
    font-size: 14px;
}

.detail-value {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text);
}

.detail-row.highlight .detail-value {
    color: var(--color-accent);
}

.detail-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
}

/* Disclaimer */
.disclaimer {
    margin-top: 24px;
    padding: 14px 16px;
    background: rgba(255, 193, 7, 0.06);
    border: 1px solid rgba(255, 193, 7, 0.15);
    border-radius: 10px;
    font-size: 12px;
    color: rgba(255, 200, 100, 0.8);
    line-height: 1.8;
    text-align: center;
    white-space: pre-line;
}

.disclaimer i {
    margin-right: 6px;
}

/* ========== Footer ========== */
.footer {
    position: relative;
    z-index: 1;
    padding: 40px 24px;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-heading);
    font-size: 16px;
    color: var(--color-primary);
    margin-bottom: 12px;
}

.footer p {
    font-size: 13px;
    color: var(--color-text-secondary);
}

.footer-disclaimer {
    font-size: 11px !important;
    color: rgba(176, 176, 208, 0.5) !important;
    margin-top: 8px;
}

/* ========== Animations ========== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.calc-panel {
    animation: fadeInUp 0.6s ease-out forwards;
}

.calc-result-panel {
    animation-delay: 0.15s;
}

@keyframes countUp {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.result-hero.animated #totalMonthlyIncome {
    animation: countUp 0.4s ease-out;
}

/* ========== Language-specific font rules ========== */
html[lang="ja"] body,
html[lang="ja"] {
    font-family: 'Noto Sans JP', var(--font-body);
}

html[lang="ko"] body,
html[lang="ko"] {
    font-family: 'Noto Sans KR', var(--font-body);
}

html[lang="en"] body,
html[lang="vi"] body {
    font-family: 'Roboto', var(--font-body);
}

/* ========== RTL Support ========== */
html[dir="rtl"] .lang-btn i:last-child {
    transform: rotate(180deg);
}

html[dir="rtl"] .lang-dropdown {
    right: auto;
    left: 0;
}

/* ========== Responsive ========== */
@media (max-width: 480px) {
    .calc-panel {
        padding: 24px 20px;
    }

    .nav-container {
        gap: 8px;
    }

    .lang-btn {
        padding: 6px 10px;
    }

    .lang-btn span:not(:first-child):not(:last-child) {
        display: none;
    }
}
