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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    color: #fff;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 20px;
}

header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.last-update {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.auto-refresh-status {
    color: #00d4aa;
    font-size: 0.8rem;
    margin-top: 5px;
}

.controls {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.add-stock {
    display: flex;
    gap: 10px;
    flex: 1;
    min-width: 250px;
}

.add-stock input {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1rem;
    outline: none;
    transition: background 0.3s;
}

.add-stock input::placeholder {
    color: #888;
}

.add-stock input:focus {
    background: rgba(255, 255, 255, 0.15);
}

.add-stock button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    background: #00d4aa;
    color: #1a1a2e;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.add-stock button:hover {
    background: #00b894;
    transform: translateY(-2px);
}

.refresh-btn {
    padding: 12px 20px;
    border: 2px solid #00d4aa;
    border-radius: 8px;
    background: transparent;
    color: #00d4aa;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.refresh-btn:hover {
    background: #00d4aa;
    color: #1a1a2e;
    transform: translateY(-2px);
}

.refresh-btn:active {
    transform: translateY(0);
}

.stock-list {
    display: grid;
    gap: 15px;
}

.stock-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stock-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(5px);
}

.stock-info h3 {
    font-size: 1.3rem;
    margin-bottom: 5px;
}

.stock-info .name {
    color: #888;
    font-size: 0.85rem;
}

.stock-price {
    text-align: right;
}

.stock-price .price {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.stock-price .change {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
}

.stock-price .change.up, .stock-price .change {
    color: #ff6b6b; /* 漲 */
}

.stock-price .change.down {
    color: #00d4aa;
}

.stock-price .change.neutral {
    color: #888;
}

.delete-btn {
    background: rgba(255, 107, 107, 0.2);
    border: none;
    color: #ff6b6b; /* 漲 */
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    margin-left: 15px;
    transition: all 0.3s;
}

.delete-btn:hover {
    background: rgba(255, 107, 107, 0.3);
}

.loading {
    text-align: center;
    padding: 40px;
    color: #888;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #00d4aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #888;
}

.empty-state p {
    margin-bottom: 10px;
}

.empty-state .hint {
    font-size: 0.9rem;
    color: #666;
}

.error-message {
    background: rgba(255, 107, 107, 0.1);
    color: #ff6b6b; /* 漲 */
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    text-align: center;
}

@media (max-width: 600px) {
    header h1 {
        font-size: 1.5rem;
    }
    
    .controls {
        flex-direction: column;
    }
    
    .refresh-btn {
        width: 100%;
    }
    
    .stock-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .stock-price {
        text-align: left;
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .stock-price .change {
        justify-content: flex-start;
    }
}
