* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #333;
    line-height: 1.6;
    padding: 20px;
    min-height: 100vh;
}

.container {
    max-width: 1300px;
    margin: 30px auto;
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

header {
    background: linear-gradient(90deg, #4b6cb7 0%, #182848 100%);
    color: white;
    padding: 25px 40px;
    text-align: center;
}

h1 {
    font-size: 2.8rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 700px;
    margin: 0 auto;
}

.mobile-warning {
    background-color: #ff6b6b;
    color: white;
    padding: 15px;
    text-align: center;
    font-weight: bold;
    display: none;
}

.main-content {
    display: flex;
    padding: 20px;
    gap: 30px;
}

.control-panel {
    flex: 0 0 320px;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.control-group {
    margin-bottom: 30px;
}

.control-group h3 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 2px solid #eaeaea;
    padding-bottom: 10px;
}

.shape-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.shape-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 5px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.shape-option:hover {
    transform: translateY(-5px);
    border-color: #4b6cb7;
    box-shadow: 0 5px 15px rgba(75, 108, 183, 0.2);
}

.shape-option.active {
    border-color: #4b6cb7;
    background-color: #eef4ff;
}

.shape-option .icon {
    font-size: 1.5rem;
    margin-bottom: 2px;
}

.size-control {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
}

.size-slider {
    flex: 1;
    height: 8px;
    -webkit-appearance: none;
    background: #e0e0e0;
    border-radius: 5px;
    outline: none;
}

.size-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #4b6cb7;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.size-value {
    font-weight: bold;
    font-size: 1.2rem;
    min-width: 45px;
    text-align: center;
    color: #4b6cb7;
}

.color-picker {
    width: 100%;
    height: 45px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    padding: 3px;
    background: white;
    border: 2px solid #e0e0e0;
}

.paper-selector {
    width: 100%;
    padding: 12px 15px;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    background: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.paper-selector:hover {
    border-color: #4b6cb7;
}

.action-buttons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.action-btn {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.print-btn {
    background: linear-gradient(to right, #4b6cb7, #3a56a0);
    color: white;
}

.download-btn {
    background: linear-gradient(to right, #00b09b, #96c93d);
    color: white;
}

.action-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.action-btn:active {
    transform: translateY(1px);
}

.preview-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #f0f4f8;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.preview-header {
    padding: 15px 25px;
    background: white;
    border-bottom: 1px solid #eaeaea;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.canvas-container {
    flex: 1;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: repeating-conic-gradient(#f0f0f0 0% 25%, #f8f8f8 0% 50%) 50% / 20px 20px;
}

#grid-canvas {
    background-color: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    max-width: 100%;
    max-height: 70vh;
}

.instructions {
    padding: 30px 40px;
    background: #f8f9fa;
    border-top: 1px solid #eaeaea;
}

.instructions h2 {
    font-size: 1.8rem;
    margin-bottom: 25px;
    color: #2c3e50;
    text-align: center;
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    counter-reset: step-counter;
}

.step {
    position: relative;
    padding: 25px;
    padding-left: 80px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.step:before {
    counter-increment: step-counter;
    content: counter(step-counter);
    position: absolute;
    left: 25px;
    top: 25px;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #4b6cb7, #3a56a0);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
}

.step h3 {
    margin-bottom: 15px;
    color: #2c3e50;
}

footer {
    text-align: center;
    padding: 25px;
    color: #7f8c8d;
    background: #f8f9fa;
    border-top: 1px solid #eaeaea;
}

/* 当视口宽度小于或等于600px时应用以下样式 */
@media (max-width: 600px) {
  .main-content {
      flex-direction: column;
  }

  .control-panel {
      width: 100%;
  }

  .mobile-warning {
      display: block !important;
  }
}
