/* Stock List Components - Two Line Layout */

.stock-row {
    display: flex;
    flex-direction: column;
    padding: 14px 16px;
    background: #fff;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.2s;
}

.swipe-wrapper {
    background: #fff;
    border-bottom: 1px solid #f1f5f9;
}

/* Line 1: Main Header Grid */
.stock-row-header {
    display: grid;
    align-items: center;
    width: 100%;
    gap: 8px;
}

/* 3-column equal distribution for Market */
#page-market .stock-row-header {
    grid-template-columns: repeat(3, 1fr);
    /* Equal columns per user requirement */
}

/* 4-column equal distribution for Holdings/Simulation */
#page-holdings .stock-row-header,
#page-simulation .stock-row-header {
    grid-template-columns: 2fr 1fr 1fr 1fr;
}

.stock-row-title {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    align-items: flex-start;
}

.stock-row-name-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
    /* Tighter */
    overflow: hidden;
    width: 100%;
}

.stock-row-title .name {
    font-size: 16px;
    /* Unified size base */
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Red label next to name: e.g., 1连板 */
.stock-name-label {
    padding: 1px 4px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    border-radius: 4px;
    font-weight: 600;
    flex-shrink: 0;
}

/* Line 2 (Attached to stock name) Sub-info pinning */
.stock-row-subtext {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
    white-space: nowrap;
}

.stock-row-item {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.stock-row-price,
.stock-row-change,
.stock-row-profit {
    font-size: 16px;
    /* Identical font size for all data columns */
    font-weight: 700;
    text-align: right;
    font-family: 'DIN Alternate', 'Helvetica Neue', Helvetica, Arial, sans-serif !important;
    white-space: nowrap;
}

.stock-row-price {
    color: #1e293b;
}

.stock-row-change,
.stock-row-profit {
    margin-top: 2px;
}

/* Dash Divider between header and tags */
.stock-row-divider {
    height: 1px;
    width: 100%;
    border-top: 1px dashed rgba(203, 213, 225, 0.5);
    margin: 10px 0;
}

/* Line 3: Tags / Status */
.stock-row-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.text-up {
    color: #dc2626;
}

.text-down {
    color: #10b981;
}

.text-flat {
    color: #94a3b8;
}

/* ═══ Minimal Flat Tags ═══ */
.tag-capsule {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 700;
    margin-right: 4px;
    white-space: nowrap;
    letter-spacing: 0.2px;
    line-height: 18px;
}

.capsule-red {
    background: rgba(239, 68, 68, 0.08);
    color: #dc2626;
}

.capsule-orange {
    background: rgba(249, 115, 22, 0.08);
    color: #ea580c;
}

.capsule-blue {
    background: rgba(59, 130, 246, 0.08);
    color: #2563eb;
}

.capsule-gray {
    background: rgba(100, 116, 139, 0.06);
    color: #64748b;
}

.capsule-green {
    background: rgba(16, 185, 129, 0.08);
    color: #059669;
}

.capsule-purple {
    background: rgba(139, 92, 246, 0.08);
    color: #7c3aed;
}

.dot-red::before {
    content: '';
    display: inline-block;
    width: 5px;
    height: 5px;
    background: #dc2626;
    border-radius: 50%;
    margin-right: 3px;
}

/* --- ZT Specific Layout --- */
.stock-row-zt {
    background: #fff7f6;
    padding: 16px;
    border-bottom: 1px solid #fee2e2;
}

.zt-name-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

.zt-row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.zt-name-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.zt-name {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
}

.zt-label {
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.zt-price-wrap {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.zt-strength {
    font-size: 13px;
    color: #dc2626;
}

.zt-price {
    font-size: 22px;
    font-weight: 700;
    color: #ef4444;
    font-family: 'DIN Alternate', 'Helvetica Neue', Helvetica, Arial, sans-serif !important;
}

.zt-row-middle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.zt-subtext {
    font-size: 13px;
    color: #94a3b8;
}

.zt-change {
    font-size: 15px;
    font-weight: 700;
    font-family: 'DIN Alternate', 'Helvetica Neue', Helvetica, Arial, sans-serif !important;
}

.zt-row-tags {
    margin-top: 12px;
    display: flex;
    gap: 8px;
}