* { box-sizing: border-box; font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; margin: 0; padding: 0; }
body {
    background: linear-gradient(150deg, #6b21a8 0%, #4c1d95 35%, #2e1065 70%, #1e1b4b 100%);
    padding: 24px 16px;
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
}
.card {
    background: #ffffff;
    border-radius: 18px;
    padding: 28px;
    margin-bottom: 22px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    overflow: visible;
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}
/* 站点 Logo（大象插画；圆角白底容器 + 图片 contain 完整显示） */
.site-logo {
    width: 30px; height: 30px; border-radius: 9px;
    background: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(107,33,168,0.25);
    overflow: hidden;
}
.site-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.card-title { font-size: 18px; color: #1f2937; font-weight: 600; }
.toggle-arrow {
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #4b5563;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background 0.2s;
}
.toggle-arrow:hover { background: #f3f4f6; }
.share-btn {
    background: linear-gradient(135deg, #16a34a, #15803d);
    color: #fff;
    border: none;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: 8px;
    cursor: pointer;
    margin-right: 4px;
    white-space: nowrap;
}
.share-btn:active { opacity: 0.85; }
.share-btn:disabled, .btn-order:disabled { opacity: .45; cursor: not-allowed; filter: grayscale(.5); }
.card-body { transition: max-height 0.35s ease; overflow: hidden; }
.card-body.collapsed { max-height: 0 !important; }
h2 { font-size: 28px; color: #111827; margin-bottom: 26px; font-weight: 700; }
h4 { font-size: 18px; color: #1f2937; margin-bottom: 16px; font-weight: 600; }
.row {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
}
.row-group-2 {
    display: grid;
    grid-template-columns: minmax(0,1fr) minmax(0,1fr);
    gap: 16px;
}
.form-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}
.form-item label {
    display: block;
    font-weight: 500;
    color: #374151;
    font-size: 14px;
    line-height: 1.4;
}
.form-item input,
.form-item select {
    width: 100%;
    height: 48px;
    padding: 10px 44px 10px 16px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font-size: 15px;
    background: #fff;
    line-height: 1.4;
    transition: border 0.2s, box-shadow 0.2s;
    position:relative;
    min-width:0;
}
.form-item input:focus,
.form-item select:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.12);
}
.search-wrap {
    position: relative;
}
.clear-port-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
    color: #9ca3af;
    cursor: pointer;
    z-index: 10;
    user-select: none;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background 0.2s;
}
.clear-port-icon:hover {
    background: #f3f4f6;
    color: #4b5563;
}
.history-container{
    display:flex;
    flex-direction:row;
    gap:8px;
    margin-top:8px;
    align-items:center;
    min-width:0;
}
.history-tag-wrap{
    display:flex;
    gap:8px;
    flex:1;
    overflow-x:auto;
    overflow-y:hidden;
    flex-wrap:nowrap !important;
    padding-bottom:4px;
    min-width:0;
}
.history-tag{
    padding:4px 10px;
    background:#f5f3ff;
    color:#6d28d9;
    border:1px solid #ede9fe;
    border-radius:999px;
    font-size:12px;
    cursor:pointer;
    transition:0.2s;
    white-space: nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
    max-width:120px;
    flex-shrink:0;
}
.history-tag:hover{
    background:#ede9fe;
}
.clear-history-btn{
    font-size:12px;
    color:#9ca3af;
    cursor:pointer;
    white-space:nowrap;
    padding:3px 8px;
    border-radius:6px;
    transition:0.2s;
    flex-shrink:0;
    display:none;
}
.clear-history-btn.show{
    display:block;
}
.clear-history-btn:hover{
    background:#f3f4f6;
    color:#6d28d9;
}
.suggest {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 20000;
    background: #fff;
    border: 1px solid #c4b5fd;
    max-height: 280px;
    overflow-y: auto;
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(30,10,60,0.22);
}
.suggest div {
    padding: 12px 16px;
    cursor: pointer;
    height: 48px;
    display: flex;
    align-items: center;
    transition: background 0.2s;
}
.suggest div:hover { background: #f5f3ff; }

.btn-full {
    width: 100%;
    padding: 14px;
    background: linear-gradient(90deg,#7c3aed,#a855f7);
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    height: 52px;
    font-weight: 600;
    margin-top: 6px;
    transition: opacity 0.2s;
}
.btn-full:hover{
    opacity:0.92;
}
.filter-summary{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
    padding:16px;
    background:#f9fafb;
    border-radius:12px;
    margin-bottom:16px;
    max-height:200px;
    overflow-y:auto;
}
.tag-port,
.tag-date,
.tag-danger,
.tag-ship,
.tag-pol{
    background:#f5f3ff;
    color:#6d28d9;
    border:1px solid #ede9fe;
    padding:8px 12px;
    border-radius:8px;
    font-size:14px;
}
.price-card-list {
    display:flex;
    flex-direction:column;
    gap:10px;
    margin-top:16px;
}
.price-card-item {
    display:flex;
    align-items: stretch;
    background:#fbf9ff;
    border:1px solid #f1ecff;
    border-radius:14px;
    overflow:hidden;
    min-height:76px;
}
.price-card-item:nth-child(even) {
    background:#f5f0ff;
    border-color:#ede4ff;
}
.type-cell {
    background:#8b5cf6;
    color:#ffffff;
    font-size:16px;
    font-weight:700;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:0 16px;
    border-top-left-radius:14px;
    border-bottom-left-radius:14px;
    min-width:110px;
}
.price-cell {
    flex:1;
    display:flex;
    align-items:center;
    justify-content:flex-end;
    font-size:28px;
    font-weight:bold;
    color:#7c3aed;
    padding:0 18px;
}
.arrow-up{color:#7c3aed;}
.arrow-flat{color:#a78bfa;}
.arrow-down{color:#4c1d95;}
.extra-info-wrap{
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin-top:12px;
}
.extra-info-row{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:10px;
    margin-bottom:10px;
    min-width:0;
}
.extra-info-row:last-child{
    margin-bottom:0;
}
.extra-info-pair{
    display:flex;
    flex-direction:column;
    gap:4px;
    background:#f5f3ff;
    border:1px solid #ede9fe;
    border-radius:12px;
    padding:12px 14px;
    min-width:0;
}
.extra-info-label{
    color:#6d28d9;
    font-weight:600;
    font-size:13px;
}
.extra-info-value{
    color:#1f2937;
    text-align:left;
    font-size:15px;
    font-weight:500;
}
.info-tag-group{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
    margin-top:12px;
}
.info-tag{
    padding:9px 14px;
    border-radius:10px;
    font-size:14px;
    background:#f5f3ff;
    color:#6d28d9;
    border:1px solid #ede9fe;
}
.remark-block{
    background-color:#f5f3ff;
    border:1px solid #ede9fe;
    border-radius:12px;
    padding:18px;
    line-height:1.7;
    color:#1f2937;
}
.update-alert{
    background:#ffffff;
    border:1px solid #ddd6fe;
    border-radius:14px;
    padding:14px 18px;
    margin-bottom:20px;
    display:flex;
    align-items:center;
    gap:12px;
    box-shadow:0 6px 20px rgba(0,0,0,0.1);
}
.update-alert-close{
    cursor:pointer;
    font-size:20px;
    color:#888;
    flex-shrink:0;
}
.update-alert-title{
    font-weight:600;
    flex-shrink:0;
    color:#4c1d95;
}
.update-tag{
    display:inline-block;
    padding:4px 10px;
    border-radius:6px;
    margin:0 5px;
    font-size:13px;
    background:#f5f3ff;
    color:#6d28d9;
}
#backTopBtn{
    position:fixed;
    bottom:28px;
    right:24px;
    width:52px;
    height:52px;
    border-radius:50%;
    background:#7c3aed;
    color:#fff;
    border:none;
    box-shadow:0 4px 16px rgba(0,0,0,0.25);
    font-size:22px;
    cursor:pointer;
    display:none;
    z-index:9999;
    transition:opacity 0.2s;
}
#backTopBtn:hover{
    opacity:0.9;
}
@media(max-width:768px){
    body {padding:16px 12px;}
    .price-cell {font-size:24px;}
    .card {padding:22px; margin-bottom:18px;}
    h2 {font-size:24px; margin-bottom:20px;}
    h4{font-size:16px;}
    #backTopBtn{
        bottom:20px;
        right:16px;
        width:46px;
        height:46px;
    }
    .info-tag{
        font-size:13px;
        padding:7px 11px;
    }
    .filter-summary{
        max-height:160px;
    }
    .type-cell{
        min-width:90px;
        padding:0 12px;
        font-size:15px;
    }
    .price-cell{
        padding:0 14px;
    }
    .history-tag{
        max-width:95px;
    }
}

/* ===== 登录状态区 ===== */
.selftest-btn{
    font-size:12px;
    color:#6b21a8;
    background:#fff;
    border:1px solid rgba(107,33,168,0.3);
    padding:4px 12px;
    border-radius:999px;
    cursor:pointer;
    flex-shrink:0;
    font-weight:600;
}
.selftest-btn:active{ background:rgba(107,33,168,0.1); }
.ver-badge{
    font-size:11px;
    color:#6b21a8;
    background:rgba(107,33,168,0.08);
    border:1px solid rgba(107,33,168,0.2);
    padding:2px 8px;
    border-radius:999px;
    flex-shrink:0;
    font-weight:600;
}
.auth-area{
    display:flex;
    align-items:center;
    gap:10px;
    font-size:13px;
    color:#6b7280;
    flex-shrink:0;
}
.auth-link{
    color:#6b21a8;
    text-decoration:none;
    font-weight:600;
    padding:5px 10px;
    border-radius:8px;
    border:1px solid rgba(107,33,168,0.25);
    background:rgba(107,33,168,0.05);
    transition:background 0.2s;
}
.auth-link:hover{ background:rgba(107,33,168,0.12); }
.auth-user{
    color:#5b21b6;
    font-weight:600;
    max-width:150px;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}

/* ===== 页脚版本号 ===== */
.page-footer{
    text-align:center;
    font-size:12px;
    color:rgba(255,255,255,0.45);
    padding:18px 0 8px;
    letter-spacing:.3px;
}

/* ===== 底部固定 Tab 栏（始终可见，内容在中间滚动） ===== */
body{
    padding-bottom: 84px; /* 底部 tab 高度 + 安全区避让 */
}
.tab-bar{
    position: fixed;
    left: 0; right: 0; bottom: 0;
    background: #ffffff;
    border-top: 1px solid #e9e5f5;
    display: flex;
    z-index: 9998;
    box-shadow: 0 -4px 20px rgba(30,10,60,0.10);
    padding-bottom: env(safe-area-inset-bottom);
}
.tab-item{
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 9px 0 7px;
    font-size: 12px;
    color: #8b8a93;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: color .2s;
    min-height: 54px;
}
.tab-item .tab-ico{ font-size:21px; line-height:1; color:#b8b6c4; transition:color .2s; }
.tab-item .tab-ico svg{ display:block; }
.tab-item.active{ color: #6d28d9; font-weight: 600; }
.tab-item.active .tab-ico{ color: #6d28d9; }

/* 面板切换 */
.tab-panel{ display: none; }
.tab-panel.active{ display: block; }

/* ===== 我的板块 ===== */
.mine-card-head{
    display:flex;
    align-items:center;
    gap:12px;
    margin-bottom:6px;
}
.mine-avatar{
    width:48px; height:48px;
    border-radius:14px;
    background:linear-gradient(135deg,#7c3aed,#4c1d95);
    color:#fff;
    font-size:20px;
    font-weight:700;
    display:flex; align-items:center; justify-content:center;
    flex-shrink:0;
}
.mine-name{ font-size:17px; font-weight:700; color:#1f2937; }
.mine-sub{ font-size:12px; color:#8b8a93; margin-top:2px; }
.mine-item{
    display:flex;
    align-items:center;
    gap:10px;
    padding:14px 0;
    border-bottom:1px solid #f3f0fa;
}
.mine-item:last-child{ border-bottom:none; }
.mine-label{ flex:0 0 88px; font-size:13px; color:#6b7280; }
.mine-value{
    flex:1;
    font-size:14px;
    color:#1f2937;
    font-weight:500;
    word-break:break-all;
    min-width:0;
}
.mine-locked{
    font-size:11px;
    color:#9ca3af;
    background:#f3f4f6;
    padding:2px 8px;
    border-radius:999px;
    flex-shrink:0;
}
.mine-edit{
    flex-shrink:0;
    font-size:12px;
    color:#6d28d9;
    background:#f5f3ff;
    border:1px solid #ede9fe;
    padding:5px 12px;
    border-radius:8px;
    cursor:pointer;
    font-weight:600;
}
.mine-edit:active{ background:#ede9fe; }
.mine-edit.cancel{ color:#6b7280; background:#f3f4f6; border-color:#e5e7eb; }
.mine-edit.danger{ color:#b91c1c; background:#fef2f2; border-color:#fecaca; }
.mine-status{ font-size:13px; line-height:1.7; margin-top:12px; }
.mine-status.ok{ color:#1a7f37; }
.mine-status.err{ color:#c0392b; }
.mine-tip{ font-size:12px; color:#8b8a93; line-height:1.7; margin-top:8px; }
.mine-form-item{
    display:flex; flex-direction:column; gap:6px;
    margin-bottom:14px;
}
.mine-form-item label{ font-size:13px; color:#374151; font-weight:500; }
.mine-form-item input{
    border:1px solid #d1d5db;
    border-radius:10px;
    padding:11px 12px;
    font-size:14px;
    width:100%;
    outline:none;
    background:#f9fafb;
    transition:border-color .2s, background .2s;
    min-width:0;
}
.mine-form-item input:focus{ border-color:#6b21a8; background:#fff; }
.mine-code-row{ display:flex; gap:8px; }
.mine-code-row input{ flex:1; min-width:0; }
.mine-code-btn{
    flex:0 0 110px;
    border:none; border-radius:10px;
    background:linear-gradient(135deg,#7c3aed,#6b21a8);
    color:#fff; font-size:13px; font-weight:600;
    cursor:pointer; padding:0 8px; white-space:nowrap;
}
.mine-code-btn:disabled{ opacity:.5; cursor:not-allowed; }

/* 密码显示/隐藏（眼睛）——定位在输入框内部最右侧 */
.pwd-wrap{ position:relative; }
.pwd-wrap input{ width:100%; padding-right:44px; box-sizing:border-box; }
.pwd-eye{
    position:absolute; right:10px; top:50%;
    transform:translateY(-50%);
    width:32px; height:32px;
    display:flex; align-items:center; justify-content:center;
    background:none; border:none; color:#8b8a93;
    cursor:pointer; border-radius:8px; padding:0; margin:0;
    line-height:1; font-size:0;
    -webkit-appearance:none; appearance:none;
    -webkit-tap-highlight-color:transparent;
}
.pwd-eye:active{ background:#f0edf7; color:#6d28d9; }
.pwd-eye svg{ display:block; }
.mine-btn-save{
    width:100%;
    padding:13px;
    border:none; border-radius:10px;
    font-size:15px; font-weight:600; cursor:pointer;
    background:linear-gradient(135deg,#7c3aed,#6b21a8);
    color:#fff; margin-top:6px;
    transition:opacity .2s;
}
.mine-btn-save:disabled{ opacity:.5; cursor:not-allowed; }

/* 修改密码入口（先显示基本信息，点"修改密码"才弹出表单抽屉） */
.mine-pwd-entry{
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:16px;
    cursor:pointer;
    color:#374151;
    font-size:14px;
    font-weight:600;
    -webkit-tap-highlight-color:transparent;
}
.mine-pwd-entry:active{ background:#f5f3ff; }
.mine-pwd-arrow{ color:#b8b6c4; font-size:20px; line-height:1; }

/* ===== 订仓清单（占位） ===== */
.orders-empty{
    text-align:center;
    padding:44px 20px;
    color:#8b8a93;
    font-size:14px;
    line-height:1.8;
}
.orders-empty .orders-ico{
    font-size:40px;
    margin-bottom:10px;
    display:block;
}

/* ===== 订仓按钮 + 多选弹层 ===== */
.btn-order{
    width:100%;
    padding:13px;
    border:none; border-radius:12px;
    background:linear-gradient(135deg,#16a34a,#15803d);
    color:#fff; font-size:15px; font-weight:600; cursor:pointer;
    margin-top:14px; transition:opacity .2s;
}
.btn-order:active{ opacity:.85; }
.os-item{
    display:flex;
    align-items:center;
    gap:10px;
    background:#fbf9ff;
    border:1px solid #f1ecff;
    border-radius:12px;
    padding:12px 14px;
}
.os-chk{ display:flex; align-items:center; gap:8px; flex:1; min-width:0; cursor:pointer; }
.os-chk input{ width:18px; height:18px; accent-color:#7c3aed; flex-shrink:0; }
.os-type{ font-size:15px; font-weight:700; color:#1f2937; }
.os-price{ font-size:15px; font-weight:600; color:#7c3aed; flex-shrink:0; }
.os-qty{ display:flex; align-items:center; gap:6px; flex-shrink:0; }
.os-qty input{
    width:56px; height:38px; border:1px solid #d1d5db; border-radius:8px;
    text-align:center; font-size:15px; color:#111827; background:#fff;
}
.os-qty span{ font-size:12px; color:#8b8a93; }

/* 订仓弹层货物类型切换按钮（与 order.html 同款） */
.cls-btns { display:flex; flex-wrap:wrap; gap:8px; }
.cls-btn { padding:8px 14px; border:1px solid #d1d5db; border-radius:999px; background:#f9fafb; color:#374151; font-size:13px; font-weight:600; cursor:pointer; -webkit-tap-highlight-color:transparent; }
.cls-btn.on { background:#7c3aed; border-color:#7c3aed; color:#fff; }
.cls-btn:active { opacity:.8; }
