:root {
    --bg-dark: #0f0b1e;
    --bg-gradient: linear-gradient(180deg, #130f26 0%, #0a0814 100%);
    --primary-color: #9b59b6; /* Purple */
    --primary-glow: #e056fd; /* Brighter glow */
    --primary-glow-rgb: 224, 86, 253;
    --accent-color: #8e44ad;
    --accent-cyan: #00d2d3;
    --glass-bg: rgba(20, 15, 40, 0.7);
    --glass-border: rgba(162, 155, 254, 0.2);
    --text-color: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.6);
    --orb-gradient: radial-gradient(circle at 30% 30%, var(--primary-glow), var(--accent-color));
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Noto Sans SC', sans-serif;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-dark);
    background-image: var(--bg-gradient);
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Background Effects */
.background-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.stars {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(1px 1px at 15% 15%, rgba(255,255,255,0.8) 100%, transparent),
        radial-gradient(1px 1px at 25% 25%, rgba(255,255,255,0.8) 100%, transparent),
        radial-gradient(2px 2px at 50% 50%, rgba(255,255,255,0.8) 100%, transparent);
    background-size: 550px 550px;
    opacity: 0.4;
    animation: twinkle 5s infinite alternate;
}

.nebula {
    position: absolute;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 50% -20%, rgba(142, 68, 173, 0.2), transparent 60%),
        radial-gradient(circle at 100% 50%, rgba(0, 210, 211, 0.1), transparent 50%),
        radial-gradient(circle at 0% 80%, rgba(190, 46, 221, 0.15), transparent 50%);
    filter: blur(60px);
}

@keyframes twinkle {
    0% { opacity: 0.3; }
    100% { opacity: 0.6; }
}

/* Character Layer */
.character-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
}

.hologram-effect {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.character-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    mask-image: linear-gradient(to bottom, black 80%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 80%, transparent 100%);
    filter: brightness(0.9) contrast(1.1);
    transition: all 0.5s ease;
}

/* Screen Overlay Effects */
.screen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    pointer-events: none;
}

.scanlines {
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(255,255,255,0),
        rgba(255,255,255,0) 50%,
        rgba(0,0,0,0.1) 50%,
        rgba(0,0,0,0.1)
    );
    background-size: 100% 4px;
    opacity: 0.6;
}

.vignette {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, transparent 50%, rgba(0,0,0,0.6) 100%);
}

/* Floating Particles */
.floating-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 1;
}

.floating-particles::before, .floating-particles::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle, rgba(255,255,255,0.3) 1px, transparent 1px),
        radial-gradient(circle, rgba(255,255,255,0.3) 1px, transparent 1px);
    background-size: 60px 60px, 100px 100px;
    background-position: 0 0, 40px 40px;
    animation: floatUp 20s linear infinite;
    opacity: 0.3;
}

.floating-particles::after {
    background-size: 150px 150px, 200px 200px;
    background-position: 20px 80px, 80px 20px;
    animation-duration: 30s;
    animation-direction: reverse;
}

@keyframes floatUp {
    0% { transform: translateY(0); }
    100% { transform: translateY(-1000px); }
}

/* Character Breathing & Float */
.character-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    mask-image: linear-gradient(to bottom, black 80%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 80%, transparent 100%);
    filter: brightness(0.9) contrast(1.1);
    transition: all 0.5s ease;
    animation: breathe 6s ease-in-out infinite;
}

@keyframes breathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

/* UI Layer */
.ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    pointer-events: none;
}

/* Top HUD (Redesigned) */
.top-hud {
    padding: 40px 20px 20px; /* Status bar space */
    display: flex;
    justify-content: space-between;
    align-items: flex-start; /* Align to top */
    pointer-events: auto;
    width: 100%;
}

