
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: Arial, sans-serif;
  background: #121212;
  padding-bottom: 500px;
  color: #e0e0e0;
}
.container {
  max-width: 1200px;
    margin: 0 auto;
    background: #1f1f1f; 
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    border-radius: 8px;
}

/* 搜索框 */
.search-box { position: relative; margin-bottom: 20px; }
.search-input {
  width: 100%;
  padding: 12px 16px;
  font-size: 16px;
  color: #e0e0e0;
  background: #1f1f1f;
  border: 1px solid #333;
  border-radius: 4px;
  transition: border-color .3s, background .3s;
}
.search-input:focus {
  outline: none;
  background: #282828;
  border-color: #0a84ff;
}
.dropdown {
  position: absolute;
  top: 100%; left: 0; right: 0;
  background: #1f1f1f;
  border: 1px solid #333;
  border-top: none;
  max-height: 300px;
  overflow-y: auto;
  display: none;
  z-index: 10;
}
.dropdown.visible { display: block; }
.dropdown-item {
  display: flex; align-items: center;
  padding: 8px 12px;
  cursor: pointer;
  transition: background .2s;
}
.dropdown-item:hover {
  background: #2a2a2a;
}
.dropdown-item img {
  width: 40px; height: 40px;
  object-fit: cover;
  border-radius: 4px;
  margin-right: 10px;
  background: #2a2a2a;
}
.dropdown-item .info { font-size: 14px; color: #e0e0e0; }
.dropdown-item .info .name { font-weight: bold; margin-bottom: 4px; }
.dropdown-item .info .price { color: #ff6b6b; }

.filters {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 30px;
}

.filter-category {
  position: relative;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 6px;
  overflow: visible;
}

.category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
  background: #1f1f1f;
  color: #e0e0e0;
  cursor: pointer;
  transition: background .2s;
  user-select: none;
  border-radius: 6px;
}

.category-header:hover {
  background: #2a2a2a;
}

.category-header.active {
  background: #0a84ff;
  color: #fff;
}

.toggle-icon {
  font-size: 12px;
  transition: transform .2s;
}

.subcategory-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  display: none;
  background: #181818;
  border: 1px solid #333;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.8);
  z-index: 100;
  margin-top: 4px;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.subcategory-list.expanded {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.filter-category.expanded .toggle-icon {
  transform: rotate(180deg);
}

.toggle-icon {
  transition: transform 0.2s ease;
}

.filter-btn {
  padding: 8px 15px;
  background: transparent;
  border: none;
  border-bottom: 1px solid #333;
  text-align: left;
  color: #e0e0e0;
  cursor: pointer;
  transition: background .2s;
  font-size: 13px;
}

.filter-btn:last-child {
  border-bottom: none;
}

.filter-btn:hover {
  background: #2a2a2a;
}

.filter-btn.active {
  background: #0a84ff;
  color: #fff;
}

.filter-btn.all-category {
  background: #2a2a2a;
  border-bottom: 2px solid #444;
  font-weight: bold;
  color: #ffcc66;
}

.filter-btn.all-category:hover {
  background: #3a3a3a;
}

.filter-btn.all-category.active {
  background: #0a84ff;
  color: #fff;
}

.results { display: none; grid-template-columns: repeat(5, 1fr); gap: 20px; }
.results.visible { display: grid; }

.item-card {
  position: relative;
  background: #1f1f1f;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.7);
  transition: transform .2s;
  cursor: pointer;
}
.item-card:hover { transform: translateY(-4px); }
.item-card .fav-btn {
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 18px;
  color: #ffc107;
  cursor: pointer;
  user-select: none;
  z-index: 1;
}
.item-card::after {
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 50%;
  height: 80px;
  pointer-events: none;
}
.item-card.level-3::after {
  background: linear-gradient(to left, rgba(26, 53, 79, 1) 0%, rgba(26, 53, 79, 0) 100%);
}
.item-card.level-4::after {
  background: linear-gradient(to left, rgba(50, 41, 64, 1) 0%, rgba(50, 41, 64, 0) 100%);
}
.item-card.level-5::after {
  background: linear-gradient(to left, rgba(76, 48, 15, 1) 0%, rgba(76, 48, 15, 0) 100%);
}
.item-card.level-6::after,
.item-card.level-7::after {
  background: linear-gradient(to left, rgba(89, 33, 27, 1) 0%, rgba(89, 33, 27, 0) 100%);
}
.item-card img {
  width: 100%;
  height: 80px;
  object-fit: contain;
  background: #2a2a2a;
}
.item-card .body {
  padding: 12px;
}
.item-card .body .title {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 6px;
  color: #e0e0e0;
}
.item-card .body .price {
  color: #ff6b6b;
  font-size: 14px;
}

.rank-container { padding: 20px 0; }
.rank-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}
.rank-tab {
  flex: 1;
  padding: 8px 0;
  background: #1f1f1f;
  border: 1px solid #333;
  border-radius: 4px;
  color: #e0e0e0;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.rank-tab.active {
  background: #0a84ff;
  border-color: #0a84ff;
  color: #fff;
}
.rank-tab:hover:not(.active) {
  background: #2a2a2a;
}
#rankings {
  display: flex;
  gap: 24px;
}
.ranking-section {
  flex: 1;
  background: #1b1b1b;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.6);
}
.ranking-section h3 {
  margin: 0 0 12px;
  font-size: 18px;
  text-align: center;
  color: #0a84ff;
}
.ranking-card {
  display: flex;
  align-items: center;
  background: #1f1f1f;
  border-radius: 6px;
  padding: 12px 14px;
  cursor: pointer;
  transition: background .2s;
  overflow: hidden;
  gap: 12px;
}
.ranking-card:hover {
  background: #2a2a2a;
}
.ranking-card img {
  width: 54px;
  height: 54px;
  object-fit: contain;
  background: #2a2a2a;
  border-radius: 4px;
}

