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

:root {
    --primary-color: #000000;
    --primary-hover: #262626;
    --background: #FFFFFF;
    --surface: #FFFFFF;
    --surface-hover: #F5F5F5;
    --text-primary: #171717;
    --text-secondary: #737373;
    --text-tertiary: #A3A3A3;
    --border-color: #E5E5E5;
    --border-hover: #D4D4D4;
    --danger-color: #EF4444;
    --danger-hover: #DC2626;
    --success-color: #10B981;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.03);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

/* Main Content */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

.main-header {
    padding: 24px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.header-left {
    flex: 1;
    min-width: 250px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.logo svg {
    color: var(--primary-color);
    flex-shrink: 0;
}

.logo h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

.header-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    margin-left: 44px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* View Toggle */
.view-toggle {
    display: flex;
    gap: 4px;
    background: var(--surface);
    padding: 4px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.view-btn {
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-btn:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.view-btn.active {
    background: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-sm);
}

/* Command Bar */
.command-bar {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    width: 90%;
    max-width: 600px;
    display: none;
}

.command-bar.active {
    display: block;
}

.command-bar-content {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.command-search {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.search-icon {
    color: var(--text-tertiary);
    flex-shrink: 0;
}

#commandInput {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    color: var(--text-primary);
    background: transparent;
    font-family: inherit;
}

#commandInput::placeholder {
    color: var(--text-tertiary);
}

.kbd {
    padding: 4px 8px;
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    font-family: inherit;
}

.command-results {
    max-height: 400px;
    overflow-y: auto;
}

.command-result-item {
    padding: 12px 20px;
    cursor: pointer;
    transition: background 0.15s ease;
    border-bottom: 1px solid var(--border-color);
}

.command-result-item:last-child {
    border-bottom: none;
}

.command-result-item:hover {
    background: var(--surface-hover);
}

/* Sections Container */
.sections-container {
    padding-bottom: 60px;
}

/* Section */
.section {
    margin-bottom: 48px;
}

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

.section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #737373;
    border-radius: 50%;
    flex-shrink: 0;
}

.section-actions {
    display: flex;
    gap: 8px;
}

/* Board View (Grid) */
.view-board .links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

/* List View */
.view-list .links-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.view-list .link-card {
    border-radius: var(--radius-md);
    padding: 16px;
}

.view-list .link-card::before {
    display: none;
}

.view-list .link-card:hover {
    transform: none;
}

/* Link Card */
.link-card {
    background: var(--surface);
    border: 1px solid rgba(229, 231, 235, 0.8);
    border-radius: var(--radius-lg);
    padding: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    cursor: pointer;
    overflow: hidden;
}

.link-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -10px rgba(0, 0, 0, 0.12);
    border-color: var(--primary-color);
}

.link-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.03) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.link-card:hover::before {
    opacity: 1;
}

.link-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.link-info {
    flex: 1;
    min-width: 0;
}

.link-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}

.link-favicon {
    width: 24px;
    height: 24px;
    padding: 4px;
    background: #f3f4f6;
    border-radius: 6px;
    flex-shrink: 0;
    object-fit: cover;
}

.link-title {
    font-weight: 600;
    color: #111827;
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.link-url {
    display: inline-block;
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: lowercase;
    text-decoration: none;
    transition: all 0.2s ease;
}

.link-url:hover {
    background: #171717;
    color: white;
}

.link-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.link-card:hover .link-actions {
    opacity: 1;
}

.link-action-btn {
    padding: 6px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.link-action-btn:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.link-action-btn.delete:hover {
    background: #FEE2E2;
    color: var(--danger-color);
}

/* Empty State */
.empty-section {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-section h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.empty-section p {
    font-size: 14px;
    color: var(--text-tertiary);
}

/* Buttons */
.btn {
    padding: 10px 18px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--surface-hover);
    border-color: var(--border-hover);
}

.btn-small {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: var(--danger-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--surface);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.2s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

.modal-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    padding: 6px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 15px;
    color: var(--text-primary);
    background: var(--surface);
    transition: all 0.2s ease;
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.form-group input::placeholder {
    color: var(--text-tertiary);
}

/* Responsive */
@media (max-width: 768px) {
    .main-content {
        padding: 0 16px;
    }

    .main-header {
        padding: 24px 0;
        flex-direction: column;
        align-items: flex-start;
    }

    .header-left {
        width: 100%;
    }

    .logo h1 {
        font-size: 24px;
    }

    .header-subtitle {
        margin-left: 0;
        margin-top: 4px;
    }

    .header-right {
        width: 100%;
        justify-content: space-between;
    }

    .view-board .links-grid {
        grid-template-columns: 1fr;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .section-actions {
        width: 100%;
        justify-content: flex-start;
    }
}
