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

:root {
    --bg: #0D1117;
    --surface: #161B22;
    --surface2: #21262D;
    --primary: #1A73E8;
    --primary-light: #4FC3F7;
    --text: #E6EDF3;
    --text2: #C9D1D9;
    --text3: #8B949E;
    --green: #00FF88;
    --red: #FF4444;
    --border: #30363D;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

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

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

h1 { font-size: 28px; letter-spacing: 4px; color: var(--primary-light); }
.subtitle { font-size: 14px; color: var(--text3); letter-spacing: 0; }

.status { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text3); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--text3); }
.dot.online { background: var(--green); box-shadow: 0 0 8px var(--green); }
.dot.offline { background: var(--red); }

.tabs { display: flex; gap: 4px; margin-bottom: 20px; }
.tab { padding: 10px 24px; background: var(--surface); border: 1px solid var(--border);
    border-radius: 8px; color: var(--text2); cursor: pointer; font-size: 14px;
    transition: all 0.2s; }
.tab:hover { background: var(--surface2); }
.tab.active { background: var(--primary); color: white; border-color: var(--primary); }

.tab-content { display: none; }
.tab-content.active { display: block; }

.toolbar { display: flex; gap: 10px; margin-bottom: 16px; align-items: center; }
.search-input { flex: 1; padding: 10px 14px; background: var(--surface);
    border: 1px solid var(--border); border-radius: 8px; color: var(--text);
    font-size: 14px; }
.search-input:focus { outline: none; border-color: var(--primary); }

.btn { padding: 10px 20px; background: var(--primary); color: white;
    border: none; border-radius: 8px; cursor: pointer; font-size: 14px;
    transition: all 0.2s; }
.btn:hover { background: var(--primary-light); }
.btn-danger { background: var(--red); }

.session-list { display: flex; flex-direction: column; gap: 8px; }
.session-card { display: flex; justify-content: space-between; align-items: center;
    padding: 14px 18px; background: var(--surface); border: 1px solid var(--border);
    border-radius: 8px; cursor: pointer; transition: all 0.2s; }
.session-card:hover { background: var(--surface2); border-color: var(--primary); }
.session-card .session-id { font-weight: 600; color: var(--text); font-size: 14px; }
.session-card .session-meta { font-size: 12px; color: var(--text3); }
.session-card .del-btn { background: none; border: none; color: var(--red);
    cursor: pointer; font-size: 18px; padding: 4px 8px; border-radius: 4px; }
.session-card .del-btn:hover { background: rgba(255,68,68,0.1); }

.hidden { display: none !important; }

.chat-view { position: fixed; top: 0; right: 0; width: 50%; height: 100%;
    background: var(--bg); border-left: 1px solid var(--border);
    display: flex; flex-direction: column; z-index: 100;
    animation: slideIn 0.2s ease; }
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
.chat-header { display: flex; align-items: center; gap: 12px;
    padding: 16px 20px; border-bottom: 1px solid var(--border); }
.btn-back { background: none; border: none; color: var(--primary-light);
    font-size: 20px; cursor: pointer; }
.chat-messages { flex: 1; overflow-y: auto; padding: 20px; }
.chat-msg { margin-bottom: 16px; max-width: 80%; }
.chat-msg.user { margin-left: auto; }
.chat-msg.assistant { margin-right: auto; }
.chat-msg .bubble { padding: 12px 16px; border-radius: 12px; font-size: 14px;
    line-height: 1.5; word-wrap: break-word; }
.chat-msg.user .bubble { background: var(--primary); color: white;
    border-bottom-right-radius: 4px; }
.chat-msg.assistant .bubble { background: var(--surface2); color: var(--text);
    border-bottom-left-radius: 4px; }
.chat-msg .time { font-size: 11px; color: var(--text3); margin-top: 4px; display: block; }
.chat-msg.user .time { text-align: right; }

.notes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.note-card { padding: 16px; background: var(--surface); border: 1px solid var(--border);
    border-radius: 8px; transition: all 0.2s; }
.note-card:hover { border-color: var(--primary); }
.note-card h3 { font-size: 16px; margin-bottom: 8px; color: var(--text); }
.note-card p { font-size: 13px; color: var(--text2); line-height: 1.5;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.note-card .note-meta { font-size: 11px; color: var(--text3); margin-top: 8px;
    display: flex; justify-content: space-between; }
.note-card .note-actions { display: flex; gap: 8px; margin-top: 10px; }
.note-card .note-actions button { padding: 4px 12px; font-size: 12px; }

.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7); display: flex; align-items: center;
    justify-content: center; z-index: 200; }
.modal-content { background: var(--surface); border: 1px solid var(--border);
    border-radius: 12px; padding: 28px; width: 90%; max-width: 500px;
    position: relative; }
.close { position: absolute; top: 12px; right: 16px; font-size: 24px;
    cursor: pointer; color: var(--text3); }
.modal-content h2 { margin-bottom: 16px; color: var(--primary-light); }
.modal-content input, .modal-content textarea { width: 100%; padding: 10px 14px;
    margin-bottom: 12px; background: var(--surface2); border: 1px solid var(--border);
    border-radius: 8px; color: var(--text); font-size: 14px; }
.modal-content textarea { min-height: 120px; resize: vertical; }
.modal-content input:focus, .modal-content textarea:focus { outline: none;
    border-color: var(--primary); }
.checkbox-label { display: flex; align-items: center; gap: 8px;
    margin-bottom: 12px; color: var(--text2); font-size: 14px; }

.config-list { display: flex; flex-direction: column; gap: 8px; }
.config-item { display: flex; justify-content: space-between; align-items: center;
    padding: 14px 18px; background: var(--surface); border: 1px solid var(--border);
    border-radius: 8px; }
.config-item .config-key { font-weight: 600; color: var(--primary-light); font-size: 14px; }
.config-item .config-value { color: var(--text2); font-size: 13px; max-width: 300px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.config-item .del-config-btn { background: none; border: none; color: var(--red);
    cursor: pointer; font-size: 16px; }

@media (max-width: 768px) {
    .chat-view { width: 100%; }
}
