body {
  background: #f7f7f7;
  font-family: "Noto Sans KR", Arial, sans-serif;
  margin: 0;
}
.container {
  background: #fff;
  margin: 20px auto;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  border-radius: 6px;
  max-width: 1400px;
  min-width: 900px;
}
.header {
  background: #2196f3;
  color: #fff;
  font-size: 22px;
  font-weight: 500;
  padding: 16px 16px 12px 16px;
  border-radius: 6px 6px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.close-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
}
.main {
  padding: 20px 16px;
  height: calc(100vh - 80px);
  min-height: 818px;
  gap: 10px;
  display: flex;
  flex-direction: column;
}
.convert-section {
  display: flex;
  justify-content: space-between;
}
.convert-box {
  background: #fafbfc;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 14px;
  width: 49.6%;
  box-sizing: border-box;
}
.convert-box h2 {
  font-size: 18px;
  margin: 0 0 10px 0;
  font-weight: 600;
}

.convert-box h3 {
  font-size: 18px;
  margin: 0 0 10px 0;
  font-weight: 400;
}
.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 12px;
}
.row input {
  margin-right: 8px;
  padding: 6px 8px;
  font-size: 16px;
  width: auto;
}
button.mobile-toggle-btn {
  display: none;
}
button,
#px-to-vw-btn,
#vw-to-px-btn,
#css1-btn,
#css2-btn,
#css1-copy-btn {
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(171, 71, 188, 0.1);
  background: #ffebee;
  color: #d32f2f;
  border: 1px solid #ffcdd2;
  padding: 6px;
  font-size: 15px;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
  margin-bottom: 5px;
  cursor: pointer;
  outline: none;
}
button:active,
#px-to-vw-btn:active,
#vw-to-px-btn:active,
#css1-btn:active,
#css2-btn:active {
  background: #4a148c;
}
button:focus,
#px-to-vw-btn:focus,
#vw-to-px-btn:focus,
#css1-btn:focus,
#css2-btn:focus {
  outline: none;
}
.button-box {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.button-box button {
  width: 100%;
}
#px-to-vw-btn,
#vw-to-px-btn,
#css1-btn,
#css2-btn {
  background: #ab47bc;
  color: #fff;
  border: 1px solid #ba68c8;
  padding: 6px 9px;
}
#px-to-vw-btn:hover,
#vw-to-px-btn:hover,
#css1-btn:hover,
#css2-btn:hover {
  background: #4a148c;
}
#css1-copy-btn {
  background: #fffde7;
  color: #f57c00;
  border: 1px solid #ffe0b2;
}
#css1-copy-btn:hover {
  background: #f57c00;
  color: #fff;
}
.css-section {
  display: flex;
  justify-content: space-between;
  height: calc(100vh - 314px);
  min-height: 540px;
}
.css-box {
  background: #fafbfc;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 14px;
  width: 49.6%;
  height: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}
.css-header {
  font-size: 16px;
  margin-bottom: 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.css-header input[type="number"] {
  width: 70px;
  margin: 0 4px;
  padding: 6px;
}
.css-header label {
  display: flex;
  align-items: center;
  font-size: 14px;
  margin-left: 8px;
}
.textarea-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
}
textarea {
  font-family: "Noto Sans KR", Arial, sans-serif;
  font-size: 15px;
  border: 1px solid #d0d0d0;
  border-radius: 4px;
  padding: 8px;
  margin-bottom: 8px;
  resize: vertical;
  min-height: 150px;
  height: 100%;
  background: #fff;
}
textarea[readonly] {
  background: #f0f0f0;
}
.vw-preset-group {
  margin-bottom: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.vw-preset-btn {
  background: #f3e5f5;
  color: #ab47bc;
  border: 1px solid #ce93d8;
  border-radius: 4px;
  padding: 6px 6px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.vw-preset-btn:hover,
.vw-preset-btn:active {
  background: #ab47bc;
  color: #fff;
}

.vw2-preset-btn:hover,
.vw2-preset-btn:active {
  background: #d32f2f;
  color: #fff;
}
#vw-copy-btn,
#px-copy-btn,
#css2-copy-btn {
  background: #fffde7;
  color: #f57c00;
  border: 1px solid #ffe0b2;
  padding: 6px;
  font-size: 15px;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
}
#vw-copy-btn:hover,
#px-copy-btn:hover,
#css2-copy-btn:hover {
  background: #f57c00;
  color: #fff;
}
#vw-clear-btn,
#px-clear-btn,
#css2-clear-btn {
  background: #ffebee;
  color: #d32f2f;
  border: 1px solid #ffcdd2;
  padding: 6px 6px;
  font-size: 15px;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
}
#vw-clear-btn:hover,
#px-clear-btn:hover,
#css2-clear-btn:hover {
  background: #d32f2f;
  color: #fff;
}
#css1-clear-btn:hover {
  background: #d32f2f;
  color: #fff;
}
/* 폼 전체 스타일 */
form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
input[type="number"],
input[type="text"],
textarea {
  border: 1.5px solid #bdbdbd;
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 16px;
  background: #fff;
  transition: border 0.2s, box-shadow 0.2s;
  outline: none;
  margin-bottom: 5px;
}
input[type="number"]:focus,
input[type="text"]:focus,
textarea:focus {
  border: 1.5px solid #ab47bc;
  box-shadow: 0 0 0 2px #f3e5f5;
}
input[readonly],
textarea[readonly] {
  background: #f5f5f5;
  color: #888;
}
/* 체크박스 커스텀 디자인 */
input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid #ab47bc;
  border-radius: 5px;
  background: #fff;
  cursor: pointer;
  position: relative;
  transition: border 0.2s, box-shadow 0.2s;
  vertical-align: middle;
  margin-right: 4px;
}
input[type="checkbox"]:checked {
  background: #ab47bc;
  border-color: #ab47bc;
}
input[type="checkbox"]:focus {
  outline: none;
  box-shadow: 0 0 0 2px #f3e5f5;
}
input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 0px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
  transition: all 0.2s;
}

