:root {
    --color-primary: #2563eb;
    --color-primary-light: #3b82f6;
    --color-primary-dark: #1d4ed8;
    --color-background: #f9fafb;
    --color-foreground: #0f172a;
    --color-muted: #f1f5f9;
    --color-border: #e2e8f0;
    --color-destructive: #dc2626;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.tag-link {
    display: inline-block;
    padding: 4px 12px;
    background: #f1f5f9;
    color: #475569;
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
}

.tag-link:hover {
    background: #dbeafe;
    color: #2563eb;
}

.drive-tab {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid transparent;
}

.drive-tab:hover {
    background: #dbeafe;
    color: #2563eb;
}

.drive-tab.active {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.3);
}

.resource-card {
    transition: all 0.2s ease;
}

.resource-card:hover {
    transform: translateY(-2px);
}

.category-card {
    transition: all 0.2s ease;
}

.category-card:hover {
    transform: translateY(-1px);
}

.sort-tab {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid transparent;
}

.sort-tab:hover {
    background: #dbeafe;
    color: #2563eb;
}

.sort-tab.active {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

.sidebar-tag {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.8125rem;
    color: #475569;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
}

.sidebar-tag:hover {
    background: #f1f5f9;
    color: #2563eb;
}

.sidebar-tag.active {
    background: #dbeafe;
    color: #2563eb;
    font-weight: 600;
}

.sidebar-group-title {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #0f172a;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
}

.sidebar-group-title:hover {
    background: #f1f5f9;
}

.sidebar-group-title .arrow {
    transition: transform 0.2s ease;
    display: inline-block;
}

.sidebar-group-title.expanded .arrow {
    transform: rotate(90deg);
}

.sidebar-children {
    padding-left: 16px;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease;
}

.sidebar-children.expanded {
    max-height: 500px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 1.5rem;
}

.breadcrumb a {
    color: #2563eb;
    text-decoration: none;
    transition: color 0.15s ease;
}

.breadcrumb a:hover {
    color: #1d4ed8;
}

.breadcrumb .separator {
    color: #94a3b8;
}

.login-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    padding: 2rem;
    max-width: 420px;
    width: 100%;
    margin: 0 auto;
}

.login-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    outline: none;
}

.login-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.detail-info-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.25rem;
}

.detail-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
}

.detail-info-row:last-child {
    border-bottom: none;
}

.detail-info-label {
    font-size: 0.8125rem;
    color: #64748b;
}

.detail-info-value {
    font-size: 0.8125rem;
    color: #0f172a;
    font-weight: 500;
}

