:root {
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --card-gradient: linear-gradient(145deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    --bg-dark: #0f172a;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --card-bg: #1e293b;
    --hover-color: #3b82f6;
    --news-date: #64748b;
    --news-source: #4ade80;
    --rank-1: #ffd700;
    --rank-2: #c0c0c0;
    --rank-3: #cd7f32;
    --rank-other: #64748b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    background: linear-gradient(
        135deg, 
        #0f172a 0%,
        #1e1b4b 25%,
        #1e1b4b 75%,
        #0f172a 100%
    );
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    padding: 20px;
    min-height: 100vh;
    position: relative;
    transition: opacity 0.3s ease;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(168, 85, 247, 0.15) 0%, transparent 40%);
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 20px;
    background: var(--card-gradient);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
}

.lang-option {
    position: relative;
    padding: 8px 16px;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.lang-option.active {
    background: var(--hover-color);
    color: var(--text-primary);
}

.lang-option:hover {
    background: var(--hover-color);
    color: var(--text-primary);
}

.lang-switch {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: all 0.3s ease;
}

.lang-switch:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.lang-current {
    padding: 8px 16px;
    color: var(--text-primary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.lang-options {
    display: none;
    background: rgba(30, 41, 59, 0.95);
    border-top: 1px solid rgba(255,255,255,0.1);
    transition: all 0.3s ease;
}

.lang-switch.active .lang-options {
    display: block;
    animation: fadeIn 0.3s ease forwards;
}

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

.lang-flag {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
    transition: all 0.3s ease;
}

h1 {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 2.5em;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.search-bar {
    margin: 20px auto;
    max-width: 600px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 15px 20px;
    border-radius: 12px;
    border: none;
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(8px);
    color: var(--text-primary);
    font-size: 1.1em;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    background: rgba(30, 41, 59, 0.95);
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3);
}

.row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .row {
        grid-template-columns: 1fr;
    }
}

.category {
    margin-bottom: 30px;
    padding: 20px;
    background: var(--card-gradient);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border-radius: 15px;
}

.category:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.2);
}

.category-title {
    color: var(--text-primary);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(255,255,255,0.1);
    font-size: 1.5em;
    display: flex;
    align-items: center;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.tool-card {
    padding: 20px;
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 15px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-gradient);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.2);
}

.tool-card:hover::before {
    opacity: 0.15;
}

.tool-name {
    font-weight: 600;
    font-size: 1.2em;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.tool-desc {
    color: var(--text-secondary);
    margin-bottom: 15px;
    font-size: 0.95em;
}

.tool-link {
    display: inline-block;
    color: var(--hover-color);
    font-size: 0.9em;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}

.tool-link:hover {
    text-decoration: underline;
}

/* 新闻卡片样式 */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.news-card {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 15px;
    padding: 20px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.2);
}

.news-date {
    color: var(--news-date);
    font-size: 0.9em;
    margin-bottom: 10px;
}

.news-title {
    font-weight: 600;
    font-size: 1.1em;
    margin-bottom: 10px;
    color: var(--text-primary);
    line-height: 1.4;
}

.news-desc {
    color: var(--text-secondary);
    margin-bottom: 15px;
    font-size: 0.95em;
    flex-grow: 1;
}

.news-source {
    color: var(--news-source);
    font-size: 0.9em;
    margin-bottom: 10px;
    font-weight: 500;
}

.news-read-more {
    color: var(--hover-color);
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.3s ease;
    align-self: flex-start;
}

.news-read-more:hover {
    text-decoration: underline;
}

/* 排行榜样式 */
.ranking-container {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 15px;
    padding: 20px;
}

.ranking-header {
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.ranking-title {
    font-weight: 600;
    font-size: 1.2em;
    color: var(--text-primary);
}

.ranking-update-time {
    color: var(--text-secondary);
    font-size: 0.9em;
}

.ranking-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.ranking-tab {
    padding: 8px 15px;
    background: rgba(30, 41, 59, 0.6);
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.9em;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    white-space: nowrap;
}

.ranking-tab.active {
    background: var(--hover-color);
    color: var(--text-primary);
}

.ranking-tab:hover {
    background: var(--hover-color);
    color: var(--text-primary);
}

.ranking-list {
    margin-top: 15px;
}

.ranking-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: all 0.3s ease;
}

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

.ranking-item:hover {
    background: rgba(59, 130, 246, 0.1);
}

.ranking-position {
    font-weight: 700;
    margin-right: 15px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(30, 41, 59, 0.8);
}

.ranking-position.pos-1 {
    color: var(--rank-1);
    background: rgba(255, 215, 0, 0.2);
}

.ranking-position.pos-2 {
    color: var(--rank-2);
    background: rgba(192, 192, 192, 0.2);
}

.ranking-position.pos-3 {
    color: var(--rank-3);
    background: rgba(205, 127, 50, 0.2);
}

.ranking-info {
    flex-grow: 1;
}

.ranking-model {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.ranking-metrics {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.ranking-metric {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85em;
    color: var(--text-secondary);
}

.ranking-metric-name {
    font-weight: 500;
}

.ranking-trend {
    margin-left: 10px;
    font-size: 0.85em;
    display: flex;
    align-items: center;
    gap: 2px;
}

.trend-up {
    color: #10b981;
}

.trend-down {
    color: #ef4444;
}

.trend-neutral {
    color: #9ca3af;
}

/* RTL支持样式 */
body.rtl {
    direction: rtl;
    text-align: right;
}

body.rtl .lang-switch {
    right: auto;
    left: 20px;
}

body.rtl .lang-option {
    flex-direction: row-reverse;
}

body.rtl .lang-current {
    flex-direction: row-reverse;
}

@media (max-width: 768px) {
    .ranking-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .row {
        grid-template-columns: 1fr;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
    }
}

/* 页脚样式 */
footer {
  background: #181818;
  color: #eee;
  text-align: center;
  padding: 32px 8px 16px 8px;
  font-size: 15px;
  border-top: 1px solid #222;
  margin-top: 48px;
}
.footer-links a {
  color: #7ec4fa;
  margin: 0 8px;
  text-decoration: underline;
}
.footer-links a:hover {
  color: #fff;
  background: #2a5b8c;
  border-radius: 4px;
  padding: 2px 6px;
}
.footer-brand small {
  display: block;
  margin: 12px 0 4px 0;
  color: #b0b0b0;
}
.footer-perf {
  margin-top: 8px;
  color: #a0e7a0;
  font-weight: bold;
}

/* 辅助内容无障碍增强 */
img, svg { outline: none; }
[alt] { outline: 2px dashed #7ec4fa; outline-offset: 2px; }
:focus { outline: 2px solid #7ec4fa; } 