:root {
    --primary-color: #4a6bdf;
    --primary-hover: #3955c8;
    --secondary-color: #f8f9fa;
    --text-color: #333;
    --light-gray: #e9ecef;
    --border-color: #dee2e6;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
  }
  
  * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }
  
  @keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
  }
  
  @keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
  }
  
  @keyframes slideInFromRight {
    from { transform: translateX(30px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
  }
  
  @keyframes floatUpDown {
    0% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
    100% { transform: translateY(0); }
  }
  
  body {
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    background-color: #f5f7fa;
    padding: 0;
    margin: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%239C92AC' fill-opacity='0.05' fill-rule='evenodd'/%3E%3C/svg%3E");
    background-attachment: fixed;
  }
  
  .container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
  }
  
  header {
    background-color: white;
    box-shadow: var(--shadow);
    padding: 20px 0;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
  }
  
  header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), #6c5ce7, #00cec9);
    animation: slideInFromRight 1.5s ease-out;
  }
  
  header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  
  h1 {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0;
    animation: fadeIn 0.8s ease-out;
  }
  
  h1 i {
    animation: floatUpDown 3s ease-in-out infinite;
    display: inline-block;
  }
  
  .main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
  }
  
  @media (max-width: 768px) {
    .main-content {
      grid-template-columns: 1fr;
    }
  }
  
  .card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 25px;
    margin-bottom: 25px;
    border-top: 4px solid var(--primary-color);
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 500px;
    animation: fadeIn 0.8s ease-out;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
  }
  
  .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
  }
  
  .left-column .card {
    animation-delay: 0.1s;
  }
  
  .right-column .card {
    animation-delay: 0.3s;
  }
  
  .card-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--light-gray);
  }
  
  .card-title i {
    margin-right: 10px;
    transition: transform 0.3s ease;
  }
  
  .card:hover .card-title i {
    transform: scale(1.2);
  }
  
  .card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
  }
  
  #upload-container {
    margin-bottom: 20px;
  }
  
  .file-upload {
    position: relative;
    display: inline-block;
    width: 100%;
    margin-bottom: 20px;
  }
  
  .file-upload-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 160px;
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    background-color: var(--secondary-color);
    cursor: pointer;
    transition: all 0.3s;
  }
  
  .file-upload-label:hover {
    border-color: var(--primary-color);
    background-color: rgba(74, 107, 223, 0.05);
  }
  
  .file-upload-label:hover i {
    animation: pulse 1s infinite;
    color: var(--primary-color);
  }
  
  .file-upload-label div {
    text-align: center;
  }
  
  .file-upload-label i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
    transition: all 0.3s ease;
  }
  
  .file-upload input[type="file"] {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
  }
  
  #canvas-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    flex: 1;
    min-height: 200px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
  }
  
  canvas {
    max-width: 100%;
    max-height: 330px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    background-color: white;
    transition: all 0.3s ease;
  }
  
  .options {
    width: 100%;
  }
  
  .option-item {
    margin-bottom: 15px;
    transition: transform 0.3s ease;
  }
  
  .option-item:hover {
    transform: translateX(5px);
  }
  
  label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
  }
  
  input[type="number"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s, box-shadow 0.3s;
  }
  
  input[type="number"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 107, 223, 0.15);
  }
  
  button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
  }
  
  button:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
  }
  
  @keyframes ripple {
    0% {
      transform: scale(0, 0);
      opacity: 0.5;
    }
    100% {
      transform: scale(100, 100);
      opacity: 0;
    }
  }
  
  button:focus:not(:active)::after {
    animation: ripple 1s ease-out;
  }
  
  button:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  }
  
  button:active {
    transform: translateY(1px);
  }
  
  button:disabled {
    background-color: var(--light-gray);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
  }
  
  .download-link {
    display: inline-block;
    margin-top: 20px;
    font-size: 16px;
    color: white;
    background-color: #28a745;
    text-decoration: none;
    padding: 12px 20px;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    width: 100%;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
  }
  
  .download-link:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
  }
  
  .download-link:focus:not(:active)::after {
    animation: ripple 1s ease-out;
  }
  
  .download-link:hover {
    background-color: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  }
  
  .download-link:active {
    transform: translateY(1px);
  }
  
  .image-info {
    margin-top: 10px;
    padding: 10px;
    background-color: var(--secondary-color);
    border-radius: 4px;
    font-size: 14px;
    animation: fadeIn 0.5s ease-out;
  }
  
  .dimension-badge {
    background-color: rgba(74, 107, 223, 0.1);
    color: var(--primary-color);
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 500;
    font-size: 13px;
    display: inline-block;
    margin-bottom: 5px;
    animation: fadeIn 0.5s ease-out;
  }
  
  .card-footer {
    margin-top: auto;
    padding-top: 20px;
  }
  
  footer {
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    color: #6c757d;
    font-size: 14px;
    background-color: white;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.03);
    animation: fadeIn 1s ease-out;
    animation-delay: 0.5s;
    animation-fill-mode: both;
  }
  
  @keyframes spinner {
    to {transform: rotate(360deg);}
  }
  
  .spinner {
    display: inline-block;
    animation: spinner 1s linear infinite;
  }
  
  .progress-container {
    height: 4px;
    width: 100%;
    background-color: #eee;
    border-radius: 2px;
    margin: 10px 0;
    overflow: hidden;
    display: none;
  }
  
  .progress-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--primary-color), #6c5ce7);
    border-radius: 2px;
  }