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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

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

/* 头部样式 */
header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* 作者信息和社交链接样式 */
.author-info {
    margin-top: 20px;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.social-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    color: white;
    text-decoration: none;
}

.social-link.twitter {
    background: linear-gradient(135deg, #1DA1F2 0%, #0d8bd9 100%);
}

.social-link.twitter:hover {
    background: linear-gradient(135deg, #0d8bd9 0%, #1DA1F2 100%);
}

.social-link.binance {
    background: linear-gradient(135deg, #F3BA2F 0%, #F7931A 100%);
}

.social-link.binance:hover {
    background: linear-gradient(135deg, #F7931A 0%, #F3BA2F 100%);
}

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

/* 响应式社交链接 */
@media (max-width: 768px) {
    .social-links {
        gap: 15px;
    }
    
    .social-link {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .social-icon {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .social-links {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .social-link {
        width: 200px;
        justify-content: center;
    }
}

/* 主要内容区域 */
main {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    overflow: hidden;
}

/* 查询表单样式 */
.query-form {
    padding: 30px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.query-form h2 {
    margin-bottom: 25px;
    color: #495057;
    font-size: 1.5rem;
}

.form-group {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.form-group label {
    font-weight: 600;
    color: #495057;
    min-width: 100px;
}

.form-group input,
.form-group select {
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    flex: 1;
    min-width: 200px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 按钮样式 */
.btn-primary,
.btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

/* 加载状态样式 */
.loading-section {
    padding: 40px;
    text-align: center;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-section p {
    color: #6c757d;
    font-size: 1.1rem;
}

/* 统计信息样式 */
.stats-section {
    padding: 30px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.stats-section h2 {
    margin-bottom: 25px;
    color: #495057;
    font-size: 1.5rem;
}

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

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card h3 {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-card p {
    font-size: 1.4rem;
    font-weight: bold;
    color: #495057;
    word-break: break-all;
    line-height: 1.2;
    font-family: 'Courier New', monospace;
}

/* 多币种统计信息样式 */
.multi-stats-container {
    margin-top: 20px;
}

.multi-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.multi-stat-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.multi-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.multi-stat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    text-align: center;
}

.multi-stat-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.multi-stat-content {
    padding: 20px;
}

.multi-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.multi-stat-row:last-child {
    border-bottom: none;
}

.multi-stat-label {
    color: #6c757d;
    font-size: 0.9rem;
    font-weight: 500;
}

.multi-stat-value {
    color: #495057;
    font-size: 1rem;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    text-align: right;
}

.multi-stat-value.volume {
    color: #28a745;
}

.multi-stat-value.price {
    color: #007bff;
}

/* 响应式多币种统计 */
@media (max-width: 768px) {
    .multi-stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .multi-stat-card {
        margin-bottom: 15px;
    }
    
    .multi-stat-header h3 {
        font-size: 1rem;
    }
    
    .multi-stat-content {
        padding: 15px;
    }
    
    .multi-stat-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .multi-stat-value {
        text-align: left;
    }
}

/* 数据表格样式 */
.data-section {
    padding: 30px;
}

.data-section h2 {
    margin-bottom: 25px;
    color: #495057;
    font-size: 1.5rem;
}

.table-container {
    overflow-x: auto;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

th, td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

/* 数字列的样式 */
td:nth-child(2), td:nth-child(3), td:nth-child(4), td:nth-child(5), td:nth-child(6), td:nth-child(7) {
    font-family: 'Courier New', monospace;
    text-align: right;
    white-space: nowrap;
}

th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
    position: sticky;
    top: 0;
    z-index: 10;
}

tr:hover {
    background: #f8f9fa;
}

/* 错误信息样式 */
.error-section {
    padding: 30px;
    text-align: center;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #f5c6cb;
}

.error-message h3 {
    margin-bottom: 10px;
}

/* 页脚样式 */
footer {
    text-align: center;
    margin-top: 40px;
    color: white;
    opacity: 0.8;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links a {
    color: white;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.footer-links a:hover {
    opacity: 1;
    text-decoration: underline;
}

.footer-links .separator {
    opacity: 0.5;
}

/* 响应式页脚 */
@media (max-width: 480px) {
    .footer-links {
        flex-direction: column;
        gap: 5px;
    }
    
    .footer-links .separator {
        display: none;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .form-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .form-group label {
        min-width: auto;
        margin-bottom: 5px;
    }
    
    .form-group input,
    .form-group select {
        min-width: auto;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-card p {
        font-size: 1.4rem;
    }
    
    th, td {
        padding: 10px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .query-form,
    .stats-section,
    .data-section {
        padding: 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
        margin-bottom: 10px;
    }
}

/* 图表样式 */
.chart-container {
    margin: 20px 0;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
}

.chart-container canvas {
    max-width: 100%;
    height: auto;
}

/* 响应式图表 */
@media (max-width: 768px) {
    .chart-container {
        padding: 10px;
    }
    
    .chart-container canvas {
        width: 100% !important;
        height: 300px !important;
    }
}

/* 选择容器样式 */
.select-container {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.symbol-search {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    transition: border-color 0.3s ease;
}

.symbol-search:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.symbol-search::placeholder {
    color: #999;
}

/* 搜索高亮样式 */
.highlight {
    background-color: #fff3cd;
    font-weight: bold;
}

/* 响应式搜索框 */
@media (max-width: 768px) {
    .select-container {
        gap: 6px;
    }
    
    .symbol-search {
        padding: 8px 10px;
        font-size: 16px; /* 移动端防止缩放 */
    }
}

/* 多币种查询样式 */
.multi-symbol-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 15px 0;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    background: #fff;
}

.multi-symbol-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.multi-symbol-item:hover {
    background: #e9ecef;
    border-color: #667eea;
}

.multi-symbol-item .symbol-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.multi-symbol-item .symbol-name {
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.multi-symbol-item .symbol-details {
    font-size: 12px;
    color: #6c757d;
}

.multi-symbol-item .remove-symbol {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.multi-symbol-item .remove-symbol:hover {
    background: #c82333;
}

.multi-symbol-controls {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.multi-symbol-controls .btn-secondary {
    flex: 1;
    padding: 8px 16px;
    font-size: 13px;
}

/* 多币种查询表单组样式 */
.form-group.multi-symbol-group {
    flex-direction: column;
    align-items: stretch;
}

.form-group.multi-symbol-group label {
    min-width: auto;
    margin-bottom: 10px;
}

/* 响应式多币种查询 */
@media (max-width: 768px) {
    .multi-symbol-list {
        max-height: 200px;
        padding: 10px;
    }
    
    .multi-symbol-item {
        padding: 8px;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .multi-symbol-item .symbol-info {
        text-align: center;
    }
    
    .multi-symbol-controls {
        flex-direction: column;
    }
    
    .multi-symbol-controls .btn-secondary {
        width: 100%;
    }
}

/* 多币种数据表格样式 */
.symbol-title-row {
    background: #667eea !important;
    color: white !important;
    font-weight: bold !important;
    text-align: center !important;
}

.symbol-title-row td {
    padding: 12px 15px !important;
    border-bottom: 2px solid #5a6fd8 !important;
}

/* 多币种数据行样式 */
.multi-symbol-data-row {
    background: #f8f9fa;
}

.multi-symbol-data-row:nth-child(even) {
    background: #ffffff;
}

/* 交易竞赛样式 */
.competition-section {
    padding: 30px;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    border-bottom: 1px solid #e9ecef;
}

.competition-section h2 {
    margin-bottom: 25px;
    color: #8b4513;
    font-size: 1.5rem;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.competition-container {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border: 2px solid #ffd700;
}

.competition-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #ffd700;
}

.competition-symbol {
    font-size: 2rem;
    font-weight: bold;
    color: #8b4513;
    margin-bottom: 10px;
}

.competition-status {
    display: inline-block;
    background: #28a745;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
}

.competition-data-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.competition-data-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #ffd700;
    transition: transform 0.3s ease;
}

.competition-data-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.competition-data-card h3 {
    color: #8b4513;
    font-size: 1.1rem;
    margin-bottom: 10px;
    font-weight: bold;
}

.competition-data-value {
    font-size: 1.4rem;
    font-weight: bold;
    color: #495057;
    font-family: 'Courier New', monospace;
    margin-bottom: 5px;
}

.competition-data-change {
    font-size: 0.9rem;
    font-weight: bold;
}

.competition-data-change.positive {
    color: #28a745;
}

.competition-data-change.negative {
    color: #dc3545;
}

.competition-data-change.neutral {
    color: #6c757d;
}

.competition-notes {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
}

.competition-notes h4 {
    color: #856404;
    margin-bottom: 10px;
    font-size: 1rem;
}

.competition-notes ul {
    margin: 0;
    padding-left: 20px;
    color: #856404;
}

.competition-notes li {
    margin-bottom: 5px;
    font-size: 0.9rem;
}

/* 响应式交易竞赛 */
@media (max-width: 768px) {
    .competition-section {
        padding: 20px;
    }
    
    .competition-container {
        padding: 20px;
    }
    
    .competition-data-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .competition-symbol {
        font-size: 1.5rem;
    }
    
    .competition-data-value {
        font-size: 1.2rem;
    }
}

/* 缓存状态显示样式 */
.cache-status {
    margin-top: 15px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 1px solid #2196f3;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.1);
}

.cache-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #1976d2;
}

.cache-icon {
    font-size: 16px;
    animation: pulse 2s infinite;
}

.cache-text {
    font-weight: 500;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
    100% {
        opacity: 1;
    }
}

/* 响应式缓存状态 */
@media (max-width: 768px) {
    .cache-status {
        margin-top: 12px;
        padding: 10px 12px;
    }
    
    .cache-info {
        font-size: 13px;
    }
}
