/* ========================================
   Character List - Responsive Styles
   PC: Table layout | Mobile: Card layout
   ======================================== */

/* ---- Base & Container ---- */
#siteContainer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  color: #333;
  line-height: 1.6;
  background: #f8f9fa;
  min-height: 100vh;
}

.split { display: none; }

h1[itemprop="name"] {
  font-size: 26px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 20px 0;
  padding-bottom: 12px;
  border-bottom: 2px solid #e9ecef;
}

/* ---- Control Bar ---- */
.controlBar {
  background: #fff;
  padding: 14px 18px;
  border-radius: 10px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
}

.sortFilter {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sortFilter h5 {
  margin: 0;
  font-size: 14px;
  color: #6c757d;
  font-weight: 600;
}

.sortFilter select {
  padding: 8px 32px 8px 12px;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  background: #fff;
  font-size: 14px;
  color: #495057;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
}

/* ---- Table Base (PC) ---- */
.pure-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  font-size: 14px;
}

.pure-table thead {
  background: #f1f3f5;
}

.pure-table thead th {
  padding: 14px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  color: #495057;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 2px solid #e9ecef;
  white-space: nowrap;
}

.pure-table thead th.tableRank { text-align: center; width: 70px; }
.pure-table thead th:nth-child(2) { width: 90px; }
.pure-table thead th:nth-child(5) { width: 90px; text-align: center; }

.pure-table tbody tr {
  transition: background-color 0.15s ease;
}

.pure-table tbody tr:hover {
  background-color: #f8f9fa;
}

.pure-table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid #f1f3f5;
  vertical-align: middle;
}

/* ---- Rank ---- */
.tableRank {
  font-size: 16px;
  font-weight: 800;
  color: #e03131;
  text-align: center;
  width: 70px;
}

/* ---- Avatar ---- */
.tableAvatar {
  width: 90px;
  text-align: center;
}

.tableAvatar img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #e9ecef;
  display: block;
  margin: 0 auto 6px;
  background: #f8f9fa;
}

/* ---- Heart Icons (Stats) ---- */
.tableAvatar .heartOn,
.tableAvatar .heartOff {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  color: #868e96;
  font-weight: 500;
}

.tableAvatar .heartOn::before,
.tableAvatar .heartOff::before {
  font-family: Arial, sans-serif;
  font-size: 11px;
  line-height: 1;
}

.tableAvatar .heartOn::before {
  content: "\2764";
  color: #e03131;
}

.tableAvatar .heartOff::before {
  content: "\2764";
  color: #adb5bd;
}

/* ---- Character Name ---- */
.tableCharInfo .name {
  font-size: 15px;
  font-weight: 700;
  color: #212529;
  text-decoration: none;
  transition: color 0.2s;
}

.tableCharInfo .name:hover {
  color: #339af0;
}

/* ---- Novels List ---- */
.tableAnime h4 {
  font-size: 11px;
  color: #adb5bd;
  margin: 0 0 6px 0;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tableAnime ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.tableAnime li {
  margin-bottom: 3px;
  border-bottom: 1px solid #f1f3f5;
  padding-bottom: 3px;
}

.tableAnime li:last-child {
  margin-bottom: 0;
  border-bottom: none;
  padding-bottom: 0;
}

.tableAnime li a {
  font-size: 13px;
  color: #495057;
  text-decoration: none;
  line-height: 1.5;
  display: block;
  transition: color 0.2s;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tableAnime li a:hover {
  color: #339af0;
}

/* ---- Love Buttons ---- */
.tableCharLove {
  text-align: center;
  width: 90px;
}

.tableCharLove .heartSwitch {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.tableCharLove .heartOn,
.tableCharLove .heartOff {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #f8f9fa;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

.tableCharLove .heartOn:hover,
.tableCharLove .heartOff:hover {
  background: #e9ecef;
  transform: scale(1.12);
}

.tableCharLove .heartOn::before,
.tableCharLove .heartOff::before {
  font-family: Arial, sans-serif;
  font-size: 16px;
  line-height: 1;
}

.tableCharLove .heartOn::before {
  content: "\2764";
  color: #e03131;
}

.tableCharLove .heartOff::before {
  content: "\2764";
  color: #adb5bd;
}

/* ========================================
   MOBILE RESPONSIVE <= 768px
   ======================================== */
@media screen and (max-width: 768px) {
  #siteContainer {
    padding: 16px 12px;
  }
  
  h1[itemprop="name"] {
    font-size: 20px;
    margin-bottom: 16px;
    padding-bottom: 10px;
  }
  
  .controlBar {
    padding: 12px 14px;
    margin-bottom: 16px;
  }
  
  /* 表格转卡片 */
  .pure-table,
  .pure-table thead,
  .pure-table tbody,
  .pure-table tr,
  .pure-table td {
    display: block;
    width: 100%;
  }
  
  .pure-table thead {
    display: none;
  }
  
  .pure-table tbody tr {
    background: #fff;
    margin-bottom: 12px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    padding: 14px;
    border-bottom: none;
    position: relative;
  }
  
  .pure-table tbody td {
    border: none;
    padding: 0;
  }
  
  /* 卡片内 Grid 布局 */
  .pure-table tbody tr {
    display: grid;
    grid-template-columns: 48px 1fr auto;
    grid-template-areas:
      "rank name love"
      "avatar novels novels"
      "stats  novels novels";
    gap: 6px 12px;
    align-items: start;
  }
  
  .tableRank {
    grid-area: rank;
    width: auto;
    text-align: left;
    font-size: 18px;
    font-weight: 800;
    color: #e03131;
    line-height: 1;
    align-self: center;
  }
  
  .tableAvatar {
    grid-area: avatar;
    width: auto;
    text-align: left;
  }
  
  .tableAvatar img {
    width: 44px;
    height: 44px;
    margin: 0;
  }
  
  .tableAvatar .heartOn,
  .tableAvatar .heartOff {
    font-size: 11px;
    margin-top: 2px;
  }
  
  .tableCharInfo {
    grid-area: name;
    align-self: center;
    min-width: 0;
  }
  
  .tableCharInfo .name {
    font-size: 15px;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .tableAnime {
    grid-area: novels;
    min-width: 0;
  }
  
  .tableAnime h4 {
    display: block;
    margin: 0 0 6px 0;
  }
  
  .tableAnime ul {
    display: block;
  }
  
  .tableAnime li {
    display: block;
    border-bottom: 1px solid #f1f3f5;
    padding-bottom: 4px;
    margin-bottom: 4px;
  }
  
  .tableAnime li:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
  }
  
  .tableAnime li::after {
    content: none;
  }
  
  .tableAnime li a {
    display: block;
    font-size: 12px;
    color: #868e96;
    -webkit-line-clamp: unset;
  }
  
  .tableCharLove {
    grid-area: love;
    width: auto;
    align-self: center;
    justify-self: end;
  }
  
  .tableCharLove .heartOn,
  .tableCharLove .heartOff {
    width: 30px;
    height: 30px;
  }
  
  .tableCharLove .heartOn::before,
  .tableCharLove .heartOff::before {
    font-size: 14px;
  }
}

/* ========================================
   SMALL MOBILE <= 480px
   ======================================== */
@media screen and (max-width: 480px) {
  .pure-table tbody tr {
    grid-template-columns: 40px 1fr auto;
    gap: 8px 10px;
    padding: 12px;
  }
  
  .tableAvatar img {
    width: 40px;
    height: 40px;
  }
  
  .tableRank {
    font-size: 16px;
  }
  
  .tableCharInfo .name {
    font-size: 14px;
  }
  
  .tableAnime li a {
    font-size: 11px;
  }
}