.ranking-card .info {
  flex: 1;
  color: #e0e0e0;
  font-size: 16px;
}
.ranking-card .fluct {
  font-size: 15px;
  margin-left: 6px;
}
.fluct.positive { color: #3ddc84; }
.fluct.negative { color: #ff6b6b; }

@media (max-width: 900px) {
  #rankings {
    flex-direction: column;
  }
  .ranking-section {
    width: 100%;
  }
  
  .filters {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .filters {
    grid-template-columns: 1fr;
  }
  
  .results {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* banner 样式 */
.banner-wrapper {
  position: relative; 
  padding: 0 0px;
  max-width: 1200px;
  margin: 0 auto 20px auto;
  background: #1f1f1f;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}
.banner-nav {
  display: flex;
  justify-content: center;
  gap: 32px;
  align-items: center;
}
.banner-nav a {
  font-size: 16px;
  font-weight: bold;
  color: #e0e0e0;
  text-decoration: none;
  transition: color 0.2s, transform 0.2s;
}
.banner-nav a:hover {
  color: #0a84ff;
  transform: translateY(-1px);
}
.contact-info {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 8px; 
  color: #ff4d4f; 
  font-size: 14px;
  font-weight: bold;
}
.contact-info img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}
.contact-left {
  left: 20px;
}
@media (max-width: 768px) {
  .contact-info {
    display: none;
  }
  
  .banner-wrapper {
    padding: 0 15px;
    margin-bottom: 25px;
  }
  
  .banner-nav {
    gap: 20px;
    flex-wrap: wrap;
    justify-content: space-around;
    min-height: 60px;
  }
  
  .banner-nav a {
    font-size: 15px;
    white-space: nowrap;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
  }
  
  .banner-nav a:hover {
    background: rgba(10, 132, 255, 0.1);
  }
}

@media (max-width: 480px) {
  .banner-wrapper {
    padding: 0 10px;
    margin-bottom: 20px;
  }
  
  .banner-nav {
    gap: 12px;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    min-height: auto;
  }
  
  .banner-nav a {
    font-size: 14px;
    padding: 12px 8px;
    width: calc(50% - 6px);
    text-align: center;
    border-radius: 6px;
    background: rgba(42, 42, 42, 0.5);
    border: 1px solid #444;
  }
  
  .banner-nav a:hover {
    background: rgba(10, 132, 255, 0.2);
    border-color: #0a84ff;
  }
}

@media (max-width: 320px) {
  .banner-nav a {
    font-size: 13px;
    padding: 10px 6px;
  }
}

/* 隐藏数字输入框的spinner箭头 */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
}
.ranking-card canvas {
  flex-grow: 1;
  height: 36px !important;
  margin-left: 12px;
  max-width: 240px;
  min-width: 120px;
}

.header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
  }

  .header img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 4px;
    background: #2a2a2a; 
  }

  .header h1 {
    margin: 0;
    font-size: 1.8em;
    text-align: center;
    color: #e0e0e0;
  }

  .current-price {
    color: #ff6b6b; 
    font-size: 1.2em;
  }

  #chart-container {
    width: 100%;
    margin-top: 40px;
  }

  #priceChart {
    width: 100% !important;
    height: auto !important;
    background-color: #1f1f1f;
  }


  #tab-buttons button {
    background: #2a2a2a;
    color: #e0e0e0;
    border: 1px solid #444;
    padding: 8px 16px;
    margin: 0 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
  }

  #tab-buttons button:hover {
    background: #3a3a3a;
  }

  #tab-buttons button.active {
    background: #0a84ff;
    color: white;
    border-color: #0a84ff;
  }
  #range-stats {
    color: #cccccc;
    margin-bottom: 10px;
  }
  #range-stats span {
    margin: 0 8px;
  }


