/* Base Reset & Variables from Demo Phy App */
html, body { 
    margin: 0; 
    padding: 0; 
    width: 100%; 
    background: #f4f7f6; 
    font-family: 'Segoe UI', 'Microsoft JhengHei', sans-serif;
    -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }

:root { 
    --billy-orange: #F5A623; 
    --billy-dark: #333; 
    --billy-blue: #008080; 
    --bg-light: #f9f9f9; 
    --slate-200: #e2e8f0;
    --slate-400: #94a3b8;
    --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: 900px;
    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;
}

/* Custom Buttons for Toggles */
.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    width: 100%;
}
.btn-toggle {
    padding: 10px 15px;
    border-radius: 8px;
    border: 2px solid var(--slate-200);
    background: white;
    cursor: pointer;
    font-weight: bold;
    color: var(--slate-500);
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 120px;
}
.btn-toggle:hover {
    background: #f8fafc;
}
.btn-toggle.active {
    border-color: var(--billy-blue);
    background: #e6f2f2;
    color: var(--billy-blue);
}
.btn-toggle .zh-text {
    margin-top: 2px;
    font-size: 0.8em;
}

/* Diagram Area */
.diagram-container {
    position: relative;
    width: 100%;
    background: #0f172a; /* Dark background for canvas */
    border-bottom: 1px solid var(--slate-200);
    padding: 0;
    line-height: 0;
}
.diagram-container svg {
    display: block;
    width: 100%;
    height: auto;
}

/* Sliders */
.sliders-wrapper {
    padding: 25px;
    background: #fff;
    border-bottom: 1px solid var(--slate-200);
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}
.slider-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
}
.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.vol { color: #3b82f6; border-color: #bfdbfe; background: #eff6ff; }

input[type=range] {
    -webkit-appearance: none; 
    width: 100%; 
    background: transparent; 
    margin-top: 10px;
    margin-bottom: 10px;
}
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-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;
}

/* Info Box */
.info-box {
    margin: 25px;
    padding: 20px;
    background: #fffbf0;
    border-left: 5px solid var(--billy-orange);
    border-radius: 0 8px 8px 0;
    color: #333;
    font-size: 0.95rem;
}
.info-box.success {
    background: #f0fdf4;
    border-left-color: var(--green-500);
}
.info-box.error {
    background: #fef2f2;
    border-left-color: var(--red-500);
}

/* Retina Preview */
.retina-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 15px;
    background: #1e293b;
    color: white;
    border-radius: 8px;
    margin-top: 15px;
    width: 100%;
}
.retina-box {
    width: 60px;
    height: 60px;
    background: black;
    border-radius: 8px;
    border: 1px solid var(--slate-500);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

@media (max-width: 600px) {
    #billy-notes-wrapper { padding: 12px; }
    .card-header { padding: 15px; }
    .sliders-wrapper { padding: 20px; }
    .info-box { margin: 15px; padding: 15px; }
    .btn-toggle { min-width: 45%; flex: 1; }
}