body {
  font-family: "Segoe UI", "Hiragino Sans", sans-serif;
  margin: 0;
  padding: 0;
  background: #f4f7fb;
  color: #333;
}

h1 {
  background: #2c6ed5;
  color: white;
  padding: 20px;
  margin: 0 0 20px 0;
  font-size: 24px;
  letter-spacing: 1px;
  opacity: 0;
  transform: translateY(-30px);
}

h1.visible {
  animation: slideInDown 0.6s ease forwards;
}

@keyframes slideInDown {
  0% {
    opacity: 0;
    transform: translateY(-30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

h2 {
  color: #2c6ed5;
  border-left: 5px solid #2c6ed5;
  padding-left: 10px;
  margin-top: 30px;
}

section {
  background: white;
  padding: 20px;
  margin: 20px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  opacity: 0;
  transform: translateY(30px);
}

section.visible {
  animation: slideInUp 0.6s ease forwards;
}

@keyframes slideInUp {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.form {
  padding: 0 20px 0 0;
}

.form input,
.form select,
.form textarea {
  width: 100%;
  padding: 10px;
  margin: 6px 0;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  transition: 0.2s;
}

.form input:focus,
.form select:focus,
.form textarea:focus {
  border: 2px solid #2c6ed5;
  box-shadow: 0 0 8px rgba(44, 110, 213, 0.55);
  outline: none;
}

.form label {
  margin-top: 10px;
  font-weight: bold;
  color: #2c6ed5;
  display: block;
}

button {
  padding: 10px 16px;
  background: #2c6ed5;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 10px;
  font-size: 14px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th {
  background: #e8effa;
  padding: 10px;
  border-bottom: 2px solid #d0d8e8;
  border-right: 1px solid #d0d8e8;
  text-align: left;
  position: sticky;
  top: 0;
  z-index: 1;
}

td {
  padding: 10px;
  border-bottom: 1px solid #e6e6e6;
  border-right: 1px solid #e0e0e0;
}

td:nth-child(1),
td:nth-child(2),
td:nth-child(3) {
  background: #f9fbff;
}

tr:hover td {
  background: #f0f6ff;
}

.log-box {
  height: 200px;
  overflow-y: auto;
  padding: 5px;
  background: #f4f7fb;
  border-radius: 6px;
}

.log-card {
  background: white;
  border: 1px solid #d0d8e8;
  border-left: 5px solid #2c6ed5;
  padding: 10px;
  margin-bottom: 10px;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.log-card.return {
  border-left-color: #d9534f;
}

.log-time {
  font-size: 12px;
  color: #666;
  margin-bottom: 4px;
}

.log-text {
  font-size: 14px;
  color: #333;
}

/* 🖥️ PC用：備品一覧スクロール対応 */
@media (min-width: 769px) {
  .table-scroll-wrapper {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #ccc;
    border-radius: 6px;
    margin-top: 15px;
  }
}

/* 📱 スマホ対応（768px以下） */
@media (max-width: 768px) {
  body {
    font-size: 16px;
    padding: 10px;
  }

  h1 {
    font-size: 20px;
    padding: 15px;
  }

  h2 {
    font-size: 18px;
  }

  section {
    margin: 10px 0;
    padding: 15px;
  }

  .form {
    padding: 0 20px 0 0;
  }

  .form input,
  .form select,
  .form textarea {
    font-size: 16px;
  }

  .filters {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .table-scroll-wrapper {
    max-height: 420px;
    overflow-y: auto;
    padding-right: 4px;
    margin-top: 10px;
  }

  table,
  thead,
  tbody,
  th,
  td,
  tr {
    display: block;
  }

  thead {
    display: none;
  }

  tr {
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  }

  td {
    padding: 6px 0;
    border: none;
  }

  td::before {
    content: attr(data-label) ": ";
    font-weight: bold;
    color: #2c6ed5;
    display: inline-block;
    width: 100px;
  }

  td[data-label="操作"] {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
  }

  td[data-label="操作"] button {
    flex: 1 1 auto;
    min-width: 100px;
  }

  .table-scroll-wrapper::-webkit-scrollbar {
    width: 6px;
  }

  .table-scroll-wrapper::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 3px;
  }
}
