/* Material Design 3 主题色 */
:root {
  --md-primary: #6750A4;
  --md-primary-container: #EADDFF;
  --md-on-primary: #FFFFFF;
  --md-on-primary-container: #21005E;
  
  --md-secondary: #625B71;
  --md-secondary-container: #E8DEF8;
  --md-on-secondary: #FFFFFF;
  --md-on-secondary-container: #1E192B;
  
  --md-tertiary: #7D5260;
  --md-tertiary-container: #FFD8E4;
  --md-on-tertiary: #FFFFFF;
  
  --md-error: #B3261E;
  --md-error-container: #F9DEDC;
  --md-on-error: #FFFFFF;
  
  --md-background: #FFFBFE;
  --md-on-background: #1C1B1F;
  
  --md-surface: #FFFBFE;
  --md-surface-variant: #E7E0EC;
  --md-on-surface: #1C1B1F;
  --md-on-surface-variant: #49454F;
  
  --md-outline: #79747E;
  --md-outline-variant: #CAC4D0;
  
  --md-success: #4CAF50;
  --md-warning: #FF9800;
  
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
}

/* 全局样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--md-background);
  color: var(--md-on-background);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 加载动画 */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--md-background);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.loading-overlay.active {
  display: flex;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--md-outline-variant);
  border-top-color: var(--md-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 页面切换 */
.page {
  display: none;
  min-height: 100vh;
}

.page.active {
  display: block;
}
/* 关闭弹框 */
.closeModal{
  position: absolute;
  top: 30px;
  right: 24px;
}
.closeModal img{
  width: 20px;
  height: 20px;
}
/* 认证页面样式 */
.auth-container {
  max-width: 400px;
  margin: 0 auto;
  padding: 48px 24px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.charge-btn-active{

  background:var(--md-primary-container); 

}
.withdraw-btn-active{

  background:var(--md-primary-container); 

}
.auth-header {
  text-align: center;
  margin-bottom: 48px;
}
.withdraw-content{
  padding: 0 16px;
}
.auth-header h1 {
  font-size: 32px;
  font-weight: 500;
  color: var(--md-primary);
  margin-bottom: 8px;
}

.auth-header p {
  font-size: 14px;
  color: var(--md-on-surface-variant);
}

.auth-form {
  display: none;
}

.auth-form.active {
  display: block;
}

.auth-form h2 {
  font-size: 24px;
  font-weight: 500;
  margin-bottom: 24px;
}

/* 输入框样式 */
.input-field {
  position: relative;
  margin-bottom: 24px;
}

.input-field input {
  width: 100%;
  padding: 16px;
  font-size: 16px;
  border: 1px solid var(--md-outline);
  border-radius: 4px;
  background: transparent;
  outline: none;
  transition: all 0.2s;
}

.input-field input:focus {
  border-color: var(--md-primary);
  border-width: 2px;
  padding: 15px;
}

.input-field label {
  position: absolute;
  left: 16px;
  top: 16px;
  color: var(--md-on-surface-variant);
  transition: all 0.2s;
  pointer-events: none;
  background: var(--md-background);
  padding: 0 4px;
}
.charge-order-btn-active{
  background: var(--md-surface-variant);
}
.input-field input:focus + label,
.input-field input:not(:placeholder-shown) + label {
  top: -8px;
  font-size: 12px;
  color: var(--md-primary);
}

/* 按钮样式 */
.btn-primary {
  width: 32%;
  padding: 8px;
  font-size: 16px;
  font-weight: 500;
  color: var(--md-on-primary);
  background-color: var(--md-primary);
  border: none;
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.auth-switch {
  text-align: center;
  margin-top: 24px;
  color: var(--md-on-surface-variant);
}

.auth-switch a {
  color: var(--md-primary);
  text-decoration: none;
  font-weight: 500;
}

/* 主应用布局 */
.view {
  display: none;
  padding-bottom: 80px;
}

.view.active {
  display: block;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 24px;
  background: var(--md-surface);
  box-shadow: var(--shadow-sm);
}

.welcome-info {
  display: flex;
  align-items: center;
  gap: 4px;
}

.welcome-text {
  color: var(--md-on-surface-variant);
  font-size: 14px;
}

.user-name {
  color: var(--md-primary);
  font-weight: 500;
  font-size: 16px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--md-on-surface-variant);
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s;
}

.icon-btn:hover {
  background: var(--md-surface-variant);
}

/* 余额卡片 */
.balance-card {
  margin: 16px;
  padding: 15px 24px;
  background: linear-gradient(135deg, var(--md-primary) 0%, #8B7BC8 100%);
  border-radius: 24px;
  color: var(--md-on-primary);
  box-shadow: var(--shadow-lg);
}

.balance-label {
  font-size: 14px;
  opacity: 0.9;
  margin-bottom: 8px;
}

.balance-amount {
  font-size: 36px;
  font-weight: 500;
  margin-bottom: 10px;
}

.balance-actions {
  display: flex;
  gap: 16px;
  justify-content: space-around;
}

/* 快速统计卡片 */
.quick-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 0 24px 24px 24px;
}

.stat-item {
  background: var(--md-surface-variant);
  padding: 16px;
  border-radius: 12px;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-value {
  font-size: 20px;
  font-weight: 500;
  color: var(--md-primary);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px;
  color: var(--md-on-surface-variant);
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 16px;
  color: var(--md-on-primary);
  cursor: pointer;
  transition: all 0.2s;
  flex: 1;
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.action-btn span.material-icons {
  font-size: 24px;
}

.action-btn span:not(.material-icons) {
  font-size: 12px;
}

/* 订单区域 */
.orders-section {
  margin: 0 24px 24px;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-left: 24px;
}

.tabs2 {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tab {
  padding: 8px 16px;
  font-size: 14px;
  background: transparent;
  border: 1px solid var(--md-outline-variant);
  border-radius: 8px;
  color: var(--md-on-surface-variant);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.tab.active {
  background: var(--md-primary-container);
  border-color: var(--md-primary);
  color: var(--md-on-primary-container);
}

.orders-list {
  min-height: 200px;
}

.empty-state, .loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  color: var(--md-on-surface-variant);
}

.empty-state .material-icons {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.order-card {
  background: var(--md-surface);
  border: 1px solid var(--md-outline-variant);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}

.order-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.order-asset {
  font-size: 18px;
  font-weight: 500;
}

.order-status {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.order-status.pending {
  background: var(--md-warning);
  color: white;
}

.order-status.completed {
  background: var(--md-success);
  color: white;
}

.order-status.cancelled {
  background: var(--md-outline-variant);
  color: var(--md-on-surface-variant);
}

.order-details {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--md-on-surface-variant);
}

/* 市场订单卡片 */
.market-orders-list {
  padding: 24px;
}

.today-orders-list {
  padding: 24px;
}

.today-order-card {
  transition: transform 0.2s, box-shadow 0.2s;
}

.today-order-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.market-order-card {
  background: var(--md-surface);
  border: 1px solid var(--md-outline-variant);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.market-order-header {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.market-logo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FFB800 0%, #FFA000 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 16px;
  margin-right: 12px;
  flex-shrink: 0;
}

.market-logo-img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  margin-right: 12px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.market-asset-info {
  flex: 1;
}

.market-asset-name {
  font-size: 20px;
  font-weight: 500;
  margin-bottom: 4px;
}

.market-asset-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--md-on-surface-variant);
}

.verified-badge {
  padding: 2px 8px;
  background: #FF9800;
  color: white;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 500;
}

.shield-icon {
  color: #2196F3;
  font-size: 16px;
}

.market-stats {
  font-size: 12px;
  color: var(--md-on-surface-variant);
  margin-bottom: 12px;
}

.market-divider {
  height: 1px;
  background: var(--md-outline-variant);
  margin: 12px 0;
}

.market-order-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.market-amounts {
  flex: 1;
}

.market-amount-item {
  font-size: 14px;
  color: var(--md-on-surface-variant);
  margin-bottom: 4px;
}

.market-amount-item strong {
  color: var(--md-on-surface);
  font-weight: 500;
}

.btn-take-order {
  padding: 12px 24px;
  background: #2196F3;
  color: white;
  border: none;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}

.btn-take-order:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* 个人资料页面 */
.profile-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  /* gap: 16px; */
  padding: 24px;
  background: var(--md-surface);
  margin-bottom: 16px;
}

.avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--md-primary-container);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--md-primary);
}

.avatar .material-icons {
  font-size: 48px;
}
.profile-info{
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.profile-username {
  font-size: 20px;
  text-align: center;
  font-weight: 500;
  margin-bottom: 4px;
}

.profile-invitecode {
  font-size: 14px;
  color: var(--md-on-surface-variant);
}

.profile-menu {
  background: var(--md-surface);
  padding: 0 20px;
}

.menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0px;
  background: transparent;
  border: 1px solid #f5f5f5;
  color: var(--md-on-surface);
  cursor: pointer;
  transition: background 0.2s;
  text-align: left;
  border-radius: 6px;
}
.menu-item-outlogin{
  margin-top: 20px;
  color: red;
}
.menu-item:hover {
  background: var(--md-surface-variant);
}

.menu-item span:nth-child(2) {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
}

.menu-item .arrow {
  color: var(--md-on-surface-variant);
}

/* 底部导航栏 */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  background: var(--md-surface);
  box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
  z-index: 100;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 12px;
  background: transparent;
  border: none;
  color: var(--md-on-surface-variant);
  cursor: pointer;
  transition: color 0.2s;
}

