/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #26a17e;
    --primary-dark: #1e8a6a;
    --secondary-color: #f7931a;
    --text-color: #333;
    --text-light: #666;
    --text-lighter: #999;
    --bg-color: #f5f5f5;
    --white: #fff;
    --border-color: #e0e0e0;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
    --radius: 8px;
    --radius-lg: 12px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    color: var(--primary-dark);
}

/* 头部导航 */
.header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
}

.logo-text {
    font-size: 20px;
    font-weight: bold;
    color: var(--primary-color);
}

.logo-divider {
    font-size: 18px;
    color: #ccc;
    margin: 0 2px;
}

.logo-domain {
    font-size: 16px;
    color: #666;
    font-weight: 400;
}

.nav {
    display: flex;
    gap: 30px;
}

.nav-link {
    color: var(--text-color);
    font-size: 15px;
    padding: 8px 0;
    position: relative;
}

.nav-link.active,
.nav-link:hover {
    color: var(--primary-color);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
}

/* 主内容区 */
.main {
    min-height: calc(100vh - 60px - 200px);
}

/* 查询区域 */
.query-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    padding: 60px 0;
    color: var(--white);
}

.query-title {
    font-size: 28px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 10px;
}

.query-subtitle {
    text-align: center;
    opacity: 0.9;
    margin-bottom: 30px;
}

.query-box {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-lg);
    max-width: 800px;
    margin: 0 auto;
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.address-input {
    flex: 1;
    height: 48px;
    padding: 0 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 15px;
    outline: none;
    transition: border-color 0.3s;
}

.address-input:focus {
    border-color: var(--primary-color);
}

.network-select {
    width: 100px;
    height: 48px;
    padding: 0 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    background: var(--white);
    cursor: pointer;
    outline: none;
}

.query-btn {
    height: 48px;
    padding: 0 30px;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s;
}

.query-btn:hover {
    background: var(--primary-dark);
}

.query-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* 价格展示 */
.price-bar {
    display: flex;
    justify-content: space-around;
    padding: 20px 0;
    border-top: 1px solid var(--border-color);
    margin-top: 20px;
}

.price-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.price-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.price-name {
    font-size: 13px;
    color: var(--text-light);
}

.price-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
}

.price-source {
    text-align: center;
    font-size: 12px;
    color: var(--text-lighter);
    margin-top: 10px;
}

/* 结果区域 */
.result-section {
    padding: 30px 0;
}

.balance-card,
.stats-card,
.transactions-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.balance-title,
.stats-title,
.transactions-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-color);
}

.balance-info {
    display: flex;
    gap: 40px;
}

.balance-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.balance-label {
    font-size: 13px;
    color: var(--text-light);
}

.balance-value {
    font-size: 24px;
    font-weight: 600;
    color: var(--primary-color);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    background: var(--bg-color);
    border-radius: var(--radius);
}

.stat-label {
    font-size: 13px;
    color: var(--text-light);
}

.stat-value {
    font-size: 18px;
    font-weight: 600;
}

.stat-value.income {
    color: #52c41a;
}

.stat-value.expense {
    color: #ff4d4f;
}

/* 交易列表 */
.transactions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.transaction-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--bg-color);
    border-radius: var(--radius);
    transition: transform 0.2s;
}

.transaction-item:hover {
    transform: translateX(4px);
}

.tx-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tx-type {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tx-type-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.tx-type-badge.income {
    background: #f6ffed;
    color: #52c41a;
}

.tx-type-badge.expense {
    background: #fff2f0;
    color: #ff4d4f;
}

.tx-address {
    font-size: 13px;
    color: var(--text-light);
    font-family: monospace;
}

.tx-time {
    font-size: 12px;
    color: var(--text-lighter);
}

.tx-amount {
    font-size: 18px;
    font-weight: 600;
}

.tx-amount.income {
    color: #52c41a;
}

.tx-amount.expense {
    color: #ff4d4f;
}

.tx-hash {
    font-size: 12px;
    color: var(--text-lighter);
    font-family: monospace;
    cursor: pointer;
}

.tx-hash:hover {
    color: var(--primary-color);
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.page-btn {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--white);
    cursor: pointer;
    transition: all 0.3s;
}

.page-btn:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-info {
    font-size: 14px;
    color: var(--text-light);
}

/* 服务卡片 */
.services-section {
    padding: 40px 0;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (min-width: 768px) {
    .services-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 24px;
    }
}

.service-card-link {
    text-decoration: none;
    color: inherit;
}

.service-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    cursor: pointer;
    text-align: center;
    padding: 24px 16px;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.service-card-image {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 16px;
}

.service-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.service-card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-color);
}

.service-card-desc {
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.5;
}

@media (max-width: 767px) {
    .service-card {
        padding: 16px 12px;
    }
    
    .service-card-image {
        width: 48px;
        height: 48px;
        margin-bottom: 8px;
    }
    
    .service-card-title {
        font-size: 14px;
    }
    
    .service-card-desc {
        font-size: 12px;
    }
}

/* 下载区域 */
.download-section {
    padding: 60px 0;
    background: var(--white);
}

.download-card {
    text-align: center;
    max-width: 400px;
    margin: 0 auto;
}

.download-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 30px;
}

.qrcode-wrapper {
    display: inline-block;
    padding: 20px;
    background: var(--bg-color);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
}

.qrcode {
    width: 200px;
    height: 200px;
    border-radius: var(--radius);
}

.download-hint {
    font-size: 15px;
    color: var(--text-color);
    margin-bottom: 8px;
}

.download-support {
    font-size: 13px;
    color: var(--text-light);
}

