:root {
  --primary: #1890ff;
  --success: #52c41a;
  --warning: #faad14;
  --error: #ff4d4f;
  --border: #e8e8e8;
  --bg-gray: #fafafa;
  --text-primary: #262626;
  --text-secondary: #8c8c8c;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
}

/* ========== 登录页 ========== */
#login-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

#login-box {
  background: #fff;
  border-radius: 12px;
  padding: 2rem 2.5rem;
  width: 360px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}

#login-box h2 {
  text-align: center;
  margin-bottom: 1.5rem;
  font-size: 1.3rem;
  color: var(--text-primary);
}

#login-box label {
  display: block;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

#login-box input {
  display: block;
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

#login-box input:focus {
  border-color: var(--primary);
}

#login-error {
  background: #fff2f0;
  border: 1px solid #ffccc7;
  color: #cf1322;
  border-radius: 6px;
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

/* ========== 用户信息栏（已移至侧边栏，以下保留兼容样式） ========== */
#user-bar-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

#user-bar-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.user-role-badge {
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  font-weight: 600;
}

.role-admin {
  background: #fff7e6;
  color: #d46b08;
  border: 1px solid #ffd591;
}

.role-user {
  background: #f0f5ff;
  color: #2f54eb;
  border: 1px solid #adc6ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--text-primary);
  background: #f5f5f5;
  display: flex;
  height: 100dvh;
  overflow: hidden;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

h1 {
  text-align: center;
  margin-bottom: 2rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ========== 侧边栏 ========== */
.sidebar {
  width: 200px;
  min-width: 200px;
  background: #fff;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: width 0.25s ease, min-width 0.25s ease;
  overflow: hidden;
  z-index: 100;
  box-shadow: 2px 0 8px rgba(0,0,0,0.06);
}

.sidebar.collapsed {
  width: 52px;
  min-width: 52px;
}

#sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 0.75rem;
  border-bottom: 1px solid var(--border);
  min-height: 52px;
}

#sidebar-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 0.2s;
}

.sidebar.collapsed #sidebar-title {
  opacity: 0;
  width: 0;
}

#sidebar-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.2rem 0.5rem;
  font-size: 0.7rem;
  color: var(--text-secondary);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
}

#sidebar-toggle:hover {
  background: #f0f7ff;
  color: var(--primary);
  border-color: var(--primary);
}

#sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.5rem 0;
}

/* ========== 导航（侧边栏竖版） ========== */
nav ul {
  display: block;
  list-style: none;
  padding: 0;
  margin: 0;
}

nav li {
  margin: 0;
}

nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: var(--text-secondary);
  border-left: 3px solid transparent;
  transition: all 0.2s;
  font-weight: 500;
  white-space: nowrap;
  font-size: 0.9rem;
}

nav a:hover {
  color: var(--primary);
  background: #f0f7ff;
}

nav a.active {
  color: var(--primary);
  border-left-color: var(--primary);
  background: #f0f7ff;
}

.nav-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

.nav-label {
  transition: opacity 0.2s;
  overflow: hidden;
}

.sidebar.collapsed .nav-label {
  opacity: 0;
  width: 0;
}

#sidebar-footer {
  border-top: 1px solid var(--border);
  padding: 0.6rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  overflow: hidden;
}

#user-bar-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  padding: 0 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 0.2s;
}

.sidebar.collapsed #user-bar-name {
  opacity: 0;
  height: 0;
  padding: 0;
}

#user-bar-role {
  padding: 0 0.5rem;
  transition: opacity 0.2s;
}

.sidebar.collapsed #user-bar-role {
  opacity: 0;
  height: 0;
  padding: 0;
}

/* ========== 主内容区 ========== */
.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  padding-left: calc(1.5rem + env(safe-area-inset-left));
  padding-right: calc(1.5rem + env(safe-area-inset-right));
  min-width: 0;
}

/* ========== 顶部栏 ========== */
#user-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0;
  padding-top: calc(0.6rem + env(safe-area-inset-top));
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

#sidebar-toggle-top {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.3rem 0.6rem;
  font-size: 1rem;
  color: var(--text-secondary);
  cursor: pointer;
  margin-right: 0.5rem;
}

#sidebar-toggle-top:hover {
  background: #f0f7ff;
  color: var(--primary);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ========== 区块容器 ========== */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding: 1rem 1.5rem;
  background: white;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.section-header h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #888;
}

.header-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: nowrap;
  align-items: center;
}

/* 紧凑按钮样式 */
.btn-compact {
  padding: 0.5rem 0.9rem;
  font-size: 0.8rem;
  white-space: nowrap;
}

/* ========== 按钮系统 ========== */
button {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.2s;
  font-family: inherit;
  font-size: 0.875rem;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.primary-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 0.65rem 1.25rem;
  font-size: 0.9rem;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.primary-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
  background: white;
  color: #666;
  padding: 0.65rem 1.25rem;
  border: 1px solid #e0e0e0;
  font-size: 0.875rem;
}

.btn-secondary:hover:not(:disabled) {
  background: #f8f9fa;
  border-color: #d0d0d0;
  color: #333;
}

.btn-small {
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  min-width: 36px;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: #40a9ff;
}

.btn-secondary {
  background: white;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
  color: var(--primary);
  border-color: var(--primary);
}

.btn-buy {
  background: #ff7a45;
  color: white;
}

.btn-buy:hover:not(:disabled) {
  background: #ff9c6e;
}

.delete-btn {
  background: white;
  color: var(--error);
  border: 1px solid #ffccc7;
  padding: 0.3rem 0.6rem;
  font-size: 0.75rem;
  border-radius: 4px;
}

.delete-btn:hover:not(:disabled) {
  background: #fff1f0;
  border-color: var(--error);
}

/* 账号操作按钮组 */
.account-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.move-btn {
  background: linear-gradient(135deg, #e6f7ff 0%, #bae7ff 100%);
  color: #0050b3;
  border: 1px solid #91d5ff;
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.move-btn span {
  font-size: 1rem;
  font-weight: 600;
}

.move-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #bae7ff 0%, #91d5ff 100%);
  border-color: #1890ff;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(24, 144, 255, 0.2);
}

.delete-btn {
  background: linear-gradient(135deg, #fff1f0 0%, #ffccc7 100%);
  color: #cf1322;
  border: 1px solid #ffa39e;
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.delete-btn span {
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1;
}

.delete-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #ffccc7 0%, #ffa39e 100%);
  border-color: #cf1322;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(207, 19, 34, 0.2);
}

/* ========== 表格 ========== */
.table-wrapper {
  overflow-x: auto;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

table {
  width: 100%;
  min-width: 1100px;
  background: white;
  border-collapse: collapse;
}

table th {
  background: #f5f7fa;
  font-weight: 600;
  font-size: 0.72rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.75rem 0.75rem;
  border-bottom: 2px solid #e8e8e8;
  border-right: 1px solid #ebebeb;
  white-space: nowrap;
}

table th:last-child {
  border-right: none;
}

table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid #f0f0f0;
  border-right: 1px solid #f5f5f5;
  font-size: 0.8rem;
  color: #333;
  background: white;
}

table td:last-child {
  border-right: none;
}

table tbody tr:hover td {
  background: #f5f8ff;
}

table tbody tr:last-child td {
  border-bottom: none;
}

/* 账号ID单元格 */
.id-cell {
  white-space: nowrap;
  font-size: 0.75rem;
}

.id-cell.can-purchase {
  background-color: #fffbe6 !important;
}

.id-cell.mode-strategy-cell {
  background-color: #ffe4ec !important;
}

.id-cell.mode-strategy-cell.can-purchase {
  background-color: #ffd6e7 !important;
}

.id-cell strong {
  font-size: 0.78rem;
}

/* 操作菜单 */
.action-menu-wrap {
  position: relative;
  display: inline-block;
}

.btn-action {
  background: white;
  border: 1px solid var(--border);
  color: #666;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  line-height: 1;
}

.btn-action:hover, .btn-action.active {
  background: #f0f7ff;
  border-color: var(--primary);
  color: var(--primary);
}

.action-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: white;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  min-width: 140px;
  z-index: 100;
  overflow: hidden;
}

.action-menu.open {
  display: block;
}

.action-menu-item {
  padding: 0.65rem 1rem;
  font-size: 0.85rem;
  color: #333;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

.action-menu-item:hover {
  background: #f5f8ff;
  color: var(--primary);
}

.action-menu-item + .action-menu-item {
  border-top: 1px solid #f5f5f5;
}

/* ========== 操作菜单弹窗 ========== */
.action-menu-box {
  width: 90%;
  max-width: 400px;
}

.action-menu-btn {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 1rem 1.25rem;
  margin-bottom: 0.5rem;
  background: white;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 1rem;
  color: #333;
  text-align: left;
}

.action-menu-btn:hover {
  background: #f5f8ff;
  border-color: var(--primary);
}

.action-menu-btn:active {
  transform: scale(0.98);
}

.action-menu-btn:last-child {
  margin-bottom: 0;
}

.action-icon {
  font-size: 1.3rem;
  margin-right: 0.75rem;
  width: 28px;
  text-align: center;
}

@media (max-width: 768px) {
  .action-menu-btn {
    padding: 1.25rem 1.5rem;
    font-size: 1.05rem;
    min-height: 56px;
  }

  .action-icon {
    font-size: 1.5rem;
    margin-right: 1rem;
  }
}

/* ========== iOS 风格操作菜单 ========== */
#action-sheet {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  pointer-events: none;
}

#action-sheet.active {
  display: block;
  pointer-events: auto;
}

