        body {
            background-color: #f5f5f5;
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
            margin: 0;
            padding: 0;
        }

        .page-container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 20px;
        }

        .page-header {
            background: #fff;
            padding: 30px;
            border-radius: 8px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
            margin-bottom: 20px;
        }

        .page-header h1 {
            margin: 0 0 10px 0;
            font-size: 28px;
            color: #333;
        }

        .page-header p {
            margin: 0;
            color: #666;
            font-size: 14px;
        }

        .tool-card {
            background: #fff;
            border-radius: 8px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
            padding: 25px;
            margin-bottom: 20px;
        }

        .tabs {
            display: flex;
            border-bottom: 2px solid #e0e0e0;
            margin-bottom: 25px;
            gap: 5px;
        }

        .tab-btn {
            padding: 12px 24px;
            background: transparent;
            border: none;
            border-bottom: 3px solid transparent;
            cursor: pointer;
            font-size: 15px;
            color: #666;
            transition: all 0.2s;
            position: relative;
            bottom: -2px;
        }

        .tab-btn:hover {
            color: #333;
            background: #f5f5f5;
        }

        .tab-btn.active {
            color: #1a73e8;
            border-bottom-color: #1a73e8;
        }

        .badge-count {
            display: inline-block;
            background: #d93025;
            color: #fff;
            font-size: 12px;
            font-weight: 600;
            padding: 2px 6px;
            border-radius: 10px;
            margin-left: 5px;
            min-width: 20px;
            text-align: center;
        }

        .tab-content {
            display: none;
        }

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

        .form-group {
            margin-bottom: 20px;
        }

        .form-label {
            display: block;
            font-weight: 500;
            color: #333;
            margin-bottom: 8px;
            font-size: 14px;
        }

        .form-label .required {
            color: #d93025;
        }

        .form-label .hint {
            font-weight: 400;
            color: #999;
            font-size: 13px;
        }

        .input-field {
            width: 100%;
            padding: 10px 12px;
            border: 1px solid #ddd;
            border-radius: 4px;
            font-size: 14px;
            transition: border-color 0.2s;
        }

        .input-field:focus {
            outline: none;
            border-color: #1a73e8;
        }

        .input-row {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 15px;
        }

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

        .checkbox-group input[type="checkbox"] {
            width: 16px;
            height: 16px;
            cursor: pointer;
        }

        .checkbox-group label {
            cursor: pointer;
            color: #555;
            font-size: 14px;
        }

        .btn-primary {
            width: 100%;
            padding: 12px;
            background: #1a73e8;
            color: #fff;
            border: none;
            border-radius: 4px;
            font-size: 15px;
            font-weight: 500;
            cursor: pointer;
            transition: background 0.2s;
        }

        .btn-primary:hover {
            background: #1557b0;
        }

        .btn-primary:active {
            background: #0d47a1;
        }

        .result-box {
            margin-top: 25px;
            padding: 20px;
            background: #f8f9fa;
            border: 1px solid #e0e0e0;
            border-radius: 4px;
            display: none;
        }

        .result-box.show {
            display: block;
        }

        .result-title {
            font-size: 15px;
            font-weight: 600;
            color: #333;
            margin-bottom: 15px;
        }

        .result-item {
            background: #fff;
            padding: 12px;
            border-radius: 4px;
            margin-bottom: 10px;
            border: 1px solid #e0e0e0;
            position: relative; /* 定位父元素 */
        }

        .result-label {
            font-size: 12px;
            color: #666;
            margin-bottom: 6px;
        }

        .result-value {
            font-family: 'Consolas', 'Monaco', monospace;
            font-size: 13px;
            color: #333;
            padding: 8px;
            background: #f5f5f5;
            border-radius: 3px;
            word-break: break-all;
            padding-right: 80px; /* 为按钮留出空间 */
        }

        .copy-btn {
            position: absolute;
            right: 8px;
            top: 50%;
            transform: translateY(-50%);
            padding: 4px 10px;
            background: #1a73e8;
            color: #fff;
            border: none;
            border-radius: 3px;
            font-size: 12px;
            cursor: pointer;
            transition: background 0.2s;
        }

        .copy-btn:hover {
            background: #1557b0;
        }

        .copy-btn.copied {
            background: #0f9d58;
            transform: scale(1.05);
            box-shadow: 0 2px 6px rgba(15, 157, 88, 0.4);
        }

        .info-box {
            background: #e8f0fe;
            padding: 20px;
            border-radius: 4px;
            margin-bottom: 20px;
            border-left: 4px solid #1a73e8;
        }

        .info-box h3 {
            color: #1a73e8;
            font-size: 15px;
            margin: 0 0 12px 0;
        }

        .info-box ul {
            list-style: none;
            padding: 0;
            margin: 0;
        }

        .info-box li {
            padding: 6px 0;
            color: #555;
            font-size: 13px;
            line-height: 1.5;
        }

        .info-box li:before {
            content: "•";
            color: #1a73e8;
            font-weight: bold;
            margin-right: 8px;
        }

        .info-box code {
            background: #fff;
            padding: 2px 6px;
            border-radius: 3px;
            font-family: 'Consolas', monospace;
            font-size: 12px;
            color: #d93025;
        }

        .examples {
            margin-top: 15px;
            padding: 15px;
            background: #fff;
            border-radius: 4px;
        }

        .examples h4 {
            font-size: 13px;
            color: #666;
            margin: 0 0 10px 0;
        }

        .examples pre {
            background: #263238;
            color: #aed581;
            padding: 12px;
            border-radius: 4px;
            font-size: 12px;
            line-height: 1.6;
            overflow-x: auto;
            margin: 0;
        }

        .batch-textarea {
            width: 100%;
            min-height: 150px;
            padding: 10px;
            border: 1px solid #ddd;
            border-radius: 4px;
            font-family: 'Consolas', monospace;
            font-size: 13px;
            resize: vertical;
        }

        .batch-textarea:focus {
            outline: none;
            border-color: #1a73e8;
        }

        .batch-result {
            margin-top: 15px;
            max-height: 400px;
            overflow-y: auto;
        }

        .btn-export {
            margin-top: 15px;
            padding: 10px 20px;
            background: #0f9d58;
            color: #fff;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-size: 14px;
            transition: background 0.2s;
        }

        .btn-export:hover {
            background: #0d8043;
        }

        .warning-box {
            background: #fff3cd;
            border-left: 4px solid #ff9800;
            padding: 15px;
            border-radius: 4px;
            margin-bottom: 20px;
        }

        .warning-box strong {
            color: #f57c00;
            display: block;
            margin-bottom: 6px;
            font-size: 14px;
        }

        .warning-box p {
            color: #856404;
            font-size: 13px;
            line-height: 1.5;
            margin: 0;
        }

        /* TMDB 相关样式 */
        .api-settings-btn {
            position: fixed;
            top: 80px;
            right: 20px;
            padding: 10px 16px;
            background: #1a73e8;
            color: #fff;
            border: none;
            border-radius: 20px;
            cursor: pointer;
            font-size: 13px;
            box-shadow: 0 2px 8px rgba(26, 115, 232, 0.3);
            transition: all 0.2s;
            z-index: 999;
        }

        .api-settings-btn:hover {
            background: #1557b0;
            box-shadow: 0 4px 12px rgba(26, 115, 232, 0.4);
            transform: translateY(-1px);
        }

        .modal {
            display: none;
            position: fixed;
            z-index: 1000;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0,0,0,0.5);
            animation: fadeIn 0.2s;
        }

        .modal.active {
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .modal-content {
            background-color: #fff;
            padding: 30px;
            border-radius: 8px;
            width: 90%;
            max-width: 500px;
            box-shadow: 0 4px 20px rgba(0,0,0,0.3);
            animation: slideIn 0.3s;
        }

        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }

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

        .modal-header {
            font-size: 20px;
            font-weight: bold;
            color: #333;
            margin-bottom: 20px;
            padding-bottom: 15px;
            border-bottom: 2px solid #e0e0e0;
        }

        .modal-close {
            float: right;
            font-size: 28px;
            font-weight: bold;
            color: #999;
            cursor: pointer;
            line-height: 20px;
        }

        .modal-close:hover {
            color: #333;
        }

        .tmdb-input-group {
            margin-bottom: 15px;
        }

        .tmdb-input-group label {
            display: block;
            margin-bottom: 8px;
            font-size: 14px;
            color: #555;
            font-weight: 500;
        }

        .tmdb-input-group input {
            width: 100%;
            padding: 10px;
            border: 1px solid #ddd;
            border-radius: 4px;
            font-size: 14px;
        }

        .tmdb-input-group input:focus {
            outline: none;
            border-color: #1a73e8;
            box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
        }

        .tmdb-hint {
            font-size: 12px;
            color: #666;
            margin-top: 5px;
            line-height: 1.4;
        }

        .tmdb-hint a {
            color: #1a73e8;
            text-decoration: none;
        }

        .tmdb-hint a:hover {
            text-decoration: underline;
        }

        .modal-actions {
            margin-top: 25px;
            display: flex;
            gap: 10px;
            justify-content: flex-end;
        }

        .btn-modal {
            padding: 10px 20px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-size: 14px;
            transition: background 0.2s;
        }

        .btn-modal-primary {
            background: #1a73e8;
            color: #fff;
        }

        .btn-modal-primary:hover {
            background: #1557b0;
        }

        .btn-modal-secondary {
            background: #e0e0e0;
            color: #333;
        }

        .btn-modal-secondary:hover {
            background: #d0d0d0;
        }

        .tmdb-fetch-group {
            display: flex;
            gap: 8px;
            align-items: flex-end;
        }

        .tmdb-fetch-group .form-group {
            flex: 1;
            margin-bottom: 0;
        }

        .btn-tmdb-fetch {
            padding: 10px 16px;
            background: #0f9d58;
            color: #fff;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-size: 13px;
            white-space: nowrap;
            transition: background 0.2s;
            height: 42px;
        }

        .btn-tmdb-fetch:hover {
            background: #0d8043;
        }

        .btn-tmdb-fetch:disabled {
            background: #ccc;
            cursor: not-allowed;
        }

        .tmdb-link-input {
            margin-bottom: 15px;
        }

        .tmdb-status {
            margin-top: 10px;
            padding: 8px 12px;
            border-radius: 4px;
            font-size: 13px;
        }

        .tmdb-status.success {
            background: #d4edda;
            color: #155724;
            border-left: 3px solid #0f9d58;
        }

        .tmdb-status.error {
            background: #f8d7da;
            color: #721c24;
            border-left: 3px solid #d93025;
        }

        .tmdb-status.loading {
            background: #d1ecf1;
            color: #0c5460;
            border-left: 3px solid #17a2b8;
        }

        .btn-nfo {
            padding: 10px 20px;
            background: #673ab7;
            color: #fff;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-size: 14px;
            margin-left: 10px;
            transition: background 0.2s;
        }

        .btn-nfo:hover {
            background: #5e35b1;
        }

        .btn-nfo:disabled {
            background: #ccc;
            cursor: not-allowed;
        }

        /* 元数据预览卡片样式 */
        .metadata-preview {
            display: none;
            margin-top: 20px;
            padding: 20px;
            background: #fff;
            border-radius: 8px;
            border: 2px solid #0f9d58;
            box-shadow: 0 2px 8px rgba(15, 157, 88, 0.2);
        }

        .metadata-preview.show {
            display: block;
            animation: slideIn 0.3s;
        }

        .metadata-header {
            display: flex;
            align-items: flex-start;
            gap: 20px;
            margin-bottom: 15px;
        }

        .metadata-poster {
            flex-shrink: 0;
            width: 150px;
            border-radius: 6px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.2);
        }

        .metadata-poster img {
            width: 100%;
            border-radius: 6px;
            display: block;
        }

        .metadata-info {
            flex: 1;
        }

        .metadata-title {
            font-size: 20px;
            font-weight: bold;
            color: #333;
            margin-bottom: 8px;
        }

        .metadata-subtitle {
            font-size: 14px;
            color: #666;
            margin-bottom: 12px;
        }

        .metadata-badges {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
            margin-bottom: 12px;
        }

        .metadata-badge {
            display: inline-flex;
            align-items: center;
            padding: 4px 10px;
            background: #e8f5e9;
            color: #2e7d32;
            border-radius: 12px;
            font-size: 12px;
            font-weight: 500;
        }

        .metadata-badge.rating {
            background: #fff3e0;
            color: #e65100;
        }

        .metadata-badge.year {
            background: #e3f2fd;
            color: #1565c0;
        }

        .metadata-badge.runtime {
            background: #f3e5f5;
            color: #6a1b9a;
        }

        .metadata-plot {
            margin-top: 12px;
            padding: 12px;
            background: #f5f5f5;
            border-left: 3px solid #0f9d58;
            border-radius: 4px;
        }

        .metadata-plot-title {
            font-size: 13px;
            font-weight: bold;
            color: #555;
            margin-bottom: 6px;
        }

        .metadata-plot-text {
            font-size: 13px;
            line-height: 1.6;
            color: #666;
        }

        .metadata-genres {
            margin-top: 12px;
        }

        .metadata-genres span {
            display: inline-block;
            padding: 3px 8px;
            margin: 2px;
            background: #e0e0e0;
            color: #555;
            border-radius: 3px;
            font-size: 12px;
        }

        .metadata-ids {
            margin-top: 12px;
            font-size: 12px;
            color: #999;
        }

        .metadata-ids strong {
            color: #666;
        }

        /* ==================== 购物车区域滚动优化 ==================== */
        #batchCartArea {
            max-height: 400px;
            overflow-y: auto;
            overflow-x: hidden;
            padding-right: 5px;
        }

        /* 自定义滚动条样式（Webkit浏览器） */
        #batchCartArea::-webkit-scrollbar {
            width: 8px;
        }

        #batchCartArea::-webkit-scrollbar-track {
            background: #f1f1f1;
            border-radius: 4px;
        }

        #batchCartArea::-webkit-scrollbar-thumb {
            background: #888;
            border-radius: 4px;
        }

        #batchCartArea::-webkit-scrollbar-thumb:hover {
            background: #555;
        }

        /* Firefox滚动条样式 */
        #batchCartArea {
            scrollbar-width: thin;
            scrollbar-color: #888 #f1f1f1;
        }

        @media (max-width: 768px) {
            .metadata-header {
                flex-direction: column;
            }

            .metadata-poster {
                width: 120px;
                margin: 0 auto;
            }

            .input-row {
                grid-template-columns: 1fr;
            }

            .tabs {
                overflow-x: auto;
            }

            .tab-btn {
                white-space: nowrap;
            }

            .page-header {
                padding: 20px;
            }

            .page-header h1 {
                font-size: 24px;
            }

            .api-settings-btn {
                position: static;  /* 取消悬浮 */
                display: block;
                width: 100%;
                margin-bottom: 15px;
                text-align: center;
                background: #f8f9fa;
                color: #1a73e8;
                border: 1px solid #1a73e8;
                box-shadow: none;
                border-radius: 4px;
            }

            .api-settings-btn:hover {
                background: #e8f0fe;
                transform: none;
                box-shadow: none;
            }

            .tmdb-fetch-group {
                flex-direction: column;
            }

            .btn-tmdb-fetch {
                width: 100%;
            }
        }

        /* ==================== 搜索结果样式 ==================== */
        .search-results {
            display: none;
            margin-top: 15px;
            padding: 15px;
            background: #f8f9fa;
            border-radius: 6px;
            border: 1px solid #e0e0e0;
        }

        .search-results.show {
            display: block;
            animation: slideIn 0.3s;
        }

        .search-results-header {
            font-size: 14px;
            font-weight: 600;
            color: #333;
            margin-bottom: 12px;
            padding-bottom: 10px;
            border-bottom: 2px solid #e0e0e0;
        }

        .search-results-list {
            display: flex;
            flex-direction: column;
            gap: 10px;
            max-height: 500px;
            overflow-y: auto;
        }

        .search-result-item {
            display: flex;
            gap: 12px;
            padding: 12px;
            background: #fff;
            border-radius: 6px;
            border: 2px solid transparent;
            cursor: pointer;
            transition: all 0.2s;
        }

        .search-result-item:hover {
            border-color: #1a73e8;
            box-shadow: 0 2px 8px rgba(26, 115, 232, 0.2);
            transform: translateY(-2px);
        }

        .result-poster {
            width: 60px;
            height: 90px;
            object-fit: cover;
            border-radius: 4px;
            flex-shrink: 0;
            background: #e0e0e0;
        }

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

        .result-title {
            font-size: 15px;
            font-weight: 600;
            color: #333;
            margin-bottom: 4px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .result-original-title {
            font-size: 12px;
            color: #888;
            margin-bottom: 6px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .result-meta {
            display: flex;
            gap: 10px;
            margin-bottom: 6px;
        }

        .result-year,
        .result-rating {
            font-size: 11px;
            padding: 2px 6px;
            background: #e8f5e9;
            color: #2e7d32;
            border-radius: 3px;
        }

        .result-rating {
            background: #fff3e0;
            color: #e65100;
        }

        .result-overview {
            font-size: 12px;
            color: #666;
            line-height: 1.4;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        @media (max-width: 768px) {
            .search-result-item {
                padding: 10px;
            }

            .result-poster {
                width: 50px;
                height: 75px;
            }

            .result-title {
                font-size: 14px;
            }

            .result-meta {
                flex-wrap: wrap;
                gap: 5px;
            }
        }
    </style>
</head>
