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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
                 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
    background: #0d1117;
    color: #e6edf3;
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 16px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 双栏布局 */
.two-column {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 32px;
    flex: 1;
}

.column-left {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.column-right {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

@media (max-width: 860px) {
    .two-column {
        grid-template-columns: 1fr;
    }
}

/* Header */
.header {
    margin-bottom: 12px;
}

.site-title {
    font-size: 24px;
    font-weight: 700;
    color: #58a6ff;
    margin-bottom: 20px;
    letter-spacing: 1px;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
}

.header-top .site-title {
    margin-bottom: 0;
}

.user-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-greeting {
    font-size: 13px;
    color: #8b949e;
}

.logout-btn {
    background: none;
    border: 1px solid #30363d;
    color: #8b949e;
    padding: 4px 12px;
    font-size: 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.logout-btn:hover {
    border-color: #f85149;
    color: #f85149;
    background: rgba(248, 81, 73, 0.08);
}

.report-link {
    background: #238636;
    color: #fff;
    padding: 4px 12px;
    font-size: 12px;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
}
.report-link:hover {
    background: #2ea043;
    text-decoration: none;
}

/* 股指区域 */
.indices-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 12px;
}

@media (max-width: 640px) {
    .indices-grid {
        grid-template-columns: 1fr;
    }
}

.indices-section {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 14px;
}

.section-title {
    font-size: 13px;
    font-weight: 600;
    color: #8b949e;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.indices-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.index-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    background: #0d1117;
    border-radius: 4px;
    font-size: 14px;
}

.index-name {
    color: #c9d1d9;
    font-weight: 500;
}

.index-price {
    font-weight: 600;
    margin-left: auto;
    margin-right: 12px;
}

.index-change {
    font-size: 13px;
    font-weight: 500;
    min-width: 80px;
    text-align: right;
}

.index-change.up { color: #f85149; }
.index-change.down { color: #3fb950; }

.update-time {
    font-size: 12px;
    color: #484f58;
    text-align: right;
    margin-top: 4px;
}

/* 热点区域 */
.main {
}

.hot-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hot-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #161b22;
    border: 1px solid #21262d;
    border-radius: 6px;
    text-decoration: none;
    color: #e6edf3;
    transition: background 0.2s;
}

.hot-item:hover {
    background: #1c2128;
    border-color: #30363d;
}

.hot-rank {
    font-size: 14px;
    font-weight: 700;
    color: #484f58;
    min-width: 28px;
    text-align: center;
}

.hot-rank.top-1 { color: #f0883e; }
.hot-rank.top-2 { color: #e6b450; }
.hot-rank.top-3 { color: #58a6ff; }

.hot-title {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
}

.hot-heat {
    font-size: 12px;
    color: #8b949e;
    white-space: nowrap;
}

/* Footer */
.footer {
    margin-top: 32px;
    padding: 20px 0;
    text-align: center;
    border-top: 1px solid #21262d;
}

.footer .beian-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    line-height: 1.6;
}

.footer .beian-item + .beian-item {
    margin-top: 4px;
}

.footer a {
    color: #484f58;
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s;
}

.footer a:hover {
    color: #58a6ff;
}

.footer .beian-icon {
    flex-shrink: 0;
}

/* Loading / Error */
.loading {
    color: #484f58;
    font-size: 13px;
    padding: 8px;
}

.error-msg {
    color: #f85149;
    font-size: 13px;
    padding: 8px;
}

/* ======== 登录页 ======== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0d1117 0%, #161b22 100%);
}

.login-box {
    width: 380px;
    padding: 40px 32px;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 12px;
    text-align: center;
}

.login-logo {
    width: 64px;
    height: 64px;
    line-height: 64px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, #58a6ff, #8250df);
    border-radius: 16px;
    font-size: 28px;
    font-weight: 700;
    color: #fff;
}

.login-title {
    font-size: 22px;
    font-weight: 700;
    color: #e6edf3;
    margin-bottom: 4px;
}

.login-subtitle {
    font-size: 14px;
    color: #8b949e;
    margin-bottom: 28px;
}

.login-form {
    text-align: left;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #c9d1d9;
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    padding: 10px 12px;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #e6edf3;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus {
    border-color: #58a6ff;
}

.form-group input::placeholder {
    color: #484f58;
}

.login-error {
    color: #f85149;
    font-size: 13px;
    margin-bottom: 12px;
    min-height: 20px;
}

.login-btn {
    width: 100%;
    padding: 10px 0;
    background: #238636;
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.login-btn:hover {
    background: #2ea043;
}

.login-btn:disabled {
    background: #1a5f2a;
    cursor: not-allowed;
}

.login-footer {
    margin-top: 24px;
    font-size: 12px;
    color: #484f58;
}

.login-footer .beian-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    line-height: 1.6;
}

.login-footer a {
    color: #484f58;
    text-decoration: none;
}

.login-footer a:hover {
    color: #58a6ff;
}

/* ======== 文件管理 ======== */

.file-section {
    margin-top: 24px;
}

.upload-area {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.upload-row {
    margin-bottom: 10px;
}

.upload-row:last-child {
    margin-bottom: 0;
}

.file-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.file-input {
    display: none;
}

.file-btn {
    display: inline-block;
    padding: 8px 16px;
    background: #21262d;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #c9d1d9;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.file-btn:hover {
    background: #30363d;
    border-color: #58a6ff;
}

.file-name {
    font-size: 13px;
    color: #8b949e;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.category-input {
    width: 100%;
    padding: 10px 12px;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #e6edf3;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.category-input:focus {
    border-color: #58a6ff;
}

.category-input::placeholder {
    color: #484f58;
}

.upload-btn {
    padding: 8px 20px;
    background: #238636;
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.upload-btn:hover {
    background: #2ea043;
}

.upload-btn:disabled {
    background: #1a5f2a;
    cursor: not-allowed;
}

.upload-status {
    font-size: 13px;
    margin-left: 12px;
}

.upload-status.success { color: #3fb950; }
.upload-status.error { color: #f85149; }

.cat-label {
    color: #c9d1d9;
    font-size: 13px;
    font-weight: 500;
    margin-right: 8px;
    white-space: nowrap;
}

.upload-actions {
    display: flex;
    align-items: center;
}

/* 文件列表 */
.file-list-area {
    margin-top: 4px;
}

.empty-msg {
    color: #484f58;
    font-size: 14px;
    padding: 24px;
    text-align: center;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
}

.file-category {
    margin-bottom: 16px;
}

.category-title {
    font-size: 15px;
    font-weight: 600;
    color: #58a6ff;
    margin-bottom: 8px;
    padding: 8px 12px;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px 6px 0 0;
    border-bottom: none;
}

.file-count {
    font-size: 12px;
    color: #8b949e;
    font-weight: normal;
}

.file-items {
    border: 1px solid #30363d;
    border-radius: 0 0 6px 6px;
    overflow: hidden;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #0d1117;
    border-bottom: 1px solid #21262d;
    transition: background 0.15s;
}

.file-item:last-child {
    border-bottom: none;
}

.file-item:hover {
    background: #161b22;
}

.file-preview {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 4px;
    overflow: hidden;
    background: #161b22;
}

.file-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #e6edf3;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.file-link:hover {
    color: #58a6ff;
}

.file-icon {
    font-size: 16px;
}

.file-name-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-meta {
    font-size: 12px;
    color: #484f58;
    margin-top: 2px;
}

.file-delete-btn {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: #484f58;
    font-size: 14px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.file-delete-btn:hover {
    background: rgba(248, 81, 73, 0.15);
    color: #f85149;
}

/* ======================== 股票池 ======================== */

.stockpool-section {
    margin-top: 12px;
}

.stockpool-tools {
    float: right;
    font-size: 14px;
    display: flex;
    gap: 4px;
}

.sp-btn {
    background: #21262d;
    border: 1px solid #30363d;
    color: #c9d1d9;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
    line-height: 1.4;
}

.sp-btn:hover {
    background: #30363d;
}

.sp-btn-primary {
    background: #238636;
    border-color: #2ea043;
    color: #fff;
}
.sp-btn-primary:hover {
    background: #2ea043;
}

.sp-btn-cancel {
    background: #21262d;
    border-color: #30363d;
}

.stockpool-content {
    margin-top: 4px;
}

/* 分类容器 */
.sp-category {
    margin-bottom: 12px;
}

.sp-category-title {
    font-size: 14px;
    font-weight: 600;
    color: #8b949e;
    margin-bottom: 6px;
    padding: 4px 8px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sp-category-title .sp-cat-count {
    font-size: 12px;
    color: #484f58;
    font-weight: normal;
}

.sp-category-title.sp-cat-above {
    border-left: 3px solid #f85149;
    color: #f85149;
}

.sp-category-title.sp-cat-between {
    border-left: 3px solid #d29922;
    color: #d29922;
}

.sp-category-title.sp-cat-below {
    border-left: 3px solid #3fb950;
    color: #3fb950;
}

/* 股票卡片 */
.sp-card {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 6px 10px;
    margin-bottom: 4px;
    cursor: default;
    transition: border-color 0.2s;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
}

.sp-card:hover {
    border-color: #484f58;
}

.sp-card.sp-delete-mode {
    cursor: pointer;
    user-select: none;
}

.sp-card.sp-delete-mode:hover {
    border-color: #f85149;
    background: rgba(248, 81, 73, 0.05);
}

.sp-card.sp-selected {
    border-color: #f85149;
    background: rgba(248, 81, 73, 0.1);
}

/* 股票行 */
.sp-rank {
    font-size: 11px;
    color: #484f58;
    min-width: 18px;
    text-align: right;
    font-family: 'SF Mono', 'Monaco', 'Menlo', monospace;
    flex-shrink: 0;
}

.sp-code {
    font-size: 13px;
    color: #484f58;
    font-family: 'SF Mono', 'Monaco', 'Menlo', monospace;
    white-space: nowrap;
}

.sp-data-item {
    display: inline-flex;
    align-items: center;
    gap: 1px;
    white-space: nowrap;
}

.sp-name {
    font-size: 13px;
    font-weight: 600;
    color: #e6edf3;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 0;
}

.sp-tag-st {
    display: inline-block;
    font-size: 11px;
    background: #f85149;
    color: #fff;
    padding: 0 5px;
    border-radius: 3px;
    font-weight: 600;
    line-height: 1.5;
}

.sp-data-label {
    color: #484f58;
    font-size: 12px;
}

.sp-data-value {
    font-family: 'SF Mono', 'Monaco', 'Menlo', monospace;
    font-size: 13px;
    font-weight: 500;
    color: #c9d1d9;
}

.sp-data-value.up {
    color: #f85149;
}
.sp-data-value.down {
    color: #3fb950;
}
.sp-data-value.sp-added-time {
    color: #8b949e;
    font-size: 12px;
}

.sp-checkbox {
    width: 16px;
    height: 16px;
    accent-color: #f85149;
    margin-right: 4px;
    flex-shrink: 0;
    cursor: pointer;
}

/* 删除按钮栏 */
.sp-delete-bar {
    display: none;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 8px;
    align-items: center;
    gap: 8px;
}

.sp-delete-bar.active {
    display: flex;
}

.sp-delete-count {
    font-size: 13px;
    color: #8b949e;
    flex: 1;
}

.sp-delete-confirm {
    background: #da3633;
    border: 1px solid #f85149;
    color: #fff;
    padding: 4px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

.sp-delete-confirm:hover {
    background: #f85149;
}

.sp-delete-cancel {
    background: transparent;
    border: 1px solid #30363d;
    color: #8b949e;
    padding: 4px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

/* 空状态 */
.sp-empty {
    text-align: center;
    padding: 20px;
    color: #484f58;
    font-size: 14px;
}

/* 弹窗 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-box {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 12px;
    width: 90%;
    max-width: 480px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #21262d;
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #e6edf3;
}

.modal-close {
    cursor: pointer;
    color: #484f58;
    font-size: 18px;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.2s;
}
.modal-close:hover {
    color: #e6edf3;
}

.modal-body {
    padding: 16px 20px;
}

.modal-tip {
    font-size: 13px;
    color: #8b949e;
    margin-bottom: 8px;
}

.stock-codes-input {
    width: 100%;
    min-height: 100px;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #e6edf3;
    padding: 10px;
    font-size: 14px;
    font-family: 'SF Mono', 'Monaco', 'Menlo', monospace;
    resize: vertical;
    outline: none;
}

.stock-codes-input:focus {
    border-color: #58a6ff;
}

.add-stock-status {
    margin-top: 8px;
    font-size: 13px;
}
.add-stock-status.success { color: #3fb950; }
.add-stock-status.error { color: #f85149; }

.modal-footer {
    padding: 12px 20px;
    border-top: 1px solid #21262d;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* 更新提示时间 */
.stockpool-update {
    font-size: 11px;
    color: #484f58;
    text-align: right;
    margin-top: 4px;
}
