* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'PingFang SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Microsoft YaHei', sans-serif;
    background: url('./assets/images/bg_main.png') no-repeat center top fixed;
    background-size: cover;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* ===== 装饰元素 ===== */
.deco {
    position: fixed;
    z-index: 20;
    pointer-events: none;
    user-select: none;
}

.deco-leaf {
    top: -10px;
    right: 0;
    width: min(42vw, 620px);
    height: auto;
}

.deco-record {
    bottom: 0;
    left: 0;
    width: min(24vw, 330px);
    height: auto;
}

.deco-robot {
    bottom: 0;
    right: 0;
    width: min(27vw, 390px);
    height: auto;
}

.container {
    max-width: 1560px;
    margin: 0 auto;
    padding: 40px 56px 72px;
    position: relative;
    z-index: 2;
}

/* ===== 头部 Logo + 主标题 ===== */
.header-new {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 150px;
    margin-bottom: 8px;
}

.brand-logo {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 62px;
    width: auto;
}

.brand-title {
    height: 150px;
    width: auto;
    max-width: 60%;
    object-fit: contain;
}

/* ===== 蓝色徽章 / 按钮 ===== */
.timer-badge {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #3E7FD6 0%, #5A9DD8 100%);
    border-radius: 14px;
    padding: 10px 22px;
    box-shadow: 0 3px 10px rgba(51, 117, 187, 0.35);
    white-space: nowrap;
}

.timer-label {
    color: #fff;
    font-size: 20px;
    font-weight: 500;
}

.timer-value {
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    margin-left: 4px;
    min-width: 56px;
    text-align: left;
    font-family: 'Courier New', monospace;
}

.admin-btn {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #3E7FD6 0%, #5A9DD8 100%);
    border-radius: 14px;
    padding: 10px 30px;
    box-shadow: 0 3px 10px rgba(51, 117, 187, 0.35);
    cursor: pointer;
    transition: all 0.3s;
    color: #fff;
    font-size: 20px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.admin-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(51, 117, 187, 0.45);
}

/* ===== 主内容区（红框 + 米黄内衬） ===== */
.main-content {
    background: linear-gradient(135deg, #C62828 0%, #9E1414 100%);
    border-radius: 34px;
    padding: 20px;
    position: relative;
    box-shadow: 0 12px 30px rgba(120, 20, 20, 0.35);
}

.main-content::before {
    content: '';
    position: absolute;
    top: 14px;
    left: 14px;
    right: 14px;
    bottom: 14px;
    background: linear-gradient(160deg, #FDF3DC 0%, #FCE3B4 100%);
    border-radius: 22px;
    z-index: 0;
}

.main-content > * {
    position: relative;
    z-index: 1;
}

/* ===== 分区标题栏 ===== */
.section-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 56px;
    margin: 6px 24px 18px;
}

.section-header .timer-badge {
    position: absolute;
    left: 0;
}

.section-header .admin-btn {
    position: absolute;
    right: 0;
}

.section-title {
    position: relative;
    z-index: 2;
    font-size: 30px;
    font-weight: 700;
    color: #1a1a1a;
    -webkit-text-stroke: 4px #FFFFFF;
    paint-order: stroke fill;
    text-align: center;
    white-space: nowrap;
    padding: 0 26px;
    display: inline-flex;
    align-items: center;
}

.section-title::before,
.section-title::after {
    content: '';
    width: 70px;
    height: 2px;
    background: linear-gradient(90deg, rgba(180, 150, 90, 0), rgba(180, 150, 90, 0.55));
    -webkit-text-stroke: 0;
}

.section-title::before {
    margin-right: 18px;
    transform: scaleX(-1);
}

.section-title::after {
    margin-left: 18px;
}

/* ===== 股票行 ===== */
.stocks-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 26px;
    margin: 0 24px 20px;
}

/* ===== 股票卡片 ===== */
.stock-card-new {
    background: #FFFFFF;
    border-radius: 16px;
    padding: 20px 22px;
    box-shadow: 0 4px 12px rgba(150, 110, 40, 0.22);
    cursor: pointer;
    transition: all 0.25s ease;
    height: 230px;
    display: flex;
    flex-direction: column;
}

.stock-card-new:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 22px rgba(150, 110, 40, 0.32);
}

.stock-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.stock-name-new {
    font-size: 23px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 30px;
}

.stock-code-badge {
    background: #F99400;
    border-radius: 8px;
    padding: 2px 14px;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    line-height: 22px;
    min-width: 52px;
    text-align: center;
    letter-spacing: 1px;
}

.stock-code-badge.etf {
    background: #7E2ECE;
}

.stock-info {
    display: flex;
    flex-direction: column;
    margin-bottom: 6px;
}

.stock-price-new {
    font-size: 30px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 40px;
}

.stock-change-new {
    font-size: 17px;
    font-weight: 700;
    line-height: 24px;
}

.price-up-new {
    color: #E63946;
}

.price-down-new {
    color: #2FB84E;
}

.price-flat-new {
    color: #888;
}

.stock-chart-new {
    height: 84px;
    margin-top: auto;
    flex: 1;
}

.stock-chart-new canvas {
    max-height: 100%;
}

/* ===== 详情弹窗 ===== */
.stock-detail-modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: url('./assets/images/bg_main.png') no-repeat center top fixed;
    background-size: cover;
    overflow-y: auto;
}

.stock-detail-modal::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(30, 20, 10, 0.25);
    z-index: -1;
}

