/* 重新设计的配色方案 */
:root {
    --primary: #2563eb;       /* 蓝色 - 主色调 */
    --primary-dark: #1d4ed8;  /* 深蓝色 */
    --secondary: #4f46e5;     /* 靛蓝色 - 次要色调 */
    --success: #059669;       /* 绿色 */
    --info: #0284c7;          /* 天蓝色 */
    --warning: #f59e0b;       /* 橙色 */
    --danger: #dc2626;        /* 红色 */
    --dark: #1e293b;          /* 暗蓝灰 */
    --light: #f8fafc;         /* 浅灰 */
    --light-hover: #f1f5f9;   /* 浅灰悬停 */
    --border: #e2e8f0;        /* 边框颜色 */
    --shadow: rgba(30, 41, 59, 0.1); /* 阴影颜色 */
    --text-primary: #334155;  /* 主要文字颜色 */
    --text-secondary: #64748b; /* 次要文字颜色 */
    --text-light: #94a3b8;    /* 浅色文字 */
}

body {
    background-color: #f1f5f9;
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.container-fluid {
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
    background-color: #f8fafc;
    min-height: 100vh;
}

/* 卡片样式增强 */
.card {
    box-shadow: 0 4px 6px var(--shadow);
    margin-bottom: 1.5rem;
    border: none;
    border-radius: 0.75rem;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    background-color: white;
}

.card:hover {
    box-shadow: 0 6px 12px rgba(30, 41, 59, 0.15);
    transform: translateY(-2px);
}

.card-header {
    font-weight: 600;
    padding: 1rem 1.25rem;
    border-bottom: 0;
    color: white;
}

.card-body {
    padding: 1.25rem;
}

/* 各种卡片标题配色 */
.bg-warning {
    background: linear-gradient(135deg, var(--warning), #d97706) !important;
}

.bg-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
}

.bg-success {
    background: linear-gradient(135deg, var(--success), #047857) !important;
}

.bg-info {
    background: linear-gradient(135deg, var(--info), #0369a1) !important;
}

.bg-danger {
    background: linear-gradient(135deg, var(--danger), #b91c1c) !important;
}

.bg-secondary {
    background: linear-gradient(135deg, var(--secondary), #4338ca) !important;
}

.table {
    margin-bottom: 0;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.table th {
    background-color: rgba(241, 245, 249, 0.7);
    font-weight: 600;
    border-bottom: 2px solid rgba(203, 213, 225, 0.4);
    color: var(--text-secondary);
}

.form-control {
    font-size: 0.875rem;
    border-radius: 0.5rem;
    border-color: var(--border);
    box-shadow: none;
    padding: 0.5rem 0.75rem;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.15);
}

input[type="number"] {
    text-align: right;
}

.table td, .table th {
    padding: 0.75rem;
    vertical-align: middle;
}

/* 按钮样式优化 */
.btn {
    border-radius: 0.5rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: all 0.2s;
    border: none;
}

.btn-outline-primary {
    color: var(--primary);
    border: 1px solid var(--primary);
    background-color: transparent;
}

.btn-outline-primary:hover {
    background-color: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.25);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.25);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #047857);
    border: none;
}

.btn-success:hover {
    background: linear-gradient(135deg, #047857, var(--success));
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(5, 150, 105, 0.25);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #b91c1c);
    border: none;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #b91c1c, var(--danger));
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(220, 38, 38, 0.25);
}

.btn-light {
    background-color: white;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-light:hover {
    background-color: var(--light-hover);
    color: var(--text-primary);
}

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* 表格数据格式化 */
.amount, .price, .market-value, .ratio {
    font-family: 'Roboto Mono', monospace;
    font-weight: 500;
}

/* 表格hover效果 */
.table tbody tr:hover {
    background-color: rgba(241, 245, 249, 0.5);
}

/* 卡片标题图标 */
.card-header i {
    margin-right: 8px;
}

/* 增加交易历史记录的可读性 */
#transactionHistoryBody tr:nth-child(odd) {
    background-color: rgba(241, 245, 249, 0.3);
}

#transactionHistoryBody tr {
    animation: fadeIn 0.3s ease-in-out;
    position: relative;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 美化当前数据区域 */
.current-price-info {
    background-color: #f8fafc;
    border-radius: 0.75rem;
    padding: 1rem;
    margin-top: 1rem;
    border: 1px solid var(--border);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.current-price-info h6 {
    color: var(--primary);
    font-weight: 600;
}

/* 流动池卡片优化 */
.card-header.bg-success + .card-body {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.card-header.bg-success + .card-body .d-flex.flex-column {
    height: 100%;
}

.card-header.bg-success + .card-body .border.rounded-3 {
    min-height: 60px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
}

.card-header.bg-success + .card-body .border.rounded-3:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

/* 流动池价格和市值显示样式 */
#initialPrice, #initialMarketCap, #realtimePrice, #realtimeMarketCap {
    font-family: 'Roboto Mono', monospace;
    font-size: 1.1rem;
    font-weight: 600;
    display: block;
    padding: 0.25rem 0;
}

.text-success {
    color: var(--success) !important;
}

.text-danger {
    color: var(--danger) !important;
}

.text-primary {
    color: var(--primary) !important;
}

/* 统一数值显示样式 */
#currentPrice, #currentMarketCap, #sellCurrentPrice, #sellCurrentMarketCap {
    font-family: 'Roboto Mono', monospace;
    font-weight: 600;
}

/* 响应式调整流动池卡片 */
@media (max-width: 768px) {
    .card-header.bg-success + .card-body .row.g-3 {
        margin: 0 -0.5rem;
    }
    
    .card-header.bg-success + .card-body .row.g-3 > .col-md-3 {
        padding: 0 0.5rem;
        margin-bottom: 0.75rem;
    }
    
    .card-header.bg-success + .card-body .border.rounded-3 {
        min-height: 50px;
    }
    
    #initialPrice, #initialMarketCap, #realtimePrice, #realtimeMarketCap {
        font-size: 0.9rem;
    }
}

/* 页脚样式 */
footer {
    color: var(--text-light);
    border-top-color: var(--border) !important;
}

/* 响应式优化 */
@media (max-width: 768px) {
    .container-fluid {
        padding: 12px;
    }
    
    .card {
        margin-bottom: 1rem;
        border-radius: 0.5rem;
    }
    
    .card-header {
        padding: 0.75rem 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    h2 {
        font-size: 1.4rem;
    }
    
    h5.card-title {
        font-size: 1rem;
    }
    
    h6 {
        font-size: 0.9rem;
    }
    
    .btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.875rem;
    }
    
    .form-label {
        font-size: 0.85rem;
        margin-bottom: 0.3rem;
    }
    
    .form-control {
        font-size: 0.85rem;
        padding: 0.4rem 0.6rem;
    }
    
    /* 表格响应式布局调整 */
    .table {
        font-size: 0.75rem;
    }
    
    .table th, .table td {
        padding: 0.5rem 0.3rem;
        white-space: nowrap;
    }
    
    /* 显示完整内容的重要字段 */
    #initialPrice, #initialMarketCap, #realtimePrice, #realtimeMarketCap,
    #currentPrice, #currentMarketCap, #sellCurrentPrice, #sellCurrentMarketCap {
        font-size: 0.8rem;
    }
    
    /* 当前数据区域移动端优化 */
    .current-price-info {
        padding: 0.75rem;
    }
    
    /* 确保价格和市值换行显示 */
    .current-price-info .d-flex {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    /* 优化表格响应式布局 */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* 让交易历史表格在移动端更紧凑 */
    #transactionHistoryBody td {
        max-width: 100px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* 小型移动设备 (小于 576px) */
@media (max-width: 575.98px) {
    .container-fluid {
        padding: 10px;
    }
    
    h2 {
        font-size: 1.25rem;
    }
    
    /* 标题和按钮优化 */
    .d-flex.justify-content-between {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch !important;
    }
    
    .d-flex.justify-content-between h2 {
        text-align: center;
    }
    
    .d-flex.justify-content-between .d-flex {
        justify-content: center;
    }
    
    /* 表格字段缩放 */
    .table {
        font-size: 0.7rem;
    }
    
    .table th, .table td {
        padding: 0.4rem 0.2rem;
    }
    
    /* 让数据表格在超小屏幕上垂直布局 */
    .table.table-bordered thead {
        display: none;
    }
    
    .table.table-bordered tbody tr {
        display: block;
        margin-bottom: 0.5rem;
        border: 1px solid var(--border);
        border-radius: 0.25rem;
        padding: 0.5rem;
    }
    
    .table.table-bordered tbody td {
        display: flex;
        justify-content: space-between;
        padding: 0.3rem;
        text-align: right;
        border: none;
        border-bottom: 1px solid var(--border);
        word-break: break-word;
        overflow: visible;
    }
    
    .table.table-bordered tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        text-align: left;
        color: var(--text-secondary);
        flex-shrink: 0;
        padding-right: 0.5rem;
    }
    
    .table.table-bordered tbody td:last-child {
        border-bottom: none;
    }
    
    /* 交易历史记录优化 */
    #transactionHistoryBody tr td {
        min-height: 44px;
        align-items: center;
    }
    
    /* 流动池信息卡片优化 */
    .card-body .mb-2 {
        display: flex;
        flex-direction: column;
        margin-bottom: 0.5rem !important;
    }
    
    /* 输入框组优化 */
    .input-group {
        flex-direction: column;
    }
    
    .input-group .form-control {
        border-radius: 0.375rem !important;
        margin-bottom: 0.5rem;
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    
    .input-group .btn {
        border-radius: 0.375rem !important;
        width: 100%;
    }
    
    /* 代币经济学手机优化 */
    #totalSupply {
        text-align: left;
        margin-bottom: 0.5rem;
        width: 100%;
    }
    
    /* 添加分类表单手机优化 */
    #newCategoryName, #newCategoryAmount {
        margin-bottom: 0.5rem;
    }
    
    /* 交易历史中的时间列简化显示 */
    #transactionHistoryBody td[data-label="时间"] {
        font-size: 0.8rem;
    }
    
    /* 确保价格列正确显示 */
    #transactionHistoryBody td[data-label="价格"] {
        word-break: normal;
        overflow: visible;
        white-space: nowrap;
    }
    
    /* 让表格行有更好的触摸区域 */
    .table.table-bordered tbody tr {
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(0,0,0,0);
        margin-bottom: 0.75rem;
    }
    
    /* 改善长文本在表格单元格中的显示 */
    .table.table-bordered tbody td {
        max-height: none;
        min-height: 40px;
    }
}

/* 大型手机横屏模式 (576px-767px) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .container-fluid {
        padding: 15px;
    }
    
    /* 确保按钮不会过小 */
    .btn {
        min-height: 38px;
    }
    
    /* 表格滚动容器 */
    .table-responsive {
        margin-bottom: 1rem;
    }
}

/* 增强输入框在移动设备上的可操作性 */
@media (max-width: 768px) {
    input, select, textarea, button {
        font-size: 16px !important; /* 防止iOS上自动缩放 */
    }
    
    /* 更好的触摸目标尺寸 */
    .btn, .form-control {
        min-height: 44px;
    }
    
    /* 避免输入时遮挡 */
    input:focus {
        position: relative;
        z-index: 1;
    }
}

/* 加载动画 */
.loading {
    position: relative;
}

.loading::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid rgba(241, 245, 249, 0.5);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s infinite linear;
    z-index: 1001;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
} 