.action-sheet-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  transition: background 0.3s ease;
}

#action-sheet.active .action-sheet-overlay {
  background: rgba(0, 0, 0, 0.4);
}

.action-sheet-container {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: #f7f7f7;
  border-radius: 16px 16px 0 0;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
}

#action-sheet.active .action-sheet-container {
  transform: translateY(0);
}

.action-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e0e0e0;
  background: white;
  border-radius: 16px 16px 0 0;
}

.action-sheet-title {
  font-size: 1rem;
  font-weight: 600;
  color: #333;
}

.action-sheet-close {
  background: none;
  border: none;
  font-size: 2rem;
  line-height: 1;
  color: #999;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.action-sheet-content {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0;
  background: white;
}

.action-sheet-item {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 1rem 1.25rem;
  background: white;
  border: none;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  transition: background 0.15s;
  text-align: left;
  font-size: 1rem;
  min-height: 56px;
}

.action-sheet-item:active {
  background: #f5f5f5;
}

.action-sheet-item:last-child {
  border-bottom: none;
}

.action-sheet-icon {
  font-size: 1.5rem;
  margin-right: 1rem;
  width: 32px;
  text-align: center;
}

.action-sheet-label {
  flex: 1;
  color: #333;
  font-weight: 500;
}

.action-sheet-footer {
  padding: 0.75rem;
  background: #f7f7f7;
  border-top: 1px solid #e0e0e0;
}

.action-sheet-cancel {
  width: 100%;
  padding: 0.875rem;
  background: white;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  color: #007aff;
  cursor: pointer;
  transition: background 0.15s;
}

.action-sheet-cancel:active {
  background: #f0f0f0;
}

/* ========== 状态标识 ========== */
.success {
  color: var(--success);
  font-weight: 600;
  font-size: 1.3rem;
}

.error {
  color: var(--error);
  font-weight: 600;
  font-size: 1.3rem;
}

/* 领取状态点 */
.claim-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  font-size: 1.1rem;
  font-weight: 700;
  border: 2px solid #d9d9d9;
  color: #bfbfbf;
  cursor: default;
  background: white;
  transition: all 0.2s;
}

.claim-dot-success {
  border-color: var(--success);
  color: var(--success);
  background: #f6ffed;
  box-shadow: 0 0 0 3px rgba(82,196,26,0.08);
}

.claim-dot-warning {
  border-color: var(--warning);
  color: var(--warning);
  background: #fffbe6;
  box-shadow: 0 0 0 3px rgba(250,173,20,0.08);
}

.claim-dot-error {
  border-color: var(--error);
  color: var(--error);
  background: #fff1f0;
  box-shadow: 0 0 0 3px rgba(255,77,79,0.08);
}

/* 资产数字单元格 */
.asset-num {
  text-align: right;
  font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
  font-size: 0.78rem;
  font-weight: 500;
  color: #333;
  padding: 0.65rem 0.75rem !important;
  white-space: nowrap;
}

.asset-zero {
  color: #ccc !important;
  font-weight: 400;
}

/* ========== 资产包详情 ========== */
.toggle-sdro-btn {
  cursor: pointer;
  user-select: none;
  transition: transform 0.2s;
  display: inline-block;
  margin-right: 0.5rem;
  color: var(--text-secondary);
}

.toggle-sdro-btn:hover {
  color: var(--primary);
}

.toggle-sdro-btn.expanded {
  transform: rotate(180deg);
}

.sdro-details-row {
  display: none;
}

.sdro-details-row.expanded {
  display: table-row;
}

.sdro-details-cell {
  padding: 0 !important;
  background: #fafafa;
}

.sdro-details-content {
  padding: 1rem;
  border-top: 2px solid #f0f0f0;
}

.loading-sdro {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-secondary);
}

