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

body {
    font-family: 'Noto Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

.main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

.input-section,
.visualization-section,
.advice-section,
.history-section {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.input-section {
    grid-column: 1;
}

.visualization-section {
    grid-column: 2;
}

.advice-section,
.history-section {
    grid-column: 1 / -1;
}

h2 {
    color: #4a5568;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #4a5568;
}

input,
select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

input:focus,
select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

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

.chart-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.chart-wrapper {
    width: 100%;
    max-width: 300px;
    position: relative;
    margin-bottom: 20px;
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
}

.input-color {
    background: #667eea;
}

.output-color {
    background: #764ba2;
}

.stats-panel {
    display: flex;
    justify-content: space-around;
    width: 100%;
    margin-top: 20px;
}

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

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: #718096;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #2d3748;
}

.advice-panel {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.advice-panel.warning {
    border-left-color: #f56565;
    background: linear-gradient(135deg, #fed7d7 0%, #feb2b2 100%);
}

.advice-panel.success {
    border-left-color: #48bb78;
    background: linear-gradient(135deg, #c6f6d5 0%, #9ae6b4 100%);
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.activity-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f7fafc;
    border-radius: 8px;
    border-left: 4px solid;
    transition: transform 0.2s ease;
}

.activity-item:hover {
    transform: translateX(5px);
}

.activity-item.input {
    border-left-color: #667eea;
}

.activity-item.output {
    border-left-color: #764ba2;
}

.activity-info {
    flex: 1;
}

.activity-name {
    font-weight: 600;
    color: #2d3748;
}

.activity-type {
    font-size: 0.9rem;
    color: #718096;
}

.activity-time {
    font-weight: 700;
    color: #4a5568;
}

.delete-btn {
    background: #f56565;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background 0.2s ease;
}

.delete-btn:hover {
    background: #e53e3e;
}

.empty-message {
    text-align: center;
    color: #718096;
    font-style: italic;
    padding: 40px;
}

.preset-activities {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.preset-btn {
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #4a5568;
    position: relative;
}

.preset-btn:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
}

.preset-btn.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
}

.type-toggle {
    display: flex;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e2e8f0;
}

.toggle-btn {
    flex: 1;
    padding: 12px;
    border: none;
    background: #f7fafc;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
    color: #4a5568;
}

.toggle-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.toggle-btn:hover:not(.active) {
    background: #edf2f7;
}

.time-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.time-btn {
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #4a5568;
    flex: 1;
    min-width: 80px;
}

.time-btn:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
}

.time-btn.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
}

.time-period-selector {
    margin-bottom: 20px;
}

.period-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.period-btn {
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #4a5568;
}

.period-btn:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
}

.period-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
}

.period-info {
    text-align: center;
    margin-bottom: 15px;
    color: #718096;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main {
        grid-template-columns: 1fr;
    }
    
    .input-section,
    .visualization-section {
        grid-column: 1;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .stats-panel {
        flex-direction: column;
        gap: 15px;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.activity-item {
    animation: fadeIn 0.3s ease;
}

.advice-panel {
    animation: fadeIn 0.5s ease;
}