.fav-container {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap; 
}

.fav-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 550px;
  min-width: 320px;
}

.fav-item-card {
  position: relative; 
  padding-left: 30px !important; 
  border: 1px solid #333; 
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5); 
  transition: border-color 0.2s, transform 0.2s;
}
.fav-item-card:hover {
    border-color: #555; 
    transform: translateY(-2px); 
}

.drag-handle {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  cursor: grab;
  color: #888;
  font-size: 20px;
  user-select: none;
}
.fav-item-card.dragging {
  opacity: 0.5;
  background: #333;
}

.unfav-btn {
  font-size: 24px;
  color: #ffc107;
  cursor: pointer;
  user-select: none;
  transition: transform .2s, color .2s;
  flex-shrink: 0; 
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px; 
}
.unfav-btn:hover {
  transform: scale(1.2);
  color: #ffde8a;
}

.ranking-card canvas {
  flex-shrink: 0;
  width: 120px !important;
}
.tooltip-container {
  position: relative;
  display: inline-flex; 
  align-items: center;
  margin-right: 6px; 
}

.tooltip-trigger {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #555;
  color: #fff;
  text-align: center;
  font-size: 12px;
  line-height: 16px;
  font-weight: bold;
  cursor: help; 
  user-select: none; 
}

.tooltip-content {
  visibility: hidden;
  opacity: 0;

  position: absolute;
  bottom: 125%; 
  left: 50%;
  transform: translateX(-50%);
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 6px;
  padding: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  width: 240px; 
  z-index: 100;
  pointer-events: none; 
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.tooltip-container:hover .tooltip-content {
  visibility: visible;
  opacity: 1;
}

.tooltip-content img {
  display: block;
  width: 100%;  
  border-radius: 4px;
  margin-bottom: 8px;
}
.tooltip-content p {
  margin: 0; 
  color: #cccccc;
  font-size: 14px;
  line-height: 1.5;
  text-align: left;
}

/* --- rtitem.php 页面专属样式 (V2) --- */
.page-title {
  text-align: center;
  margin-bottom: 24px;
  color: #e0e0e0;
  font-size: 24px;
}

.subscription-wrapper {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

/* 布局: 左 1/3, 右 2/3 */
.sub-column.available-column {
  flex: 1;
}
.sub-column.subscribed-column {
  flex: 2;
  display: flex;
  flex-direction: column;
}

.sub-column {
  background: transparent; 
  border-radius: 8px;
  padding: 0; /* 移除内边距 */
  box-shadow: none; /* 移除阴影 */
  min-width: 0; /* 允许 flex 压缩 */
}

.sub-column h2 {
  margin: 0 0 16px;
  font-size: 18px;
  text-align: center;
  color: #0a84ff;
}

.item-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-grow: 1;
}

.sub-item-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #2c2c2e;
  padding: 12px;
  border-radius: 6px;
  border: 1px solid #444; 
  transition: border-color .2s;
}

