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

:root {
    --bg: #f5f6f8;
    --bg-card: #ffffff;
    --bg-sidebar: #f0f1f3;
    --text: #1a1a2e;
    --text-muted: #6b7280;
    --border: #e2e4e8;
    --accent: #3b5998;
    --accent-hover: #2d4373;
    --alive: #22c55e;
    --dead: #ef4444;
    --timeout: #f59e0b;
    --unchecked: #94a3b8;
    --tag-bg: #e8edf3;
    --tag-text: #3b5998;
    --tag-active-bg: #3b5998;
    --tag-active-text: #fff;
    --danger: #dc2626;
    --danger-hover: #b91c1c;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.1);
    --radius: 8px;
    --radius-sm: 4px;
}

[data-theme="dark"] {
    --bg: #0f1117;
    --bg-card: #1a1b26;
    --bg-sidebar: #14151f;
    --text: #e2e4e8;
    --text-muted: #8b8fa3;
    --border: #2a2d3a;
    --accent: #6b8fd4;
    --accent-hover: #8ba8e0;
    --tag-bg: #252738;
    --tag-text: #8ba8e0;
    --shadow: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.4);
}

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

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* ── Navbar ──────────────────────────────── */
.navbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 24px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
    white-space: nowrap;
}
.brand-icon { font-size: 1.4rem; }

.nav-center { flex: 1; max-width: 600px; margin: 0 auto; }

.search-form { display: flex; width: 100%; }
.search-input {
    flex: 1;
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius) 0 0 var(--radius);
    font-size: 0.95rem;
    background: var(--bg);
    color: var(--text);
    outline: none;
}
.search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(59,89,152,0.15); }
.search-btn {
    padding: 8px 16px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 0 var(--radius) var(--radius) 0;
    cursor: pointer;
    font-size: 0.95rem;
}
.search-btn:hover { background: var(--accent-hover); }

.nav-right { display: flex; align-items: center; gap: 12px; }
.nav-link {
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.9rem;
}
.nav-link.active, .nav-link:hover { color: var(--accent); background: var(--tag-bg); }

.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 5px 8px;
    cursor: pointer;
    font-size: 1.1rem;
    color: var(--text-muted);
}

/* ── Stats bar ───────────────────────────── */
.stats-bar {
    display: flex;
    gap: 1px;
    background: var(--border);
    border-bottom: 1px solid var(--border);
}
.stat {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg-card);
    text-align: center;
}
.stat-num { display: block; font-size: 1.5rem; font-weight: 700; }
.stat-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.stat.alive .stat-num { color: var(--alive); }
.stat.dead .stat-num { color: var(--dead); }
.stat.timeout .stat-num { color: var(--timeout); }
.stat.unchecked .stat-num { color: var(--unchecked); }

/* ── Dashboard layout ────────────────────── */
.dashboard-body {
    display: flex;
    min-height: calc(100vh - 140px);
}

.sidebar {
    width: 220px;
    padding: 16px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    flex-shrink: 0;
}
.sidebar h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.tag-cloud { display: flex; flex-wrap: wrap; gap: 4px; }
.tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: var(--tag-bg);
    color: var(--tag-text);
    border-radius: 12px;
    font-size: 0.78rem;
    white-space: nowrap;
    transition: all 0.15s;
}
.tag-pill:hover, .tag-pill.active {
    background: var(--tag-active-bg);
    color: var(--tag-active-text);
}
.tag-count { font-size: 0.7rem; opacity: 0.7; }
.clear-filter {
    display: block;
    margin-top: 12px;
    font-size: 0.8rem;
    color: var(--dead);
}

/* ── Content area ────────────────────────── */
.content-area { flex: 1; padding: 16px 20px; overflow-x: hidden; }

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 12px;
    flex-wrap: wrap;
}
.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 8px; }

.results-info { font-size: 0.85rem; color: var(--text-muted); }