.hud-pill {
    background: rgba(15, 11, 30, 0.6);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(142, 68, 173, 0.3);
    border-radius: 30px;
    padding: 5px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 44px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.center-pill {
    border-color: rgba(255, 255, 255, 0.1);
    padding: 5px 25px;
    background: rgba(15, 11, 30, 0.8);
}

.hud-text-col {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.1;
}

.hud-label {
    font-size: 8px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.hud-value {
    font-size: 12px;
    font-weight: 700;
    color: #fff;
}

.char-name-display {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    background: linear-gradient(90deg, #fff, var(--primary-glow));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.mini-progress {
    width: 30px;
    height: 3px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    margin-left: 5px;
}

.mini-fill {
    height: 100%;
    background: var(--primary-glow);
    box-shadow: 0 0 5px var(--primary-glow);
}

/* Views Container */
.views-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    z-index: 5;
    perspective: 1000px; /* Add depth */
}

.view-section {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    transform: scale(1.1) translateZ(-50px); /* Start further away */
    filter: blur(10px); /* Start blurred */
    overflow-y: auto; /* 允许垂直滚动 */
    overflow-x: hidden; /* 隐藏水平滚动条 */
}

.view-section.active {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1) translateZ(0);
    filter: blur(0);
}

/* Home View Layout */
.side-action-bar {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 20;
}

.side-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    position: relative;
    overflow: hidden;
}

.side-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
}

.side-btn:hover {
    background: rgba(142, 68, 173, 0.2);
    border-color: var(--primary-glow);
    color: var(--primary-glow);
    transform: scale(1.1) translateX(-5px);
    box-shadow: 0 0 15px var(--primary-glow);
    text-shadow: 0 0 8px var(--primary-glow);
}

.side-btn:hover::before {
    opacity: 1;
}

.side-btn:active {
    transform: scale(0.95);
}

/* HUD Card Design - Vertical Layout */
.hud-card {
    background: rgba(15, 11, 30, 0.6); /* More transparent */
    backdrop-filter: blur(10px);
    border: 1px solid rgba(142, 68, 173, 0.2);
    border-radius: 16px;
    padding: 12px;
    display: flex;
    flex-direction: column; /* Vertical stack */
    gap: 10px;
    width: 140px; /* Fixed slim width */
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    position: relative;
    overflow: hidden;
    margin-top: -5px; /* Slight adjustment */
}

.hud-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom, transparent, var(--primary-glow), transparent);
    animation: scanVertical 3s linear infinite;
}

.stat-main {
    display: flex;
    flex-direction: column; /* Stack icon and bar */
    gap: 8px;
    padding-bottom: 10px;
    border-right: none; /* Remove side border */
    border-bottom: 1px solid rgba(255,255,255,0.1); /* Add bottom separator */
    padding-right: 0;
}

.stat-main-top {
    display: flex;
    align-items: center;
    gap: 10px;
}

.icon-box {
    width: 28px; /* Smaller icon */
    height: 28px;
    background: rgba(255, 118, 117, 0.1);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #ff7675;
    font-size: 12px;
    border: 1px solid rgba(255, 118, 117, 0.3);
    flex-shrink: 0;
}

.heart-pulse {
    animation: heartbeat 1.5s ease-in-out infinite;
}

.stat-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
}

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

.stat-label {
    font-size: 8px;
    color: rgba(255,255,255,0.5);
    letter-spacing: 1px;
}

.level-value {
    font-size: 12px;
    font-weight: 800;
    color: white;
    text-shadow: 0 0 5px rgba(255,255,255,0.5);
}

.tech-progress-bar {
    width: 100%;
    height: 3px; /* Thinner bar */
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
    margin-top: 2px;
}

.tech-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff7675, #e056fd);
    box-shadow: 0 0 10px #e056fd;
    position: relative;
}

.tech-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 2px;
    height: 100%;
    background: white;
    box-shadow: 0 0 5px white;
}

.stat-sub-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stat-chip {
    display: flex;
    align-items: center;
    justify-content: space-between; /* Spread content */
    gap: 6px;
    font-size: 10px;
    color: rgba(255,255,255,0.8);
    background: rgba(255,255,255,0.03);
    padding: 4px 8px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.05);
}

.stat-chip i {
    font-size: 10px;
}

