﻿*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

:root {
  --navy: #19324f;
  --ink: #253f5b;
  --soft-ink: #55708a;
  --blue: #4d789f;
  --blue-light: #8faec8;
  --line: rgba(129, 157, 181, 0.24);
  --panel: rgba(255, 255, 255, 0.94);
  --shadow: 0 18px 42px rgba(58, 86, 112, 0.11);
  --serif: "Shippori Mincho", "Noto Serif JP", "Yu Mincho", "Hiragino Mincho ProN", serif;
}

html {
  min-height: 100%;
  background: #f3f7fa;
}

body,
input,
button,
label,
a {
  font-family: var(--serif);
}

body {
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(250, 252, 253, 0.98) 0 68px, rgba(238, 244, 248, 0.96) 68px 100%),
    linear-gradient(135deg, rgba(222, 234, 242, 0.44), rgba(255, 255, 255, 0) 28%),
    #f4f8fb;
  font-feature-settings: "palt";
}

ul {
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  border: 0;
  cursor: pointer;
}

header {
  height: 72px;
  background: rgba(252, 254, 255, 0.94);
  box-shadow: 0 8px 28px rgba(62, 91, 118, 0.08);
}

.billing-success-toast {
  position: fixed;
  top: 18px;
  left: 50%;
  z-index: 2000;
  width: min(calc(100vw - 32px), 520px);
  min-height: 44px;
  padding: 12px 18px;
  border: 1px solid rgba(92, 146, 123, 0.26);
  border-radius: 14px;
  color: #1f5f4b;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(240, 249, 245, 0.96)),
    #fff;
  box-shadow: 0 18px 42px rgba(42, 74, 62, 0.16);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.55;
  text-align: center;
  transform: translateX(-50%);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.billing-success-toast--hide {
  opacity: 0;
  transform: translate(-50%, -8px);
}

.container {
  width: min(95vw, 1420px);
  min-width: 720px;
  margin: 0 auto;
}

header .container {
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--navy);
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0;
  text-shadow: 0 1px 7px rgba(77, 120, 159, 0.1);
}

.logo::after {
  color: rgba(143, 174, 200, 0.72);
  font-size: 26px;
  letter-spacing: 1px;
  transform: translateY(-2px);
}

.menu-right {
  display: flex;
  align-items: center;
  gap: 22px;
}