.filter-group { display: flex; gap: 2px; }
.filter-btn {
    padding: 5px 12px;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    background: var(--bg);
    border: 1px solid var(--border);
}
.filter-btn.active, .filter-btn:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

select {
    padding: 5px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    background: var(--bg);
    color: var(--text);
}

.view-toggle { display: flex; gap: 2px; }
.view-btn {
    padding: 5px 10px;
    font-size: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    background: var(--bg);
}
.view-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── Grid view ───────────────────────────── */
.bookmarks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}

.bookmark-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.15s;
    position: relative;
}
.bookmark-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card-select {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.15s;
}
.bookmark-card:hover .card-select { opacity: 1; }

.card-thumb {
    height: 140px;
    background: var(--bg-sidebar);
    background-size: cover;
    background-position: center top;
}
.card-thumb-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.domain-letter {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent);
    opacity: 0.5;
}
.domain-text { font-size: 0.75rem; color: var(--text-muted); }

.card-body { padding: 10px 12px; }
.card-title {
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.card-title a { color: var(--text); }

.card-domain {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.status-dot.status-alive, .status-badge.status-alive { background: var(--alive); }
.status-dot.status-dead, .status-dot.status-error { background: var(--dead); }
.status-dot.status-timeout { background: var(--timeout); }
.status-dot.status-unchecked { background: var(--unchecked); }

.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #fff;
}
.status-badge.status-alive { background: var(--alive); }
.status-badge.status-dead, .status-badge.status-error { background: var(--dead); }
.status-badge.status-timeout { background: var(--timeout); }
.status-badge.status-unchecked { background: var(--unchecked); color: var(--text-muted); }

.http-code { font-size: 0.7rem; color: var(--text-muted); }

.card-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-tags { display: flex; flex-wrap: wrap; gap: 3px; }
.mini-tag {
    font-size: 0.7rem;
    padding: 1px 6px;
    background: var(--tag-bg);
    color: var(--tag-text);
    border-radius: 8px;
}
.mini-tag.more { opacity: 0.6; }

/* Status visual indicators for cards */
.status-dead .card-title a,
.status-error .card-title a { color: var(--dead); text-decoration: line-through; opacity: 0.7; }
.status-dead .card-thumb,
.status-error .card-thumb { opacity: 0.4; filter: grayscale(100%); }

/* ── List view ───────────────────────────── */
.bm-table {
    width: 100%;
    border-collapse: collapse;
}
.bm-table th {
    text-align: left;
    padding: 8px 12px;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
    letter-spacing: 0.5px;
}
.bm-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
    vertical-align: top;
}
.bm-table tr:hover { background: var(--bg-sidebar); }

.list-title { color: var(--text); font-weight: 500; }
.list-desc { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.list-domain { color: var(--text-muted); white-space: nowrap; }

.status-row-dead .list-title, .status-row-error .list-title {
    text-decoration: line-through;
    opacity: 0.6;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.9rem;
}
.action-btn:hover { background: var(--bg-sidebar); color: var(--text); }
.action-btn.del:hover { color: var(--dead); border-color: var(--dead); }

/* ── Pagination ──────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 24px;
    padding-bottom: 24px;
}
.page-btn {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--text-muted);
    background: var(--bg-card);
}
.page-btn.active, .page-btn:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.page-dots { padding: 6px 4px; color: var(--text-muted); }

/* ── Detail page ─────────────────────────── */
.detail-page { max-width: 1100px; margin: 0 auto; padding: 20px; }

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.back-link { font-size: 0.9rem; }
.detail-actions { display: flex; gap: 8px; }

.detail-body { display: flex; gap: 24px; }
.detail-main { flex: 1; }
.detail-sidebar { width: 300px; flex-shrink: 0; }

.detail-screenshot {
    background: var(--bg-sidebar);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 16px;
    min-height: 200px;
}
.screenshot-img { width: 100%; display: block; }
.screenshot-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 250px;
    color: var(--text-muted);
    gap: 8px;
}
.big-letter { font-size: 4rem; font-weight: 700; opacity: 0.3; }

