:root {
    --bg-color: #f0f2f5;
    --card-bg: #ffffff;
    --text-color: #1c1e21;
    --primary: #007bff;
    --secondary: #28a745;
    --border: #dddfe2;
}

.dark-mode {
    --bg-color: #18191a;
    --card-bg: #242526;
    --text-color: #e4e6eb;
    --border: #3e4042;
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
    margin: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
    transition: background-color 0.3s ease;
}

.dpf-wide-container {
    width: 99vw;
    margin: 0 auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    height: 98vh;
    box-sizing: border-box;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px 10px;
    border-bottom: 1px solid var(--border);
}

header h1 {
    font-size: 1.4rem;
    margin: 0;
    color: var(--primary);
}

.theme-btn {
    padding: 0.4rem 0.8rem;
    background-color: transparent;
    border: 1px solid var(--border);
    color: var(--text-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
}

.main-layout {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr; /* 3등분 폭 균등 */
    gap: 15px;
    flex: 1;
    margin-top: 15px;
    overflow: hidden;
}

.layout-col {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 15px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* 애니메이션 효과 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade {
    animation: fadeIn 0.8s ease-out forwards;
}

/* 입력 컬럼 */
.system-diagram-container img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 12px;
}

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

.form-section h3 {
    font-size: 0.95rem;
    margin: 0 0 10px;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 4px;
    color: var(--primary);
}

.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.85rem;
}

.form-row span {
    flex: 1;
    font-weight: 600;
}

.form-row input {
    width: 100px;
    padding: 5px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 0.9rem;
}

.triple-input {
    display: flex;
    gap: 4px;
    width: 180px;
}

.triple-input input {
    width: 100%;
    padding: 5px 2px;
    text-align: center;
}

.btn-group-vertical {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.btn-group-vertical button {
    padding: 12px;
    font-weight: bold;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    color: white;
    font-size: 0.95rem;
    transition: background 0.2s;
}

.primary-btn { background: var(--primary); }
.secondary-btn { background: var(--secondary); }
.primary-btn:hover { background: #0056b3; }
.secondary-btn:hover { background: #1e7e34; }

.guide-box-mini {
    font-size: 0.75rem;
    margin-top: 15px;
    color: var(--text-color);
    opacity: 0.7;
    font-style: italic;
    background: var(--bg-color);
    padding: 8px;
    border-radius: 6px;
}

/* 결과 컬럼 */
.results-container h3 {
    font-size: 1.1rem;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 8px;
    margin-top: 0;
}

.result-card {
    background: var(--bg-color);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 12px;
    border-left: 5px solid var(--primary);
    font-size: 0.95rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    /* 결과 카드에도 애니메이션 적용 */
    animation: fadeIn 0.5s ease-out forwards;
}

.result-card strong {
    color: var(--primary);
    display: block;
    margin-bottom: 8px;
    font-size: 1rem;
}

.result-card p {
    margin: 4px 0;
    font-family: 'Consolas', monospace;
}

.placeholder-msg {
    text-align: center;
    margin-top: 60px;
    opacity: 0.5;
    font-size: 1.1rem;
}

/* 그래프 컬럼 */
.graph-box {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.graph-box h3 {
    font-size: 1.1rem;
    margin: 0 0 15px;
    text-align: center;
}

.chart-wrapper {
    flex: 1;
    position: relative;
    background: white;
    border-radius: 10px;
    padding: 15px;
    min-height: 400px;
    border: 1px solid var(--border);
}

.dark-mode .chart-wrapper {
    background: #ffffff;
}

@media (max-width: 1000px) {
    .main-layout {
        grid-template-columns: 1fr;
        overflow-y: auto;
    }
    .layout-col {
        height: auto;
        overflow: visible;
    }
    .dpf-wide-container {
        height: auto;
    }
}