.sdro-row {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.sdro-cell {
  padding: 0.5rem 0.4rem;
  background: white;
  border: 1px solid #f0f0f0;
  border-radius: 6px;
  text-align: center;
  font-size: 0.75rem;
  color: #bfbfbf;
}

.sdro-cell-active {
  background: #f6ffed;
  border-color: #b7eb8f;
  color: var(--text-primary);
}

.sdro-cell-total {
  background: #fff7e6;
  border-color: #ffd591;
  color: var(--text-primary);
  font-weight: 600;
}

.sdro-cell-name {
  font-weight: 600;
  font-size: 0.72rem;
  margin-bottom: 0.2rem;
}

.sdro-cell-hold {
  font-size: 0.78rem;
  margin-bottom: 0.1rem;
}

.sdro-cell-earn {
  font-size: 0.68rem;
  color: var(--success);
  margin-top: 0.1rem;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sdro-cell-clickable {
  cursor: pointer;
  border-style: dashed;
  border-color: #adc6ff;
}

.sdro-cell-clickable:hover {
  background: #e6f7ff;
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(24,144,255,0.15);
  transition: all 0.15s;
}

.sdro-divider-title {
  margin: 0.75rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sdro-divider-total {
  font-size: 0.9rem;
  font-weight: 600;
  color: #ff7a45;
  background: #fff7e6;
  padding: 0.4rem 1.5rem;
  border-radius: 6px;
  border: 1px solid #ffd591;
}

.sdro-details-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sdro-detail-group {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 0.75rem;
  padding: 0.75rem;
  background: white;
  border-radius: 6px;
  border: 1px solid #f0f0f0;
}

.sdro-detail-divider {
  border-top: none;
}

.sdro-detail-header {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
  padding: 0.3rem;
  background: #e6f7ff;
  border: 1px solid #91d5ff;
  border-radius: 6px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sdro-detail-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.sdro-detail-card {
  padding: 0.4rem 0.6rem;
  background: #f6ffed;
  border: 1px solid #b7eb8f;
  border-radius: 5px;
  font-size: 0.72rem;
  color: var(--text-primary);
  line-height: 1.5;
  text-align: center;
  flex: 0 0 auto;
}

.sdro-card-progress {
  font-weight: 600;
  margin-bottom: 0.15rem;
  font-size: 0.75rem;
  white-space: nowrap;
}

.sdro-card-value {
  color: var(--text-secondary);
  font-size: 0.7rem;
}

.sdro-card-nowrap {
  white-space: nowrap;
  font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
}

/* ========== 购买表单 ========== */
.purchase-form-row {
  display: none;
}

.purchase-form-row.open {
  display: table-row;
}

.purchase-form-cell {
  padding: 1rem 1.5rem 1rem 3rem;
  background: #fafafa;
  border-top: 2px solid #f0f0f0;
}

.purchase-inline-form {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.purchase-inline-form select,
.purchase-inline-form input {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: inherit;
  background: white !important;
  color: black !important;
}

/* 购买弹窗中的输入框和下拉框 */
#purchase-modal select,
#purchase-modal input,
.modal-box select,
.modal-box input {
  background: white !important;
  color: black !important;
}

.purchase-inline-form select {
  min-width: 120px;
}

.purchase-inline-form input[type="number"] {
  width: 80px;
}

.purchase-inline-form input[type="password"] {
  width: 140px;
}

.pf-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.pf-total-hint {
  font-size: 0.85rem;
  color: var(--text-secondary);
  min-width: 70px;
}

.pf-error {
  font-size: 0.9rem;
  color: var(--error);
  background: #fff1f0;
  border: 1px solid #ffccc7;
  border-radius: 6px;
  padding: 0.5rem 1rem;
}

/* ========== 任务执行 ========== */
.task-controls {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
}

.control-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.control-group label {
  display: block;
}

.control-group label strong {
  display: block;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
  font-weight: 600;
}

.status-box {
  margin-bottom: 1.5rem;
  padding: 1.25rem;
  background: #f0f7ff;
  border-radius: 8px;
  border-left: 4px solid var(--primary);
}

.task-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.task-progress-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.task-progress-text {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
}

.task-progress-bar {
  width: 100%;
  height: 10px;
  background: #e6f4ff;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid #bae0ff;
}

.task-progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #69b1ff 0%, #1890ff 100%);
  transition: width 0.25s ease;
}

#task-logs-container h3 {
  margin-bottom: 1rem;
  color: var(--text-primary);
  font-weight: 600;
}

.logs-box {
  max-height: 500px;
  overflow-y: auto;
  background: #1e1e1e;
  color: #d4d4d4;
  padding: 1.5rem;
  border-radius: 8px;
  font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
  font-size: 0.9rem;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.3);
}

.log-entry {
  margin-bottom: 0.3rem;
  line-height: 1.6;
}

.log-error {
  color: #ff6b6b;
}

/* ========== 配置管理 ========== */
.config-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 2rem;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.config-tab-btn {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 1rem 2rem;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  flex: 1;
  transition: all 0.2s;
}

.config-tab-btn:hover {
  color: var(--primary);
  background: #f0f7ff;
}

.config-tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: #f0f7ff;
}

.config-panel {
  display: none;
  background: white;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.config-panel.active {
  display: block;
}

.hint {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 2rem;
  padding: 1rem;
  background: #fafafa;
  border-radius: 6px;
  border-left: 3px solid var(--primary);
}

.accounts-header {
  display: grid;
  grid-template-columns: 24px 32px 120px 200px 100px 120px 110px 100px auto;
  gap: 0.5rem;
  padding: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid #f0f0f0;
  margin-bottom: 0.5rem;
}

.config-account-row {
  display: grid;
  grid-template-columns: 24px 32px 120px 200px 100px 120px 110px 100px auto;
  gap: 0.5rem;
  padding: 0.75rem;
  background: white;
  border: 1px solid #f0f0f0;
  border-radius: 6px;
  margin-bottom: 0.5rem;
  transition: all 0.2s;
}

/* 自动扣除模式 - 蓝色背景 */
.config-account-row.mode-auto {
  background: linear-gradient(135deg, #f0f7ff 0%, #e6f4ff 100%);
  border-color: #bae0ff;
}

.config-account-row.mode-auto:hover {
  background: linear-gradient(135deg, #e6f4ff 0%, #d6ebff 100%);
  border-color: #91caff;
  box-shadow: 0 2px 8px rgba(24,144,255,0.15);
}

/* 策略模式 - 黄色背景 */
.config-account-row.mode-strategy {
  background: linear-gradient(135deg, #fffbe6 0%, #fff7e6 100%);
  border-color: #ffe7ba;
}

.config-account-row.mode-strategy:hover {
  background: linear-gradient(135deg, #fff7e6 0%, #ffe7ba 100%);
  border-color: #ffd591;
  box-shadow: 0 2px 8px rgba(250,173,20,0.15);
}

.config-account-row:hover {
  box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

.config-account-row input,
.config-account-row select {
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  width: 100%;
}

.config-account-row input:focus,
.config-account-row select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(24,144,255,0.1);
}

.drag-handle {
  cursor: grab;
  color: #d9d9d9;
  font-size: 1.2rem;
  text-align: center;
  user-select: none;
}

.drag-handle:hover {
  color: var(--text-secondary);
}

.config-row.dragging .drag-handle {
  cursor: grabbing;
}

.sort-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.sort-btn {
  background: white;
  border: 1px solid var(--border);
  padding: 0.2rem 0.4rem;
  cursor: pointer;
  font-size: 0.7rem;
  border-radius: 4px;
  color: var(--text-secondary);
  min-width: 24px;
  font-weight: 600;
}

.sort-btn:hover:not(:disabled) {
  background: #fafafa;
  color: var(--primary);
  border-color: var(--primary);
}

.sort-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

#add-account-btn,
#add-proxy-btn {
  margin-top: 1rem;
  background: white;
  color: var(--success);
  border: 2px dashed #b7eb8f;
  width: 100%;
  padding: 0.75rem;
  border-radius: 6px;
  font-weight: 500;
}

#add-account-btn:hover,
#add-proxy-btn:hover {
  background: #f6ffed;
  border-color: var(--success);
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 2px solid #f0f0f0;
}

/* ========== 其他 ========== */
.log-filters {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

#proxy-status {
  margin: 1.5rem 0;
  padding: 1.25rem;
  background: #f0f7ff;
  border-left: 4px solid var(--primary);
  border-radius: 8px;
}

/* ========== 购买弹窗 ========== */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.open {
  display: flex;
}

.modal-box {
  background: white;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  width: 420px;
  max-width: 90vw;
  overflow: hidden;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #f0f0f0;
}

.modal-title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
}

.modal-close {
  cursor: pointer;
  font-size: 1.3rem;
  color: var(--text-secondary);
  line-height: 1;
  padding: 0 0.25rem;
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 1.25rem;
}

.modal-select-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.modal-select-row label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  white-space: nowrap;
  min-width: 80px;
}

.modal-select-row select {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: inherit;
}

/* 购买数量控制组 */
.quantity-control-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.quantity-btn-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.quantity-input {
  width: 56px;
  height: 30px;
  padding: 0 0.5rem;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-primary);
  transition: all 0.2s;
}

.quantity-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(24,144,255,0.1);
}

.quantity-btn {
  height: 30px;
  padding: 0 0.75rem;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  background: white;
  color: #666;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 500;
  transition: all 0.2s;
  white-space: nowrap;
  line-height: 1;
}

.quantity-btn.primary {
  border-color: var(--primary);
  color: var(--primary);
}

.quantity-btn:hover {
  background: #fafafa;
  transform: translateY(-1px);
}

.quantity-btn.primary:hover {
  background: #e6f7ff;
  border-color: #40a9ff;
  color: #40a9ff;
}

.quantity-hint {
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.35rem 0.75rem;
  background: #f0f7ff;
  border-radius: 6px;
  white-space: nowrap;
}

.modal-cost-info {
  background: #f5f8ff;
  border: 1px solid #d6e4ff;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
  line-height: 1.8;
}

.modal-cost-info .cost-row {
  display: flex;
  justify-content: space-between;
}

.modal-cost-info .cost-label {
  color: var(--text-secondary);
}

.modal-cost-info .cost-value {
  font-weight: 600;
  font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
}

.modal-footer {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  padding: 0 1.25rem 1.25rem;
}