/* 页脚 */
.footer {
    background: #2c3e50;
    color: var(--white);
    padding: 40px 0 20px;
}

.footer-content {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.footer-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
}

.footer-text {
    font-size: 14px;
    opacity: 0.8;
}

.footer-link {
    color: var(--white);
    text-decoration: underline;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.copyright {
    font-size: 13px;
    opacity: 0.6;
}

/* 提示信息 */
.toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    padding: 12px 24px;
    background: rgba(0, 0, 0, 0.8);
    color: var(--white);
    border-radius: var(--radius);
    font-size: 14px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 1000;
}

.toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    background: #52c41a;
}

.toast.error {
    background: #ff4d4f;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--white);
    animation: spin 0.8s linear infinite;
}

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

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 15px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 0 10px;
    }
    
    .header .container {
        height: 50px;
    }
    
    .logo-text {
        font-size: 18px;
    }
    
    .nav {
        gap: 20px;
    }
    
    .nav-link {
        font-size: 14px;
    }
    
    .query-section {
        padding: 40px 0;
    }
    
    .query-title {
        font-size: 22px;
    }
    
    .query-subtitle {
        font-size: 14px;
        margin-bottom: 20px;
    }
    
    .query-box {
        padding: 16px;
        margin: 0 10px;
        max-width: calc(100% - 20px);
    }
    
    .input-group {
        flex-direction: column;
        gap: 12px;
    }
    
    .address-input {
        width: 100%;
        height: 52px;
        font-size: 16px;
        padding: 0 16px;
    }
    
    .network-select {
        width: 100%;
        height: 48px;
        font-size: 15px;
    }
    
    .query-btn {
        width: 100%;
        height: 52px;
        font-size: 16px;
        font-weight: 600;
    }
    
    .price-bar {
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .price-item {
        flex: 1 1 40%;
        justify-content: center;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .transaction-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .tx-amount {
        align-self: flex-end;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 8px;
    }
    
    .query-box {
        padding: 12px;
        margin: 0 5px;
        max-width: calc(100% - 10px);
    }
    
    .address-input {
        height: 54px;
        font-size: 16px;
        padding: 0 14px;
    }
    
    .query-btn {
        height: 54px;
        font-size: 16px;
    }
    
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .service-card {
        padding: 16px 12px;
    }
    
    .service-card-image {
        width: 48px;
        height: 48px;
        margin-bottom: 8px;
    }
    
    .service-card-title {
        font-size: 13px;
        margin-bottom: 4px;
    }
    
    .service-card-desc {
        font-size: 11px;
        line-height: 1.4;
    }
    
    .balance-info {
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .balance-item {
        flex: 1 1 calc(50% - 10px);
        min-width: calc(50% - 10px);
    }
    
    .query-title {
        font-size: 20px;
    }
}

/* ========== 交易详情页面样式 ========== */

/* 页面标题区域 */
.page-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    padding: 40px 0;
    color: var(--white);
    text-align: center;
}

.page-title {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 10px;
}

.page-subtitle {
    font-size: 15px;
    opacity: 0.9;
}

/* 查询输入区域 */
.query-input-section {
    padding: 30px 0;
    background: var(--white);
}

/* 交易详情区域 */
.transaction-detail-section {
    padding: 30px 0;
}

/* 详情卡片 */
.detail-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-color);
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

/* 状态卡片 */
.status-card {
    text-align: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.status-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.status-badge {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

.status-badge.success {
    background: #d4edda;
    color: #155724;
}

.status-badge.failed {
    background: #f8d7da;
    color: #721c24;
}

.tx-network {
    padding: 4px 12px;
    background: var(--primary-color);
    color: var(--white);
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.status-amount {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
}

.amount-value {
    font-size: 36px;
    font-weight: bold;
    color: var(--primary-color);
}

.amount-currency {
    font-size: 18px;
    color: var(--text-light);
}

/* 信息列表 */
.info-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-color);
    border-radius: var(--radius);
}

.info-label {
    font-size: 14px;
    color: var(--text-light);
    min-width: 80px;
}

.info-value {
    flex: 1;
    font-size: 14px;
    color: var(--text-color);
    word-break: break-all;
}

.info-value.mono {
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.copy-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.3s;
}

.copy-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* 地址信息卡片 */
.party-card {
    border-left: 4px solid var(--primary-color);
}

.party-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.address-display {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-color);
    border-radius: var(--radius);
}

.address-text {
    flex: 1;
    font-size: 14px;
    color: var(--text-color);
    word-break: break-all;
}

.address-balance {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #e8f5e9;
    border-radius: var(--radius);
}

.balance-label {
    font-size: 13px;
    color: var(--text-light);
}

.balance-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--primary-color);
}

/* 费用卡片 */
.fee-card {
    border-left: 4px solid var(--secondary-color);
}

/* 操作按钮 */
.action-buttons {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.action-btn {
    flex: 1;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.action-btn {
    background: var(--primary-color);
    color: var(--white);
}

.action-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.action-btn.secondary:hover {
    background: var(--bg-color);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* 空状态 */
.empty-section {
    padding: 60px 0;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.empty-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-color);
}

.empty-text {
    font-size: 14px;
    color: var(--text-light);
}

/* 响应式设计 - 交易详情页 */
@media (max-width: 768px) {
    .page-header {
        padding: 30px 0;
    }
    
    .page-title {
        font-size: 22px;
    }
    
    .status-amount {
        flex-direction: column;
        gap: 4px;
    }
    
    .amount-value {
        font-size: 28px;
    }
    
    .info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .info-label {
        min-width: auto;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-btn {
        width: 100%;
    }
}