.nav-item.active {
  color: var(--md-primary);
}

.nav-item .material-icons {
  font-size: 24px;
  margin-bottom: 4px;
}

.nav-item span:not(.material-icons) {
  font-size: 12px;
}

/* Toast 通知 */
#toast-container {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  pointer-events: none;
}

.toast {
  padding: 12px 24px;
  background: var(--md-on-surface);
  color: var(--md-surface);
  border-radius: 4px;
  box-shadow: var(--shadow-lg);
  margin-bottom: 8px;
  animation: slideUp 0.3s;
  pointer-events: auto;
}

.toast.success {
  background: var(--md-success);
}

.toast.error {
  background: var(--md-error);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 模态框 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 24px;
}

.modal {
  background: var(--md-surface);
  border-radius: 28px;
  padding: 24px;
  max-width: 400px;
  width: 100%;
  max-height: 80vh;
  position: relative;
  overflow-y: auto;
}

.modal-header {
  font-size: 24px;
  font-weight: 500;
  margin-bottom: 16px;
}

.modal-content {
  margin-bottom: 24px;
}

.modal-actions {
  display: flex;
  flex-direction: row;
  gap: 12px;
  justify-content: flex-end;
  align-items: center;
}

.btn-text {
  padding: 10px 24px;
  background: transparent;
  border: 1px solid;
  color: var(--md-primary);
  font-weight: 500;
  cursor: pointer;
  border-radius: 100px;
  transition: background 0.2s;
}