.stat-chip.mood i { color: #fdcb6e; }
.stat-chip.energy i { color: #00d2d3; }

@keyframes heartbeat {
    0% { transform: scale(1); }
    15% { transform: scale(1.15); }
    30% { transform: scale(1); }
    45% { transform: scale(1.15); }
    60% { transform: scale(1); }
}

@keyframes scanVertical {
    0% { top: -100%; }
    100% { top: 100%; }
}

/* Update icons in HUD (Remove old styles) */
/* .heart-icon, .stat-item .icon { ... } */

.home-voice-trigger {
    position: absolute;
    bottom: 110px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 20;
}

.voice-orb {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-glow), var(--accent-color));
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 26px;
    color: white;
    box-shadow: 
        0 0 20px rgba(224, 86, 253, 0.6),
        inset 0 2px 10px rgba(255, 255, 255, 0.4),
        inset 0 -2px 10px rgba(0, 0, 0, 0.2);
    z-index: 2;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.voice-orb::after {
    content: '';
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 40%;
    height: 30%;
    border-radius: 50%;
    background: linear-gradient(to bottom, rgba(255,255,255,0.4), transparent);
    filter: blur(2px);
}

.home-voice-trigger:hover .voice-orb {
    transform: scale(1.1);
    box-shadow: 
        0 0 30px rgba(224, 86, 253, 0.8),
        inset 0 2px 15px rgba(255, 255, 255, 0.6);
}

.home-voice-trigger:active .voice-orb {
    transform: scale(0.95);
}

.orb-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(224, 86, 253, 0.4) 0%, transparent 70%);
    animation: pulse-glow 2s infinite;
    z-index: 0;
}

.orb-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 15px var(--primary-glow);
    animation: ring-scale 3s infinite linear;
    opacity: 0;
    z-index: 1;
}

@keyframes pulse-glow {
    0% { transform: scale(0.8); opacity: 0.8; }
    50% { transform: scale(1.2); opacity: 0.4; }
    100% { transform: scale(0.8); opacity: 0.8; }
}

@keyframes ring-scale {
    0% { transform: scale(0.8); opacity: 1; border-width: 2px; }
    100% { transform: scale(2); opacity: 0; border-width: 0px; }
}

.cinematic-subtitle {
    position: absolute;
    bottom: 190px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    text-align: center;
    background: linear-gradient(90deg, transparent, rgba(0,0,0,0.6) 20%, rgba(0,0,0,0.6) 80%, transparent);
    padding: 10px;
    border-radius: 5px;
    pointer-events: none; /* Let clicks pass through */
    transition: all 0.3s ease;
}

.cinematic-subtitle p {
    font-size: 13px;
    line-height: 1.5;
    color: rgba(255,255,255,0.9);
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    font-style: italic;
    transition: all 0.3s ease;
}

/* Bottom Nav (Redesigned) */
.bottom-nav {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 380px;
    height: 65px;
    background: rgba(15, 11, 30, 0.85);
    backdrop-filter: blur(20px);
    border-radius: 35px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0 20px;
    z-index: 50;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    pointer-events: auto;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    width: 50px;
}

.nav-item.active {
    color: var(--primary-glow);
    text-shadow: 0 0 10px var(--primary-glow);
}

.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    width: 4px;
    height: 4px;
    background: var(--primary-glow);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--primary-glow);
}

.nav-icon {
    font-size: 20px;
    margin-bottom: 2px;
    transition: transform 0.2s;
}

.nav-item:hover .nav-icon {
    transform: translateY(-2px);
}

.nav-text {
    font-size: 10px;
    font-weight: 500;
}

/* Chat View Redesign */
#view-chat {
    background: rgba(0,0,0,0.4); /* Dim background for chat */
}

.chat-interface {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding-bottom: 120px; /* Space for nav */
}

.chat-history {
    flex: 1;
    width: 100%;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    mask-image: linear-gradient(to bottom, transparent 0%, black 10%, black 100%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 10%, black 100%);
}

.msg {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    max-width: 80%;
    animation: fadeIn 0.3s ease-out;
}