.modal-progress {
  text-align: center;
  padding: 1rem 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.modal-result {
  border-radius: 6px;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  line-height: 1.8;
}

.modal-result.success {
  background: #f6ffed;
  border: 1px solid #b7eb8f;
  color: #389e0d;
}

.modal-result.error {
  background: #fff1f0;
  border: 1px solid #ffa39e;
  color: #cf1322;
}

/* ========== Toast 提示 ========== */
#toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  opacity: 0;
  transform: translateX(20px);
  transition: all 0.3s ease;
  max-width: 420px;
  line-height: 1.5;
}

.toast-show {
  opacity: 1;
  transform: translateX(0);
}

.toast-success {
  background: #f6ffed;
  border: 1px solid #b7eb8f;
  color: #389e0d;
}

.toast-error {
  background: #fff1f0;
  border: 1px solid #ffa39e;
  color: #cf1322;
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
  /* 基础布局 */
  body {
    padding: 1rem 0;
  }

  .container {
    padding: 0 0.75rem;
  }

  h1 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
  }

  /* 导航栏 */
  nav ul {
    flex-wrap: wrap;
  }

  nav li {
    flex: 1 1 50%;
    min-width: 50%;
  }

  nav a {
    padding: 0.75rem 0.5rem;
    font-size: 0.85rem;
  }

  /* 区块头部 */
  .section-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding: 0.75rem;
  }

  .section-header h2 {
    font-size: 1rem;
  }

  .header-actions {
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  .header-actions button {
    flex: 1 1 calc(50% - 0.2rem);
    min-width: calc(50% - 0.2rem);
    font-size: 0.75rem;
    padding: 0.5rem 0.4rem;
  }

  /* 按钮 */
  .btn-compact {
    padding: 0.5rem 0.6rem;
    font-size: 0.75rem;
  }

  .primary-btn {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
  }

  /* 表格 */
  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -0.75rem;
    padding: 0 0.75rem;
  }

  table {
    min-width: 100%;
    font-size: 0.75rem;
  }

  table th {
    padding: 0.5rem 0.3rem;
    font-size: 0.65rem;
  }

  table td {
    padding: 0.5rem 0.3rem;
    font-size: 0.75rem;
  }

  /* 账号ID和用户名列不换行 */
  table td:nth-child(1),
  table td:nth-child(2) {
    white-space: nowrap;
  }

  /* 移动端隐藏部分列 */
  table th:nth-child(n+4):nth-child(-n+9),
  table td:nth-child(n+4):nth-child(-n+9) {
    display: none;
  }

  /* 保留：账号ID、用户名、状态、更新、领取、收益、操作 */
  table th:nth-child(1),
  table th:nth-child(2),
  table th:nth-child(3),
  table th:nth-child(12),
  table th:nth-child(13),
  table th:nth-child(14),
  table th:nth-child(15),
  table td:nth-child(1),
  table td:nth-child(2),
  table td:nth-child(3),
  table td:nth-child(12),
  table td:nth-child(13),
  table td:nth-child(14),
  table td:nth-child(15) {
    display: table-cell;
  }

  /* 操作按钮 */
  .btn-action {
    padding: 0.5rem 0.8rem;
    font-size: 1.3rem;
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .action-menu {
    min-width: 160px;
    right: 0;
    left: auto;
  }

  .action-menu-item {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  /* 资产包详情 */
  .sdro-row {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.4rem;
  }

  .sdro-cell {
    padding: 0.4rem 0.3rem;
    font-size: 0.7rem;
  }

  .sdro-cell-name {
    font-size: 0.68rem;
  }

  .sdro-cell-hold {
    font-size: 0.72rem;
  }

  .sdro-cell-earn {
    font-size: 0.62rem;
  }

  .sdro-detail-group {
    grid-template-columns: 50px 1fr;
    gap: 0.5rem;
    padding: 0.6rem;
  }

  .sdro-detail-header {
    font-size: 0.7rem;
  }

  .sdro-detail-card {
    padding: 0.35rem 0.5rem;
    font-size: 0.68rem;
  }

  /* 弹窗 */
  .modal-box,
  .modal-content {
    width: 95vw;
    max-width: 95vw;
    margin: 0 0.5rem;
  }

  .modal-header {
    padding: 0.85rem 1rem;
  }

  .modal-title,
  .modal-header h3 {
    font-size: 0.95rem;
  }

  .modal-body {
    padding: 1rem;
  }

  .modal-select-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .modal-select-row label {
    font-size: 0.85rem;
  }

  .modal-cost-info {
    padding: 0.65rem 0.85rem;
    font-size: 0.8rem;
  }

  .modal-footer {
    padding: 0 1rem 1rem;
    gap: 0.5rem;
  }

  .modal-footer button {
    flex: 1;
    padding: 0.65rem 1rem;
  }

  /* 兑换弹窗 */
  .exchange-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .exchange-label {
    min-width: auto;
    font-size: 0.85rem;
  }

  .exchange-input {
    max-width: 100%;
  }

  /* 任务执行 */
  .control-group {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .task-controls {
    padding: 1rem;
  }

  .logs-box {
    font-size: 0.8rem;
    padding: 1rem;
  }

  /* 配置管理 */
  .config-tabs {
    flex-direction: column;
  }

  .config-tab-btn {
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
  }

  .config-panel {
    padding: 1rem;
  }

  .hint {
    font-size: 0.85rem;
    padding: 0.75rem;
  }

  /* 账号配置 */
  .accounts-header {
    display: none;
  }

  .config-account-row {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    padding: 0.75rem;
  }

  .config-account-row input,
  .config-account-row select {
    font-size: 0.9rem;
  }

  .drag-handle {
    display: none;
  }

  .sort-buttons {
    flex-direction: row;
    gap: 0.3rem;
  }

  /* 日志筛选 */
  .log-filters {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  /* Toast 提示 */
  #toast-container {
    top: 1rem;
    right: 1rem;
    left: 1rem;
  }

  .toast {
    max-width: 100%;
    font-size: 0.85rem;
    padding: 0.65rem 1rem;
  }

  /* 购买表单 */
  .purchase-form-cell {
    padding: 0.75rem 1rem;
  }

  .purchase-inline-form {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .purchase-inline-form select,
  .purchase-inline-form input {
    width: 100% !important;
    max-width: 100%;
    min-width: 100%;
  }

  .pf-label {
    font-size: 0.8rem;
  }
}

/* 超小屏幕优化 */
@media (max-width: 480px) {
  h1 {
    font-size: 1.3rem;
  }

  nav li {
    flex: 1 1 100%;
    min-width: 100%;
  }

  .header-actions button {
    flex: 1 1 100%;
    min-width: 100%;
  }

  .sdro-row {
    grid-template-columns: repeat(2, 1fr);
  }

  table {
    min-width: 800px;
  }
}

/* SDRP 状态样式 */
.sdrp-status {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 500;
  text-align: center;
  min-width: 60px;
}

.sdrp-ready {
  background: #f6ffed;
  color: var(--success);
  border: 1px solid #b7eb8f;
}

.sdrp-cooldown {
  background: #fff7e6;
  color: var(--warning);
  border: 1px solid #ffd591;
  font-family: 'Courier New', monospace;
}

/* 可点击的资产单元格 */
.asset-clickable {
  cursor: pointer;
  color: var(--primary);
  font-weight: 600;
  transition: all 0.2s;
}

.asset-clickable:hover {
  background: #e6f7ff;
  transform: scale(1.05);
}

/* 兑换弹窗样式 */
.exchange-info {
  padding: 1rem 0;
}

.exchange-row {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
  gap: 1rem;
}

.exchange-label {
  font-weight: 500;
  min-width: 120px;
  color: var(--text-primary);
}

.exchange-value {
  color: var(--text-primary);
  font-weight: 600;
}

.exchange-input {
  flex: 1;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 1rem;
  max-width: 200px;
}

.exchange-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.1);
}

.exchange-hint {
  margin-top: 0.5rem;
  padding: 0.75rem;
  background: #f0f5ff;
  border-radius: 4px;
  border-left: 3px solid var(--primary);
}

/* ========== 策略操作样式 ========== */
.customer-select {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: inherit;
  min-width: 200px;
  background: white;
}

.customer-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(24,144,255,0.1);
}