.category-menu-toggle {
  display: none;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-direction: column;
  border: 1px solid rgba(132, 158, 181, 0.42);
  border-radius: 50%;
  color: var(--navy);
  background: linear-gradient(180deg, #ffffff 0%, #edf4f8 100%);
  box-shadow: 0 10px 24px rgba(45, 76, 104, 0.12);
}

.category-menu-toggle span {
  width: 16px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.category-drawer-backdrop {
  display: none;
}

.dropdown {
  position: relative;
}

.dropdown input[type="checkbox"] {
  display: none;
}

.dropdown label {
  min-width: 120px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px 0 17px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(180deg, #5b86ad 0%, #456f97 100%);
  box-shadow: 0 10px 24px rgba(45, 76, 104, 0.18);
  font-size: 15px;
  font-weight: 600;
}

.dropdown label::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
}

.dropdown label:hover {
  background: linear-gradient(180deg, #537da2 0%, #3f668d 100%);
  transform: translateY(-1px);
}

.submenu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  z-index: 20;
  min-width: 150px;
  padding: 6px 0;
  border: 1px solid rgba(132, 158, 181, 0.3);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 18px 36px rgba(45, 70, 94, 0.16);
  transform: translateX(-50%);
}

.dropdown input[type="checkbox"]:checked ~ .submenu {
  display: block;
}

.submenu a {
  display: block;
  padding: 9px 17px;
  color: var(--navy);
  font-size: 15px;
  font-weight: 600;
}

.submenu a:hover {
  background: rgba(232, 239, 245, 0.8);
  color: #3e688f;
}

.btn.account {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(132, 158, 181, 0.42);
  border-radius: 50%;
  color: var(--navy);
  background: linear-gradient(180deg, #ffffff 0%, #edf4f8 100%);
  box-shadow: 0 10px 24px rgba(45, 76, 104, 0.12);
  font-size: 20px;
  font-weight: 600;
}

main .container {
  --sidebar-width: 190px;
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-top: 8px;
}

/*カテゴリ一覧*/
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  flex: 0 0 var(--sidebar-width);
  min-height: auto;
  height: var(--content-panel-height, auto);
  overflow-y: auto;
  padding: 10px 12px 0px 15px;
  border: 1px solid rgba(133, 160, 183, 0.3);
  border-radius: 22px;
  color: var(--navy);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0.24)),
    linear-gradient(180deg, #f9fbfc 0%, #eaf1f6 100%);
  box-shadow: var(--shadow);
}

.sidebar-resize-handle {
  position: relative;
  z-index: 2;
  flex: 0 0 16px;
  width: 16px;
  align-self: stretch;
  min-height: var(--content-panel-height, auto);
  margin: 0 -12px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: col-resize;
  touch-action: none;
}

.sidebar-resize-handle::before {
  content: "";
  position: absolute;
  top: 22px;
  bottom: 22px;
  left: 50%;
  width: 4px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(85, 126, 161, 0.28);
  box-shadow: 0 0 0 4px rgba(85, 126, 161, 0.05);
  opacity: 0;
  transition: opacity 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}

.sidebar-resize-handle:hover::before,
.sidebar-resize-handle:focus-visible::before,
body.sidebar-resizing .sidebar-resize-handle::before {
  opacity: 1;
  background: rgba(80, 124, 162, 0.55);
  box-shadow: 0 0 0 5px rgba(85, 126, 161, 0.1);
}

.sidebar-resize-handle:focus-visible {
  outline: 2px solid rgba(76, 119, 156, 0.55);
  outline-offset: 5px;
}

body.sidebar-resizing {
  cursor: col-resize;
  user-select: none;
}

.sidebar-header {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0px 10px 7px;
  border-bottom: 1px solid var(--line);
}

.sidebar-header h2 {
  color: var(--navy);
  font-size: 25px;
  font-weight: 600;
  line-height: 1;
}

.sidebar-header h2::after {
  color: rgba(143, 174, 200, 0.72);
  font-size: 15px;
}

#add-category-btn {
  margin-right: 8px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  color: #fff;
  background: linear-gradient(180deg, #5c86aa, #456e94);
  box-shadow: 0 8px 18px rgba(45, 76, 104, 0.16);
  font-size: 25px;
  font-weight: 600;
  line-height: 1;
}

#add-category-btn:hover {
  transform: translateY(-1px);
}

#category-list > ul {
  padding-top: 0px;
}

.sidebar-category-group {
  padding: 10px 4px 10px 0px;
  border-bottom: 1px solid rgba(100, 154, 210, 0.22);
}

.parent-category {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--navy);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.35;
  cursor: pointer;
}

.parent-category::before {
  flex: 0 0 auto;
  content: "◆";
  margin-right: 8px;
  color: #6d91b1;
  font-size: 13px;
}

.sidebar-child-list {
  padding-top: 0px;
}

.child-category {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0 0 18px;
  color: #344f6a;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  cursor: pointer;
}

.child-category::before {
  flex: 0 0 auto;
  content: "・";
  margin-right: 5px;
}

.category-label-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-count-badge {
  flex: 0 0 auto;
  min-width: 0;
  padding-left: 4px;
  color: #6f8ba6;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.child-category .category-count-badge {
  padding-left: 3px;
  font-size: 11px;
}

.parent-category:hover,
.child-category:hover,
.category-name:hover {
  color: #426f96;
}

.content {
  flex: 1;
  min-width: 0;
  padding: 38px 44px 30px;
  border: 1px solid rgba(133, 160, 183, 0.28);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 252, 253, 0.94)),
    var(--panel);
  box-shadow: var(--shadow);
}

.content h1 {
  position: relative;
  display: inline-block;
  margin: 0 0 42px 6px;
  color: var(--navy);
  font-size: 31px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0;
  text-shadow: 0 1px 7px rgba(77, 120, 159, 0.1);
}

