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

:root {
    --sidebar-w: 240px;
    --bg: #f5f6f8;
    --sidebar-bg: #1e2227;
    --sidebar-text: #c8ccd4;
    --sidebar-active: #3b82f6;
    --accent: #3b82f6;
}

html, body { height: 100%; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }

#app { display: flex; height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    min-width: var(--sidebar-w);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 14px 12px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.logo { width: 32px; height: 32px; border-radius: 6px; }

.brand strong { display: block; font-size: 15px; color: #fff; }
.brand span { font-size: 11px; opacity: .6; }

.sidebar-search { padding: 10px 12px; }
.sidebar-search input {
    width: 100%;
    padding: 7px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.06);
    color: #fff;
    font-size: 13px;
    outline: none;
}
.sidebar-search input:focus { border-color: var(--accent); }
.sidebar-search input::placeholder { color: rgba(255,255,255,.35); }

.tool-list { flex: 1; overflow-y: auto; padding: 6px 0; }

.tool-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 14px;
    cursor: pointer;
    font-size: 13px;
    transition: background .15s;
    user-select: none;
}
.tool-item:hover { background: rgba(255,255,255,.07); }
.tool-item.active { background: rgba(59,130,246,.2); color: #fff; }

.tool-icon {
    width: 26px;
    height: 26px;
    border-radius: 5px;
    background: rgba(255,255,255,.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: #93c5fd;
    flex-shrink: 0;
}

.content { flex: 1; position: relative; background: var(--bg); }

#toolFrame { width: 100%; height: 100%; border: none; display: none; }
#toolFrame.visible { display: block; }

.welcome {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #666;
}
.welcome img { width: 80px; height: 80px; opacity: .6; }
.welcome h1 { font-size: 22px; font-weight: 600; color: #333; }

.donate-modal { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; }
.donate-modal[hidden] { display: none; }
.donate-mask { position: absolute; inset: 0; background: rgba(0,0,0,.4); }
.donate-body {
    position: relative;
    background: #fff;
    border-radius: 12px;
    padding: 28px 32px;
    max-width: 360px;
    text-align: center;
    box-shadow: 0 12px 40px rgba(0,0,0,.2);
}
.donate-body h3 { margin-bottom: 10px; }
.donate-body button {
    margin-top: 16px;
    padding: 7px 24px;
    border: none;
    border-radius: 6px;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
}

@media (max-width: 768px) {
    :root { --sidebar-w: 56px; }
    .brand, .sidebar-search { display: none; }
    .tool-item span { display: none; }
    .tool-item { justify-content: center; padding: 12px 0; }
}