.hint-text {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.95rem;
  padding: 2rem;
}

.error-text {
  text-align: center;
  color: var(--error);
  font-size: 0.95rem;
  padding: 2rem;
}

.strategy-not-found {
  text-align: center;
  padding: 2rem;
}

.strategy-not-found p {
  margin-bottom: 0.5rem;
}

.strategy-info {
  background: white;
  padding: 1.25rem;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}

.info-row {
  display: flex;
  align-items: center;
  margin-bottom: 0.75rem;
  gap: 1rem;
}

.info-row:last-child {
  margin-bottom: 0;
}

.info-row .label {
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 80px;
  font-size: 0.9rem;
}

.info-row .value {
  color: var(--text-primary);
  font-size: 0.95rem;
}

.strategy-summary {
  background: white;
  padding: 1.25rem;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}

.strategy-summary h3 {
  margin: 0 0 1rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.summary-item {
  display: flex;
  flex-direction: column;
  padding: 1rem;
  background: #f0f7ff;
  border-radius: 6px;
  border: 1px solid #d6e4ff;
}

.summary-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.summary-value {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--primary);
  font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
}

.strategy-expense {
  background: white;
  padding: 1.25rem;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}

.strategy-expense h3 {
  margin: 0 0 1rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.expense-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.expense-item {
  display: flex;
  flex-direction: column;
  padding: 1rem;
  background: #fafafa;
  border-radius: 6px;
  border: 1px solid #f0f0f0;
}

.expense-item.has-expense {
  background: #fff7e6;
  border-color: #ffd591;
}

.expense-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.expense-value {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-primary);
  font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
}

.expense-value.total {
  color: var(--warning);
}

/* 累计资产 */
.strategy-cumulative {
  background: white;
  padding: 1.25rem;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}

.strategy-cumulative h3 {
  margin: 0 0 1rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.cumulative-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.cumulative-item {
  display: flex;
  flex-direction: column;
  padding: 1rem;
  background: #f0f7ff;
  border-radius: 6px;
  border: 1px solid #bae0ff;
}

.cumulative-item.highlight {
  background: linear-gradient(135deg, #fff7e6 0%, #ffe7ba 100%);
  border-color: #ffc069;
}

.cumulative-item.recovery {
  background: linear-gradient(135deg, #f6ffed 0%, #d9f7be 100%);
  border-color: #95de64;
}

.cumulative-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.cumulative-value {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-primary);
  font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
}

.cumulative-value.total {
  color: var(--warning);
}

.cumulative-value.rate {
  color: var(--success);
}

/* 今日提币计划 */
.strategy-withdraw {
  background: white;
  padding: 1.25rem;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
  border-left: 4px solid #ff4d4f;
}

.strategy-withdraw h3 {
  margin: 0 0 1rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: #cf1322;
}

.withdraw-alert {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, #fff1f0 0%, #ffccc7 100%);
  border: 1px solid #ffa39e;
  border-radius: 6px;
  margin-bottom: 1rem;
}

.withdraw-amount {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.withdraw-label {
  font-size: 0.8rem;
  color: #cf1322;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.withdraw-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: #cf1322;
  font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
  line-height: 1;
}

.withdraw-hint {
  font-size: 0.85rem;
  color: #cf1322;
  font-weight: 500;
}

.withdraw-accounts-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}

.withdraw-account-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: #fff1f0;
  border: 1px solid #ffa39e;
  border-radius: 6px;
  transition: all 0.2s;
}

.withdraw-account-item:hover {
  background: #ffe6e6;
  border-color: #ff4d4f;
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(255,77,79,0.15);
}

.btn-warning {
  background: linear-gradient(135deg, #ff7a45 0%, #ff4d4f 100%);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.85rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-warning:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255,77,79,0.35);
}

.btn-warning:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 账号操作弹窗 */
.action-modal-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.5rem 0;
}

.action-modal-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: white;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.9rem;
  color: var(--text-primary);
  text-align: left;
}

.action-modal-btn:hover {
  background: #f0f7ff;
  border-color: var(--primary);
  transform: translateX(4px);
  box-shadow: 0 2px 8px rgba(24,144,255,0.15);
}

.action-modal-btn .action-icon {
  font-size: 1.3rem;
  line-height: 1;
  flex-shrink: 0;
}

.action-modal-btn .action-text {
  font-weight: 500;
  flex: 1;
}

/* 客户选择面板 */
.customer-selector-panel {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}

.customer-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.customer-card {
  background: white;
  border: 2px solid #e8e8e8;
  border-radius: 8px;
  padding: 1.25rem;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.customer-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(24,144,255,0.15);
}

.customer-card.active {
  border-color: var(--primary);
  background: linear-gradient(135deg, #f0f7ff 0%, #e6f4ff 100%);
  box-shadow: 0 4px 12px rgba(24,144,255,0.25);
}

.customer-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.customer-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.customer-status {
  font-size: 1.2rem;
  line-height: 1;
}

.customer-status.status-success {
  color: var(--success);
}

.customer-status.status-error {
  color: var(--error);
}

.customer-card-footer {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.customer-files-count {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  background: #f5f5f5;
  border-radius: 4px;
}

.strategy-packages {
  background: white;
  padding: 1.25rem;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.strategy-packages h3 {
  margin: 0 0 1rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.packages-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.package-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: #f6ffed;
  border: 1px solid #b7eb8f;
  border-radius: 6px;
  transition: all 0.2s;
}

.package-item:hover {
  background: #e6f7ff;
  border-color: #91d5ff;
  transform: translateX(4px);
}

.package-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.package-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 60px;
}

.package-count {
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
}

/* 响应式 - 策略操作 */
@media (max-width: 768px) {
  .summary-grid,
  .expense-grid,
  .cumulative-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .package-item {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .package-info {
    justify-content: space-between;
  }
}

/* 策略资产包区块 */
.strategy-package-section {
  background: white;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.package-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
  border-bottom: 2px solid #f0f0f0;
}

.package-name-large {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary);
  min-width: 80px;
}

.package-count-large {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-secondary);
  font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
}

.strategy-accounts-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}

.strategy-account-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: #f6ffed;
  border: 1px solid #b7eb8f;
  border-radius: 6px;
  transition: all 0.2s;
}

.strategy-account-item:hover {
  background: #e6f7ff;
  border-color: #91d5ff;
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(24,144,255,0.15);
}

.account-id-badge {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  padding: 0.25rem 0.75rem;
  background: white;
  border-radius: 4px;
  border: 1px solid #d9d9d9;
}

/* 策略账号操作台 */
.strategy-accounts-panel {
  background: white;
  padding: 1.25rem;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}

.strategy-accounts-panel h3 {
  margin: 0 0 1rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* 策略购买成本展示 */
.strategy-cost-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: #fff7e6;
  border-radius: 6px;
  border: 1px solid #ffd591;
}

.cost-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.cost-item.total {
  background: white;
  padding: 0.5rem;
  border-radius: 6px;
  border: 1px solid #ff7a45;
}

.cost-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.cost-value {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--warning);
  font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
}

.cost-item.total .cost-value {
  color: #ff7a45;
}

/* 策略购买弹窗 */
.strategy-purchase-info {
  padding: 1rem 0;
}

.strategy-purchase-info .info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid #f0f0f0;
}

.strategy-purchase-info .info-row:last-child {
  border-bottom: none;
}

.strategy-purchase-info .label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.strategy-purchase-info .value {
  font-size: 1rem;
  color: var(--text-primary);
  font-weight: 600;
}