.content h1::before {
  content: "✦";
  position: absolute;
  top: -14px;
  right: -30px;
  color: rgba(143, 174, 200, 0.72);
  font-size: 19px;
  text-shadow: 12px -9px 0 rgba(143, 174, 200, 0.34);
}

.content h1::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -14px;
  width: 160px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, #789bb8 0%, #b6c9d8 68%, transparent 100%);
  box-shadow: 0 2px 8px rgba(80, 118, 150, 0.14);
}

.works-section {
  margin-bottom: 36px;
}

.works-section:last-child {
  margin-bottom: 0;
}

.works-section-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 10px;
}

.more-works-link {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid rgba(132, 158, 181, 0.44);
  border-radius: 999px;
  color: #244766;
  background: linear-gradient(180deg, #ffffff 0%, #eef5f9 100%);
  box-shadow: 0 10px 22px rgba(45, 76, 104, 0.12);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: box-shadow 0.22s ease, transform 0.22s ease, color 0.22s ease;
}

.more-works-link::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-left: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
}

.more-works-link:hover {
  color: #315f87;
  box-shadow: 0 14px 28px rgba(45, 76, 104, 0.16);
  transform: translateY(-1px);
}

.content p {
  padding: 0 0 20px;
  color: var(--navy);
  font-size: 20px;
  font-weight: 600;
  line-height: 1;
}

.content p::before {
  display: inline-block;
  width: 1.75em;
  color: #7194b1;
  font-size: 23px;
  text-align: center;
  transform: translateY(1px);
}

#main-shosetu,
#main-irasuto,
#main-manga {
  min-height: 170px;
  display: flex;
  flex-wrap: nowrap;
  gap: 25px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 0 8px;
  scroll-behavior: smooth;
}

#main-shosetu::-webkit-scrollbar,
#main-irasuto::-webkit-scrollbar,
#main-manga::-webkit-scrollbar {
  height: 8px;
}

#main-shosetu::-webkit-scrollbar-track,
#main-irasuto::-webkit-scrollbar-track,
#main-manga::-webkit-scrollbar-track {
  background: transparent;
}

#main-shosetu::-webkit-scrollbar-thumb,
#main-irasuto::-webkit-scrollbar-thumb,
#main-manga::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(143, 174, 200, 0.5);
}

.sakuhin {
  position: relative;
  width: 165px;
  height: 230px;
  aspect-ratio: 33 / 46;
  contain: layout paint;
  flex: 0 0 auto;
  display: flex;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 8px;
  background-color: #e7eff5;
  background-size: cover;
  background-position: center;
  box-shadow: 0 14px 26px rgba(45, 70, 94, 0.13);
  cursor: pointer;
  transition: box-shadow 0.22s ease, transform 0.22s ease, filter 0.22s ease;
}

.sakuhin:hover {
  box-shadow: 0 18px 34px rgba(45, 70, 94, 0.17);
  transform: translateY(-1px);
}

.sakuhin-text {
  position: relative;
  z-index: 2;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.sakuhin-image {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: 33 / 46;
  object-fit: cover;
  opacity: 0;
  transition: opacity 160ms ease;
}

.sakuhin.has-image::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(105deg, transparent 0 34%, rgba(255, 255, 255, 0.36) 44%, transparent 54%),
    linear-gradient(180deg, #d8e6ef 0%, #8faec8 100%);
  background-size: 220% 100%, 100% 100%;
  animation: card-image-placeholder 1.15s ease-in-out infinite;
}

.sakuhin.image-loaded .sakuhin-image {
  opacity: 1;
}

.sakuhin.image-loaded::after,
.sakuhin.image-error::after {
  opacity: 0;
  animation: none;
}

@keyframes card-image-placeholder {
  0% {
    background-position: 120% 0, 0 0;
  }

  100% {
    background-position: -120% 0, 0 0;
  }
}

#main-shosetu .sakuhin {
  align-items: center;
  justify-content: center;
  padding: 14px 12px 12px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 75%, rgba(255, 255, 255, 0.68) 0 2px, transparent 3px),
    linear-gradient(90deg, rgba(92, 118, 143, 0.12), transparent 10%, transparent 90%, rgba(255, 255, 255, 0.5)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), transparent 34%),
    linear-gradient(180deg, #f9fbfc 0%, #e4edf4 54%, #ffffff 100%);
  color: #213a55;
}

