/* 全局重置与字体 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #0D47A1;
    --primary-dark: #002171;
    --primary-light: #5472D3;
    --accent: #E53935;
    --accent-blue: #1E88E5;
    --positive: #E53935;
    --negative: #1E88E5;
    --bg: #F5F7FA;
    --card-bg: #FFFFFF;
    --text-primary: #1A1A2E;
    --text-secondary: #5A5A7A;
    --text-muted: #8E8EA0;
    --border: #E8ECF2;
    --shadow: 0 2px 12px rgba(0,0,0,0.06);
    --radius: 16px;
    --radius-sm: 10px;
    --safe-bottom: env(safe-area-inset-bottom, 20px);
}

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #E8EDF2;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    color: var(--text-primary);
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
}

/* 手机容器 */
.app-container {
    width: 100%;
    max-width: 430px;
    height: 100vh;
    height: 100dvh;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 40px rgba(0,0,0,0.15);
    border-radius: 0;
}

@media (min-width: 430px) {
    .app-container {
        border-radius: 30px;
        height: 95vh;
        height: 95dvh;
    }
}

/* 状态栏 */
.status-bar {
    display: flex;
    justify-content: space-between;
    padding: 12px 20px 4px;
    font-size: 13px;
    font-weight: 600;
    background: var(--bg);
    color: var(--text-primary);
}

.status-icons {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 头部 */
.app-header {

    padding: 10px;
    background-color: #FFFFFF;
    color: #FFFFFF;
   
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
   
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon {
    font-size: 24px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.logo-text {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.icon-btn {
    background: #e6e6e6;
    border: none;
    color: white;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(4px);
    position: relative;
}

.notification-btn .badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--accent);
    color: white;
    font-size: 10px;
    font-weight: 700;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid white;
}

/* 账户卡片 */
.account-card {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(12px);
    border-radius: 18px;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(255,255,255,0.2);
}

.account-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.account-label {
    font-size: 12px;
    opacity: 0.8;
    font-weight: 400;
}

.balance-amount {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.balance-change {
    font-size: 13px;
    font-weight: 600;
    margin-left: 6px;
}

.balance-change.positive,
.positive {
    color: #FF6B6B;
}

.balance-change.negative,
.negative {
    color: #64B5F6;
}

.account-detail-row {
    display: flex;
    gap: 8px;
    font-size: 11px;
    opacity: 0.9;
    margin-top: 2px;
}

.detail-item strong {
    font-weight: 700;
}

.divider {
    opacity: 0.5;
}

.account-chart-mini {
    width: 80px;
    height: 45px;
}

.mini-chart {
    width: 100%;
    height: 100%;
}

/* 主内容 */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px 16px 8px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.main-content::-webkit-scrollbar {
    display: none;
}

/* 部分 */
.section {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 18px 16px;
    box-shadow: var(--shadow);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.section-title {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.text-btn {
    background: none;
    border: none;
    color: var(--primary-light);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
}

/* 指数横向滚动 */
.indices-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.indices-scroll::-webkit-scrollbar {
    display: none;
}

.index-card {
    min-width: 130px;
    background: #F8FAFC;
    border-radius: var(--radius-sm);
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    scroll-snap-align: start;
    border: 1px solid var(--border);
}

.index-name-row {
    display: flex;
    align-items: center;
    gap: 5px;
}

.index-flag {
    font-size: 16px;
}

.index-name {
    font-weight: 700;
    font-size: 14px;
}

.index-value {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.3px;
}

.index-change {
    font-size: 12px;
    font-weight: 600;
}

.index-sparkline {
    width: 100%;
    height: 24px;
    margin-top: 4px;
}

/* 标签按钮 */
.tab-buttons {
    display: flex;
    gap: 6px;
    background: #F0F2F5;
    padding: 4px;
    border-radius: 10px;
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: 0.2s;
}

.tab-btn.active {
    background: white;
    color: var(--primary-dark);
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

/* 股票列表 */
.stock-list {
    display: flex;
    flex-direction: column;
}

.stock-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.15s;
}

.stock-item:active {
    background: #F5F7FA;
}

.stock-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.stock-logo {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #E8EDF2;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}

.stock-info {
    display: flex;
    flex-direction: column;
}

.stock-name {
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 2px;
}

.stock-code {
    font-size: 11px;
    color: var(--text-muted);
}

.stock-right {
    text-align: right;
}

.stock-price {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 2px;
}

.stock-change {
    font-size: 13px;
    font-weight: 600;
}

.more-stocks-btn {
    width: 100%;
    margin-top: 12px;
    padding: 12px;
    background: #F0F4FF;
    border: none;
    border-radius: 12px;
    color: var(--primary);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
}

/* 新闻 */
.news-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.news-item {
    display: flex;
    gap: 14px;
    align-items: center;
}

.news-text h4 {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 4px;
}

.news-meta {
    font-size: 11px;
    color: var(--text-muted);
}

.news-thumb {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    flex-shrink: 0;
}

.bottom-spacer {
    height: 70px;
}

/* 底部导航 */
.bottom-nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: white;
    padding: 8px 12px calc(8px + var(--safe-bottom));
    border-top: 1px solid var(--border);
    box-shadow: 0 -2px 12px rgba(0,0,0,0.04);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 12px;
    transition: 0.2s;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item svg {
    transition: 0.2s;
}

/* 模态框 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 100;
    visibility: hidden;
    opacity: 0;
    transition: 0.25s ease;
}

.modal-overlay.active {
    visibility: visible;
    opacity: 1;
}

.modal-sheet {
    width: 100%;
    max-width: 430px;
    background: white;
    border-radius: 24px 24px 0 0;
    padding: 12px 20px 30px;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 -8px 30px rgba(0,0,0,0.15);
}

.modal-overlay.active .modal-sheet {
    transform: translateY(0);
}

.modal-handle {
    width: 40px;
    height: 4px;
    background: #D1D5DB;
    border-radius: 2px;
    margin: 0 auto 18px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.modal-header h3 {
    font-size: 18px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--text-secondary);
}

.modal-price-row {
    margin-bottom: 20px;
}

.modal-price {
    font-size: 24px;
    font-weight: 800;
    margin-right: 10px;
}

.trade-type-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.trade-type-btn {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--border);
    background: white;
    border-radius: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    cursor: pointer;
}

.trade-type-btn.active {
    border-color: var(--accent);
    color: var(--accent);
    background: #FFEBEE;
}

.trade-input-group {
    margin-bottom: 20px;
}

.trade-input-group label {
    font-size: 13px;
    font-weight: 600;
    display: block;
    margin-bottom: 8px;
}

.quantity-input {
    display: flex;
    align-items: center;
    gap: 10px;
}

.qty-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #F0F2F5;
    border: none;
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
}

.quantity-input input {
    flex: 1;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 10px;
    text-align: center;
    font-weight: 700;
    font-size: 16px;
    pointer-events: none;
    background: #FAFBFC;
}

.trade-summary {
    background: #F8FAFC;
    padding: 14px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.trade-submit-btn {
    width: 100%;
    padding: 16px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 14px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
}

.trade-disclaimer {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 10px;
}

/* 吐司 */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: #1A1A2E;
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 200;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
}

.mainMenuGroup
{
    display: flex;
    flex-wrap: wrap-reverse;
}
.mainMenuGroup table{
    width:100%;
}
.mainMenuGroup table td{
    width:33.33%;
    text-align: center;
    color: var(--text-muted);
    padding:2px;
}
.mainMenuGroup table span{
    color: var(--text-primary);
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 2px;
}
.mainMenuGroup table div{
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    padding: 5px 12px;
    background: #F8FAFC;
}

 /* 검색 오버레이 */
 .search-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 100;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.2s, opacity 0.25s;
}
.search-overlay.active {
    visibility: visible;
    opacity: 1;
}
.search-panel {
    width: 100%;
    max-width: 430px;
    background: white;
    border-radius: 28px 28px 0 0;
    padding: 18px 18px 24px;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}
.search-overlay.active .search-panel {
    transform: translateY(0);
}

.panel-handle {
    width: 40px; height: 4px;
    background: #D1D5DB;
    border-radius: 2px;
    margin: 0 auto 14px;
}

/* 검색 입력 + 버튼 그룹 */
.search-bar-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}
.search-input-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    background: #F2F4F7;
    border-radius: 14px;
    padding: 6px 12px;
}
.search-input-wrap input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 16px;
    padding: 10px 0;
    outline: none;
}
.clear-btn {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-muted);
    cursor: pointer;
    display: none;
    margin-left: 4px;
}
.clear-btn.visible { display: block; }

