/* style.css */
:root {
    --primary-color: #00d9ff;
    --primary-dark: #0c1725;
    --accent-green: #20ff88;
    --accent-red: #ff4d4d;
    --accent-gold: #ffed4e;
    --card-bg: rgba(0, 22, 45, 0.82);
    --text-light: #d0dce8;
    --glow-color: rgba(0, 217, 255, 0.55);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: "Exo 2", "Segoe UI", Roboto, Arial, sans-serif;
    color: #fff;
    background: var(--primary-dark);
    -webkit-tap-highlight-color: transparent;
    line-height: 1.6;
    overflow-x: hidden;
}
body {
    position: relative;
    min-height: 100vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
}

/* ç§‘å¹»é£Žæ ¼èƒŒæ™¯ - ä¿®å¤ç‰ˆ */
.scifi-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background: linear-gradient(135deg, #0c1725 0%, #112035 35%, #0d1f3a 70%, #0c1725 100%);
    overflow: hidden;
}

/* ç½‘æ ¼æ•ˆæžœ */
.grid-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
            linear-gradient(rgba(0, 217, 255, 0.12) 1px, transparent 1px),
            linear-gradient(90deg, rgba(0, 217, 255, 0.12) 1px, transparent 1px);
    background-size: 32px 32px;
    opacity: 0.28;
}

/* å…‰ç‚¹æ•ˆæžœ */
.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.particle {
    position: absolute;
    background: rgba(0, 217, 255, 0.55);
    border-radius: 50%;
    opacity: 0;
    animation: particleFloat 15s infinite linear;
}

@keyframes particleFloat {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.7;
    }
    100% {
        /* move upward substantially so particles rise into view */
        transform: translateY(-300px) translateX(50px);
        opacity: 0;
    }
}

/* ç§‘å¹»å…‰æŸ */
.light-beams {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.beam {
    position: absolute;
    background: linear-gradient(90deg, rgba(0, 217, 255, 0) 0%, rgba(0, 217, 255, 0.55) 50%, rgba(0, 217, 255, 0) 100%);
    height: 1px;
    filter: blur(1px);
    animation: beamMove 20s infinite linear;
}

@keyframes beamMove {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* ç§‘å¹»å…‰æ™• */
.glow-circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(50px);
    opacity: 0.1;
    animation: pulse 8s infinite ease-in-out;
    pointer-events: none;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.1;
        transform: scale(1);
    }
    50% {
        opacity: 0.15;
        transform: scale(1.1);
    }
}

.page-container {
    width: 100%;
    max-width: 500px;
    padding: 0 15px 15px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
    flex: 1;
    justify-content: flex-start;
    padding-top: 10px;
}