.cost-highlight {
  color: var(--warning) !important;
  font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
  font-size: 1.1rem !important;
}

/* 今日购买计划总栏（黄色）*/
.strategy-cost-total {
  background: linear-gradient(135deg, #fff7e6 0%, #ffe7ba 100%);
  border: 2px solid #ffc069;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.strategy-cost-total .cost-value {
  font-size: 1.5rem;
}

/* 每个资产包成本明细 */
.strategy-pkg-breakdown {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
  padding: 0.6rem;
  background: #fafafa;
  border: 1px solid #f0f0f0;
  border-radius: 6px;
  max-height: 280px;
  overflow-y: auto;
}

.pkg-breakdown-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.6rem;
  background: white;
  border-radius: 4px;
  border: 1px solid #f0f0f0;
  font-size: 0.82rem;
  line-height: 1.3;
}

.pkg-breakdown-name {
  font-weight: 600;
  color: var(--text-primary);
  min-width: 65px;
  font-size: 0.8rem;
}

.pkg-breakdown-cost {
  color: var(--text-secondary);
  font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
  font-size: 0.78rem;
  flex: 1;
}

.pkg-breakdown-cost strong {
  color: var(--warning);
}

.pkg-breakdown-total {
  font-weight: 600;
  color: #ff7a45;
  font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
  font-size: 0.78rem;
  white-space: nowrap;
}

/* 资产包标题区的成本提示 */
.package-cost-hint {
  font-size: 0.82rem;
  color: var(--text-secondary);
  background: #fff7e6;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  border: 1px solid #ffd591;
  font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
  white-space: nowrap;
}

/* 响应式 - 策略成本 */
@media (max-width: 768px) {
  .strategy-cost-summary {
    grid-template-columns: 1fr;
  }

  .pkg-breakdown-row {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .pkg-breakdown-name {
    min-width: auto;
    flex: 0 0 100%;
  }
}

/* 账号配置用户切换器 */
.user-tab-group {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}

.user-tab-btn {
  padding: 4px 14px;
  border: 1px solid #444;
  border-radius: 16px;
  background: #2a2a2a;
  color: #ccc;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.user-tab-btn:hover {
  background: #333;
  border-color: #666;
  color: #fff;
}

.user-tab-btn.active {
  background: #4a9eff22;
  border-color: #4a9eff;
  color: #4a9eff;
}

/* 所属用户列 */
.owner-cell {
  padding: 0.3rem 0.5rem;
}

.owner-select {
  width: 100%;
  padding: 0.25rem 0.4rem;
  font-size: 0.75rem;
  border: 1px solid #444;
  border-radius: 4px;
  background: #2a2a2a;
  color: #ccc;
  cursor: pointer;
}

.owner-select:hover {
  border-color: #666;
  background: #333;
}

.owner-select:focus {
  outline: none;
  border-color: #4a9eff;
}

/* 用户管理页面 */
.user-mgmt-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.user-mgmt-section {
  background: #1e1e1e;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.section-header h2 {
  margin: 0;
  font-size: 1.5rem;
  color: #fff;
}

.users-table-container {
  overflow-x: auto;
}

.users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.users-table th {
  text-align: left;
  padding: 0.75rem;
  background: #2a2a2a;
  color: #aaa;
  font-weight: 600;
  border-bottom: 2px solid #333;
}

.users-table td {
  padding: 0.75rem;
  border-bottom: 1px solid #333;
  color: #ccc;
}

.users-table tr:hover {
  background: #252525;
}

.status-badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-active {
  background: #27ae6022;
  color: #27ae60;
}

.status-frozen {
  background: #e74c3c22;
  color: #e74c3c;
}

.user-form-section {
  background: #1e1e1e;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.user-form-section h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  color: #fff;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.4rem;
  color: #aaa;
  font-size: 0.9rem;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.6rem;
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 4px;
  color: #fff;
  font-size: 0.9rem;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #4a9eff;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.btn-warning {
  background: #f39c12;
  color: #fff;
}

.btn-warning:hover {
  background: #e67e22;
}

.btn-success {
  background: #27ae60;
  color: #fff;
}

.btn-success:hover {
  background: #229954;
}

.btn-danger {
  background: #e74c3c;
  color: #fff;
}

.btn-danger:hover {
  background: #c0392b;
}

/* ==================== 收益合计列 ==================== */
.revenue-col {
  text-align: center;
  white-space: nowrap;
}

.revenue-cell {
  display: inline-block;
  font-size: 0.8rem;
  cursor: default;
}

.revenue-loaded {
  color: #096dd9;
  font-weight: 600;
  cursor: help;
}

.revenue-empty {
  color: #bbb;
}

.revenue-error {
  color: #cf1322;
}

/* ==================== 收益弹窗 ==================== */
#revenue-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

#revenue-modal.open {
  display: flex;
}

#revenue-modal .rev-box {
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  width: 480px;
  max-width: 92vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#revenue-modal .rev-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0;
}

#revenue-modal .rev-body {
  padding: 1.25rem;
  overflow-y: auto;
  flex: 1;
}

#revenue-modal .rev-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

#revenue-modal .rev-table th,
#revenue-modal .rev-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #f0f0f0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#revenue-modal .rev-table col.col-month  { width: 110px; }
#revenue-modal .rev-table col.col-amount { width: auto; }
#revenue-modal .rev-table col.col-count  { width: 70px; }

/* ========== 移动端底部导航 ========== */
#bottom-nav {
  display: none;
}

