/* API Auto Sync 样式 - 现代化设计 */

/* 基础变量 */
:root {
    --primary-color: #4a90e2;
    --secondary-color: #50c878;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --border-color: #e1e8ed;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 通用容器样式 */
.api-data-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
}

/* 表格样式 - Table1 */
.aa-table1 {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 24px 0;
    background: var(--card-bg);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    font-size: 14px;
}

.aa-table1 thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.aa-table1 th {
    padding: 16px 20px;
    text-align: left;
    font-weight: 600;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 12px;
}

.aa-table1 td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.aa-table1 tbody tr {
    transition: var(--transition);
}

.aa-table1 tbody tr:hover {
    background-color: #f0f4f8;
    transform: scale(1.002);
}

.aa-table1 tbody tr:last-child td {
    border-bottom: none;
}

/* 卡片样式 - Table2 */
.aa-table2 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin: 24px 0;
    padding: 0;
}

.aa-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.aa-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

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

.aa-card div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.aa-card div:last-child {
    border-bottom: none;
}

.aa-card div strong {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.aa-card div span,
.aa-card div:not(:has(strong)) {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 15px;
}

/* 高亮表格 - Table3 */
.aa-table3 {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 24px 0;
    background: var(--card-bg);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    font-size: 14px;
}

.aa-table3 thead {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.aa-table3 th {
    padding: 16px 20px;
    text-align: left;
    font-weight: 600;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 12px;
}

.aa-table3 td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
}

.aa-table3 tbody tr {
    transition: var(--transition);
}

.aa-table3 tbody tr:hover {
    background-color: #e8f5e9;
}

.aa-table3 tbody tr:nth-child(even) {
    background-color: #fafafa;
}

.aa-table3 tbody tr:nth-child(even):hover {
    background-color: #e8f5e9;
}

.aa-table3 td[style*="color:red"],
.aa-table3 td[style*="color: red"] {
    color: var(--danger-color) !important;
    font-weight: 700;
    background-color: rgba(231, 76, 60, 0.08);
    border-radius: var(--radius-sm);
}

/* 列表样式 - Table4 */
.aa-table4 {
    margin: 24px 0;
    background: var(--card-bg);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.aa-list-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px 24px;
    color: #ffffff;
}

.aa-list-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.aa-list-header h3::before {
    content: '📊';
    font-size: 20px;
}

.aa-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.aa-list-item {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    transition: var(--transition);
}

.aa-list-item:hover {
    background-color: #f8f9fa;
    padding-left: 28px;
}

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

.aa-list-label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 4px;
}

.aa-list-value {
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 500;
}

/* 字符串数据显示样式 */
.api-string-data {
    background: #f4f4f4;
    border: 1px solid #ddd;
    border-radius: var(--radius-sm);
    padding: 16px;
    margin: 20px 0;
    overflow-x: auto;
}

.api-string-data pre {
    margin: 0;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
    color: #333;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* 空数据提示 */
.api-data-container > p {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-size: 16px;
    background: var(--bg-color);
    border-radius: var(--radius-md);
    border: 2px dashed var(--border-color);
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.aa-table1, .aa-table2, .aa-table3, .aa-table4 {
    animation: fadeInUp 0.5s ease-out;
}

.aa-card {
    animation: fadeInUp 0.5s ease-out;
    animation-fill-mode: both;
}

.aa-card:nth-child(1) { animation-delay: 0.05s; }
.aa-card:nth-child(2) { animation-delay: 0.1s; }
.aa-card:nth-child(3) { animation-delay: 0.15s; }
.aa-card:nth-child(4) { animation-delay: 0.2s; }
.aa-card:nth-child(5) { animation-delay: 0.25s; }
.aa-card:nth-child(6) { animation-delay: 0.3s; }

.aa-list-item {
    animation: slideIn 0.3s ease-out;
    animation-fill-mode: both;
}

.aa-list-item:nth-child(1) { animation-delay: 0.05s; }
.aa-list-item:nth-child(2) { animation-delay: 0.1s; }
.aa-list-item:nth-child(3) { animation-delay: 0.15s; }
.aa-list-item:nth-child(4) { animation-delay: 0.2s; }
.aa-list-item:nth-child(5) { animation-delay: 0.25s; }

/* 响应式设计 */
@media screen and (max-width: 1024px) {
    .aa-table2 {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
    }
}

@media screen and (max-width: 768px) {
    .aa-table1, .aa-table3 {
        font-size: 13px;
    }
    
    .aa-table1 th, .aa-table1 td,
    .aa-table3 th, .aa-table3 td {
        padding: 12px 16px;
    }
    
    .aa-table2 {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .aa-card {
        padding: 20px;
    }
    
    .aa-list-item {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 16px 20px;
    }
}

@media screen and (max-width: 480px) {
    .aa-table1, .aa-table3 {
        font-size: 12px;
    }
    
    .aa-table1 th, .aa-table1 td,
    .aa-table3 th, .aa-table3 td {
        padding: 10px 12px;
    }
    
    .aa-card {
        padding: 16px;
    }
    
    .aa-card div {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .aa-list-header {
        padding: 16px 20px;
    }
    
    .aa-list-header h3 {
        font-size: 16px;
    }
}

/* 打印样式 */
@media print {
    .aa-table1, .aa-table2, .aa-table3, .aa-table4 {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .aa-card {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }
}

/* 暗色模式支持 */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1a1a2e;
        --card-bg: #16213e;
        --text-primary: #eaeaea;
        --text-secondary: #a0a0a0;
        --border-color: #2d3748;
    }
    
    .aa-table1 tbody tr:hover,
    .aa-table3 tbody tr:hover,
    .aa-list-item:hover {
        background-color: #1f2937;
    }
    
    .aa-table3 tbody tr:nth-child(even) {
        background-color: #1a202c;
    }
    
    .api-string-data {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .api-string-data pre {
        color: #e2e8f0;
    }
}