.sub-item-card:hover {
  border-color: #666;
}

.sub-item-card img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  background: #3a3a3c; 
  border-radius: 4px;
  flex-shrink: 0;
}

.sub-item-card .item-name {
  flex-grow: 1;
  color: #e0e0e0;
  font-size: 16px;
}

.add-btn, .remove-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  font-size: 22px;
  line-height: 28px; 
  font-weight: bold;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color .2s, transform .2s;
}

.add-btn {
  background-color: #28a745;
  color: white;
}
.add-btn:hover {
  background-color: #218838;
}

.remove-btn {
  background-color: #dc3545;
  color: white;
}
.remove-btn:hover {
  background-color: #c82333;
}


.sub-item-card.subscribed {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 16px;
    align-items: center;
}

.sub-main-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sub-info {
    width: 120px;
}
.sub-info .item-name {
    margin-bottom: 4px;
}
.current-price {
  font-size: 13px;
  color: #aaa;
}
.current-price-value {
  color: #ffc107;
  font-weight: bold;
  transition: color 0.5s ease;
}
.price-up { color: #3ddc84 !important; }
.price-down { color: #ff6b6b !important; }

.alert-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.alert-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ccc;
  font-size: 14px;
}

.alert-input {
  width: 70px;
  padding: 4px 6px;
  background: #3a3a3c;
  border: 1px solid #555;
  color: #e0e0e0;
  border-radius: 4px;
}
.alert-input:focus {
    outline: none;
    border-color: #0a84ff;
}

.sub-control-panel {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
    padding: 12px;
    background: #2c2c2e;
    border-radius: 6px;
    border: 1px solid #444;
}

.latency-display {
    font-size: 14px;
    color: #aaa;
}

.toggle-sub-btn {
    padding: 8px 20px;
    font-size: 16px;
    font-weight: bold;
    color: white;
    background-color: #0a84ff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color .2s;
}
.toggle-sub-btn:hover {
    background-color: #0073e6;
}
.toggle-sub-btn.paused {
    background-color: #555;
}
.toggle-sub-btn.paused:hover {
    background-color: #666;
}
/* --- rtitem.php 新增的通知按钮样式 --- */
.notify-btn {
    padding: 8px 12px;
    font-size: 14px;
    color: #e0e0e0;
    background-color: #555;
    border: 1px solid #666;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color .2s, border-color .2s;
    margin-right: auto; /* 将自己推到最左边 */
}

.notify-btn:hover:not(:disabled) {
    background-color: #666;
    border-color: #777;
}

.notify-btn:disabled {
    cursor: default;
    opacity: 0.7;
}

.notify-btn.granted {
    background-color: #28a745; 
    border-color: #28a745;
    color: white;
}

.subscribed-column .notifications-disabled .alert-controls {
    opacity: 0.5;
    pointer-events: none; 
    user-select: none; 
}

.subscribed-column .notifications-disabled .alert-input,
.subscribed-column .notifications-disabled .alert-checkbox {
    background-color: #444; 
    cursor: not-allowed;
}