.msg-avatar {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.msg-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.msg-content {
    padding: 10px 15px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
    position: relative;
    max-width: 100%;
    word-wrap: break-word;
}

.msg.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.msg.user .msg-content {
    background: rgba(142, 68, 173, 0.2);
    border: 1px solid rgba(142, 68, 173, 0.4);
    color: white;
    border-bottom-right-radius: 2px;
}

.msg.user .msg-avatar {
    border-color: rgba(142, 68, 173, 0.4);
}

.msg.ai {
    align-self: flex-start;
    flex-direction: row;
}

.msg.ai .msg-content {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    border-bottom-left-radius: 2px;
}

.msg.ai .msg-avatar {
    border-color: rgba(0, 210, 211, 0.3);
}

.msg.system {
    align-self: center;
    justify-content: center;
}

.msg.system .msg-content {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-size: 11px;
    text-align: center;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 5px 10px;
}

.msg.user .msg-content::before {
    content: 'YOU';
    position: absolute;
    top: -14px;
    right: 0;
    font-size: 8px;
    color: var(--primary-glow);
    opacity: 0.7;
}

.msg.ai .msg-content::before {
    content: attr(data-character-name);
    position: absolute;
    top: -14px;
    left: 0;
    font-size: 8px;
    color: rgba(255,255,255,0.5);
    opacity: 0.7;
}

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

.character-dialogue-bubble {
    background: rgba(20, 15, 40, 0.85);
    border: 1px solid rgba(142, 68, 173, 0.3);
    border-radius: 20px;
    border-bottom-left-radius: 4px;
    padding: 20px;
    margin: 0 20px 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
    backdrop-filter: blur(15px);
    transform: translateY(0);
}

.typing-text {
    font-size: 14px;
    line-height: 1.6;
    color: #fff;
}

.voice-control-area {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

/* Text Input Fallback */
.text-input-wrapper {
    width: 90%;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    background: rgba(20, 15, 40, 0.6);
    padding: 5px 5px 5px 15px; /* Adjust padding */
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s;
}

.text-input-wrapper:focus-within {
    border-color: var(--primary-glow);
    background: rgba(20, 15, 40, 0.9);
    box-shadow: 0 0 15px rgba(142, 68, 173, 0.2);
}

.text-input-wrapper input {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    padding: 10px 0;
    outline: none;
    font-size: 14px;
}

/* Mini Voice Button */
.voice-btn-mini {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    border-radius: 50%;
    position: relative;
    transition: all 0.3s;
}

.voice-btn-mini:hover {
    color: var(--primary-glow);
    background: rgba(255,255,255,0.05);
}

.voice-btn-mini.listening {
    color: #ff7675;
    animation: pulse-red 1.5s infinite;
}

.voice-wave-mini {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid #ff7675;
    opacity: 0;
    pointer-events: none;
}

.voice-btn-mini.listening .voice-wave-mini {
    animation: ripple 1.5s infinite;
    opacity: 1;
}

@keyframes pulse-red {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes ripple {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(2); opacity: 0; }
}

.text-input-wrapper .send-btn {
    background: var(--primary-color);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s;
    padding: 0;
}

.text-input-wrapper .send-btn:hover {
    background: var(--primary-glow);
    box-shadow: 0 0 10px var(--primary-glow);
    transform: rotate(-10deg) scale(1.1);
}


.quick-replies {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 5px 20px;
    width: 100%;
    scrollbar-width: none;
}

.chip-btn {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    white-space: nowrap;
    transition: all 0.3s;
}

.chip-btn:hover {
    background: rgba(142, 68, 173, 0.5);
    border-color: var(--primary-glow);
}

/* Login View Redesign */
#view-login {
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-container {
    background: rgba(15, 11, 30, 0.8);
    border: 1px solid rgba(142, 68, 173, 0.3);
    box-shadow: 0 0 60px rgba(142, 68, 173, 0.15);
    padding: 40px;
    border-radius: 20px;
    width: 80%;
    max-width: 400px;
    text-align: center;
}

.login-btn {
    background: linear-gradient(45deg, #8e44ad, #e056fd);
    box-shadow: 0 4px 15px rgba(142, 68, 173, 0.4);
    border: none;
    padding: 15px 30px;
    border-radius: 30px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    margin-top: 20px;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.input-group {
    margin-bottom: 20px;
    text-align: left;
}

.input-group label {
    display: block;
    font-size: 10px;
    color: var(--accent-color);
    margin-bottom: 5px;
    letter-spacing: 1px;
}

.input-group input {
    width: 100%;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 10px;
    border-radius: 8px;
    color: white;
    outline: none;
}

.input-group input:focus {
    border-color: var(--primary-glow);
}

/* Explore & Archive Common */
.archive-panel, .explore-header, .task-list {
    background: rgba(15, 11, 30, 0.85);
    border: 1px solid rgba(142, 68, 173, 0.2);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    backdrop-filter: blur(20px);
    padding: 20px;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    margin: 20px auto;
}

/* 档案面板特殊样式 */
.archive-panel {
    margin-top: 100px; /* 留出顶部空间 */
    margin-bottom: 100px; /* 留出底部空间 */
}

.explore-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 100px; /* Space for Top HUD */
}

.explore-header h2, .archive-panel h2 {
    font-size: 18px;
    color: #fff;
    text-shadow: 0 0 10px rgba(224, 86, 253, 0.5);
    margin-bottom: 20px;
}

/* 角色档案样式 */
.character-profile {
    margin-bottom: 20px;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(142, 68, 173, 0.3);
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 2px solid var(--primary-glow);
    box-shadow: 0 0 15px rgba(224, 86, 253, 0.5);
    object-fit: cover;
}

.profile-title h3 {
    font-size: 20px;
    color: #fff;
    margin-bottom: 5px;
    text-shadow: 0 0 10px rgba(224, 86, 253, 0.5);
}

.profile-subtitle {
    font-size: 12px;
    color: var(--accent-cyan);
    opacity: 0.8;
}

.profile-section {
    margin-bottom: 15px;
}

.profile-section h4 {
    font-size: 14px;
    color: var(--primary-glow);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.profile-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.profile-value {
    font-size: 12px;
    color: #fff;
}

.profile-text {
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-secondary);
    text-align: justify;
}

.special-skill {
    background: rgba(224, 86, 253, 0.1);
    padding: 10px;
    border-radius: 10px;
    border: 1px solid rgba(224, 86, 253, 0.3);
}

.special-skill h4 {
    color: #fff;
}

.special-skill .profile-text {
    color: #fff;
    font-weight: 500;
}

.stamina-pill {
    background: rgba(0,0,0,0.4);
    border: 1px solid #f1c40f;
    color: #f1c40f;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 10px;
}

.location-cards {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 90%;
    max-width: 400px;
    margin: 20px auto;
}

.location-card {
    background: rgba(15, 11, 30, 0.9); /* High opacity for contrast */
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.location-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s;
}

.location-card:hover {
    background: rgba(20, 15, 40, 0.95);
    border-color: var(--primary-glow);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(142, 68, 173, 0.3);
}

.location-card:hover::before {
    transform: translateX(100%);
}

.location-card.locked {
    opacity: 0.6;
    filter: grayscale(0.8);
    cursor: not-allowed;
    background: rgba(10, 8, 20, 0.9);
}

.location-card.locked:hover {
    transform: none;
    box-shadow: none;
    border-color: rgba(255, 255, 255, 0.1);
}

.card-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(142, 68, 173, 0.2), rgba(0, 0, 0, 0.2));
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    color: var(--primary-glow);
    box-shadow: inset 0 0 10px rgba(0,0,0,0.2);
}

.location-card:hover .card-icon-wrapper {
    background: var(--primary-glow);
    color: white;
    box-shadow: 0 0 15px var(--primary-glow);
}

.card-info {
    flex: 1;
}

.card-info h3 {
    font-size: 15px;
    margin-bottom: 4px;
    color: white;
    font-weight: 600;
}

.card-info p {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
}

.card-arrow {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.3);
    transition: all 0.3s;
}