@media (max-width: 768px) {
    .category-card {
        padding: 1rem;
    }

    .resource-card {
        padding: 1rem;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.resource-card {
    animation: fadeIn 0.3s ease forwards;
}

.resource-card:nth-child(1) { animation-delay: 0ms; }
.resource-card:nth-child(2) { animation-delay: 50ms; }
.resource-card:nth-child(3) { animation-delay: 100ms; }
.resource-card:nth-child(4) { animation-delay: 150ms; }
.resource-card:nth-child(5) { animation-delay: 200ms; }
.resource-card:nth-child(6) { animation-delay: 250ms; }

.admin-sidebar { width: 240px; min-height: calc(100vh - 64px); background: white; border-right: 1px solid #e2e8f0; position: fixed; left: 0; top: 64px; z-index: 40; }

.admin-sidebar-item { display: flex; align-items: center; gap: 12px; padding: 12px 20px; font-size: 0.875rem; color: #475569; cursor: pointer; transition: all 0.15s ease; border-left: 3px solid transparent; }

.admin-sidebar-item:hover { background: #f1f5f9; color: #2563eb; }

.admin-sidebar-item.active { background: #eff6ff; color: #2563eb; font-weight: 600; border-left-color: #2563eb; }

.admin-content { margin-left: 240px; padding: 24px; min-height: calc(100vh - 64px); background: #f9fafb; }

.admin-stat-card { background: white; border-radius: 12px; padding: 20px; border: 1px solid #e2e8f0; }

.admin-table { width: 100%; border-collapse: collapse; }

.admin-table th { text-align: left; padding: 12px 16px; font-size: 0.75rem; font-weight: 600; color: #64748b; text-transform: uppercase; border-bottom: 1px solid #e2e8f0; background: #f8fafc; }

.admin-table td { padding: 12px 16px; font-size: 0.875rem; color: #0f172a; border-bottom: 1px solid #f1f5f9; }

.admin-table tr:hover td { background: #f8fafc; }

.admin-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 8px; font-size: 0.875rem; font-weight: 500; cursor: pointer; transition: all 0.15s ease; border: 1px solid transparent; }

.admin-btn-primary { background: #2563eb; color: white; }

.admin-btn-primary:hover { background: #1d4ed8; }

.admin-btn-danger { background: white; color: #dc2626; border-color: #fecaca; }

.admin-btn-danger:hover { background: #fef2f2; }

.admin-btn-ghost { background: transparent; color: #475569; }

.admin-btn-ghost:hover { background: #f1f5f9; }

.admin-input { width: 100%; padding: 8px 12px; border: 1px solid #e2e8f0; border-radius: 8px; font-size: 0.875rem; outline: none; transition: all 0.2s ease; }

.admin-input:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }

.admin-select { padding: 8px 12px; border: 1px solid #e2e8f0; border-radius: 8px; font-size: 0.875rem; outline: none; background: white; }

.admin-select:focus { border-color: #2563eb; }

.admin-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 100; display: flex; align-items: center; justify-content: center; }

.admin-modal { background: white; border-radius: 16px; padding: 24px; max-width: 640px; width: 90%; max-height: 80vh; overflow-y: auto; }

.admin-badge { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 9999px; font-size: 0.75rem; font-weight: 500; }

.admin-badge-green { background: #dcfce7; color: #166534; }

.admin-badge-yellow { background: #fef3c7; color: #92400e; }

.admin-badge-blue { background: #dbeafe; color: #1e40af; }

.admin-badge-purple { background: #ede9fe; color: #6d28d9; }

.admin-badge-gray { background: #f1f5f9; color: #475569; }

.admin-checkbox { width: 16px; height: 16px; accent-color: #2563eb; }

.admin-pagination { display: flex; align-items: center; gap: 8px; justify-content: center; margin-top: 24px; }

.admin-pagination button { padding: 6px 12px; border: 1px solid #e2e8f0; border-radius: 6px; font-size: 0.875rem; background: white; cursor: pointer; }

.admin-pagination button:hover { background: #f1f5f9; }

.admin-pagination button.active { background: #2563eb; color: white; border-color: #2563eb; }

.admin-pagination button:disabled { opacity: 0.5; cursor: not-allowed; }

.admin-toast-container { position: fixed; top: 20px; right: 20px; z-index: 10000; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }

.admin-toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 12px 20px; border-radius: 10px; font-size: 14px; font-weight: 500; box-shadow: 0 4px 20px rgba(0,0,0,0.12); animation: admin-toast-in 0.3s ease; min-width: 280px; max-width: 420px; backdrop-filter: blur(8px); }

.admin-toast-success { background: rgba(240,253,244,0.95); color: #166534; border: 1px solid #bbf7d0; }

.admin-toast-error { background: rgba(254,242,242,0.95); color: #991b1b; border: 1px solid #fecaca; }

.admin-toast-warning { background: rgba(255,251,235,0.95); color: #92400e; border: 1px solid #fde68a; }

.admin-toast-info { background: rgba(239,246,255,0.95); color: #1e40af; border: 1px solid #bfdbfe; }

.admin-toast-icon { flex-shrink: 0; width: 20px; height: 20px; }

.admin-toast-close { margin-left: auto; cursor: pointer; opacity: 0.5; transition: opacity 0.2s; flex-shrink: 0; }

.admin-toast-close:hover { opacity: 1; }

.admin-toast-exit { animation: admin-toast-out 0.3s ease forwards; }

@keyframes admin-toast-in { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }

@keyframes admin-toast-out { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(40px); } }