.detail-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 8px;
    padding: 4px;
    border-radius: var(--radius-sm);
    outline: none;
}
.detail-title:focus { background: var(--tag-bg); }

.detail-url { margin-bottom: 12px; }
.detail-url a { word-break: break-all; font-size: 0.85rem; }
.copy-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 2px 6px;
    cursor: pointer;
    font-size: 0.8rem;
    margin-left: 4px;
}
.redirect-info { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }

.detail-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}
.checked-date { font-size: 0.8rem; color: var(--text-muted); }

.detail-section {
    margin-bottom: 20px;
}
.detail-section h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.detail-description {
    padding: 8px;
    border-radius: var(--radius-sm);
    min-height: 60px;
    outline: none;
    font-size: 0.9rem;
    line-height: 1.6;
}
.detail-description:focus { background: var(--tag-bg); }

.detail-notes {
    width: 100%;
    min-height: 100px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
    resize: vertical;
    background: var(--bg);
    color: var(--text);
}

/* Tag editor */
.tag-editor {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-bottom: 8px;
}
.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: var(--tag-active-bg);
    color: var(--tag-active-text);
    border-radius: 12px;
    font-size: 0.82rem;
}
.tag-remove {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 1rem;
    opacity: 0.7;
    padding: 0 2px;
}
.tag-remove:hover { opacity: 1; }

.tag-input {
    border: 1px dashed var(--border);
    border-radius: 12px;
    padding: 3px 10px;
    font-size: 0.82rem;
    width: 100px;
    background: transparent;
    color: var(--text);
    outline: none;
}
.tag-input:focus { border-style: solid; border-color: var(--accent); }

.tag-suggestions { display: flex; flex-wrap: wrap; gap: 3px; }
.suggest-tag {
    font-size: 0.72rem;
    padding: 2px 8px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    color: var(--text-muted);
}
.suggest-tag:hover { border-color: var(--accent); color: var(--accent); }

.info-table { width: 100%; }
.info-table td {
    padding: 4px 0;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border);
}
.info-table td:first-child { color: var(--text-muted); width: 80px; }

/* ── Manage page ─────────────────────────── */
.manage-page { max-width: 900px; margin: 0 auto; padding: 20px; }
.manage-page h1 { margin-bottom: 20px; }

.manage-grid { display: flex; flex-direction: column; gap: 16px; }
.manage-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}
.manage-card h2 { font-size: 1.1rem; margin-bottom: 8px; }
.card-desc { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 16px; }

.worker-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.worker-row:last-child { border-bottom: none; }
.worker-desc { font-size: 0.8rem; color: var(--text-muted); }
.worker-progress { margin-top: 6px; display: flex; align-items: center; gap: 8px; }

.progress-bar {
    width: 200px;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.3s;
}

.done-text { color: var(--alive); font-size: 0.85rem; font-weight: 500; }

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
.stat-box {
    text-align: center;
    padding: 12px;
    background: var(--bg);
    border-radius: var(--radius-sm);
}
.stat-big { font-size: 1.8rem; font-weight: 700; }
.stat-box.alive .stat-big { color: var(--alive); }
.stat-box.dead .stat-big { color: var(--dead); }