.btn-text:hover {
  background: var(--md-primary-container);
}

/* 官网页面样式 */
.website-hero {
  margin: 24px;
  margin-bottom: 16px;
}

.hero-image {
  width: 100%;
  /* height: 170px; */
  background: var(--md-surface-variant);
  border-radius: 16px;
  overflow: hidden;
  position: relative;
}

.hero-image img {
  width: 100% !important;
  height: 100% !important;
  /* object-fit: cover !important; */
  border-radius: 16px;
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
}

.image-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--md-on-surface-variant);
}

.image-placeholder .material-icons {
  font-size: 48px;
  margin-bottom: 8px;
}

.image-placeholder p {
  font-size: 14px;
}

.website-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  margin: 0 24px 24px 24px;
}

.website-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px;
  background: var(--md-surface);
  border: 1px solid var(--md-outline-variant);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.website-btn:hover {
  background: var(--md-primary-container);
  border-color: var(--md-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.website-btn.active {
  background: var(--md-primary-container);
  border-color: var(--md-primary);
}

.website-btn.active .material-icons {
  color: var(--md-primary);
}

.website-btn.active span:last-child {
  color: var(--md-primary);
  font-weight: 600;
}

.website-btn .material-icons {
  font-size: 24px;
  color: var(--md-primary);
}

.website-btn span:last-child {
  font-size: 14px;
  font-weight: 500;
  color: var(--md-on-surface);
}

.website-content {
  margin: 0 24px 100px 24px;
}

.default-content h3 {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 16px;
  color: var(--md-primary);
}

.content-text {
  background: var(--md-surface-variant);
  padding: 16px;
  border-radius: 12px;
  line-height: 1.6;
}

.content-text p {
  margin-bottom: 12px;
  font-size: 14px;
  color: var(--md-on-surface);
}

.content-text p:last-child {
  margin-bottom: 0;
}

.content-section h3 {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 16px;
  color: var(--md-primary);
}
.view-title{
  display: flex;
  justify-content: center;
  position: relative;
  font-size: 14px;
  padding: 24px 0;
}
.view-title .back-icon{
  left: 24px;
  width: 28px;
  height: 28px;
  border-radius: 28px;
  position: absolute;
  display: flex;
  justify-content: center;
  align-items: center;
  top: 0;
  bottom: 0;
  margin: auto;
  background: rgb(242, 246, 255);
}
.view-title .back-icon img{
  width: 20px;
  height: 20px;
}
/* app下载 */
.download-content-card{
    padding: 0 24px;
}
.download-content-card .download-title{
    font-size: 16px;
    margin-bottom: 24px;
}
.download-content-card .download-box{
    display: flex;
    justify-content: space-between;
    margin-bottom: 36px;
}
.download-content-card .download-item{
    width: 48%;
    border-radius: 12px;
    height: 156px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}
.download-content-card .download-item img{
    margin-bottom: 10px;
    width: 50px;
}
.download-content-card .download-item div:nth-of-type(1){
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 8px; 
}
.download-content-card .download-item div:nth-of-type(2){
    height: 20px;
    width: 60px;
    text-align: center;
    font-size: 12px;
    line-height: 20px;
    background: #fff;
    border-radius: 20px;
}
.download-content-card .download-item div:nth-of-type(2) a{
  text-decoration: none;
}
.download-content-card .download-tips{
    padding: 28px 20px;
    border-radius: 12px;
    box-shadow: 0px 0px 16px rgba(0, 0, 0, 0.1);
}
.download-content-card .download-tips >div:nth-of-type(1){
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 16px;
}
.download-content-card .download-tips >div:nth-of-type(2){
    font-size: 12px;
    margin-bottom: 20px;
}
.download-content-card .download-tips >div:nth-of-type(3){
    font-size: 12px;
}
/* 响应式调整 */
@media (min-width: 768px) {
  .auth-container {
    max-width: 480px;
  }
  
  .balance-card {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
  }
  
  .orders-section,
  .market-orders-list {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
  }
  
  .website-buttons {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
  }
  
  .website-content {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
  }
}