#main-shosetu .sakuhin:nth-child(4n + 2) {
  background:
    radial-gradient(circle at 50% 75%, rgba(255, 255, 255, 0.68) 0 2px, transparent 3px),
    linear-gradient(90deg, rgba(92, 118, 143, 0.1), transparent 10%, transparent 90%, rgba(255, 255, 255, 0.48)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.68), transparent 36%),
    linear-gradient(180deg, #fbfcfd 0%, #e8f2f5 54%, #ffffff 100%);
}

#main-shosetu .sakuhin:nth-child(4n + 3) {
  background:
    radial-gradient(circle at 50% 75%, rgba(255, 255, 255, 0.72) 0 2px, transparent 3px),
    linear-gradient(90deg, rgba(124, 146, 166, 0.1), transparent 10%, transparent 90%, rgba(255, 255, 255, 0.48)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.68), transparent 36%),
    linear-gradient(180deg, #fffdf8 0%, #edf1f4 58%, #ffffff 100%);
}

#main-shosetu .sakuhin::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(121, 149, 174, 0.28);
  border-radius: 7px;
  background:
    linear-gradient(135deg, rgba(121, 149, 174, 0.22) 0 1px, transparent 1px 10px) left top / 18px 18px no-repeat,
    linear-gradient(225deg, rgba(121, 149, 174, 0.22) 0 1px, transparent 1px 10px) right top / 18px 18px no-repeat,
    linear-gradient(45deg, rgba(121, 149, 174, 0.18) 0 1px, transparent 1px 10px) left bottom / 18px 18px no-repeat,
    linear-gradient(315deg, rgba(121, 149, 174, 0.18) 0 1px, transparent 1px 10px) right bottom / 18px 18px no-repeat;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.62),
    inset 0 0 18px rgba(95, 143, 189, 0.06);
}

#main-shosetu .sakuhin-title {
  color: #213a55;
  height: 120px;
  margin-bottom: 4px;
  padding: 0 8px;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  font-size: 15px;
  font-weight: 600; 
  line-height: 1.38;
  word-break: normal;
  overflow-wrap: break-word;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.72);
}

#main-shosetu .sakuhin-title.title-fits {
  display: flex;
  align-items: center;
  justify-content: center;
}

#main-shosetu .sakuhin-caption {
  width: 87%;
  height: 80px;
  margin: 0 auto;
  padding-top: 8px;
  display: block;
  overflow: hidden;
  border-top: 1px solid rgba(121, 149, 174, 0.25);
  color: rgba(33, 58, 85, 0.78);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

#main-irasuto .sakuhin,
#main-manga .sakuhin,
.sakuhin.manga {
  height: 230px;
  align-items: flex-end;
  justify-content: flex-start;
}

#main-irasuto .sakuhin::before,
#main-manga .sakuhin::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(20, 40, 58, 0) 56%, rgba(13, 29, 43, 0.08) 61%, rgba(13, 29, 43, 0.22) 66%, rgba(13, 29, 43, 0.46) 71%, rgba(13, 29, 43, 0.788) 78%, rgba(7, 15, 22, 0.9) 89%, rgb(0, 0, 0) 100%),
    linear-gradient(0deg, rgba(20, 40, 58, 0.16), rgba(20, 40, 58, 0));
}

#main-irasuto .sakuhin-text,
#main-manga .sakuhin-text {
  justify-content: flex-end;
  min-height: 74px;
  padding: 24px 12px 11px;
}

#main-irasuto .sakuhin-title,
#main-manga .sakuhin-title,
.sakuhin-title {
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
  text-shadow: 0 2px 8px rgba(4, 18, 32, 0.72);
}