.location-card:hover .card-arrow {
    color: white;
    transform: translateX(3px);
}

.location-card.locked .card-arrow {
    color: rgba(255, 255, 255, 0.2);
}

.task-list {
    margin-top: 0;
}

.task-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    margin-bottom: 10px;
    transition: all 0.3s;
}

.task-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(5px);
    border-color: rgba(255, 255, 255, 0.2);
}

.claim-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-glow));
    border: none;
    color: white;
    padding: 6px 18px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(142, 68, 173, 0.3);
    transition: all 0.3s;
}

.claim-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px var(--primary-glow);
}

.claim-btn:disabled {
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.4);
    box-shadow: none;
    cursor: default;
    transform: none;
}

/* Beautified Wardrobe Button */
.btn-wardrobe {
    font-family: 'Noto Sans SC', sans-serif;
    font-weight: 600;
    font-size: 12px;
    padding: 8px 16px;
    border-radius: 12px;
    color: #ffffff;
    border: 1px solid rgba(255,255,255,0.18);
    background: linear-gradient(135deg, #7A59FF 0%, #B36CFF 100%);
    box-shadow: 0 4px 12px rgba(122, 89, 255, 0.35),
                inset 0 1px 0 rgba(255,255,255,0.25);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    outline: none;
}

.btn-wardrobe:hover {
    filter: brightness(1.1);
    box-shadow: 0 6px 16px rgba(122, 89, 255, 0.5);
    transform: translateY(-2px);
}

.btn-wardrobe:active {
    transform: translateY(1px);
    box-shadow: 0 2px 8px rgba(122, 89, 255, 0.3);
}

.btn-wardrobe i {
    font-size: 14px;
}

/* Character Selector */
.character-selector {
    background: rgba(0,0,0,0.2);
    padding: 10px;
    border-radius: 40px;
    display: flex;
    gap: 15px;
}

.char-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid transparent;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
}