@media (max-width: 768px) {
  /* 整体布局：侧边栏隐藏，主内容全宽，底部留出 Tab 高度 */
  body {
    flex-direction: column;
    height: 100dvh;
    overflow: hidden;
    padding: 0;
  }

  .sidebar {
    display: none !important;
  }

  .main-content {
    padding: 0.75rem 0.75rem 0;
    padding-left: calc(0.75rem + env(safe-area-inset-left));
    padding-right: calc(0.75rem + env(safe-area-inset-right));
    padding-bottom: calc(60px + env(safe-area-inset-bottom));
  }

  /* 顶部栏 */
  #user-bar {
    padding: 0.5rem 0;
    padding-top: calc(0.5rem + env(safe-area-inset-top));
    margin-bottom: 0.75rem;
  }

  #user-bar-title {
    font-size: 0.95rem;
  }

  #sidebar-toggle-top {
    display: none !important;
  }

  /* 底部导航 */
  #bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(56px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: #fff;
    border-top: 1px solid var(--border);
    box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
    z-index: 200;
  }

  .bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.65rem;
    padding: 6px 0;
    transition: color 0.2s;
    -webkit-tap-highlight-color: transparent;
  }

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

  .bottom-nav-icon {
    font-size: 1.3rem;
    line-height: 1;
  }

  .bottom-nav-label {
    font-size: 0.62rem;
    font-weight: 500;
  }

  /* section-header 操作按钮：两列网格 */
  .section-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
  }

  .header-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
  }

  .header-actions button {
    font-size: 0.75rem;
    padding: 0.55rem 0.4rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    width: 100%;
  }

  /* 账号表格 → 卡片布局 */
  .table-wrapper {
    overflow-x: visible;
    box-shadow: none;
    border-radius: 0;
  }

  .table-wrapper table {
    display: block;
    min-width: unset;
  }

  .table-wrapper thead {
    display: none;
  }

  .table-wrapper tbody {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
  }

  /* 普通数据行 → 卡片 */
  .table-wrapper tbody tr:not(.sdro-details-row):not(.purchase-form-row) {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    background: white;
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    overflow: hidden;
    padding: 0;
  }

  /* 账号ID 单元格：跨两列，顶部 */
  .table-wrapper tbody tr td.id-cell {
    grid-column: 1 / -1;
    background: #f5f8ff;
    border-bottom: 1px solid var(--border);
    padding: 0.6rem 0.75rem;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  /* 用户名单元格 */
  .table-wrapper tbody tr td:nth-child(2) {
    grid-column: 1 / -1;
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    border-bottom: 1px solid #f5f5f5;
  }

  /* 状态单元格 */
  .table-wrapper tbody tr td:nth-child(3) {
    display: none;
  }

  /* 资产数字单元格：两列排列 */
  .table-wrapper tbody tr td.asset-num {
    padding: 0.4rem 0.75rem !important;
    font-size: 0.85rem;
    border-bottom: 1px solid #f5f5f5;
    border-right: 1px solid #f5f5f5;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.3rem;
  }

  .table-wrapper tbody tr td.asset-num::before {
    content: attr(data-label);
    display: inline-block;
    font-size: 0.65rem;
    color: var(--text-secondary);
    font-weight: 700;
    min-width: 28px;
    background: #f0f0f0;
    border-radius: 3px;
    padding: 0.05rem 0.3rem;
    text-align: center;
    flex-shrink: 0;
  }

  .table-wrapper tbody tr td.asset-num.asset-clickable::before {
    background: #e6f7ff;
    color: var(--primary);
  }

  /* 更新时间列：隐藏 */
  .table-wrapper tbody tr td:nth-last-child(4) {
    display: none;
  }

  /* 领取状态列：跨一列 */
  .table-wrapper tbody tr td:nth-last-child(3) {
    padding: 0.4rem 0.75rem;
    border-bottom: 1px solid #f5f5f5;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
  }

  .table-wrapper tbody tr td:nth-last-child(3)::before {
    content: '领取';
    font-size: 0.68rem;
    color: var(--text-secondary);
    font-weight: 600;
  }

  /* 收益合计列 */
  .table-wrapper tbody tr td:nth-last-child(2) {
    padding: 0.4rem 0.75rem;
    border-bottom: 1px solid #f5f5f5;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
  }

  .table-wrapper tbody tr td:nth-last-child(2)::before {
    content: '收益';
    font-size: 0.68rem;
    color: var(--text-secondary);
    font-weight: 600;
  }

  /* 操作列：跨两列，底部 */
  .table-wrapper tbody tr td:last-child {
    grid-column: 1 / -1;
    padding: 0.5rem 0.75rem;
    display: flex;
    justify-content: flex-end;
  }

  /* 资产包详情行：跨全宽 */
  .table-wrapper tbody tr.sdro-details-row {
    display: none;
  }

  .table-wrapper tbody tr.sdro-details-row.expanded {
    display: block;
    background: white;
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    overflow: hidden;
    margin-top: -0.5rem;
  }

  .table-wrapper tbody tr.sdro-details-row td {
    display: block;
    padding: 0;
  }

  /* 购买表单行 */
  .table-wrapper tbody tr.purchase-form-row {
    display: none;
  }

  .table-wrapper tbody tr.purchase-form-row.open {
    display: block;
    background: white;
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    overflow: hidden;
    margin-top: -0.5rem;
  }

  .table-wrapper tbody tr.purchase-form-row td {
    display: block;
  }

  /* 资产包详情内容 */
  .sdro-row {
    grid-template-columns: repeat(3, 1fr);
  }

  /* 弹窗全屏化 */
  .modal-box,
  .modal-content {
    width: 100vw;
    max-width: 100vw;
    max-height: 90dvh;
    border-radius: 16px 16px 0 0;
    margin: 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    overflow-y: auto;
  }

  .modal {
    align-items: flex-end !important;
  }

  /* 策略客户卡片 */
  .customer-cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
  }

  .customer-card {
    padding: 0.85rem;
  }

  .customer-name {
    font-size: 0.95rem;
  }

  /* 策略数据网格 */
  .summary-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
  }

  .expense-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
  }

  .cumulative-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
  }

  .summary-value,
  .expense-value,
  .cumulative-value {
    font-size: 1.1rem;
  }

  /* 任务执行 */
  .task-controls {
    padding: 0.85rem;
  }

  .control-group {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
  }

  /* 日志框 */
  .logs-box {
    font-size: 0.75rem;
    padding: 0.75rem;
    max-height: 300px;
  }

  /* 配置管理 */
  .config-tabs {
    flex-direction: row;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
  }

  .config-tab-btn {
    padding: 0.65rem 0.85rem;
    font-size: 0.8rem;
    white-space: nowrap;
    flex: 0 0 auto;
  }

  .config-panel {
    padding: 0.85rem;
  }

  /* 账号配置行 */
  .config-account-row {
    grid-template-columns: 1fr;
    gap: 0.4rem;
    padding: 0.65rem;
  }

  .accounts-header {
    display: none;
  }

  /* Toast */
  #toast-container {
    top: auto;
    bottom: calc(64px + env(safe-area-inset-bottom));
    right: 0.75rem;
    left: 0.75rem;
  }

  .toast {
    max-width: 100%;
    font-size: 0.85rem;
    padding: 0.65rem 1rem;
  }
}