.cleanup-row {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.cleanup-row:last-child { border-bottom: none; }
.cleanup-desc { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }

.domain-list { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.domain-chip {
    font-size: 0.78rem;
    padding: 2px 8px;
    background: var(--tag-bg);
    border-radius: 10px;
    color: var(--tag-text);
}

.export-buttons { display: flex; gap: 8px; }

.form-row { display: flex; gap: 8px; }
.form-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    background: var(--bg);
    color: var(--text);
}
.form-result { margin-top: 8px; font-size: 0.85rem; }
.success { color: var(--alive); }
.error { color: var(--dead); }

/* ── Buttons ─────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    padding: 7px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    cursor: pointer;
    background: var(--bg-card);
    color: var(--text);
    white-space: nowrap;
}
.btn:hover { background: var(--bg-sidebar); }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: var(--danger-hover); color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 0.78rem; }

.bulk-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* ── History page ────────────────────────── */
.history-search-form { display: flex; width: 100%; max-width: 400px; }

.search-with-suggest { position: relative; flex: 1; }
.search-with-suggest .search-input { width: 100%; }

.suggest-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 200;
    max-height: 360px;
    overflow-y: auto;
}
.suggest-item {
    display: flex;
    flex-direction: column;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    transition: background 0.1s;
}
.suggest-item:last-child { border-bottom: none; }
.suggest-item:hover { background: var(--bg-sidebar); }
.suggest-title { font-size: 0.85rem; line-height: 1.3; }
.suggest-meta { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }

.domain-sidebar-list { display: flex; flex-direction: column; gap: 1px; }
.domain-sidebar-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--text);
    transition: background 0.15s;
}
.domain-sidebar-item:hover { background: var(--tag-bg); color: var(--text); }
.domain-sidebar-item.active { background: var(--accent); color: #fff; }
.domain-sidebar-item.active .domain-sidebar-count { color: rgba(255,255,255,0.8); }
.domain-sidebar-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}
.domain-sidebar-count {
    font-size: 0.72rem;
    color: var(--text-muted);
    flex-shrink: 0;
    margin-left: 6px;
}

.history-timeline { display: flex; flex-direction: column; gap: 0; }

.timeline-day { margin-bottom: 4px; }

.timeline-date-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--bg-sidebar);
    border: 1px solid var(--border);
    border-radius: var(--radius) var(--radius) 0 0;
    position: sticky;
    top: 52px;
    z-index: 10;
}
.timeline-date {
    font-weight: 700;
    font-size: 0.9rem;
}
.timeline-day-count {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.timeline-entries {
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    background: var(--bg-card);
}

.history-entry {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 14px;
    border-bottom: 1px solid var(--border);
    transition: background 0.1s;
}
.history-entry:last-child { border-bottom: none; }
.history-entry:hover { background: var(--bg-sidebar); }

.entry-time {
    width: 42px;
    flex-shrink: 0;
    font-size: 0.78rem;
    color: var(--text-muted);
    padding-top: 2px;
    font-variant-numeric: tabular-nums;
}

.entry-body { flex: 1; min-width: 0; }

.entry-title {
    font-size: 0.88rem;
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: 6px;
}
.entry-title a {
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.entry-title a:hover { color: var(--accent); }
.entry-bookmarked { font-size: 0.75rem; flex-shrink: 0; }

.entry-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}
.entry-domain {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.entry-domain:hover { color: var(--accent); }

.visit-count-badge {
    font-size: 0.68rem;
    padding: 1px 7px;
    background: var(--tag-bg);
    color: var(--tag-text);
    border-radius: 8px;
    white-space: nowrap;
}

.visit-count-lg {
    font-size: 0.82rem;
    padding: 3px 10px;
    font-weight: 600;
}

.entry-actions { flex-shrink: 0; padding-top: 2px; }

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    font-size: 0.95rem;
}
.empty-state a { color: var(--accent); }

/* ── Responsive ──────────────────────────── */
@media (max-width: 900px) {
    .navbar { flex-wrap: wrap; padding: 8px 12px; gap: 8px; }
    .nav-center { order: 3; flex-basis: 100%; max-width: none; }
    .dashboard-body { flex-direction: column; }
    .sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); }
    .detail-body { flex-direction: column; }
    .detail-sidebar { width: 100%; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .bookmarks-grid { grid-template-columns: 1fr; }
    .form-row { flex-direction: column; }
    .entry-time { width: 36px; font-size: 0.72rem; }
    .history-search-form { max-width: none; }
}
