/* --- 基础设置 --- */
        :root {
            --primary-color: #4f46e5;
            --primary-hover: #4338ca;
            --secondary-color: #10b981;
            --secondary-hover: #059669;
            --bg-color: #f3f4f6;
            --card-bg: #ffffff;
            --text-main: #1f2937;
            --text-sub: #6b7280;
            --border-color: #d1d5db;
        }

        body {
            background-color: var(--bg-color);
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 0 1rem;
            margin: 0;
            box-sizing: border-box;
        }
        
        html,body{ font-size:inherit;}
        .website { padding: 90px 10px 20px !important;font-size: 14px;}
        .mnav {   font-size: 13px;}

        /* --- 通用工具类 --- */
        .hidden { display: none !important; }
        .text-center { text-align: center; }
        .flex { display: flex; }
        .items-center { align-items: center; }
        .justify-center { justify-content: center; }
        
        /* --- 标题区域 --- */
        header { margin-bottom: 2.5rem; text-align: center; }
        h1 { 
            font-size: 2.25rem; 
            font-weight: 700; 
            color: var(--text-main); 
            margin-bottom: 0.5rem; 
            margin-top: 0; 
        }
        header p { color: var(--text-sub); margin: 0; }

        /* --- 主容器卡片 --- */
        main {
            width: 100%;
            max-width: 56rem; /* 对应 max-w-4xl */
            background-color: var(--card-bg);
            border-radius: 0.75rem;
            box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
            padding: 1.5rem;
            transition: all 0.3s;
            box-sizing: border-box;
        }
        @media (min-width: 768px) { main { padding: 2.5rem; } }

        /* --- 上传区域 --- */
        #drop-zone {
            border: 2px dashed var(--border-color);
            border-radius: 0.75rem;
            padding: 2.5rem;
            text-align: center;
            cursor: pointer;
            transition: background-color 0.3s, border-color 0.3s;
        }
        #drop-zone:hover { background-color: #f9fafb; }
        #drop-zone.drag-active { 
            border-color: var(--primary-color) !important; 
            background-color: #eef2ff !important; 
        }
        
        .upload-icon-wrapper {
            padding: 1rem;
            background-color: #eef2ff;
            border-radius: 50%;
            display: inline-flex;
            margin-bottom: 1rem;
            color: var(--primary-color);
            transition: background-color 0.3s;
        }
        #drop-zone:hover .upload-icon-wrapper { background-color: #e0e7ff; }
        .upload-text-main { font-size: 1.125rem; font-weight: 500; color: #374151; margin: 0; }
        .upload-text-sub { font-size: 0.875rem; color: #9ca3af; margin-top: 0.25rem; }

        /* --- 图标 SVG --- */
        .icon-svg { width: 2.5rem; height: 2.5rem; stroke-width: 2; }
        .icon-sm { width: 1.5rem; height: 1.5rem; }
        .icon-xs { width: 1rem; height: 1rem; }

        /* --- 控制面板 --- */
        #control-panel { margin-top: 2rem; animation: fadeIn 0.5s; }
        
        .file-info-box {
            background-color: #f9fafb;
            padding: 1rem;
            border-radius: 0.5rem;
            border: 1px solid #f3f4f6;
            display: flex;
            flex-direction: column;
            gap: 1rem;
        }
        @media (min-width: 768px) {
            .file-info-box { flex-direction: row; justify-content: space-between; align-items: center; }
        }

        .file-details { display: flex; align-items: center; gap: 0.75rem; overflow: hidden; }
        .file-icon { 
            background-color: #fee2e2; 
            color: #dc2626; 
            padding: 0.5rem; 
            border-radius: 0.25rem; 
            display: flex;
            flex-shrink: 0;
        }
        #file-name { font-weight: 600; color: #1f2937; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; margin: 0;}
        #page-count { font-size: 0.875rem; color: #6b7280; margin: 0; }

        /* --- 按钮样式 --- */
        .btn {
            padding: 0.625rem 1.5rem;
            font-weight: 500;
            border-radius: 0.5rem;
            border: none;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            transition: background-color 0.2s;
            color: white;
            font-size: 1rem;
            text-decoration: none;
        }
        .btn-primary { background-color: var(--primary-color); width: 100%; }
        .btn-primary:hover { background-color: var(--primary-hover); }
        .btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
        @media (min-width: 768px) { .btn-primary { width: auto; } }

        .btn-success { background-color: var(--secondary-color); font-size: 0.875rem; padding: 0.5rem 1rem; }
        .btn-success:hover { background-color: var(--secondary-hover); }

        .btn-outline {
            display: block; width: 100%; text-align: center; padding: 0.5rem;
            border: 1px solid var(--primary-color); color: var(--primary-color);
            background: transparent;
            border-radius: 0.25rem; text-decoration: none; font-size: 0.875rem;
            transition: background-color 0.2s;
            box-sizing: border-box;
        }
        .btn-outline:hover { background-color: #eef2ff; }

        /* --- 进度条 --- */
        #progress-container { margin-top: 1rem; background-color: #e5e7eb; border-radius: 9999px; height: 0.625rem; overflow: hidden; width: 100%; }
        #progress-bar { background-color: var(--primary-color); height: 100%; width: 0%; transition: width 0.3s; }
        #status-text { text-align: center; font-size: 0.875rem; color: #6b7280; margin-top: 0.5rem; height: 1.25rem; }

        /* --- 结果区域 --- */
        #results-area { margin-top: 2.5rem; }
        .results-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
        .results-title { font-size: 1.25rem; font-weight: 700; color: var(--text-main); margin: 0; }

        /* --- 图片网格 --- */
        #image-grid {
            display: grid;
            grid-template-columns: 1fr;
            gap: 1.5rem;
        }
        @media (min-width: 768px) { #image-grid { grid-template-columns: repeat(2, 1fr); } }
        @media (min-width: 1024px) { #image-grid { grid-template-columns: repeat(3, 1fr); } }

        /* --- 卡片组件 --- */
        .card {
            background-color: white;
            border-radius: 0.5rem;
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
            overflow: hidden;
            border: 1px solid #f3f4f6;
            transition: box-shadow 0.3s;
        }
        .card:hover { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); }
        .card-image-wrapper {
            position: relative;
            background-color: #e5e7eb;
            aspect-ratio: 3/4;
            overflow: hidden;
        }
        .card-image { width: 100%; height: 100%; object-fit: contain; display: block; }
        .card-content { padding: 1rem; }
        .card-info { display: flex; justify-content: space-between; margin-bottom: 0.5rem; font-size: 0.875rem; align-items: center; }

        /* --- 动画 --- */
        @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
        @keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
        
        .loader {
            border: 3px solid #f3f3f3;
            border-top: 3px solid currentColor;
            border-radius: 50%;
            width: 20px;
            height: 20px;
            animation: spin 1s linear infinite;
            display: inline-block;
        }

        /* --- Footer & Hidden --- */
        #hidden-canvas { display: none; }
        footer { margin-top: 3rem; color: #9ca3af; font-size: 0.875rem; }