/* ä¿®æ”¹è‚¡ç¥¨è¡Œæƒ…åŒºåŸŸ - è°ƒæ•´ä¸ºæ˜¾ç¤º5è¡Œ */
.stock-ticker-wrapper {
    width: 100%;
    margin: 8px auto 16px;
    position: relative;
}
.ticker-title {
    text-align: center;
    font-family: 'Orbitron', sans-serif;
    font-size: 16px;
    color: var(--accent-gold);
    margin-bottom: 8px;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
    letter-spacing: 1px;
}
.stock-ticker {
    background: transparent;
    padding: 4px 0;
    overflow: hidden;
    height: 120px; /* è°ƒæ•´ä¸º5è¡Œçš„é«˜åº¦ (5 * 24px) */
    display: none;
    width: 100%;
    position: relative;
    mask-image: linear-gradient(to bottom,
    rgba(0,0,0,0) 0%,
    rgba(0,0,0,1) 10%,
    rgba(0,0,0,1) 90%,
    rgba(0,0,0,0) 100%);
    -webkit-mask-image: linear-gradient(to bottom,
    rgba(0,0,0,0) 0%,
    rgba(0,0,0,1) 10%,
    rgba(0,0,0,1) 90%,
    rgba(0,0,0,0) 100%);
}
.ticker-container {
    height: 100%;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 15px rgba(0, 217, 255, 0.22);
    border-radius: 6px;
    background: rgba(0, 22, 45, 0.45);
    backdrop-filter: blur(3px);
    border: 1px solid rgba(0, 217, 255, 0.28);
}
.ticker-list {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    animation: ticker-vertical 35s linear infinite;
}
.ticker-item {
    font-size: 13px;
    padding: 4px 12px;
    color: var(--primary-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    white-space: nowrap;
    height: 24px;
    font-family: 'Orbitron', monospace;
    text-shadow: 0 0 8px var(--glow-color), 0 0 15px rgba(0, 217, 255, 0.48);
    background: rgba(0, 22, 45, 0.52);
    margin: 2px 4px;
    border-radius: 4px;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 217, 255, 0.22);
}
.ticker-item:hover {
    background: rgba(0, 22, 45, 0.72);
    transform: scale(1.02);
    border-color: rgba(0, 217, 255, 0.52);
    box-shadow: 0 0 10px rgba(0, 217, 255, 0.42);
}
.ticker-symbol {
    font-weight: 600;
    letter-spacing: 0.5px;
    font-size: 12px;
}
.ticker-price {
    font-weight: bold;
    margin-left: 8px;
    display: flex;
    align-items: center;
    font-size: 12px;
}
.price-change {
    margin-left: 6px;
    font-size: 11px;
}
.up { color: var(--accent-green); }
.down { color: var(--accent-red); }
@keyframes ticker-vertical {
    0% { transform: translateY(0); }
    100% { transform: translateY(-50%); } /* è°ƒæ•´ä¸ºç§»åŠ¨50% (10è¡Œ/20è¡Œ) */
}

main {
    position: relative;
    text-align: center;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    flex: 1;
    margin-top: 5px;
}
.content-wrapper {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}
.robot-img { margin-bottom: 10px; }
.robot-img img {
    width: 120px;
    margin: 0 auto;
    display: block;
    filter: drop-shadow(0 0 10px var(--primary-color));
    animation: float 6s ease-in-out infinite;
}
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.title {
    font-size: 1.5rem;
    margin: 5px 0 4px;
    color: var(--primary-color);
    text-shadow: 0 0 10px rgba(0, 217, 255, 0.75);
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 0.5px;
}
.subtitle {
    font-size: 0.95rem;
    margin-bottom: 12px;
    color: var(--accent-gold);
    font-weight: 500;
}

/* ä¼˜åŒ–å¡ç‰‡æ–‡å­—æŽ’ç‰ˆ */
.card {
    background: var(--card-bg);
    border: 1px solid var(--primary-color);
    border-radius: 10px;
    padding: 15px 12px;
    margin: 0 auto 12px;
    box-shadow: 0 0 12px rgba(0, 217, 255, 0.32);
    font-size: 0.85rem;
    width: 100%;
    line-height: 1.5;
}
.accuracy {
    font-size: 0.9rem;
    margin-bottom: 6px;
    font-weight: 600;
}
.percent { color: var(--accent-green); font-weight: bold; }
.desc {
    font-size: 0.8rem;
    line-height: 1.4;
    text-align: center;
}
.highlight {
    color: var(--accent-gold);
    font-weight: 700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.7);
    display: inline-block;
    animation: countBounce 0.4s ease-out;
}
/* ä¼˜åŒ–äººæ•°è·³åŠ¨åŠ¨ç”» */
@keyframes countBounce {
    0%, 100% {
        transform: scale(1);
        color: var(--accent-gold);
    }
    50% {
        transform: scale(1.3);
        color: #ffed4e;
        text-shadow: 0 0 15px rgba(255, 215, 0, 0.9);
    }
}

/* é”™è¯¯çŠ¶æ€æ ·å¼ */
.input-error {
    border: 2px solid red !important;
    animation: shake 0.3s ease-in-out;
}

/* æ™ƒåŠ¨åŠ¨ç”» */
@keyframes shake {
    0% { transform: translateX(0); }
    20% { transform: translateX(-5px); }
    40% { transform: translateX(5px); }
    60% { transform: translateX(-5px); }
    80% { transform: translateX(5px); }
    100% { transform: translateX(0); }
}

