/* Base Reset & Variables */
html, body { 
    margin: 0; 
    padding: 0; 
    width: 100%; 
    background: #f4f7f6; 
    font-family: 'Segoe UI', 'Microsoft JhengHei', sans-serif;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
* { box-sizing: border-box; }

:root { 
    --billy-orange: #F5A623; 
    --billy-dark: #333; 
    --billy-blue: #008080; 
    --bg-light: #f9f9f9; 
    --slate-200: #e2e8f0;
    --slate-500: #64748b;
    --slate-800: #1e293b;
    --red-500: #ef4444;
    --green-500: #22c55e;
}

#billy-notes-wrapper {
    line-height: 1.6; 
    color: #333; 
    width: 100%; 
    max-width: 800px;
    margin: 0 auto; 
    padding: 20px; 
    background: #fff;
    min-height: 100vh;
    box-shadow: 0 0 20px rgba(0,0,0,0.05);
}

/* Typography */
#billy-notes-wrapper h1 { 
    color: var(--billy-blue); 
    border-bottom: 3px solid var(--billy-orange); 
    padding-bottom: 10px; 
    font-size: 2em; 
    text-align: center; 
    margin-bottom: 20px; 
    margin-top: 0; 
}
.en-text { font-weight: bold; color: #222; }
.zh-text { color: #666; font-size: 0.9em; display: block; margin-top: 4px; font-weight: normal; }

/* Cards & Layout */
.note-card { 
    background: var(--bg-light); 
    border-radius: 12px; 
    padding: 0; 
    margin: 20px 0; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.05); 
    border-top: 4px solid var(--billy-blue); 
    overflow: hidden;
}

.card-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--slate-200);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: #fff;
    gap: 15px;
}

/* Status Badge */
.status-badge {
    padding: 6px 24px;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 700;
    text-align: center;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}
.status-running { background: #fee2e2; color: #b91c1c; border-color: #fecaca; animation: pulse 2s infinite; }
.status-paused { background: #f1f5f9; color: var(--slate-500); border-color: var(--slate-200); }

/* Time Display */
.pressure-display {
    text-align: center;
    width: 100%;
    padding: 15px;
    background: var(--bg-light);
    border-radius: 8px;
    border: 1px solid var(--slate-200);
    position: relative;
    overflow: hidden;
}
.pressure-display::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, var(--billy-blue), var(--billy-orange));
}
.pressure-val {
    font-size: 3.5rem;
    font-family: monospace;
    font-weight: bold;
    color: var(--slate-800);
    line-height: 1.1;
}
.pressure-unit { font-size: 1.2rem; color: var(--slate-500); font-weight: bold; }

/* Diagram Area */
.diagram-container {
    position: relative;
    width: 100%;
    background: #0f172a; 
    border-bottom: 1px solid var(--slate-200);
    padding: 0;
    height: 350px;
    overflow: hidden;
}
.overlay-info {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.6);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.85rem;
    pointer-events: none;
    z-index: 50;
}

/* Sliders */
.sliders-wrapper {
    padding: 25px;
    background: #fff;
    border-bottom: 1px solid var(--slate-200);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.slider-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    font-size: 0.9rem;
    color: var(--slate-800);
}
.val-badge {
    background: var(--bg-light);
    border: 1px solid var(--slate-200);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.85rem;
}
.val-badge.temp { color: #ef4444; border-color: #fecaca; background: #fef2f2; }
.val-badge.vol { color: #3b82f6; border-color: #bfdbfe; background: #eff6ff; }

input[type=range] {
    -webkit-appearance: none; 
    width: 100%; 
    background: transparent; 
}
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 18px;
    width: 18px;
    border-radius: 50%;
    background: var(--billy-blue);
    cursor: pointer;
    margin-top: -6px; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    border: 2px solid white;
}
.slider-temp::-webkit-slider-thumb { background: #ef4444 !important; }
.slider-vol::-webkit-slider-thumb { background: #3b82f6 !important; }

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: var(--slate-200);
    border-radius: 3px;
}

/* Controls */
.controls {
    padding: 25px;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    background: #fff;
}

.controls button {
    padding: 15px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.btn-start {
    background: linear-gradient(135deg, #F5A623 0%, #F76B1C 100%);
    color: white;
    box-shadow: 0 4px 10px rgba(245, 166, 35, 0.3);
}
.btn-start.paused {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    box-shadow: 0 4px 10px rgba(34, 197, 94, 0.3);
}
.btn-start:hover { transform: translateY(-2px); box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15); }
.btn-start:active { transform: scale(0.98); }
.btn-start .zh-text { color: rgba(255,255,255,0.9); margin-top: 0; }

.btn-reset {
    background: white;
    border: 2px solid var(--billy-blue);
    color: var(--billy-blue);
}
.btn-reset:hover { background: #f0f8f8; transform: translateY(-2px); }
.btn-reset:active { transform: scale(0.98); }
.btn-reset .zh-text { color: var(--billy-blue); margin-top: 0; }

/* Info Box */
.info-box {
    margin: 0 25px 25px 25px;
    padding: 20px;
    background: #fffbf0;
    border-left: 5px solid var(--billy-orange);
    border-radius: 0 8px 8px 0;
    color: #333;
    font-size: 0.95rem;
}

/* Animations */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Mobile Optimization */
@media (max-width: 600px) {
    #billy-notes-wrapper { padding: 12px; }
    .card-header { padding: 15px; }
    .sliders-wrapper { grid-template-columns: 1fr; gap: 15px; padding: 20px; }
    .controls { grid-template-columns: 1fr; gap: 15px; padding: 20px; }
    .info-box { margin: 0 15px 20px 15px; padding: 15px; }
    .pressure-val { font-size: 2.5rem; }
}