:root {
    --primary-color: #2563eb;
    --hover-color: #1d4ed8;
    --background-color: #f8fafc;
    --border-color: #e2e8f0;
    --text-color: #1e293b;
    --secondary-text: #64748b;
    --negative-color: #22c55e;
    --positive-color: #ef4444;
    --hover-bg: #f1f5f9;
    --alternate-row-bg: #f8fafc;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    margin: 0;
    padding: 24px;
    background-color: var(--background-color);
    color: var(--text-color);
    -webkit-font-smoothing: antialiased;
    display: flex;
    justify-content: center;
    gap: 24px;
    min-height: 100vh;
}

.container {
    max-width: 1300px;
    margin: 0;
}

/* Page header layout */
.header-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
    gap: 16px;
}

.title-section {
    flex: 1;
    margin-right: 0;
}

/* Page title styles */
.page-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0 0 8px 0;
}

.page-subtitle {
    font-size: 14px;
    color: var(--secondary-text);
    margin: 0;
}

/* Stats cards grid layout */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

/* Stats card styles */
.stats-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.stats-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stats-card h3 {
    font-size: 14px;
    font-weight: 500;
    color: var(--secondary-text);
    margin: 0 0 16px 0;
}

.site-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.site-info .site-logo {
    width: 32px;
    height: 32px;
    border-radius: 6px;
}

.site-info .site-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-color);
}

.traffic-value {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-color);
    margin: 8px 0;
}

.growth-rate {
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.traffic-change {
    font-size: 15px;
    font-weight: 500;
    text-align: center;
}

.growth-change {
    font-size: 13px;
    color: var(--secondary-text);
    margin-top: 4px;
}

/* Table base styles */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 24px;
    font-size: 14px;
    background: white;
}

tr {
    height: 64px;
    transition: background-color 0.2s ease;
}

tr:hover {
    background-color: var(--hover-bg);
}

th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    line-height: 1.4;
}

/* Domain column styles */
.domain-cell {
    width: 180px;
    padding: 12px 16px;
}

.domain-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.domain-info img.site-logo {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    object-fit: cover;
}

.domain-info a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
}

/* Trend chart column styles */
.trend-cell {
    width: 100px;
    padding: 12px 8px;
    text-align: center;
}

.trend-chart-container {
    width: 80px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.trend-chart {
    width: 80px;
    height: 30px;
}

/* Traffic data column styles */
.traffic-cell {
    padding: 12px 16px;
    width: 120px;
    text-align: center;
}

.traffic-cell .traffic-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    text-align: center;
    display: block;
    margin-bottom: 6px;
}

.traffic-cell .growth-rate {
    font-size: 13px;
    line-height: 1.4;
    white-space: nowrap;
    text-align: center;
    display: block;
    font-weight: 500;
}

/* Growth rate styles */
.positive, .negative {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    white-space: nowrap;
    justify-content: center;
    padding: 2px 6px;
    border-radius: 4px;
}

.positive {
    color: var(--positive-color);
    background-color: rgba(239, 68, 68, 0.1);
}

.negative {
    color: var(--negative-color);
    background-color: rgba(34, 197, 94, 0.1);
}

/* Growth rate styles in stats cards */
.stats-card .growth-rate {
    font-size: 20px;
    font-weight: 600;
}

.stats-card .traffic-value {
    font-size: 22px;
    font-weight: 600;
    text-align: center;
}

/* Enhanced header styles */
th {
    font-weight: 600;
    color: var(--text-color);
    background: white;
    position: sticky;
    top: 0;
    z-index: 10;
    text-align: center;
    padding: 16px;
}

th:first-child {
    text-align: left;
}

/* Set column width and alignment */
td {
    text-align: center;
}

td:first-child {
    text-align: left;
}

/* Pagination styles optimization */
#pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