.input-group { margin: 12px 0; width: 100%; }
.input-group input {
    width: 100%;
    padding: 11px 12px;
    border-radius: 8px;
    border: 1px solid var(--primary-color);
    background: rgba(10, 22, 35, 0.7);
    color: #fff;
    font-size: 0.9rem;
    font-family: 'Exo 2', sans-serif;
    transition: all 0.3s ease;
}
.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 217, 255, 0.42);
}

/* å¢žå¼ºå¼€å§‹æŒ‰é’®åŠ¨ç”»æ•ˆæžœ */
.btn {
    background: linear-gradient(90deg, var(--primary-color), #0099ff);
    color: #fff;
    border: none;
    padding: 13px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.95rem;
    box-shadow: 0 0 20px rgba(0, 217, 255, 0.68);
    width: 100%;
    margin-top: 8px;
    font-family: 'Exo 2', sans-serif;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    animation: gentlePulse 2s infinite;
}
.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 217, 255, 0.85);
    animation: none;
}
.btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 15px rgba(0, 217, 255, 0.58);
}
.btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.7s ease;
}
.btn:hover::after {
    left: 100%;
}
/* æ›´æ˜¾çœ¼çš„è„‰å†²åŠ¨ç”» */
@keyframes gentlePulse {
    0%, 100% { box-shadow: 0 0 20px rgba(0, 217, 255, 0.68); }
    50% { box-shadow: 0 0 30px rgba(0, 217, 255, 0.85), 0 0 40px rgba(0, 217, 255, 0.58); }
}

/* è°ƒæ•´æ¨¡æ€æ¡†ä½ç½® */
.ai-modal { display: none; position: fixed; inset: 0; z-index: 10000; }
.ai-modal .modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(5px); }
.ai-modal .modal-content {
    position: relative;
    width: 90%;
    max-width: 340px;
    margin: 35vh auto;
    background: rgba(10, 22, 35, 0.95);
    border-radius: 14px;
    padding: 18px 14px;
    color: #fff;
    border: 1px solid var(--primary-color);
    max-height: 70vh;
    overflow-y: auto;
}
.modal-title { font-size: 16px; font-weight: 600; text-align: center; margin-bottom: 14px; color: var(--primary-color); font-family: 'Orbitron', sans-serif; }
.modal-text { font-size: 13px; text-align: center; margin-bottom: 16px; color: var(--text-light); }
.progress-item { margin-bottom: 12px; }
.progress-label { font-size: 12px; margin-bottom: 4px; display: block; color: var(--text-light); }
.progress-bar { width: 100%; height: 10px; border-radius: 6px; background: #1e293b; overflow: hidden; position: relative; }
.progress-fill { width: 0%; height: 100%; background: linear-gradient(90deg, #00d9ff, #20ff88); border-radius: 6px; transition: width 0.3s ease; }
.btn-whatsapp { display: block; width: 100%; padding: 11px; background: #20ff88; color: #fff; font-size: 14px; font-weight: 600; border-radius: 7px; cursor: pointer; text-align: center; font-family: 'Exo 2', sans-serif; }

/* é‡æ–°è®¾è®¡Cookieæ¨ªå¹… - åŒæŒ‰é’®ç‰ˆæœ¬ */
#cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 22, 45, 0.93);
    color: var(--text-light);
    padding: 15px;
    text-align: center;
    font-size: 13px;
    z-index: 20000;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-top: 1px solid var(--primary-color);
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.3);
}
#cookie-banner p {
    margin-bottom: 12px;
    max-width: 400px;
    line-height: 1.5;
}
.cookie-buttons {
    display: flex;
    gap: 10px;
}
#cookie-decline, #cookie-accept {
    padding: 8px 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
}
#cookie-accept {
    background: var(--accent-green);
    color: #000;
}
#cookie-accept:hover {
    background: #10d466;
    transform: translateY(-2px);
}
#cookie-decline {
    background: transparent;
    color: var(--text-light);
    border: 1px solid rgba(255, 255, 255, 0.3);
}
#cookie-decline:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ä¿®æ”¹åŽçš„é¡µè„šæ ·å¼ - åŽ»é™¤èƒŒæ™¯å’Œè¾¹æ¡† */
.footer {
    width: 100%;
    max-width: 400px;
    margin: 18px auto 0;
    padding: 8px 0;
    box-sizing: border-box;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-light);
    position: relative;
    z-index: 2;
    background: transparent;
    border: none;
    backdrop-filter: none;
}