.search-submit-btn {
    background: var(--primary);
    border: none;
    color: white;
    font-weight: 700;
    font-size: 14px;
    padding: 12px 16px;
    border-radius: 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}

.search-submit-btn01 {
    background: #F7941C;
    border: none;
    color: white;
    font-weight: 700;
    font-size: 14px;
    padding: 12px 16px;
    border-radius: 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}

.search-submit-btn:active { background: #002171; }

/* 인기 태그 */
.trending-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}
.trending-tag {
    background: #F0F4FF;
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    color: var(--text-primary);
}

/* 결과 리스트 */
.result-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}
.result-logo {
    width: 38px; height: 38px;
    border-radius: 10px;
    background: #E8EDF2;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--primary);
}
.result-info { flex: 1; }
.result-name { font-weight: 700; font-size: 15px; }
.result-code { font-size: 11px; color: var(--text-muted); }
.result-price { font-weight: 700; text-align: right; }
.result-change { font-size: 12px; font-weight: 600; }
.positive { color: var(--positive); }
.negative { color: var(--negative); }

.no-result {
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
}

a:link, a:visited {color:#1A1A2E;text-decoration:none}
a:hover, a:focus, a:active {color:crimson;text-decoration:none}
/* 상단 바 */
.top-bar {
    background: linear-gradient(145deg, #0A1F5C 0%, #132D7A 100%);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    color: white;
    box-shadow: 0 4px 12px rgba(10,31,92,0.2);
}

.top-title {
    font-size: 15px;
    font-weight: 400;
}