        /* --- 基础变量与重置 --- */
        :root {
            --primary-color: #4f46e5; /* Indigo 600 */
            --primary-hover: #4338ca; /* Indigo 700 */
            --primary-light: #e0e7ff; /* Indigo 100 */
            --bg-color: #f8fafc;      /* Slate 50 */
            --text-main: #1e293b;     /* Slate 800 */
            --text-secondary: #64748b; /* Slate 500 */
            --border-color: #e2e8f0;  /* Slate 200 */
            --white: #ffffff;
            --danger: #ef4444;
            --success: #4ade80;
        }

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

        body {
            font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
            background-color: var(--bg-color);
            color: var(--text-main);
            min-height: 100vh;
            display: flex;
            flex-direction: column;
        }

        /* --- 通用工具类 --- */
        .container {
            max-width: 80rem; /* 7xl equivalent */
            margin: 0 auto;
            padding: 0 1rem;
            width: 100%;
        }
        html,body{ font-size:inherit;}
        /* --- 布局工具 --- */
    
    .mlogo a img {
    display: inline-block;
}
      
        .hidden {
            display: none !important;
        }

        .card {
            background-color: var(--white);
            border-radius: 0.75rem; /* rounded-xl */
            box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
            border: 1px solid var(--border-color);
            padding: 1.25rem;
            margin-bottom: 1rem;
        }

        .btn {
            cursor: pointer;
            border: 1px solid transparent;
            border-radius: 0.5rem;
            padding: 0.5rem 1rem;
            font-weight: 500;
            transition: all 0.2s;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 0.875rem;
        }

        .btn-primary {
            background-color: var(--primary-color);
            color: white;
            box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.1), 0 2px 4px -1px rgba(79, 70, 229, 0.06);
        }
        .btn-primary:hover {
            background-color: var(--primary-hover);
        }
        .btn-primary:active {
            transform: scale(0.98);
        }

        .btn-secondary {
            background-color: white;
            border-color: #cbd5e1;
            color: var(--text-secondary);
        }
        .btn-secondary:hover {
            background-color: var(--bg-color);
        }

        /* --- 导航栏 --- */
        nav {
            display: flex;
    align-items: center;
    margin-top: 90px;
        }
        
        .nav-content {
            display: flex;
            justify-content: space-between;
            align-items: center;
            width: 100%;
        }

        .logo-box {
            width: 2.5rem;
            height: 2.5rem;
            background-color: var(--primary-color);
            border-radius: 0.5rem;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 1.25rem;
            margin-right: 0.75rem;
        }

        .nav-link {
            text-decoration: none;
            color: var(--text-secondary);
            font-size: 0.875rem;
            transition: color 0.2s;
        }
        .nav-link:hover {
            color: var(--primary-color);
        }

        /* --- 上传区域 --- */
        #upload-area {
            border: 2px dashed #e0e7ff; /* indigo-100 */
            background-color: white;
            border-radius: 0.75rem;
            padding: 3rem;
            text-align: center;
            cursor: pointer;
            transition: all 0.3s;
            margin-bottom: 1.5rem;
        }
        
        #upload-area:hover {
            border-color: #a5b4fc; /* indigo-300 */
            background-color: rgba(238, 242, 255, 0.3);
        }

        #upload-area.drag-active {
            border-color: var(--primary-color);
            background-color: var(--primary-light);
        }

        .upload-icon {
            width: 5rem;
            height: 5rem;
            background-color: var(--primary-light);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 1rem;
            color: #6366f1; /* indigo-500 */
            font-size: 1.875rem;
        }

        /* --- 编辑器布局 --- */
        .editor-grid {
            display: grid;
            grid-template-columns: 1fr;
            gap: 2rem;
        }

        @media (min-width: 1024px) {
            .editor-grid {
                grid-template-columns: 2fr 1fr;
            }
        }

        /* --- 裁剪工作台 --- */
        .img-wrapper {
            background-color: white;
            padding: 0.25rem;
            border-radius: 0.75rem;
            box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
            border: 1px solid var(--border-color);
            margin-bottom: 1rem;
        }

        .img-container {
            min-height: 400px;
            max-height: 600px;
            background-color: #f8fafc;
            /* 透明格背景 */
            background-image: 
                linear-gradient(45deg, #e2e8f0 25%, transparent 25%), 
                linear-gradient(-45deg, #e2e8f0 25%, transparent 25%), 
                linear-gradient(45deg, transparent 75%, #e2e8f0 75%), 
                linear-gradient(-45deg, transparent 75%, #e2e8f0 75%);
            background-size: 20px 20px;
            background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 0.5rem;
            overflow: hidden;
        }

        img {
            max-width: 100%;
            display: block; 
        }

        /* --- 工具栏 --- */
        .toolbar {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
            align-items: center;
            justify-content: center;
        }
        @media (min-width: 640px) {
            .toolbar {
                justify-content: space-between;
            }
        }

        .tool-group {
            display: flex;
            gap: 0.5rem;
            align-items: center;
        }

        .divider {
            width: 1px;
            height: 2rem;
            background-color: #cbd5e1;
            margin: 0 0.25rem;
        }

        .tool-btn {
            width: 2.75rem;
            height: 2.75rem;
            display: flex;
            align-items: center;
            justify-content: center;
            background-color: #f1f5f9;
            color: #475569;
            border: none;
            border-radius: 0.5rem;
            cursor: pointer;
            transition: all 0.2s;
            font-size: 1rem;
        }
        .tool-btn:hover {
            background-color: var(--primary-light);
            color: var(--primary-color);
        }

        .reset-btn {
            background-color: #fef2f2;
            color: var(--danger);
            padding: 0.75rem 1rem;
            width: auto;
            font-size: 0.875rem;
        }
        .reset-btn:hover {
            background-color: #fee2e2;
        }

        /* --- 右侧控制面板 --- */
        .panel-title {
            font-weight: 600;
            color: var(--text-main);
            margin-bottom: 0.75rem;
            display: flex;
            align-items: center;
        }
        .panel-title i {
            color: #6366f1;
            margin-right: 0.5rem;
        }

        .preview-box {
            overflow: hidden;
            width: 100%;
            height: 200px;
            background-color: #f3f4f6;
            border: 1px dashed #cbd5e1;
            border-radius: 0.5rem;
        }

        /* 比例按钮 */
        .ratio-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 0.5rem;
        }

        .ratio-btn {
            padding: 0.5rem 0.75rem;
            background-color: white;
            color: #475569;
            border: 1px solid var(--border-color);
            border-radius: 0.375rem;
            font-size: 0.875rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
        }
        .ratio-btn:hover {
            border-color: #a5b4fc;
            color: var(--primary-color);
        }
        .ratio-btn.active {
            background-color: var(--primary-color);
            color: white;
            border-color: var(--primary-color);
        }

        /* 输入框 */
        .input-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 1rem;
        }
        .input-group label {
            display: block;
            font-size: 0.75rem;
            font-weight: 500;
            color: var(--text-secondary);
            margin-bottom: 0.25rem;
        }
        .input-control {
            width: 100%;
            padding: 0.5rem 0.75rem;
            background-color: #f8fafc;
            border: 1px solid var(--border-color);
            border-radius: 0.5rem;
            font-size: 0.875rem;
            outline: none;
            transition: border-color 0.2s;
        }
        .input-control:focus {
            border-color: var(--primary-color);
            box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
        }

        /* 大下载按钮 */
        .download-btn {
            width: 100%;
            padding: 1rem;
            font-size: 1.125rem;
            font-weight: 700;
            border-radius: 0.75rem;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-bottom: 1rem;
            border: none;
        }

        /* --- Toast 提示 --- */
        #toast {
            position: fixed;
            bottom: 1.25rem;
            left: 50%;
            transform: translateX(-50%);
            background-color: #1e293b;
            color: white;
            padding: 0.75rem 1.5rem;
            border-radius: 9999px;
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
            display: flex;
            align-items: center;
            opacity: 0;
            transition: opacity 0.3s;
            pointer-events: none;
            z-index: 50;
            white-space: nowrap;
        }
        #toast.show {
            opacity: 1;
        }
        
        /* 辅助类用于 JS 动态修改颜色 */
        .text-success { color: #4ade80; }
        .text-error { color: #f87171; }
        .mr-2 { margin-right: 0.5rem; }

        input[type="file"] {
            display: none;
        }