#main-irasuto .sakuhin-caption,
#main-manga .sakuhin-caption,
.sakuhin-caption {
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.94);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
  text-shadow: 0 1px 6px rgba(7, 22, 38, 0.72);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background-color: rgba(31, 55, 76, 0.22);
  backdrop-filter: blur(2px);
}

.hidden {
  display: none !important;
}

.modal-content {
  width: min(680px, 92vw);
  max-height: min(760px, calc(100dvh - 56px));
  padding: 32px;
  overflow-y: auto;
  border: 1px solid rgba(132, 158, 181, 0.4);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(243, 248, 251, 0.98));
  box-shadow: 0 24px 52px rgba(38, 61, 82, 0.2);
}

.modal h3 {
  margin-bottom: 18px;
  color: var(--navy);
  font-size: 24px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal label {
  color: var(--soft-ink);
  font-size: 15px;
  font-weight: 600;
}

.modal input,
.edit-category-input,
.parent-category-input,
.child-category-input {
  width: 100%;
  min-height: 44px;
  padding: 12px 14px;
  border: 1px solid rgba(132, 158, 181, 0.48);
  border-radius: 10px;
  color: var(--ink);
  background: #fbfdff;
  font-size: 16px;
}

.modal input:focus,
.edit-category-input:focus,
.parent-category-input:focus,
.child-category-input:focus {
  outline: none;
  border-color: #8faec8;
  box-shadow: 0 0 0 3px rgba(143, 174, 200, 0.18);
}

.existing-categories {
  max-height: min(420px, 48dvh);
  overflow-y: auto;
  margin-top: 20px;
  padding: 10px 16px 16px;
  border: 1px solid rgba(132, 158, 181, 0.3);
  border-radius: 12px;
  background: rgba(251, 253, 255, 0.86);
}

.existing-categories.empty {
  display: none;
}

.modal-category {
  padding: 7px 0;
  border-bottom: 1px solid rgba(100, 154, 210, 0.18);
  transition: transform 180ms ease, opacity 140ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.modal-category:first-child {
  padding-top: 0;
}

.category-header,
.child-category-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  transition: transform 180ms ease, opacity 140ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.drag-handle {
  flex: 0 0 auto;
  width: 26px;
  min-width: 26px !important;
  height: 28px;
  min-height: 28px !important;
  padding: 0 !important;
  border-radius: 8px !important;
  background: transparent !important;
  box-shadow: none !important;
  cursor: grab;
  touch-action: none;
  position: relative;
}

.drag-handle::before {
  content: "";
  position: absolute;
  inset: 7px 8px;
  background:
    radial-gradient(circle, #7697b5 1.5px, transparent 1.7px) 0 0 / 7px 7px;
  opacity: 0.78;
}

.drag-handle:hover,
.drag-handle:focus-visible {
  background: rgba(143, 174, 200, 0.16) !important;
  outline: none;
}

.drag-handle:hover::before,
.drag-handle:focus-visible::before {
  opacity: 1;
}

.drag-handle:active {
  cursor: grabbing;
}

.child-drag-handle {
  margin-left: -4px;
}

.category-name,
.child-name {
  flex: 1;
  color: var(--navy);
  font-weight: 600;
}

.child-category-list {
  padding: 8px 0 0 18px;
}

.modal-category.is-dragging,
.child-category-list > li.is-dragging {
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 34px rgba(45, 76, 104, 0.2);
  opacity: 0.96;
  pointer-events: none;
}

.drag-placeholder {
  display: block;
  margin: 4px 0;
  border: 1px dashed rgba(91, 134, 173, 0.48);
  border-radius: 12px;
  background: rgba(143, 174, 200, 0.12);
  list-style: none;
  transition: height 160ms ease, margin 160ms ease;
}

.category-drag-active {
  user-select: none;
}

.child-category-form {
  display: flex;
  gap: 8px;
  padding-top: 10px;
}

.child-category-form .child-category-input {
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 13px;
}

.child-category-form .submit-child {
  min-height: 30px;
  min-width: 56px;
  padding: 0 12px;
  font-size: 15px;
}

.modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.modal button,
.add-subcategory-btn,
.submit-child {
  min-height: 36px;
  min-width: 64px;
  padding: 0 16px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(180deg, #5b86ad 0%, #456f97 100%);
  box-shadow: 0 8px 18px rgba(45, 76, 104, 0.16);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.submit-child {
  min-width: 52px;
  min-height: 34px;
  padding: 0 14px;
  font-size: 14px;
}

.edit-category-btn,
.edit-child-btn,
.delete-category-btn,
.delete-child-btn {
  min-height: auto;
  padding: 4px 6px;
  border-radius: 7px;
  color: #5f7f9e !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 12px;
}

.edit-category-btn:hover,
.edit-child-btn:hover,
.delete-category-btn:hover,
.delete-child-btn:hover {
  background: rgba(168, 191, 210, 0.2) !important;
  color: #3e668a !important;
}

html::-webkit-scrollbar,
.sidebar::-webkit-scrollbar,
.existing-categories::-webkit-scrollbar {
  width: 8px;
}

.sidebar::-webkit-scrollbar-button:vertical:start:decrement {
  display: block;
  height: 40px;
  background: transparent;
}

.sidebar::-webkit-scrollbar-button:vertical:end:increment {
  display: block;
  height: 30px;
  background: transparent;
}

html::-webkit-scrollbar-track,
.sidebar::-webkit-scrollbar-track,
.existing-categories::-webkit-scrollbar-track {
  background: rgba(238, 244, 248, 0.72);
}

html::-webkit-scrollbar-thumb,
.sidebar::-webkit-scrollbar-thumb,
.existing-categories::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(143, 174, 200, 0.48);
}

@media (max-width: 1024px) {
  .container {
    width: min(94vw, 1420px);
    min-width: 0;
  }

  main .container {
    gap: 16px;
  }

  .sidebar {
    width: 170px;
    min-width: 170px;
    flex-basis: 170px;
    padding: 10px 10px 0 12px;
    border-radius: 18px;
  }

  .sidebar-header h2 {
    font-size: 22px;
  }

  .parent-category {
    font-size: 16px;
  }

  .child-category {
    margin-left: 14px;
    font-size: 14px;
  }

  .content {
    padding: 32px 30px 28px;
  }

  .content h1 {
    margin-bottom: 36px;
    font-size: 28px;
  }

  #main-shosetu,
  #main-irasuto,
  #main-manga {
    gap: 18px;
  }

  .sakuhin {
    width: 150px;
    height: 210px;
  }

  #main-irasuto .sakuhin,
  #main-manga .sakuhin,
  .sakuhin.manga {
    height: 210px;
  }
}

@media (max-width: 760px) {
  body {
    background:
      linear-gradient(180deg, rgba(250, 252, 253, 0.98) 0 62px, rgba(238, 244, 248, 0.96) 62px 100%),
      #f4f8fb;
  }

  .container {
    width: min(94vw, 1420px);
    min-width: 0;
  }

  header {
    height: auto;
  }

  header .container {
    min-height: 62px;
    height: auto;
    padding: 10px 0;
  }

  .logo {
    font-size: 28px;
  }

  .menu-right {
    gap: 12px;
  }

  .dropdown label {
    min-width: auto;
    height: 38px;
    padding: 0 14px;
    font-size: 14px;
  }

  .submenu {
    left: auto;
    right: 0;
    transform: none;
  }

  main .container {
    flex-direction: row;
    align-items: flex-start;
    gap: 10px;
    margin-top: 10px;
  }

  .sidebar {
    width: 118px;
    min-width: 118px;
    flex-basis: 118px;
    max-height: calc(100vh - 86px);
    height: var(--content-panel-height, auto);
    padding: 8px 7px 0 8px;
    border-radius: 14px;
  }

  .sidebar-header {
    min-height: 36px;
    padding: 0 0 7px;
  }

  .sidebar-header h2 {
    font-size: 16px;
  }

  #add-category-btn {
    width: 34px;
    height: 34px;
    margin-right: 0;
    border-radius: 8px;
    font-size: 24px;
  }

  .sidebar-category-group {
    padding: 8px 0;
  }

  .parent-category {
    font-size: 13px;
  }

  .parent-category::before {
    margin-right: 4px;
    font-size: 10px;
  }

  .child-category {
    margin: 6px 0 0 8px;
    font-size: 12px;
  }

  .content {
    width: auto;
    padding: 22px 14px 22px;
    border-radius: 14px;
  }

  .content h1 {
    margin: 0 0 30px 0;
    font-size: 22px;
  }

  .content h1::before {
    display: none;
  }

  .content h1::after {
    width: 118px;
  }

  .content p {
    font-size: 16px;
  }

  #main-shosetu,
  #main-irasuto,
  #main-manga {
    min-height: 160px;
    gap: 12px;
  }

  .sakuhin {
    width: 112px;
    height: 156px;
  }

  #main-irasuto .sakuhin,
  #main-manga .sakuhin,
  .sakuhin.manga {
    height: 156px;
  }

  #main-shosetu .sakuhin {
    padding: 12px 9px 10px;
  }

  #main-shosetu .sakuhin-title {
    height: 80px;
    padding: 0 5px;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    font-size: 11px;
    line-height: 1.34;
    word-break: normal;
    overflow-wrap: break-word;
  }

  #main-shosetu .sakuhin-title.title-fits {
    display: -webkit-box;
    align-items: initial;
    justify-content: initial;
  }

  #main-shosetu .sakuhin-caption {
    height: 52px;
    padding-top: 6px;
    font-size: 10px;
    line-height: 1.4;
  }

  #main-irasuto .sakuhin-text,
  #main-manga .sakuhin-text {
    min-height: 66px;
    padding: 20px 10px 10px;
  }

  #main-irasuto .sakuhin-title,
  #main-manga .sakuhin-title,
  .sakuhin-title {
    font-size: 12px;
  }

  .modal {
    align-items: center;
    padding: 0;
  }

  .modal-content {
    width: 85vw;
    max-height: 85dvh;
    padding: 24px 20px;
    overflow-y: auto;
  }

  .modal h3 {
    font-size: 21px;
  }

  .existing-categories {
    max-height: 46dvh;
    padding: 10px 12px 14px;
  }
}

