/* 字帖生成器样式 */

.calligraphy-layout {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.controls-panel {
  background: #fff;
  border-radius: var(--border-radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.control-row {
  display: flex;
  gap: 16px;
}

.color-row {
  display: flex;
  gap: 16px;
}

.color-row .control-group {
  flex: 1;
  margin-bottom: 0;
}

.control-row .control-section {
  flex: 1;
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.control-section {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--gray-100);
}

.control-section:last-of-type {
  border-bottom: none;
  margin-bottom: 12px;
}

.control-section h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 10px;
}

/* Type Select */
.type-select select,
.grade-select select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  font-size: 0.95rem;
  color: var(--gray-700);
  background: #fff;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.type-select select:focus,
.grade-select select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Control Groups */
.control-group {
  margin-bottom: 10px;
}

.control-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--gray-600);
  margin-bottom: 5px;
}

.control-group select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  font-size: 0.9rem;
  color: var(--gray-700);
  background: #fff;
  cursor: pointer;
}

.control-group select:focus {
  outline: none;
  border-color: var(--primary);
}

.control-group input[type="number"],
.control-group input[type="text"] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  font-size: 0.9rem;
  color: var(--gray-700);
}

.control-group input[type="number"]:focus,
.control-group input[type="text"]:focus {
  outline: none;
  border-color: var(--primary);
}

.control-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  font-size: 0.9rem;
  color: var(--gray-700);
  resize: vertical;
  min-height: 100px;
  font-family: inherit;
}

.control-group textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.control-group input[type="range"] {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  background: var(--gray-200);
  border-radius: 3px;
  outline: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
}

/* Color Input */
.color-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.color-input-wrap input[type="color"] {
  width: 40px;
  height: 32px;
  padding: 2px;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  cursor: pointer;
}

.color-input-wrap span {
  font-size: 0.85rem;
  color: var(--gray-500);
  font-family: monospace;
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  flex: 1;
  min-width: 120px;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--secondary);
  color: #fff;
}

.btn-secondary:hover {
  background: var(--secondary-hover);
}

.btn-outline {
  background: #fff;
  color: var(--gray-700);
  border: 1px solid var(--gray-300);
}

.btn-outline:hover {
  background: var(--gray-50);
  border-color: var(--gray-400);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Preview Panel */
.preview-panel {
  background: #fff;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.preview-card {
  padding: 20px;
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--gray-100);
}

.preview-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-800);
}

.preview-header p {
  font-size: 0.85rem;
  color: var(--gray-500);
  margin-top: 4px;
}

.preview-box {
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  background: #fff;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

/* Print Sheet Styles */
.resprint {
  background: #fff;
  padding: 2mm 10mm;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  margin: 0 auto;
}

.resprinthead {
  margin-bottom: 2mm;
  padding-bottom: 2mm;
  border-bottom: 1px solid #bbbbbb;
}

.resprinthead-info {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.resprinthead-info span {
  font-size: 13px;
  color: #666666;
}

.info-site {
  color: #999;
  font-size: 12px;
}

.reszhuti {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Empty Preview */
.empty-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--gray-400);
}

.empty-preview svg {
  margin-bottom: 16px;
}

.empty-preview p {
  font-size: 0.95rem;
}

/* Info Section */
.info-section {
  background: #fff;
  border-radius: var(--border-radius);
  padding: 24px;
  margin-top: 20px;
  box-shadow: var(--shadow);
}

.info-section h2 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 16px;
}

.info-content p {
  color: var(--gray-600);
  margin-bottom: 12px;
  line-height: 1.8;
}

.info-content ul {
  margin: 12px 0;
  padding-left: 24px;
}

.info-content li {
  color: var(--gray-600);
  margin-bottom: 8px;
  line-height: 1.6;
}

/* Links Section */
.links-section {
  background: #fff;
  border-radius: var(--border-radius);
  padding: 24px;
  margin-top: 20px;
  box-shadow: var(--shadow);
}

.links-section h2 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 16px;
}

.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.links-grid a {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 8px 12px;
  border-radius: 6px;
  transition: background 0.2s;
}

.links-grid a:hover {
  background: var(--gray-50);
}

/* Footer */
footer {
  text-align: center;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--gray-200);
}

footer p {
  color: var(--gray-500);
  font-size: 0.85rem;
  margin-bottom: 8px;
}

footer a {
  color: var(--primary);
  text-decoration: none;
}

/* Print Styles */
@media print {
  body * {
    visibility: hidden;
  }
  
  .resprint,
  .resprint * {
    visibility: visible;
  }
  
  .resprint {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    box-shadow: none;
  }
  
  .resprinthead {
    margin-bottom: 2mm;
    padding-bottom: 2mm;
    border-bottom: 1px solid #bbbbbb;
  }
  
  .resprinthead-info {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
  }
  
  .resprinthead-info span {
    font-size: 14px;
    color: #666666;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 20px 15px;
  }
  
  header h1 {
    font-size: 1.5rem;
  }
  
  .control-row {
    flex-direction: column;
    gap: 0;
  }
  
  .control-row .control-section {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gray-100);
  }
  
  .action-buttons {
    flex-direction: column;
  }
  
  .btn {
    width: 100%;
  }
  
  .resprint {
    padding: 10mm;
    min-height: auto;
  }
  
  .links-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}