/* Echo — shared base styles. */

/* ─── Reset ─── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* ─── Design tokens ─── */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #eef2ff;
    --bg: #fafafa;
    --surface: #fff;
    --text: #1e293b;
    --text-dim: #64748b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --success: #22c55e;
    --warning: #f59e0b;
    --error: #ef4444;
    --radius: 12px;
    --radius-sm: 8px;
}

/* ─── Base ─── */
html { font-size: 16px; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ─── Typography ─── */
h1 { font-size: 18px; font-weight: 600; }
h2 { font-size: 16px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; }

/* ─── Buttons ─── */
.btn {
    display: inline-block;
    padding: 8px 18px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    text-decoration: none;
    line-height: 1.4;
}
.btn:hover { opacity: 0.9; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: var(--surface); border: 1px solid var(--border); color: var(--text-dim); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: var(--surface); border: 1px solid #fecaca; color: var(--error); }
.btn-danger:hover { background: #fef2f2; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ─── Badges ─── */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}
.badge-active, .badge-online { background: #f0fdf4; color: #166534; }
.badge-offline { background: #fef2f2; color: #991b1b; }
.badge-unbound { background: #f5f5f5; color: #999; }
.badge-pending { background: #fffbeb; color: #92400e; }

/* ─── Forms ─── */
input, select, textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    outline: none;
    transition: border-color 0.15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); }
input::placeholder, textarea::placeholder { color: var(--text-muted); }

textarea {
    font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', 'JetBrains Mono', 'Consolas', 'Monaco', 'Noto Sans SC', monospace;
    font-size: 13px;
    line-height: 1.7;
    min-height: 100px;
    resize: vertical;
}

label { font-size: 12px; font-weight: 500; color: var(--text-dim); display: block; margin-bottom: 4px; }
.form-group { margin-bottom: 14px; }
.hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ─── Utilities ─── */
.empty { text-align: center; padding: 48px 20px; color: var(--text-dim); font-size: 13px; line-height: 1.8; }
.loading { text-align: center; padding: 30px; color: var(--text-muted); font-size: 13px; }

/* ─── Toast ─── */
#toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1000;
    pointer-events: none;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
#toast.show { opacity: 1; }