#pagination button {
    min-width: 40px;
    height: 40px;
    padding: 0 16px;
    border: 1px solid var(--border-color);
    background-color: white;
    color: var(--text-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

#pagination button.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

#pagination button:hover:not(:disabled):not(.active) {
    background-color: var(--hover-bg);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

#pagination button:disabled {
    color: var(--secondary-text);
    cursor: not-allowed;
    opacity: 0.6;
}

.prev-next {
    font-weight: 500;
    padding: 0 16px !important;
}

.ellipsis {
    color: var(--secondary-text);
    padding: 0 4px;
    user-select: none;
}

/* Responsive design */
@media (max-width: 1200px) {
    .container {
        max-width: 100%;
        padding: 0 16px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    table {
        font-size: 13px;
    }
    
    th, td {
        padding: 8px 12px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 16px;
    }
    
    .header-container {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }
    
    .title-section {
        text-align: center;
    }
    
    .logo-title-wrapper {
        justify-content: center;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    
    th, td {
        min-width: 100px;
    }
    
    .domain-cell {
        position: sticky;
        left: 0;
        background: white;
        z-index: 1;
    }
    
    .search-box {
        width: 100%;
    }
    
    .search-box input {
        width: 100%;
    }
    
    #pagination button {
        padding: 6px 10px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 20px;
    }
    
    .page-subtitle {
        font-size: 12px;
    }
    
    .stats-card {
        padding: 16px;
    }
    
    .stats-card h3 {
        font-size: 13px;
    }
    
    .traffic-value {
        font-size: 20px;
    }
    
    .growth-rate {
        font-size: 12px;
    }
    
    .domain-info img.site-logo {
        width: 20px;
        height: 20px;
    }
    
    .domain-info a {
        font-size: 13px;
    }
    
    .trend-chart-container {
        width: 60px;
    }
    
    .trend-chart {
        width: 60px;
        height: 25px;
    }
}

/* 平板设备特定样式 */
@media (min-width: 769px) and (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .container {
        max-width: 95%;
    }
    
    table {
        font-size: 13px;
    }
    
    th, td {
        padding: 10px 14px;
    }
}

/* 横屏模式优化 */
@media (max-height: 600px) and (orientation: landscape) {
    body {
        padding: 12px;
    }
    
    .header-container {
        margin-bottom: 16px;
    }
    
    .stats-grid {
        margin-bottom: 16px;
    }
    
    tr {
        height: 48px;
    }
    
    .stats-card {
        padding: 16px;
    }
}

/* Trend column styles */
.trend-header {
    width: 100px !important;
    min-width: 100px !important;
    text-align: center !important;
    padding: 8px 8px !important;
}

.trend-chart-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.trend-chart {
    width: 90px;
    height: 30px;
    display: inline-block;
    vertical-align: middle;
}

.stats-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.stats-card a:hover {
    color: var(--primary-color);
}

/* Search box styles */
.search-container {
    display: flex;
    align-items: center;
    gap: 12px;
    width: calc((100% - 48px) / 4);  /* Same as stats-grid cards */
    margin-top: 4px;
    margin-right: 0;  /* Ensure no extra margin on right */
}

.search-box {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.search-box input {
    width: 100%;
    height: 36px;
    padding: 0 36px 0 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    color: var(--text-color);
    background-color: white;
    transition: all 0.2s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.search-box input::placeholder {
    color: var(--secondary-text);
}

.search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--secondary-text);
    pointer-events: none;
}

.logo-title-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.logo-title-wrapper .site-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.logo-title-wrapper .page-title {
    margin: 0;  /* Remove default margin from title */
    font-size: 24px;
    font-weight: 600;
    color: var(--text-color);
}

/* Language switcher styles */
.language-switcher {
    position: relative;
    flex-shrink: 0;
}

.language-switcher select {
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background-color: white;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    appearance: none;
    padding-right: 30px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23374151' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    width: 100px;
}

.language-switcher select:hover {
    border-color: #d1d5db;
}

.language-switcher select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
} 