/* ç§»é™¤é¡µè„šä¸Šæ–¹çš„æ¸å˜çº¿ */
.footer::before {
    display: none;
}

.footer-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.8rem;
    margin-bottom: 6px;
    color: var(--accent-gold);
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
    letter-spacing: 0.5px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
}

.footer-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.7rem;
    transition: all 0.3s ease;
    position: relative;
    padding: 2px 4px;
    white-space: nowrap;
}

.footer-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--primary-color);
    transition: width 0.3s ease;
    box-shadow: 0 0 5px var(--primary-color);
}

.footer-link:hover {
    color: var(--accent-green);
    text-shadow: 0 0 8px rgba(0, 217, 255, 0.68);
}

.footer-link:hover::after {
    width: 100%;
}

.loading-indicator {
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--primary-color);
    font-family: 'Orbitron', sans-serif;
    font-size: 12px;
    text-shadow: 0 0 5px var(--glow-color);
    width: 100%;
    margin: 8px auto 12px;
    background: transparent;
    border-radius: 6px;
    box-shadow: 0 0 20px rgba(0, 217, 255, 0.32);
    background: rgba(0, 22, 45, 0.32);
    backdrop-filter: blur(2px);
}
.loading-dots { display: inline-flex; margin-left: 6px; }
.loading-dots span { width: 5px; height: 5px; margin: 0 2px; background: var(--primary-color); border-radius: 50%; animation: bounce 1.5s infinite ease-in-out; }
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

/* è‹¹æžœSafariç‰¹å®šä¿®å¤ */
@media not all and (min-resolution:.001dpcm) {
    @supports (-webkit-appearance:none) {
        /* Safariç‰¹å®šæ ·å¼ */
        body {
            height: 100vh;
            display: flex;
            flex-direction: column;
            justify-content: flex-start;
        }
        .page-container {
            margin: 0 auto;
            padding-top: 15px;
        }
    }
}

@media (max-height: 700px) {
    .page-container { padding: 0 15px 10px; }
    .robot-img img { width: 90px; }
    .title { font-size: 1.3rem; }
    .card { padding: 10px; margin-bottom: 8px; }
    .ai-modal .modal-content { margin: 15vh auto; }
    .footer { margin-top: 12px; padding: 6px 0; }
}
@media (max-height: 600px) {
    .stock-ticker, .loading-indicator { height: 90px; }
    .ticker-item { height: 18px; font-size: 11px; }
    .ai-modal .modal-content { margin: 10vh auto; padding: 15px 10px; }
    .footer { margin-top: 10px; padding: 5px 0; font-size: 0.7rem; }
    .footer-title { font-size: 0.75rem; margin-bottom: 5px; }
    .footer-links { gap: 10px; }
    .footer-link { font-size: 0.65rem; }

    /* è¿›ä¸€æ­¥åŽ‹ç¼©åž‚ç›´ç©ºé—´ */
    .robot-img { margin-bottom: 5px; }
    .title { margin: 3px 0 2px; }
    .subtitle { margin-bottom: 8px; }
    .input-group { margin: 8px 0; }
    .btn { margin-top: 5px; padding: 10px 12px; }
}
@media (max-width: 480px) {
    .footer-links {
        flex-direction: row;
        gap: 10px;
    }
    .footer {
        max-width: 350px;
    }
}
@media (max-width: 380px) {
    .footer-links {
        gap: 8px;
    }
    .footer-link {
        font-size: 0.65rem;
        padding: 1px 3px;
    }
}