.modal-content {
    background: linear-gradient(135deg, #C62828 0%, #9E1414 100%);
    margin: 40px auto;
    padding: 20px;
    width: 90%;
    max-width: 1400px;
    border-radius: 34px;
    position: relative;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.modal-inner {
    background: #FFFFFF;
    border-radius: 22px;
    display: flex;
    height: min(620px, calc(100vh - 140px));
    overflow: hidden;
}

/* 关闭按钮 */
.close {
    position: absolute;
    right: 34px;
    top: 34px;
    width: 44px;
    height: 44px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #3E7FD6;
    border-radius: 50%;
    transition: all 0.3s;
    box-shadow: 0 3px 10px rgba(59, 130, 246, 0.45);
}

.close::before,
.close::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 3px;
    background: #FFFFFF;
    border-radius: 2px;
}

.close::before { transform: rotate(45deg); }
.close::after { transform: rotate(-45deg); }

.close:hover {
    background: #2563EB;
    transform: scale(1.08);
}

/* 左侧黄色面板 */
.modal-left {
    background: linear-gradient(180deg, #F7D07E 0%, #F3C15E 100%);
    width: 400px;
    border-radius: 22px 0 0 22px;
    padding: 40px 28px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.modal-left-logo {
    width: 260px;
    height: auto;
    margin-bottom: 40px;
}

.detail-info {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 2;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 22px;
    background: #FFFFFF;
    border-radius: 10px;
    height: 54px;
}

.info-label {
    color: #1a1a1a;
    font-size: 23px;
    font-weight: 700;
}

.info-value {
    font-weight: 700;
    font-size: 23px;
    color: #1a1a1a;
}

/* 无锡男孩吉祥物 */
.modal-left-qr {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 320px;
    height: auto;
    z-index: 1;
}

/* 右侧内容区 */
.modal-right {
    flex: 1;
    padding: 40px 40px 40px 44px;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.detail-header {
    display: flex;
    align-items: baseline;
    margin-bottom: 16px;
}

.detail-stock-name {
    font-size: 42px;
    font-weight: 700;
    color: #1a1a1a;
}

.detail-stock-code {
    font-size: 30px;
    color: #888;
    margin-left: 12px;
}

.detail-price-section {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    gap: 20px;
}

.detail-current-price {
    font-size: 48px;
    font-weight: 700;
}

.detail-change-badge {
    background: #E63946;
    border-radius: 10px;
    padding: 8px 16px;
    color: #FFFFFF;
    font-size: 22px;
    font-weight: 700;
}

.detail-change-badge.negative {
    background: #2FB84E;
}

.detail-chart {
    flex: 1;
    min-height: 0;
    background: #FFFFFF;
    border: 1px solid #EFE7D6;
    border-radius: 16px;
    padding: 24px 30px;
    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.04);
    position: relative;
}

.detail-chart canvas {
    width: 100% !important;
    height: 100% !important;
}

/* ===== 响应式 ===== */
@media (max-width: 1400px) {
    .stocks-row {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }
    .deco-leaf { width: 34vw; }
}

@media (max-width: 1100px) {
    .container { padding: 30px 28px 60px; }
    .stocks-row { grid-template-columns: repeat(3, 1fr); gap: 16px; }
    .brand-title { height: 110px; }
    .header-new { min-height: 110px; }
    .main-content { padding: 16px; }
}

@media (max-width: 768px) {
    .container { padding: 20px 14px 50px; }
    .stocks-row { grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 0 8px 16px; }

    .header-new {
        flex-direction: column;
        min-height: auto;
        gap: 12px;
        margin-bottom: 12px;
    }
    .brand-logo { position: static; transform: none; height: 44px; }
    .brand-title { height: 72px; max-width: 90%; }

    .main-content { padding: 12px; border-radius: 24px; }
    .main-content::before { top: 10px; left: 10px; right: 10px; bottom: 10px; border-radius: 16px; }

    .section-header {
        flex-wrap: wrap;
        height: auto;
        gap: 10px;
        margin: 6px 8px 12px;
    }
    .section-header .timer-badge,
    .section-header .admin-btn { position: static; }
    .section-title { order: -1; width: 100%; font-size: 22px; -webkit-text-stroke: 2px #fff; }
    .section-title::before, .section-title::after { width: 40px; }

    .timer-label, .timer-value { font-size: 15px; }
    .admin-btn { font-size: 15px; padding: 8px 18px; }

    .stock-card-new { height: auto; min-height: 190px; padding: 16px; }
    .stock-name-new { font-size: 18px; }
    .stock-code-badge { font-size: 14px; padding: 1px 10px; min-width: 46px; }
    .stock-price-new { font-size: 24px; }
    .stock-change-new { font-size: 14px; }
    .stock-chart-new { height: 64px; }

    .deco-leaf { width: 40vw; }
    .deco-record { width: 34vw; }
    .deco-robot { width: 36vw; }

    /* 弹窗 */
    .modal-content { margin: 20px auto; width: 95%; padding: 14px; border-radius: 24px; }
    .modal-inner { flex-direction: column; height: auto; border-radius: 16px; }
    .modal-left { width: 100%; border-radius: 16px 16px 0 0; padding: 24px 16px 0; }
    .modal-left-logo { width: 200px; margin-bottom: 24px; }
    .info-item { padding: 8px 16px; height: 46px; }
    .info-label, .info-value { font-size: 18px; }
    .modal-left-qr { position: static; transform: none; width: 200px; margin-top: 16px; }
    .modal-right { padding: 24px 16px; }
    .detail-stock-name { font-size: 28px; }
    .detail-stock-code { font-size: 20px; }
    .detail-current-price { font-size: 32px; }
    .detail-change-badge { font-size: 16px; padding: 6px 10px; }
    .detail-chart { min-height: 260px; padding: 16px; }
    .close { right: 18px; top: 18px; width: 34px; height: 34px; }
    .close::before, .close::after { width: 17px; }
}

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