body {
  background: #18191e;
  font-family: 'Noto Sans TC', 'Arial', sans-serif;
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.wrapper {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 90vh;
  width: 100%;
  padding: 20px 0;
  box-sizing: border-box;
}

.card {
  width: 340px;
  background: #23252c;
  padding: 40px 36px 32px 36px;
  border-radius: 24px;
  box-shadow: 0 3px 24px #0006;
  position: relative;
  font-weight: bold;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* --- 標題區塊 --- */
.header-section {
  text-align: center;
  margin-bottom: 24px;
  position: relative;
  z-index: 10;
}

.main-title {
  font-size: 32px;
  letter-spacing: 2px;
  font-weight: 900;
  color: #fff;
  margin-bottom: 10px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

/* --- 下拉選單樣式 --- */
.dropdown-container {
  position: relative;
  display: inline-block;
}

.dropdown-trigger {
  font-size: 14px;
  color: #888b97;
  font-weight: 500;
  letter-spacing: 1px;
  background: #353843;
  padding: 6px 16px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}

.dropdown-trigger:hover {
  background: #454955;
  color: #fff;
}

.dropdown-trigger .arrow {
  font-size: 10px;
  transition: transform 0.3s;
}

.dropdown-container.active .arrow {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  width: 260px;
  background: #2c2f38;
  border: 1px solid #464a55;
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  pointer-events: none;
}

.dropdown-container.active .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(8px);
  pointer-events: auto;
}

/* --- 合夥人列表樣式 --- */
.partner-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #3a3d47;
  font-size: 13px;
}

.partner-row:last-child {
  border-bottom: none;
}

.partner-info-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.partner-img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: #3a3d47;
  border: 1px solid rgba(255,255,255,0.1);
  display: block;
}

.p-name {
  color: #c9cbce;
  font-weight: normal;
}

.p-val {
  text-align: right;
}
.p-percent {
  color: #888b97;
  font-size: 12px;
  margin-right: 4px;
}
.p-amount {
  color: #70c464;
  font-family: monospace;
  font-weight: bold;
}

/* --- 自訂圖表區塊樣式 --- */
.custom-chart-card {
  width: 100%;
  background: #1e2026;
  border-radius: 16px;
  padding: 16px 12px;
  /* 【修改點】原本是 24px，改小一點讓它跟下面的框框靠近 */
  margin-bottom: 8px; 
  box-sizing: border-box;
  border: 1px solid #2c2f38;
}

.chart-header-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-family: monospace;
}

.chart-pair {
  color: #888b97;
  font-size: 13px;
  font-weight: normal;
}

.chart-price {
  color: #fff;
  font-size: 14px;
  font-weight: bold;
}

