* {
  margin: 0;
  padding: 0;

}

body {
  background-color: #f1f2f3;
}

.container {
  width: 100%;
  max-width: 1600px;
  min-width: 1100px;
  box-sizing: border-box;
  margin: 20px auto;
  color: #333;
}

.container *{
  box-sizing: border-box;
}

header {
  text-align: center;
  margin-bottom: 25px;
}

h1 {
  font-size: 2rem;
  margin-bottom: 5px;
}

.subtitle {
  font-size: 1rem;
  color: #7f8c8d;
  max-width: 95%;
  margin: 0 auto;
  line-height: 1.6;
}

.input-area {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  padding: 20px;
  margin-bottom: 20px;
}

.input-row {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
}

textarea {
  flex: 1;
  height: 100px;
  padding: 15px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 16px;
  line-height: 1.65;
  resize: vertical;
  transition: border-color 0.3s;
}

textarea:focus {
  border-color: #3498db;
  outline: none;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.btn-group {
  display: flex;
  gap: 15px;
}

button {
  padding: 12px 25px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 180px;
}

#btn-query {
  background: linear-gradient(to right, #3498db, #2980b9);
  color: white;
}

#btn-query:hover {
  background: linear-gradient(to right, #2980b9, #2573a7);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
}

#btn-clear {
  background: linear-gradient(to right, #e74c3c, #c0392b);
  color: white;
}

#btn-clear:hover {
  background: linear-gradient(to right, #c0392b, #a93226);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
}

.result-area {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 12px;
  margin-bottom: 20px;
}

.no-result {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px;
  color: #7f8c8d;
  font-size: 18px;
}

.char-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  padding: 20px;
  transition: transform 0.3s;
  display: flex;
  flex-direction: column;
  margin-bottom: 20px;
}

.char-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.12);
}

.char-header {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

.char-display {
  font-size: 18px;
  font-weight: bold;
  text-align: center;
  width: 36px;
  height: 36px;
  line-height: 36px;
  background: #f8f9fa;
  border-radius: 4px;
  margin-right: 80px;
}

.char-info {
  flex: 1;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
}

.info-item {
  display: flex;
  align-items: center;
}

.info-label {
  font-weight: bold;
  min-width: 70px;
  color: #7f8c8d;
  margin-right: 10px;
}

.info-value {
  color: #2c3e50;
}

.content-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.animation-section {
  width: 160px;
}

.strokes-section {
  flex: 2;
  min-width: 300px;
}

.strokes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 12px;
}

.stroke-item {
  background: #f8f9fa;
  border-radius: 6px;
  padding: 10px;
  text-align: center;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stroke-preview {
  width: 60px;
  height: 60px;
  margin-bottom: 10px;
  border: 1px solid #eee;
  border-radius: 4px;
}


.char-info-row {
  display: flex;
  margin-bottom: 8px;
  font-size: 16px;
}

.info-label {
  font-weight: bold;
  width: 70px;
  color: #7f8c8d;
}

.info-value {
  flex: 1;
  color: #2c3e50;
}

.animation-container {
  width: 120px;
  height: 120px;
  border: 1px solid #eee;
  border-radius: 8px;
  background: #f8f9fa;
}

.animation-controls {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-right: 80px;
}

.animation-controls button{
  min-width: auto;
}

.anim-btn {
  padding: 8px 20px;
  border-radius: 6px;
  font-size: 14px;
  background: #ecf0f1;
  color: #2c3e50;
}

.anim-btn:hover {
  background: #d5dbdb;
}

.section-title {
  font-size: 16px;
  margin-bottom: 12px;
  color: #8a8a8a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.stroke-item {
  background: #f8f9fa;
  border-radius: 6px;
  padding: 10px;
  text-align: center;
  font-size: 14px;
}

.stroke-index {
  display: inline-block;
  width: 24px;
  height: 24px;
  line-height: 24px;
  background: #3498db;
  color: white;
  border-radius: 50%;
  margin-bottom: 5px;
  font-size: 12px;
}

.stroke-name {
  color: #2c3e50;
  font-weight: 500;
}

.instructions {
    background: #dbeafe;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.instructions h3 {
    margin-bottom: 10px;
    color: #1e40af;
    display: flex;
    align-items: center;
    gap: 10px;
}

.instructions ul {
    padding-left: 25px;
}

.instructions li {
    margin-bottom: 8px;
}

footer {
  text-align: center;
  margin-top: 10px;
  color: #7f8c8d;
  font-size: 14px;
}

.tip {
  background: #fef9e7;
  border-left: 4px solid #f1c40f;
  padding: 12px 15px;
  margin-top: 15px;
  border-radius: 0 8px 8px 0;
  font-size: 14px;
}