.char-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.char-avatar.active {
    border-color: #e056fd;
    box-shadow: 0 0 15px rgba(224, 86, 253, 0.5);
    transform: scale(1.1);
}

/* Slider */
.slider {
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
}
.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary-glow);
    box-shadow: 0 0 10px var(--primary-glow);
    cursor: pointer;
}

/* Archive Stats */
.archive-stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: rgba(255,255,255,0.03);
    border-radius: 10px;
}

.setting-item {
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.toggle-switch {
    background: rgba(0,0,0,0.3);
    border-radius: 20px;
    padding: 2px;
    display: flex;
}

.toggle-switch span {
    padding: 5px 15px;
    font-size: 10px;
    border-radius: 18px;
    cursor: pointer;
}

.toggle-switch span.active {
    background: var(--primary-color);
    color: white;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 0px;
}

/* ========== 衣橱弹窗样式 ========== */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease-in-out;
}

.modal-content {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease-out;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid var(--glass-border);
}

.modal-header h2 {
    font-size: 20px;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header h2 i {
    color: var(--primary-color);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 28px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
}

.modal-body {
    padding: 25px;
    max-height: calc(80vh - 80px);
    overflow-y: auto;
}

.costume-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
}

.costume-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.costume-card:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(155, 89, 182, 0.3);
}

.costume-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 12px;
}

.costume-name {
    font-size: 14px;
    color: var(--text-color);
    margin-bottom: 12px;
    font-weight: 500;
}

.costume-select-btn {
    width: 100%;
    padding: 8px 16px;
    background: var(--primary-color);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.costume-select-btn:hover {
    background: var(--primary-glow);
    box-shadow: 0 5px 20px rgba(155, 89, 182, 0.5);
    transform: scale(1.05);
}

.costume-select-btn i {
    font-size: 12px;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* 滚动条样式 */
.modal-body::-webkit-scrollbar {
    width: 6px;
}

.modal-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--primary-glow);
}

/* 响应式设计 */
@media (max-width: 600px) {
    .modal-content {
        width: 95%;
        max-height: 85vh;
    }
    
    .costume-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 15px;
    }
    
    .costume-card img {
        height: 150px;
    }
}