@media (max-width: 480px) {
  .header-actions {
    grid-template-columns: 1fr 1fr;
  }

  .customer-cards-grid {
    grid-template-columns: 1fr 1fr;
  }

  .sdro-row {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ========== 策略页面移动端优化 ========== */

/* 客户选择卡片 */
@media (max-width: 768px) {
  /* 策略 tab header：按钮单列全宽，避免溢出 */
  #tab-strategy .header-actions {
    grid-template-columns: 1fr;
  }

  .customer-selector-panel {
    padding: 0.75rem;
  }

  .customer-cards-grid {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }

  .customer-card {
    padding: 1rem;
    border-radius: 12px;
  }

  .customer-name {
    font-size: 1rem !important;
  }

  /* 策略信息块 */
  .strategy-info {
    padding: 1rem;
    border-radius: 12px;
  }

  .info-row {
    padding: 0.6rem 0;
    gap: 0.5rem;
  }

  .info-row .label {
    font-size: 0.8rem;
    min-width: 64px;
  }

  .info-row .value {
    font-size: 0.9rem;
  }

  /* 今日收益预期 */
  .strategy-summary {
    padding: 1rem;
    border-radius: 12px;
  }

  .strategy-summary h3,
  .strategy-cumulative h3,
  .strategy-withdraw h3,
  .strategy-packages h3,
  .strategy-expense h3,
  .strategy-accounts-panel h3 {
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
  }

  .summary-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
  }

  .summary-item {
    padding: 0.85rem 1rem;
    border-radius: 10px;
  }

  .summary-label {
    font-size: 0.75rem;
    margin-bottom: 0.35rem;
  }

  .summary-value {
    font-size: 1.4rem;
  }

  /* 累计资产 */
  .strategy-cumulative {
    padding: 1rem;
    border-radius: 12px;
  }

  .cumulative-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
  }

  .cumulative-item {
    padding: 0.85rem 1rem;
    border-radius: 10px;
  }

  .cumulative-label {
    font-size: 0.75rem;
    margin-bottom: 0.35rem;
  }

  .cumulative-value {
    font-size: 1.25rem;
  }

  /* 今日提币计划 */
  .strategy-withdraw {
    padding: 1rem;
    border-radius: 12px;
  }

  .withdraw-alert {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 10px;
  }

  .withdraw-value {
    font-size: 2rem;
  }

  .withdraw-hint {
    font-size: 0.8rem;
    line-height: 1.5;
  }

  .withdraw-accounts-list {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    margin-top: 0.75rem;
  }

  .withdraw-account-item {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1rem;
    border-radius: 10px;
  }

  .account-id-badge {
    font-size: 1rem;
  }

  .btn-warning.btn-compact {
    padding: 0.6rem 1.25rem;
    font-size: 0.9rem;
    min-height: 44px;
  }

  /* 今日购买计划 */
  .strategy-packages {
    padding: 1rem;
    border-radius: 12px;
  }

  .strategy-cost-summary {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.5rem;
    padding: 0.85rem;
    border-radius: 10px;
    margin-bottom: 0.75rem;
  }

  .cost-item {
    gap: 0.3rem;
  }

  .cost-label {
    font-size: 0.72rem;
  }

  .cost-value {
    font-size: 1.1rem;
  }

  /* 资产包明细列表 */
  .strategy-pkg-breakdown {
    max-height: 200px;
    border-radius: 8px;
    margin-bottom: 0.75rem;
  }

  .pkg-breakdown-row {
    padding: 0.5rem 0.75rem;
    gap: 0.4rem;
    flex-wrap: wrap;
  }

  .pkg-breakdown-name {
    flex: 0 0 100%;
    font-size: 0.82rem;
    color: var(--text-primary);
    font-weight: 700;
  }

  .pkg-breakdown-cost {
    font-size: 0.8rem;
  }

  .pkg-breakdown-total {
    font-size: 0.82rem;
    margin-left: auto;
  }

  /* 资产包购买区块 */
  .strategy-package-section {
    padding: 0.85rem;
    border-radius: 10px;
    margin-bottom: 0.75rem;
  }

  .package-header {
    flex-wrap: wrap;
    gap: 0.4rem;
    padding-bottom: 0.6rem;
    margin-bottom: 0.6rem;
  }

  .package-name-large {
    font-size: 1.15rem;
  }

  .package-count-large {
    font-size: 1rem;
  }

  .package-cost-hint {
    flex: 0 0 100%;
    font-size: 0.78rem;
  }

  /* 账号购买按钮列表 */
  .strategy-accounts-list {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .strategy-account-item {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    min-height: 52px;
  }

  .strategy-account-item .account-id-badge {
    font-size: 0.95rem;
    padding: 0.3rem 0.75rem;
  }

  .strategy-account-item .btn-primary {
    padding: 0.6rem 1.5rem;
    font-size: 0.9rem;
    min-height: 44px;
  }

  /* 策略账号操作台 */
  .strategy-accounts-panel {
    padding: 0.85rem;
    border-radius: 12px;
  }

  /* 策略账号操作台：表格转卡片（复用 table-wrapper 卡片布局） */
  .strategy-accounts-panel .table-wrapper {
    overflow-x: visible;
    box-shadow: none;
    border-radius: 0;
  }

  .strategy-accounts-panel .table-wrapper table {
    display: block;
    min-width: unset;
  }

  .strategy-accounts-panel .table-wrapper thead {
    display: none;
  }

  .strategy-accounts-panel .table-wrapper tbody {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
  }

  /* 普通数据行 → 卡片 */
  .strategy-accounts-panel .table-wrapper tbody tr:not(.sdro-details-row) {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    background: white;
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    overflow: hidden;
  }

  /* 账号ID：跨两列，顶部 */
  .strategy-accounts-panel .table-wrapper tbody tr td.id-cell {
    grid-column: 1 / -1;
    border-bottom: 1px solid var(--border);
    padding: 0.6rem 0.75rem;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  /* 用户名：跨两列 */
  .strategy-accounts-panel .table-wrapper tbody tr td:nth-child(2) {
    grid-column: 1 / -1;
    padding: 0.35rem 0.75rem;
    font-size: 0.78rem;
    color: var(--text-secondary);
    border-bottom: 1px solid #f5f5f5;
  }

  /* 状态列：隐藏 */
  .strategy-accounts-panel .table-wrapper tbody tr td:nth-child(3) {
    display: none;
  }

  /* 资产数字单元格 */
  .strategy-accounts-panel .table-wrapper tbody tr td.asset-num {
    padding: 0.4rem 0.75rem !important;
    font-size: 0.82rem;
    border-bottom: 1px solid #f5f5f5;
    border-right: 1px solid #f5f5f5;
    display: flex;
    align-items: center;
    gap: 0.3rem;
  }

  .strategy-accounts-panel .table-wrapper tbody tr td.asset-num::before {
    content: attr(data-label);
    font-size: 0.65rem;
    color: var(--text-secondary);
    font-weight: 700;
    min-width: 28px;
    background: #f0f0f0;
    border-radius: 3px;
    padding: 0.05rem 0.3rem;
    text-align: center;
    flex-shrink: 0;
  }

  .strategy-accounts-panel .table-wrapper tbody tr td.asset-num.asset-clickable::before {
    background: #e6f7ff;
    color: var(--primary);
  }

  /* 更新时间：隐藏 */
  .strategy-accounts-panel .table-wrapper tbody tr td:nth-last-child(5) {
    display: none;
  }

  /* 领取状态 */
  .strategy-accounts-panel .table-wrapper tbody tr td:nth-last-child(4) {
    padding: 0.4rem 0.75rem;
    border-bottom: 1px solid #f5f5f5;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
  }

  .strategy-accounts-panel .table-wrapper tbody tr td:nth-last-child(4)::before {
    content: '领取';
    font-size: 0.65rem;
    color: var(--text-secondary);
    font-weight: 700;
  }

  /* 资产包摘要 */
  .strategy-accounts-panel .table-wrapper tbody tr td:nth-last-child(3) {
    grid-column: 1 / -1;
    padding: 0.35rem 0.75rem;
    font-size: 0.72rem;
    color: var(--text-secondary);
    border-bottom: 1px solid #f5f5f5;
    display: block;
  }

  .strategy-accounts-panel .table-wrapper tbody tr td:nth-last-child(3)::before {
    content: '资产包 ';
    font-weight: 700;
    color: var(--text-secondary);
  }

  /* 收益合计 */
  .strategy-accounts-panel .table-wrapper tbody tr td:nth-last-child(2) {
    padding: 0.4rem 0.75rem;
    border-bottom: 1px solid #f5f5f5;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
  }

  .strategy-accounts-panel .table-wrapper tbody tr td:nth-last-child(2)::before {
    content: '收益';
    font-size: 0.65rem;
    color: var(--text-secondary);
    font-weight: 700;
  }

  /* 操作列：跨两列，底部 */
  .strategy-accounts-panel .table-wrapper tbody tr td:last-child {
    grid-column: 1 / -1;
    padding: 0.5rem 0.75rem;
    display: flex;
    justify-content: flex-end;
  }

  .strategy-accounts-panel .table-wrapper tbody tr td:last-child button {
    min-height: 44px;
    padding: 0.5rem 1.5rem;
    font-size: 0.9rem;
  }

  /* 资产包详情展开行 */
  .strategy-accounts-panel .table-wrapper tbody tr.sdro-details-row {
    display: none;
  }

  .strategy-accounts-panel .table-wrapper tbody tr.sdro-details-row.expanded {
    display: block;
    background: white;
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    overflow: hidden;
    margin-top: -0.5rem;
  }

  .strategy-accounts-panel .table-wrapper tbody tr.sdro-details-row td {
    display: block;
    padding: 0;
  }
}


/* ========== 账号操作 Bottom Sheet ========== */
#action-sheet-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 500;
}

#action-sheet {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #f2f2f7;
  border-radius: 16px 16px 0 0;
  z-index: 501;
  padding-bottom: env(safe-area-inset-bottom);
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
}

#action-sheet.open {
  transform: translateY(0);
}

#action-sheet-overlay.open {
  display: block;
}

#action-sheet-title {
  padding: 1rem 1.25rem 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#action-sheet-items {
  background: white;
  margin: 0 0.75rem;
  border-radius: 12px;
  overflow: hidden;
}

.action-sheet-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.95rem 1.1rem;
  font-size: 0.95rem;
  color: var(--text-primary);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}

.action-sheet-item:not(:last-child) {
  border-bottom: 1px solid #f0f0f0;
}

.action-sheet-item:active {
  background: #f5f5f5;
}

.action-sheet-item-icon {
  font-size: 1.2rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

#action-sheet-cancel {
  display: block;
  width: calc(100% - 1.5rem);
  margin: 0.5rem 0.75rem 0.75rem;
  padding: 0.9rem;
  background: white;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

#action-sheet-cancel:active {
  background: #f0f0f0;
}
