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

        body {
            font-family: 'Inter', 'Noto Sans SC', 'Noto Sans JP', system-ui, sans-serif;
            background: #0a0b14;
            color: #e2e8f0;
            min-height: 100vh;
        }

        /* ── Header ── */
        .res-header {
            background: linear-gradient(135deg, #1a1b2e 0%, #0d0e1a 100%);
            border-bottom: 1px solid rgba(102, 126, 234, .2);
            padding: 20px 24px;
            display: flex;
            align-items: center;
            gap: 16px;
            position: sticky;
            top: 0;
            z-index: 100;
            backdrop-filter: blur(12px);
        }

        .res-header .logo {
            font-family: inherit;
            font-size: 18px;
            font-weight: 700;
            background: linear-gradient(135deg, #667eea, #764ba2);
            -webkit-background-clip: text;
            background-clip: text;
            -webkit-text-fill-color: transparent;
        }

        .res-header .subtitle {
            color: #a0aec0;
            font-size: 13px;
            font-weight: 500;
        }

        .res-header .back-btn {
            margin-left: auto;
            background: rgba(102, 126, 234, .12);
            border: 1px solid rgba(102, 126, 234, .3);
            color: #a0aec0;
            padding: 8px 16px;
            border-radius: 8px;
            cursor: pointer;
            font-size: 13px;
            text-decoration: none;
            transition: .2s;
        }

        .res-header .back-btn:hover {
            background: rgba(102, 126, 234, .25);
            color: #fff;
        }

        /* ── Search ── */
        .search-bar {
            max-width: 900px;
            margin: 24px auto 0;
            padding: 0 24px;
        }

        .search-bar input {
            width: 100%;
            background: #1a1b2e;
            border: 1px solid rgba(102, 126, 234, .2);
            border-radius: 12px;
            padding: 12px 16px 12px 40px;
            color: #e2e8f0;
            font-size: 14px;
            outline: none;
            font-family: inherit;
            transition: border-color .2s;
        }

        .search-bar input:focus {
            border-color: #667eea;
        }

        .search-bar {
            position: relative;
        }

        .search-bar::before {
            content: '🔍';
            position: absolute;
            left: 38px;
            top: 50%;
            transform: translateY(-50%);
            font-size: 14px;
        }

        /* ── Category tabs ── */
        .cat-tabs {
            max-width: 900px;
            margin: 16px auto 0;
            padding: 0 24px;
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
        }

        .cat-tab {
            background: rgba(255, 255, 255, .04);
            border: 1px solid rgba(255, 255, 255, .08);
            color: #a0aec0;
            padding: 6px 16px;
            border-radius: 20px;
            cursor: pointer;
            font-size: 12px;
            font-weight: 600;
            transition: .2s;
            font-family: inherit;
        }

        .cat-tab:hover {
            background: rgba(102, 126, 234, .15);
            color: #cbd5e1;
        }

        .cat-tab.active {
            background: linear-gradient(135deg, #667eea, #764ba2);
            color: #fff;
            border-color: transparent;
        }

        /* ── Grid ── */
        .res-grid {
            max-width: 900px;
            margin: 24px auto;
            padding: 0 24px;
        }

        .cat-section {
            margin-bottom: 32px;
        }

        .cat-section h2 {
            font-size: 16px;
            font-weight: 700;
            color: #a78bfa;
            margin-bottom: 12px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .cat-section h2 .count {
            font-size: 11px;
            background: rgba(167, 139, 250, .15);
            color: #a78bfa;
            padding: 2px 8px;
            border-radius: 10px;
            font-weight: 600;
        }

        /* ── Cards ── */
        .res-card {
            background: #1a1b2e;
            border: 1px solid rgba(255, 255, 255, .06);
            border-radius: 12px;
            padding: 16px;
            margin-bottom: 10px;
            display: flex;
            align-items: center;
            gap: 14px;
            transition: .2s;
            cursor: pointer;
        }

        .res-card:hover {
            border-color: rgba(102, 126, 234, .3);
            background: #1f2037;
            transform: translateY(-1px);
            box-shadow: 0 8px 24px rgba(0, 0, 0, .3);
        }

        .res-card .icon {
            width: 44px;
            height: 44px;
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 22px;
            flex-shrink: 0;
        }

        .res-card .icon.pdf {
            background: rgba(239, 68, 68, .12);
        }

        .res-card .icon.xlsx {
            background: rgba(34, 197, 94, .12);
        }

        .res-card .icon.video {
            background: rgba(59, 130, 246, .12);
        }

        .res-card .icon.folder {
            background: rgba(251, 191, 36, .12);
        }

        .res-card .icon.default {
            background: rgba(148, 163, 184, .1);
        }

        /* ── Highlight: cards with file downloads ── */
        .res-card.has-file {
            border-left: 3px solid rgba(34, 197, 94, .5);
            background: linear-gradient(90deg, rgba(34, 197, 94, .04), transparent 40%);
        }
        .res-card.has-file:hover {
            border-left-color: #22c55e;
        }

        /* ── Highlight: software type cards ── */
        .res-card.software {
            border-left: 3px solid rgba(59, 130, 246, .5);
            background: linear-gradient(90deg, rgba(59, 130, 246, .04), transparent 40%);
        }
        .res-card.software:hover {
            border-left-color: #3b82f6;
        }
        .res-card.software .icon {
            background: rgba(59, 130, 246, .12);
        }

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

        .res-card .info .title {
            font-size: 14px;
            font-weight: 600;
            color: #e2e8f0;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .res-card .info .desc {
            font-size: 12px;
            color: #64748b;
            margin-top: 2px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .res-card .actions {
            display: flex;
            gap: 6px;
            flex-shrink: 0;
        }

        .res-card .act-btn {
            background: rgba(102, 126, 234, .1);
            border: 1px solid rgba(102, 126, 234, .25);
            color: #94a3b8;
            padding: 6px 12px;
            border-radius: 8px;
            cursor: pointer;
            font-size: 11px;
            font-weight: 600;
            transition: .2s;
            font-family: inherit;
            white-space: nowrap;
        }

        .res-card .act-btn:hover {
            background: rgba(102, 126, 234, .25);
            color: #fff;
        }

        .res-card .act-btn.primary {
            background: linear-gradient(135deg, #667eea, #764ba2);
            border-color: transparent;
            color: #fff;
        }

        .res-card .act-btn.primary:hover {
            opacity: .9;
        }

        .res-card .dl-count {
            font-size: 10px;
            color: #475569;
            margin-top: 4px;
        }

        .ai-badge {
            display: inline-flex;
            align-items: center;
            gap: 3px;
            font-size: 9px;
            font-weight: 700;
            color: #a78bfa;
            background: rgba(139, 92, 246, .1);
            border: 1px solid rgba(139, 92, 246, .25);
            border-radius: 10px;
            padding: 1px 7px;
            cursor: pointer;
            margin-left: 6px;
            vertical-align: middle;
        }

        .ai-badge:hover {
            background: rgba(139, 92, 246, .2);
        }

        .ai-summary {
            display: none;
            margin-top: 8px;
            padding: 10px 12px;
            background: rgba(139, 92, 246, .04);
            border: 1px solid rgba(139, 92, 246, .12);
            border-radius: 8px;
            font-size: 12px;
            color: rgba(255, 255, 255, .7);
            line-height: 1.55;
            white-space: pre-wrap;
            max-height: 300px;
            overflow-y: auto;
        }

        .ai-summary.show {
            display: block;
        }

        .ext-text-btn {
            font-size: 9px;
            color: #64748b;
            cursor: pointer;
            border: 1px solid rgba(255, 255, 255, .08);
            background: rgba(255, 255, 255, .03);
            border-radius: 6px;
            padding: 2px 8px;
            margin-left: 4px;
            display: inline-block;
        }

        .ext-text-btn:hover {
            color: #a78bfa;
            border-color: rgba(139, 92, 246, .3);
        }

        .ext-text {
            display: none;
            margin-top: 8px;
            padding: 10px 12px;
            background: rgba(255, 255, 255, .02);
            border: 1px solid rgba(255, 255, 255, .06);
            border-radius: 8px;
            font-size: 11px;
            color: rgba(255, 255, 255, .5);
            line-height: 1.5;
            white-space: pre-wrap;
            max-height: 400px;
            overflow-y: auto;
            font-family: 'Courier New', monospace;
        }

        .ext-text.show {
            display: block;
        }

        /* ── Admin bar ── */
        .admin-bar {
            max-width: 900px;
            margin: 0 auto;
            padding: 14px 24px;
            display: none;
        }

        .admin-bar.show {
            display: flex;
            gap: 8px;
            align-items: center;
            flex-wrap: wrap;
        }

        .admin-bar .add-btn {
            background: linear-gradient(135deg, #22c55e, #16a34a);
            border: none;
            color: #fff;
            padding: 8px 16px;
            border-radius: 8px;
            cursor: pointer;
            font-size: 13px;
            font-weight: 600;
            font-family: inherit;
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .admin-bar .add-btn:hover {
            opacity: .9;
        }

        .admin-bar .tool-btn {
            background: rgba(102, 126, 234, .1);
            border: 1px solid rgba(102, 126, 234, .3);
            color: #94a3b8;
            padding: 8px 14px;
            border-radius: 8px;
            cursor: pointer;
            font-size: 12px;
            font-weight: 600;
            font-family: inherit;
            transition: .2s;
            display: flex;
            align-items: center;
            gap: 5px;
        }

        .admin-bar .tool-btn:hover {
            background: rgba(102, 126, 234, .25);
            color: #fff;
        }

        .admin-bar .tool-btn.danger {
            border-color: rgba(239, 68, 68, .3);
            color: #f87171;
        }

        .admin-bar .tool-btn.danger:hover {
            background: rgba(239, 68, 68, .15);
        }

        /* ── Analyze button on card ── */
        .act-btn.analyze {
            background: rgba(139, 92, 246, .12);
            border-color: rgba(139, 92, 246, .35);
            color: #a78bfa;
        }

        .act-btn.analyze:hover {
            background: rgba(139, 92, 246, .25);
            color: #c4b5fd;
        }

        .act-btn.analyze.loading {
            opacity: .6;
            cursor: wait;
            pointer-events: none;
        }

        .act-btn.analyze.done {
            background: rgba(34, 197, 94, .1);
            border-color: rgba(34, 197, 94, .3);
            color: #4ade80;
        }

        /* ── Modal ── */
        .modal-overlay {
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, .65);
            z-index: 200;
            display: none;
            align-items: center;
            justify-content: center;
        }

        .modal-overlay.show {
            display: flex;
        }

        .modal {
            background: #1a1b2e;
            border: 1px solid rgba(102, 126, 234, .3);
            border-radius: 16px;
            padding: 24px;
            width: 90%;
            max-width: 480px;
            animation: slideUp .2s ease;
        }

        @keyframes slideUp {
            from {
                opacity: 0;
                transform: translateY(20px)
            }

            to {
                opacity: 1;
                transform: translateY(0)
            }
        }

        .modal h3 {
            font-size: 16px;
            font-weight: 700;
            color: #a78bfa;
            margin-bottom: 16px;
        }

        .modal label {
            display: block;
            font-size: 12px;
            color: #94a3b8;
            margin: 10px 0 4px;
            font-weight: 600;
        }

        .modal input,
        .modal select,
        .modal textarea {
            width: 100%;
            background: #0d0e1a;
            border: 1px solid rgba(255, 255, 255, .1);
            border-radius: 8px;
            padding: 8px 12px;
            color: #e2e8f0;
            font-size: 13px;
            outline: none;
            font-family: inherit;
        }

        .modal input:focus,
        .modal select:focus,
        .modal textarea:focus {
            border-color: #667eea;
        }

        .modal textarea {
            min-height: 60px;
            resize: vertical;
        }

        .modal .btn-row {
            display: flex;
            gap: 8px;
            margin-top: 16px;
            justify-content: flex-end;
        }

        .modal .btn-cancel {
            background: rgba(255, 255, 255, .06);
            border: 1px solid rgba(255, 255, 255, .1);
            color: #94a3b8;
            padding: 8px 16px;
            border-radius: 8px;
            cursor: pointer;
            font-family: inherit;
            font-size: 13px;
        }

        .modal .btn-save {
            background: linear-gradient(135deg, #667eea, #764ba2);
            border: none;
            color: #fff;
            padding: 8px 20px;
            border-radius: 8px;
            cursor: pointer;
            font-family: inherit;
            font-size: 13px;
            font-weight: 600;
        }

        /* ── Modal tabs ── */
        .modal-tabs {
            display: flex;
            gap: 0;
            margin-bottom: 16px;
            border-bottom: 1px solid rgba(255, 255, 255, .08);
        }

        .modal-tab {
            background: none;
            border: none;
            color: #64748b;
            padding: 8px 16px;
            cursor: pointer;
            font-size: 13px;
            font-weight: 600;
            font-family: inherit;
            border-bottom: 2px solid transparent;
            margin-bottom: -1px;
            transition: .2s;
        }

        .modal-tab.active {
            color: #a78bfa;
            border-bottom-color: #a78bfa;
        }

        .modal-tab-content {
            display: none;
        }

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

        /* ── Upload drop zone ── */
        .drop-zone {
            border: 2px dashed rgba(102, 126, 234, .25);
            border-radius: 12px;
            padding: 32px 20px;
            text-align: center;
            cursor: pointer;
            transition: .2s;
            position: relative;
        }

        .drop-zone:hover,
        .drop-zone.dragover {
            border-color: #667eea;
            background: rgba(102, 126, 234, .06);
        }

        .drop-zone input[type="file"] {
            position: absolute;
            inset: 0;
            opacity: 0;
            cursor: pointer;
            width: 100%;
            height: 100%;
        }

        .drop-zone .dz-icon {
            font-size: 32px;
            margin-bottom: 8px;
        }

        .drop-zone .dz-text {
            font-size: 13px;
            color: #64748b;
        }

        .drop-zone .dz-hint {
            font-size: 11px;
            color: #475569;
            margin-top: 4px;
        }

        .drop-zone .dz-selected {
            font-size: 12px;
            color: #a78bfa;
            margin-top: 8px;
            font-weight: 600;
        }

        /* ── Progress bar ── */
        .progress-wrap {
            margin-top: 10px;
            display: none;
        }

        .progress-wrap.show {
            display: block;
        }

        .progress-bar-bg {
            height: 6px;
            background: rgba(255, 255, 255, .08);
            border-radius: 3px;
            overflow: hidden;
        }

        .progress-bar-fill {
            height: 100%;
            background: linear-gradient(90deg, #667eea, #a78bfa);
            border-radius: 3px;
            transition: width .3s ease;
            width: 0;
        }

        .progress-label {
            font-size: 11px;
            color: #64748b;
            margin-top: 4px;
            text-align: center;
        }

        /* ── Stats modal ── */
        .stats-modal {
            max-width: 560px;
        }

        .stats-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 10px;
            margin-bottom: 16px;
        }

        .stat-card {
            background: rgba(255, 255, 255, .04);
            border: 1px solid rgba(255, 255, 255, .07);
            border-radius: 10px;
            padding: 12px;
            text-align: center;
        }

        .stat-card .s-val {
            font-size: 24px;
            font-weight: 700;
            color: #a78bfa;
        }

        .stat-card .s-lbl {
            font-size: 11px;
            color: #64748b;
            margin-top: 2px;
        }

        .analyze-progress {
            background: rgba(255, 255, 255, .03);
            border: 1px solid rgba(255, 255, 255, .06);
            border-radius: 10px;
            padding: 10px 12px;
            max-height: 160px;
            overflow-y: auto;
            font-size: 11px;
            color: #64748b;
            font-family: monospace;
        }

        .analyze-progress .prog-row {
            padding: 2px 0;
        }

        .analyze-progress .prog-row.ok {
            color: #4ade80;
        }

        .analyze-progress .prog-row.err {
            color: #f87171;
        }

        .analyze-progress .prog-row.cached {
            color: #fbbf24;
        }

        /* ── Empty state ── */
        .empty-state {
            text-align: center;
            padding: 60px 20px;
            color: #475569;
        }

        .empty-state .icon {
            font-size: 48px;
            margin-bottom: 12px;
        }

        .empty-state p {
            font-size: 14px;
        }

        /* ── Toast ── */
        .toast {
            position: fixed;
            bottom: 24px;
            left: 50%;
            transform: translateX(-50%);
            background: #22c55e;
            color: #fff;
            padding: 8px 20px;
            border-radius: 20px;
            font-size: 13px;
            z-index: 300;
            animation: fadeOut 2s ease forwards;
            pointer-events: none;
        }

        @keyframes fadeOut {
            0% {
                opacity: 1
            }

            70% {
                opacity: 1
            }

            100% {
                opacity: 0
            }
        }

        /* ── Responsive ── */
        @media (max-width: 600px) {
            .res-header {
                padding: 14px 16px;
            }

            .search-bar,
            .cat-tabs,
            .res-grid,
            .admin-bar {
                padding: 0 16px;
            }

            .res-card {
                padding: 12px;
            }

            .res-card .icon {
                width: 36px;
                height: 36px;
                font-size: 18px;
            }

            .res-card .actions {
                flex-direction: column;
            }
        }