@media (max-width: 1024px) {
  body.category-drawer-open {
    overflow: hidden;
  }

  header .container {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 10px;
  }

  .category-menu-toggle {
    display: inline-flex;
    justify-self: start;
  }

  .logo {
    justify-self: start;
  }

  main .container {
    display: block;
    margin-top: 10px;
  }

  .content {
    width: 100%;
  }

  .sidebar {
    position: fixed;
    top: 76px;
    bottom: 16px;
    left: max(10px, env(safe-area-inset-left));
    z-index: 80;
    width: min(76vw, 270px);
    min-width: 0;
    flex-basis: auto;
    height: auto;
    max-height: none;
    padding: 12px 12px 14px;
    border-radius: 18px;
    transform: translateX(calc(-100% - 24px));
    transition: transform 0.22s ease;
  }

  .sidebar-resize-handle {
    display: none;
  }

  body.category-drawer-open .sidebar {
    transform: translateX(0);
  }

  .category-drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: block;
    background: rgba(17, 32, 48, 0.28);
    backdrop-filter: blur(2px);
  }

  .category-drawer-backdrop[hidden] {
    display: none;
  }

  .sidebar-header h2 {
    font-size: 20px;
  }

  .parent-category {
    font-size: 15px;
  }

  .child-category {
    margin-left: 14px;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .dropdown label,
  .btn.account {
    min-height: 40px;
  }

  .modal {
    align-items: center;
    padding: 0;
    overflow-y: hidden;
  }

  .modal-content {
    width: 85vw;
    max-height: 85dvh;
  }

  .modal button,
  .add-subcategory-btn,
  .edit-category-btn,
  .edit-child-btn,
  .delete-category-btn,
  .delete-child-btn {
    min-height: 44px;
  }
}