.chart-change {
  font-size: 13px;
}
.text-green { color: #49d2a3; }
.text-red { color: #ff6b6b; }

.chart-canvas-container {
  position: relative;
  height: 160px;
  width: 100%;
}

/* --- LOGO 與 副標 --- */
.buy-row {
  margin-bottom: 24px;
  text-align: center;
  width: 100%;
  z-index: 1;
}

.btc-row-flex {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(255,255,255,0.03);
  padding: 8px 16px;
  border-radius: 50px;
  border: 1px solid rgba(255,255,255,0.05);
}

.btc-row-text {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 1px;
  white-space: nowrap;
  color: #f5f6fa;
}

.btc-row-logo {
  width: 20px;
  height: 20px;
  display: block;
}

/* --- 進度條與總資產 --- */
.goal-row {
  text-align: center;
  font-size: 15px;
  font-weight: 400;
  margin-bottom: 12px;
  letter-spacing: 1px;
  width: 100%;
  color: #c9cbce;
}

.progress-bg {
  width: 100%;
  height: 17px;
  background: #353843;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 6px #0004 inset;
  margin-bottom: 8px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #49d2a3 0%, #70c464 100%);
  border-radius: 14px 0 0 14px;
  transition: width 0.6s cubic-bezier(.4,1,.5,1);
  min-width: 3px;
}

.total-row {
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  margin-top: 12px;
  letter-spacing: 0.5px;
  color: #70c464;
  width: 100%;
}

/* --- 統計數據網格 --- */
.stats-grid {
  display: flex;
  justify-content: space-between;
  width: 100%;
  /* 【修改點】原本是 16px，改為 0，讓它緊貼上面的圖表 */
  margin-top: 0;
  gap: 12px;
}

.stat-item {
  flex: 1;
  background: #2c2f38;
  border-radius: 12px;
  padding: 12px 0;
  text-align: center;
  border: 1px solid #353843;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.stat-label {
  font-size: 12px;
  color: #888b97;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 16px;
  font-weight: bold;
  color: #fff;
  font-family: monospace;
}

.stat-sub {
  font-size: 11px;
  margin-top: 2px;
  font-weight: normal;
  opacity: 0.8;
  font-family: monospace;
}

/* 損益變色 */
.pnl-green .stat-value, .pnl-green .stat-sub { color: #70c464; }
.pnl-red .stat-value, .pnl-red .stat-sub { color: #ff6b6b; }

/* --- 歷史紀錄區域 --- */
.history-container {
  width: 100%;
  margin-top: 28px;
  margin-bottom: 8px;
  border-top: 1px solid #353843;
  padding-top: 20px;
}

.history-title {
  font-size: 12px;
  color: #666975;
  text-align: center;
  margin-bottom: 14px;
  font-weight: normal;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.history-list {
  width: 100%;
  max-height: 150px;
  overflow-y: auto;
  padding-right: 4px;
}

.history-list::-webkit-scrollbar {
  width: 4px;
}
.history-list::-webkit-scrollbar-track {
  background: #23252c; 
}
.history-list::-webkit-scrollbar-thumb {
  background: #353843; 
  border-radius: 4px;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  padding: 10px 4px;
  border-bottom: 1px solid #2c2f38;
}

.history-item:last-child {
  border-bottom: none;
}

.history-date {
  color: #888b97;
  font-weight: 400;
  font-size: 12px;
  font-family: monospace;
}

.history-from {
  font-size: 11px;
  color: #555863;
  margin-top: 2px;
  font-family: monospace;
}

.history-amount {
  font-family: monospace;
  font-weight: bold;
  letter-spacing: -0.5px;
}

.amount-in { color: #70c464; }
.amount-out { color: #ff6b6b; }

.history-loading {
  text-align: center;
  color: #555;
  font-size: 12px;
  padding: 10px;
}

/* --- 底部按鈕 --- */
.links-container {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: 20px;
}

.kaspa-pool {
  background-color: #353843;
  color: #ffffff;
  padding: 14px 0;
  border-radius: 12px;
  text-decoration: none;
  font-size: 14px;
  font-weight: bold;
  letter-spacing: 1px;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 1px solid #464a55;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  transition: all 0.2s ease;
}

.kaspa-pool.full-width {
  width: 100%;
}

.kaspa-pool:hover {
  background-color: #70c464;
  border-color: #70c464;
  color: #18191e;
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(112, 196, 100, 0.2);
}

/* --- 頂部公告欄樣式 --- */
.announcement-box {
  width: 100%;
  background: rgba(247, 174, 49, 0.1);
  border: 1px solid rgba(247, 174, 49, 0.3);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 24px;
  box-sizing: border-box;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.announcement-icon {
  font-size: 16px;
  line-height: 1.4;
}

.announcement-text {
  font-size: 13px;
  color: #f7ae31;
  font-weight: normal;
  line-height: 1.4;
  text-align: left;
}

/* --- Footer --- */
.footer-powered {
  width: 100%;
  text-align: center;
  font-size: 13px;
  color: #555863;
  margin-top: 32px;
  margin-bottom: 12px;
  letter-spacing: 1px;
  font-weight: 400;
}

.footer-powered a {
  color: #70c464;
  text-decoration: none;
  margin-left: 4px;
  font-weight: bold;
}

.footer-powered a:hover {
  text-decoration: underline;
  color: #85db78;
}

/* 手機版 RWD */
@media (max-width: 500px) {
  .wrapper {
    min-height: 86vh;
  }
  .card {
    width: 94vw;
    min-width: 0;
    padding: 32px 8vw 24px 8vw;
  }
  .main-title {
    font-size: 8vw;
  }
  .goal-row, .total-row {
    font-size: 3.8vw;
  }
  .dropdown-menu {
    width: 240px;
  }
}
