/* 基础重置和兼容性处理 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
    background-color: #f5f7fa;
    color: #2c3e50;
    padding: 20px;
    min-height: 100vh;
}

/* 容器样式 */
.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 24px;
}

/* 夜间模式 */
body.night-mode {
    background-color: #0a1929;
    color: #e3e4e6;
}
body.night-mode .container {
    background: #132f4c;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}
body.night-mode .card {
    background: #132f4c;
    border-color: #1e4976;
    color: #e3e4e6;
}
body.night-mode .header,
body.night-mode h2,
body.night-mode th,
body.night-mode td,
body.night-mode footer {
    border-color: #1e4976;
    color: #e3e4e6;
}
body.night-mode th {
    color: #8c94a7;
}
body.night-mode .logo {
    color: #8c94a7;
}
body.night-mode .stock-title p {
    color: #8c94a7;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e1e8ed;
}
.logo {
    width: 131px;
    height: 66px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: #5a6c7d;
    font-size: 14px;
}
.stock-title h1 {
    font-size: 28px;
    font-weight: 700;
}
.stock-title .symbol {
    color: #3498db;
    font-weight: 600;
}
.stock-title p {
    color: #5a6c7d;
    margin-top: 4px;
}

/* Content 布局 */
.content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

/* 卡片 */
.card {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid #e1e8ed;
}
h2 {
    font-size: 20px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e1e8ed;
}

/* 股价信息 */
.price-section {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
}
.current-price {
    font-size: 36px;
    font-weight: 700;
    margin-right: 16px;
}
.price-change {
    font-size: 18px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 6px;
    background-color: rgba(234, 57, 67, 0.1);
    color: #ea3943;
}
.price-up {
    background-color: rgba(46, 204, 113, 0.1);
    color: #2ecc71;
}
.price-down {
    background-color: rgba(234, 57, 67, 0.1);
    color: #ea3943;
}

/* 表格 */
table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    word-wrap: break-word;
}
th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e1e8ed;
}
th {
    color: #5a6c7d;
    font-weight: 600;
    font-size: 14px;
}
td {
    font-weight: 500;
}

/* 业务构成 */
.business-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e1e8ed;
}
.business-item:last-child {
    border-bottom: none;
}
.business-name {
    font-weight: 500;
}
.business-value {
    font-weight: 600;
}

/* 区域分布 */
.region-item {
    margin-bottom: 16px;
}
.region-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}
.region-bar {
    height: 8px;
    background-color: #e1e8ed;
    border-radius: 4px;
    overflow: hidden;
}
.region-fill {
    height: 100%;
    border-radius: 4px;
}
.region-1 {
    width: 48.85%;
    background-color: #3498db;
}
.region-2 {
    width: 29.71%;
    background-color: #9b59b6;
}
.region-3 {
    width: 21.44%;
    background-color: #2ecc71;
}

.price-up {
    background-color: rgba(16, 185, 129, 0.1) !important;
    color: #ea3943 !important;
}

.price-down {
    background-color: rgba(234, 57, 67, 0.1) !important;
    color: #10b981 !important;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    color: #5a6c7d;
    font-size: 14px;
    border-top: 1px solid #e1e8ed;
}

/* 移动端适配 */
@media screen and (max-width: 768px) {
    body { padding: 10px; }

    .container {
        width: 100%;
        max-width: 100%;
        padding: 16px;
        overflow: hidden;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .logo {
        width: 100px;
        height: 50px;
        font-size: 12px;
    }

    .stock-title h1 {
        font-size: 24px;
    }

    .stock-title .symbol {
        display: block;
        margin-top: 4px;
    }

    .content {
        display: flex !important;
        flex-direction: column !important;
    }

    .left-column, .right-column {
        width: 100% !important;
    }

    .card {
        margin-bottom: 20px;
        padding: 16px;
    }

    .price-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .current-price {
        font-size: 24px;
    }

    .price-change {
        font-size: 14px;
    }

    h2 {
        font-size: 18px;
    }

    th, td {
        padding: 8px 12px;
        font-size: 14px;
    }
}

/* 超小屏幕适配 */
@media screen and (max-width: 480px) {
    .container { padding: 12px; }
    .card { padding: 12px; }
    .current-price { font-size: 20px; }
    .price-change { font-size: 12px; }
    h2 { font-size: 16px; }
}

/* 清除浮动 */
.clearfix:after {
    content: "";
    display: table;
    clear: both;
}

/* 打印样式 */
@media print {
    body { background: white !important; color: black !important; padding: 0; }
    .container { box-shadow: none; border: 1px solid #ccc; }
}