/* 방문자 통계 섹션 */
.visit-section {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 0;
}

.visit-section p {
  font-size: 12px;
}

.visit-box {
  display: flex;
  gap: 10px;
}

.visit-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.visit-label {
  font-size: 14px;
  color: #6c757d;
  font-weight: 500;
}

.visit-count {
  font-size: 24px;
  font-weight: 700;
  color: #2196f3;
}

/* 블로그 링크 스타일 */
.blog-links-container {
  text-align: center;
}

.blog-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.blog-link {
  color: #2196f3;
  text-decoration: none;
  font-size: 13px;
  padding: 5px 10px;
  border: 1px solid #2196f3;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.blog-link:hover {
  background: #2196f3;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(33, 150, 243, 0.2);
}

/* =========================== 1024px ================================ */
/* =========================== 1024px ================================ */
/* =========================== 1024px ================================ */

@media (max-width: 1024px) {
  .visit-section {
    flex-direction: column;
    align-items: flex-start;
  }
  .visit-section p {
    font-size: 10px;
  }
}

/* =========================== mobile ================================ */
/* =========================== mobile ================================ */
/* =========================== mobile ================================ */

@media (max-width: 720px) {
  .container {
    margin: 10px;
    min-width: auto;
    max-width: none;
    height: 100%;
  }
  .header {
    font-size: 18px;
    padding: 12px 12px 8px 12px;
  }
  .close-btn {
    font-size: 24px;
  }
  .blog-links {
    display: flex;
    justify-content: flex-start;
    gap: 5px;
  }
  .blog-links a.blog-link {
    font-size: 12px;
    padding: 5px 6px;
  }
  .main {
    padding: 15px 12px;
    height: 100%;
    min-height: 100%;
  }
  .convert-section {
    flex-direction: column;
    gap: 15px;
  }
  .convert-box {
    width: 100%;
    padding: 12px;
  }
  .convert-box h2 {
    font-size: 16px;
  }
  .convert-box h3 {
    font-size: 16px;
  }
  .row {
    flex-direction: column;
    align-items: stretch;
    /* gap: 8px; */
  }
  .row input {
    width: 100%;
    margin-right: 0;
    box-sizing: border-box;
  }
  button,
  #px-to-vw-btn,
  #vw-to-px-btn,
  #css1-btn,
  #css2-btn,
  #css1-copy-btn {
    font-size: 14px;
    padding: 4px 6px;
  }
  button:active,
  #px-to-vw-btn:active,
  #vw-to-px-btn:active,
  #css1-btn:active,
  #css2-btn:active {
    background: #4a148c;
  }
  button:focus,
  #px-to-vw-btn:focus,
  #vw-to-px-btn:focus,
  #css1-btn:focus,
  #css2-btn:focus {
    outline: none;
  }
  .btn-box {
    display: flex;
    flex-direction: row;
    gap: 8px;
  }
  .btn-box button {
    width: auto;
    flex: 1;
    padding: 8px;
  }
  .button-box {
    flex-direction: row;
    gap: 8px;
  }
  .button-box button {
    width: auto;
    flex: 1;
    padding: 8px;
  }
  #px-to-vw-btn,
  #vw-to-px-btn,
  #css1-btn,
  #css2-btn {
    background: #ab47bc;
    color: #fff;
    border: 1px solid #ba68c8;
    padding: 8px;
  }
  #px-to-vw-btn:hover,
  #vw-to-px-btn:hover,
  #css1-btn:hover,
  #css2-btn:hover {
    background: #4a148c;
  }
  #css1-copy-btn {
    background: #fffde7;
    color: #f57c00;
    border: 1px solid #ffe0b2;
    padding: 8px;
  }
  #css1-copy-btn:hover {
    background: #f57c00;
    color: #fff;
  }
  .css-section {
    flex-direction: column;
    height: auto;
    min-height: auto;
    gap: 15px;
  }
  .css-box {
    width: 100%;
    height: auto;
    min-height: 300px;
  }
  .css-header {
    font-size: 14px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .css-header input[type="number"] {
    width: 60px;
  }
  .css-header label {
    font-size: 12px;
    margin-left: 4px;
  }
  .textarea-box {
    min-height: 200px;
  }
  textarea {
    font-size: 14px;
    min-height: 120px;
  }
  textarea[readonly] {
    background: #f0f0f0;
  }
  .vw-preset-group {
    gap: 4px;
    margin-bottom: 10px;
  }
  #vw1-width,
  #vw2-width {
    width: 30%;
  }
  #css1-float {
    width: 10%;
  }
  .vw-preset-btn {
    font-size: 14px;
    padding: 4px 6px;
  }
  .vw-preset-btn:hover,
  .vw-preset-btn:active {
    background: #ab47bc;
    color: #fff;
  }
  .vw2-preset-btn:hover,
  .vw2-preset-btn:active {
    background: #d32f2f;
    color: #fff;
  }
  #vw-copy-btn,
  #px-copy-btn,
  #css2-copy-btn {
    font-size: 14px;
    padding: 8px;
  }
  #vw-copy-btn:hover,
  #px-copy-btn:hover,
  #css2-copy-btn:hover {
    background: #f57c00;
    color: #fff;
  }
  #vw-clear-btn,
  #px-clear-btn,
  #css2-clear-btn {
    font-size: 14px;
    padding: 8px;
  }
  #vw-clear-btn:hover,
  #px-clear-btn:hover,
  #css2-clear-btn:hover {
    background: #d32f2f;
    color: #fff;
  }
  #css1-clear-btn:hover {
    background: #d32f2f;
    color: #fff;
  }
  /* 폼 전체 스타일 */
  form {
    gap: 10px;
  }
  input[type="number"],
  input[type="text"],
  textarea {
    font-size: 14px;
    padding: 6px 10px;
    /* margin-bottom: 0; */
  }
  input[type="number"]:focus,
  input[type="text"]:focus,
  textarea:focus {
    border: 1.5px solid #ab47bc;
    box-shadow: 0 0 0 2px #f3e5f5;
  }
  input[readonly],
  textarea[readonly] {
    background: #f5f5f5;
    color: #888;
  }
  /* 체크박스 커스텀 디자인 */
  input[type="checkbox"] {
    width: 18px;
    height: 18px;
  }
  input[type="checkbox"]:checked {
    background: #ab47bc;
    border-color: #ab47bc;
  }
  input[type="checkbox"]:focus {
    outline: none;
    box-shadow: 0 0 0 2px #f3e5f5;
  }
  input[type="checkbox"]:checked::after {
    left: 3px;
    top: 0px;
    width: 4px;
    height: 8px;
  }

  /* 모바일 전환 버튼 */
  button.mobile-toggle-btn {
    position: fixed;
    top: 40px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(171, 71, 188, 0.3);
    z-index: 1000;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.2;
    background: #ffebee;
    color: #d32f2f;
    border: 1px solid #ffcdd2;
  }
  .mobile-toggle-btn.on {
    background: #f3e5f5;
    color: #ab47bc;
    border: 1px solid #ce93d8;
  }

  .mobile-toggle-btn:hover {
    /* background: #4a148c; */
    /* transform: scale(1.05); */
  }

  .mobile-toggle-btn:active {
    transform: scale(0.95);
  }

  /* 모바일에서 화면 전환 */
  .convert-box.hidden,
  .css-box.hidden {
    display: none;
  }

  .convert-box.visible,
  .css-box.visible {
    display: block;
  }

  /* 모바일 방문자 통계 */

  .visit-item {
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
    padding: 0 20px;
  }

  .visit-label {
    font-size: 16px;
    color: #495057;
  }

  .visit-count {
    font-size: 20px;
    color: #2196f3;
  }
}
