/* ========================================
   定投可视化 - Spotify 风格主题
   ======================================== */

:root {
    --spotify-black: #000000;
    --spotify-dark: #121212;
    --spotify-card: #181818;
    --spotify-highlight: #282828;
    --spotify-border: #3e3e3e;
    --spotify-green: #1DB954;
    --spotify-green-dark: #1aa34a;
    --spotify-text-primary: #ffffff;
    --spotify-text-secondary: #b3b3b3;
    --spotify-text-muted: #6a6a6a;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--spotify-black);
    color: var(--spotify-text-primary);
    min-height: 100vh;
    line-height: 1.5;
}

#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ========================================
   Header Styles
   ======================================== */
.app-header {
    background: linear-gradient(to bottom, rgba(29, 185, 84, 0.15), transparent);
    padding: 16px 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--spotify-green);
}

.brand-name {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.stats-summary {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
}

.stat-item {
    text-align: right;
}

.stat-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--spotify-text-secondary);
    margin-bottom: 2px;
}

.stat-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--spotify-text-primary);
}

.stat-value.highlight {
    color: var(--spotify-green);
}

.stat-value.profit {
    color: var(--spotify-green);
}

.stat-value.loss {
    color: #e91429;
}

/* ========================================
   Main Content Layout
   ======================================== */
.main-content {
    flex: 1;
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 24px;
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

@media (max-width: 900px) {
    .main-content {
        grid-template-columns: 1fr;
        padding: 16px;
    }
    
    .stats-summary {
        width: 100%;
        justify-content: center;
    }
}

/* ========================================
   Control Panel
   ======================================== */
.control-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.panel-card {
    background-color: var(--spotify-card);
    border-radius: 8px;
    padding: 20px;
    transition: background-color 0.2s ease;
}

.panel-card:hover {
    background-color: var(--spotify-highlight);
}

.panel-title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--spotify-text-secondary);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid solid rgba(255, 255, 255, 0.05);
}

.control-group {
    margin-bottom: 18px;
}

.control-group:last-child {
    margin-bottom: 0;
}

.control-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--spotify-text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ========================================
   Custom Inputs - Spotify Style
   ======================================== */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-prefix,
.input-suffix {
    position: absolute;
    color: var(--spotify-text-muted);
    font-size: 14px;
    pointer-events: none;
}

.input-prefix {
    left: 14px;
}

.input-suffix {
    right: 14px;
}

.spotify-input {
    width: 100%;
    background-color: var(--spotify-highlight);
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 12px 14px;
    padding-left: 32px;
    color: var(--spotify-text-primary);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    outline: none;
}

.spotify-input:focus {
    border-color: var(--spotify-green);
    box-shadow: 0 0 0 2px rgba(29, 185, 84, 0.25);
}

.spotify-input:hover:not(:focus) {
    border-color: var(--spotify-border);
}

.spotify-input.has-suffix {
    padding-right: 50px;
}

.select-wrapper {
    position: relative;
}

.spotify-select {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    background-color: var(--spotify-highlight);
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 12px 40px 12px 14px;
    color: var(--spotify-text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23b3b3b3' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.spotify-select:focus {
    border-color: var(--spotify-green);
    box-shadow: 0 0 0 2px rgba(29, 185, 84, 0.25);
}

.spotify-select:hover:not(:focus) {
    border-color: var(--spotify-border);
}

.spotify-select option {
    background-color: var(--spotify-card);
    color: var(--spotify-text-primary);
}

.range-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.spotify-range {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: var(--spotify-border);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.spotify-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--spotify-green);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.15s ease;
}

.spotify-range::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.spotify-range::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--spotify-green);
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

.range-value {
    min-width: 36px;
    text-align: right;
    font-size: 14px;
    font-weight: 600;
    color: var(--spotify-green);
}

/* ========================================
   Info Card
   ======================================== */
.info-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.info-row:last-child {
    border-bottom: none;
}

.info-row span:first-child {
    color: var(--spotify-text-secondary);
}

.info-row span:last-child {
    color: var(--spotify-text-primary);
    font-weight: 600;
}

/* ========================================
   Chart Section
   ======================================== */
.chart-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chart-container {
    background-color: var(--spotify-card);
    border-radius: 8px;
    padding: 24px;
    flex: 1;
    min-height: 450px;
    position: relative;
}

.chart-container canvas {
    width: 100% !important;
    height: 100% !important;
}

.chart-controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.legend-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background-color: var(--spotify-card);
    border: 1px solid transparent;
    border-radius: 20px;
    color: var(--spotify-text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.6;
}

.legend-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.legend-btn.active {
    opacity: 1;
    border-color: var(--spotify-border);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

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

.panel-card {
    animation: fadeInUp 0.4s ease forwards;
}

.panel-card:nth-child(2) {
    animation-delay: 0.1s;
}

.chart-container {
    animation: fadeInUp 0.4s ease 0.2s both;
}

/* ========================================
   Scrollbar
   ======================================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--spotify-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--spotify-border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ========================================
   Number Input Arrows
   ======================================== */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    opacity: 1;
    filter: invert(1);
}
