        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
            background: #f0f4fa;
            color: #1a2c3e;
            line-height: 1.5;
        }

        .site-header {
            background: rgba(255,255,255,0.96);
            backdrop-filter: blur(12px);
            border-bottom: 1px solid rgba(0,0,0,0.05);
            position: sticky;
            top: 0;
            z-index: 100;
        }
        .header-container {
            max-width: 1280px;
            margin: 0 auto;
            padding: 0.75rem 1.5rem;
            display: flex;
            align-items: center;
            justify-content: space-between;
            flex-wrap: wrap;
            gap: 0.75rem;
        }
        .logo {
            display: flex;
            align-items: center;
            gap: 0.6rem;
            text-decoration: none;
            font-weight: 700;
            font-size: 1.125rem;
            color: #1a2c3e;
        }
        .logo-mark {
            background: linear-gradient(135deg, #2c5a7a, #3b82b6);
            width: 32px;
            height: 32px;
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-weight: 700;
            font-size: 0.9rem;
        }
        .nav {
            display: flex;
            gap: 1.25rem;
            flex-wrap: wrap;
        }
        .nav a {
            color: #4a627a;
            text-decoration: none;
            font-size: 0.8rem;
            font-weight: 500;
            transition: color 0.2s;
        }
        .nav a:hover, .nav a.active {
            color: #3b82b6;
        }

        .main {
            max-width: 1280px;
            margin: 0 auto;
            padding: 1.5rem;
        }

        .hero {
            margin-bottom: 2rem;
            padding: 1rem 0;
        }
        .hero h1 {
            font-size: 2rem;
            font-weight: 700;
            letter-spacing: -0.02em;
            color: #1a2c3e;
            margin-bottom: 0.5rem;
        }
        .hero p {
            color: #4a627a;
            font-size: 0.95rem;
            max-width: 560px;
        }

        .tool-container {
            background: white;
            border-radius: 2rem;
            box-shadow: 0 20px 35px -12px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.02);
            overflow: hidden;
        }

        .upload-zone {
            padding: 2.5rem 1.5rem;
            text-align: center;
            background: linear-gradient(145deg, #ffffff, #fafcff);
            border-bottom: 1px solid #e6edf4;
            cursor: pointer;
            transition: all 0.2s;
        }
        .upload-zone:hover {
            background: #ffffff;
        }
        .upload-zone.drag-over {
            background: #eef4fc;
        }
        .upload-icon {
            margin-bottom: 1rem;
        }
        .upload-text {
            font-weight: 600;
            font-size: 1rem;
            margin-bottom: 0.25rem;
            color: #3b82b6;
        }
        .upload-hint {
            font-size: 0.75rem;
            color: #6b85a0;
        }

        .workspace {
            display: none;
        }
        .workspace.active {
            display: block;
        }

        .splitter-layout {
            display: flex;
            flex-direction: column;
            gap: 1.5rem;
            padding: 1.5rem;
        }

        /* Document info section */
        .doc-info-section {
            background: #fafdff;
            border-radius: 1.25rem;
            border: 1px solid #e6edf4;
            padding: 1.25rem;
            display: flex;
            flex-wrap: wrap;
            gap: 1.5rem;
            align-items: center;
            justify-content: space-between;
        }
        .doc-details {
            display: flex;
            gap: 1.5rem;
            flex-wrap: wrap;
        }
        .doc-detail {
            display: flex;
            flex-direction: column;
            gap: 0.25rem;
        }
        .doc-label {
            font-size: 0.7rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            color: #6b85a0;
        }
        .doc-value {
            font-size: 0.9rem;
            font-weight: 600;
            color: #1a2c3e;
        }
        .new-file-btn {
            background: #f0f4fa;
            border: 1px solid #d4e0ec;
            padding: 0.5rem 1rem;
            border-radius: 2rem;
            font-size: 0.75rem;
            cursor: pointer;
            transition: all 0.2s;
        }
        .new-file-btn:hover {
            background: #e2eaf1;
        }

        /* Split mode selector */
        .mode-selector {
            background: #fafdff;
            border-radius: 1.25rem;
            border: 1px solid #e6edf4;
            padding: 1.25rem;
        }
        .mode-title {
            font-weight: 600;
            font-size: 0.85rem;
            margin-bottom: 1rem;
            color: #1a2c3e;
        }
        .mode-buttons {
            display: flex;
            gap: 0.75rem;
            flex-wrap: wrap;
            margin-bottom: 1.25rem;
        }
        .mode-option {
            padding: 0.6rem 1.2rem;
            background: #f0f4fa;
            border: 1px solid #d4e0ec;
            border-radius: 2rem;
            cursor: pointer;
            font-size: 0.8rem;
            font-weight: 500;
            transition: all 0.2s;
        }
        .mode-option.active {
            background: #3b82b6;
            border-color: #3b82b6;
            color: white;
        }
        .mode-config {
            background: white;
            border-radius: 1rem;
            padding: 1rem;
            border: 1px solid #e6edf4;
        }
        .range-input-area {
            display: flex;
            flex-direction: column;
            gap: 0.75rem;
        }
        .range-input-area label {
            font-size: 0.75rem;
            font-weight: 500;
            color: #4a627a;
        }
        .range-input {
            width: 100%;
            padding: 0.6rem 0.8rem;
            border: 1px solid #d4e0ec;
            border-radius: 0.75rem;
            font-size: 0.85rem;
            font-family: monospace;
            font-weight: 500;
        }
        .range-hint {
            font-size: 0.65rem;
            color: #6b85a0;
            margin-top: 0.25rem;
        }
        .page-preview-area {
            margin-top: 1rem;
            padding-top: 1rem;
            border-top: 1px solid #e6edf4;
        }
        .page-badge-container {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
            margin-top: 0.75rem;
            max-height: 150px;
            overflow-y: auto;
        }
        .page-badge {
            background: #f0f4fa;
            padding: 0.3rem 0.7rem;
            border-radius: 2rem;
            font-size: 0.7rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
            user-select: none;
        }
        .page-badge.selected {
            background: #3b82b6;
            color: white;
        }
        .page-badge:hover {
            background: #e2eaf1;
        }
        .page-badge.selected:hover {
            background: #2c5a7a;
        }

        /* Action section */
        .action-section {
            background: #fafdff;
            border-radius: 1.25rem;
            border: 1px solid #e6edf4;
            padding: 1.25rem;
            display: flex;
            flex-wrap: wrap;
            gap: 1rem;
            align-items: flex-end;
            justify-content: space-between;
        }
        .filename-group {
            flex: 2;
            min-width: 200px;
        }
        .filename-group label {
            font-size: 0.7rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            color: #6b85a0;
            display: block;
            margin-bottom: 0.3rem;
        }
        .filename-input {
            width: 100%;
            padding: 0.6rem 0.8rem;
            border: 1px solid #d4e0ec;
            border-radius: 3rem;
            font-size: 0.8rem;
            font-family: inherit;
            background: white;
        }
        .btn-primary {
            background: #3b82b6;
            color: white;
            padding: 0.6rem 1.5rem;
            border: none;
            border-radius: 3rem;
            font-weight: 600;
            font-size: 0.85rem;
            cursor: pointer;
            transition: all 0.2s;
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
        }
        .btn-primary:hover:not(:disabled) {
            background: #2c5a7a;
            transform: translateY(-1px);
        }
        .btn-primary:disabled {
            opacity: 0.6;
            cursor: wait;
        }
        .btn-secondary {
            background: #f0f4fa;
            color: #4a627a;
            padding: 0.6rem 1.2rem;
            border: 1px solid #d4e0ec;
            border-radius: 3rem;
            font-weight: 500;
            font-size: 0.8rem;
            cursor: pointer;
            transition: all 0.2s;
        }
        .btn-secondary:hover {
            background: #e2eaf1;
        }

        /* Progress area */
        .progress-area {
            border-top: 1px solid #e6edf4;
            padding: 1.5rem;
            background: #fafdff;
            display: none;
        }
        .progress-area.active {
            display: block;
        }
        .progress-bar {
            height: 6px;
            background: #e2eaf1;
            border-radius: 3px;
            overflow: hidden;
        }
        .progress-fill {
            background: #3b82b6;
            width: 0%;
            height: 100%;
            transition: width 0.25s;
        }
        .progress-message {
            font-size: 0.75rem;
            text-align: center;
            margin-top: 0.75rem;
            color: #4a627a;
        }

        /* Result area */
        .result-area {
            border-top: 1px solid #e6edf4;
            padding: 1.5rem;
            text-align: center;
            background: #eef4fc;
            display: none;
        }
        .result-area.active {
            display: block;
        }
        .result-icon {
            font-size: 2rem;
        }
        .result-title {
            font-weight: 600;
            margin: 0.5rem 0;
        }
        .result-stats {
            display: flex;
            justify-content: center;
            gap: 1rem;
            margin: 1rem 0;
            flex-wrap: wrap;
        }
        .result-stat {
            background: white;
            padding: 0.5rem 1rem;
            border-radius: 2rem;
            font-size: 0.85rem;
        }
        .result-downloads {
            display: flex;
            flex-wrap: wrap;
            gap: 0.75rem;
            justify-content: center;
            margin: 1rem 0;
            max-height: 300px;
            overflow-y: auto;
            padding: 0.5rem;
        }
        .download-item {
            background: white;
            padding: 0.5rem 1rem;
            border-radius: 2rem;
            border: 1px solid #d4e0ec;
            cursor: pointer;
            transition: all 0.2s;
            font-size: 0.75rem;
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
        }
        .download-item:hover {
            background: #eef4fc;
            border-color: #3b82b6;
        }
        .download-all-btn {
            background: #3b82b6;
            color: white;
            padding: 0.6rem 1.5rem;
            border: none;
            border-radius: 3rem;
            font-weight: 600;
            font-size: 0.85rem;
            cursor: pointer;
            margin-top: 0.5rem;
        }

        /* Error area */
        .error-area {
            border-top: 1px solid #fee2e2;
            padding: 1.5rem;
            text-align: center;
            background: #fef6f5;
            display: none;
        }
        .error-area.active {
            display: block;
        }
        .error-title {
            font-weight: 600;
        }
        .error-message {
            font-size: 0.75rem;
            margin: 0.5rem 0;
        }

        /* Knowledge section */
        .knowledge-section {
            margin-top: 2.5rem;
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
            gap: 1.25rem;
        }
        .knowledge-card {
            background: white;
            border-radius: 1.25rem;
            padding: 1.2rem;
            border: 1px solid #e6edf4;
        }
        .knowledge-card h3 {
            font-size: 0.9rem;
            font-weight: 600;
            margin-bottom: 0.6rem;
            color: #2c5a7a;
        }
        .knowledge-card p, .knowledge-card li {
            font-size: 0.8rem;
            color: #4a627a;
            line-height: 1.5;
        }
        .knowledge-card ul {
            padding-left: 1.2rem;
            margin-top: 0.3rem;
        }

        .footer-note {
            margin-top: 2rem;
            padding-top: 1rem;
            border-top: 1px solid #dce5ef;
            font-size: 0.7rem;
            text-align: center;
            color: #6b85a0;
        }
        .toast {
            position: fixed;
            bottom: 1rem;
            right: 1rem;
            background: #1a2c3e;
            color: white;
            padding: 0.5rem 1rem;
            border-radius: 2rem;
            font-size: 0.75rem;
            transform: translateX(400px);
            transition: transform 0.2s;
            z-index: 200;
        }
        .spinner {
            width: 14px;
            height: 14px;
            border: 2px solid rgba(255,255,255,0.3);
            border-top-color: white;
            border-radius: 50%;
            animation: spin 0.6s linear infinite;
            display: inline-block;
        }
        @keyframes spin {
            to { transform: rotate(360deg); }
        }
        .hidden {
            display: none;
        }

        #footerSpan {
            margin-left: 1rem;
        }

        .footerLink {
            color: #3b82b6;
            text-decoration: none;
        }

        #newSplitBtn {
            margin-top: 0.75rem;
        }

        #splitSpinner {
            display: none;
        }

        #fileInput {
            display: none;
        }