@charset "UTF-8";
/* 
 * TTFox Stock Rating Website Stylesheet
 * Responsive design, supports PC and mobile
 */

/* ========== Global Styles ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Rating Colors - Red for up, Green for down (Chinese market convention) */
    --rating-8: #e53935;  /* Strong Long - Dark Red */
    --rating-7: #ff6b4a;  /* Long - Red */
    --rating-6: #ff9966;  /* Moderate Long - Light Red */
    --rating-5: #ffcc80;  /* Weak Long - Pale Orange */
    --rating-4: #85e0b8;  /* Weak Short - Pale Green */
    --rating-3: #40c896;  /* Moderate Short - Light Green */
    --rating-2: #15a06a;  /* Short - Green */
    --rating-1: #0d7a4e;  /* Strong Short - Dark Green */
    --rating-0: #9e9e9e;  /* No Rating - Gray */
    
    /* Theme Colors */
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --bg-color: #f5f7fa;
    --card-bg: #ffffff;
    --border-color: #e0e0e0;
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

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

a:hover {
    text-decoration: underline;
}

/* ========== Header ========== */
.header {
    background-color: var(--primary-color);
    color: white;
    padding: var(--spacing-md) 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header .container {
    position: relative;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: var(--spacing-xs);
}

.logo a {
    color: white;
    text-decoration: none;
}

.tagline {
    color: #ecf0f1;
    font-size: 0.9rem;
}

.nav {
    display: flex;
    gap: var(--spacing-md);
    margin-top: var(--spacing-sm);
}

.nav a {
    color: white;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: 4px;
    transition: background-color 0.3s;
}

.nav a:hover,
.nav a.active {
    background-color: rgba(255,255,255,0.2);
    text-decoration: none;
}

/* Main Navigation */
.main-nav {
    display: flex;
    gap: var(--spacing-xl);
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid rgba(255,255,255,0.2);
    flex-wrap: wrap;
}

.nav-section {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.nav-label {
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
    font-weight: 600;
}

.nav-section a {
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    transition: background-color 0.3s;
    font-size: 0.95rem;
    white-space: nowrap;
}

.nav-section a:hover {
    background-color: rgba(255,255,255,0.15);
    text-decoration: none;
}

/* ========== Language Switcher ========== */
.lang-switcher {
    position: absolute;
    top: 0;
    right: 0;
}

.lang-btn {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.4rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.lang-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.lang-btn:active {
    transform: translateY(0);
}

/* ========== Main Content ========== */
.main-content {
    padding: var(--spacing-lg) 0;
    min-height: calc(100vh - 200px);
}

.hero {
    text-align: center;
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-lg) 0;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-sm);
    color: var(--primary-color);
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
}

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

/* ========== Software Promo Cards ========== */
.software-promo {
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-lg) 0;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: var(--spacing-lg);
    color: var(--primary-color);
}

.software-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.software-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: var(--spacing-xl);
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    color: white;
    position: relative;
    overflow: hidden;
}

.software-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    transform: rotate(45deg);
}

.software-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 24px rgba(0,0,0,0.3);
}

.software-icon {
    margin-bottom: var(--spacing-md);
    color: rgba(255,255,255,0.9);
}

.software-card h3 {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-sm);
    font-weight: bold;
}

.software-card p {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: var(--spacing-md);
}

.software-badge {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* ========== Market Cards ========== */
.markets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.market-card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: var(--spacing-lg);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.market-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.market-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: var(--spacing-sm);
}

.market-header h3 {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.market-code {
    background: var(--secondary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.9rem;
}

.indices-list {
    min-height: 150px;
}

.index-item {
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.index-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.index-code {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.market-footer {
    margin-top: var(--spacing-md);
    text-align: right;
}

.view-detail {
    color: var(--secondary-color);
    font-weight: 600;
}

/* ========== Rating Badges ========== */
.rating-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
}

.rating-1, .rating-badge.rating-1 { background-color: var(--rating-1); }
.rating-2, .rating-badge.rating-2 { background-color: var(--rating-2); }
.rating-3, .rating-badge.rating-3 { background-color: var(--rating-3); }
.rating-4, .rating-badge.rating-4 { background-color: var(--rating-4); color: #333; }
.rating-5, .rating-badge.rating-5 { background-color: var(--rating-5); color: #333; }
.rating-6, .rating-badge.rating-6 { background-color: var(--rating-6); color: white; }
.rating-7, .rating-badge.rating-7 { background-color: var(--rating-7); color: white; }
.rating-8, .rating-badge.rating-8 { background-color: var(--rating-8); color: white; }
.rating-0, .rating-badge.rating-0 { background-color: var(--rating-0); color: white; }

/* US Market: Green for up, Red for down (US market convention) */
.us-market .rating-1, .us-market .rating-badge.rating-1 { background-color: var(--rating-8); color: white; }
.us-market .rating-2, .us-market .rating-badge.rating-2 { background-color: var(--rating-7); color: white; }
.us-market .rating-3, .us-market .rating-badge.rating-3 { background-color: var(--rating-6); color: white; }
.us-market .rating-4, .us-market .rating-badge.rating-4 { background-color: var(--rating-5); color: #333; }
.us-market .rating-5, .us-market .rating-badge.rating-5 { background-color: var(--rating-4); color: #333; }
.us-market .rating-6, .us-market .rating-badge.rating-6 { background-color: var(--rating-3); color: white; }
.us-market .rating-7, .us-market .rating-badge.rating-7 { background-color: var(--rating-2); color: white; }
.us-market .rating-8, .us-market .rating-badge.rating-8 { background-color: var(--rating-1); color: white; }
.us-market .rating-0, .us-market .rating-badge.rating-0 { background-color: var(--rating-0); color: white; }

/* ========== Info Section ========== */
.info-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-xl);
}

.info-card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: var(--spacing-lg);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.info-card h4 {
    font-size: 1.3rem;
    margin-bottom: var(--spacing-md);
    color: var(--primary-color);
}

.info-card p {
    margin-bottom: var(--spacing-sm);
    line-height: 1.8;
}

.rating-legend {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.rating-item {
    display: flex;
    gap: var(--spacing-xs);
    flex-wrap: wrap;
}

/* ========== Page Header (Market Detail) ========== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.page-header h2 {
    font-size: 2rem;
    color: var(--primary-color);
}

.date-selector {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.date-selector label {
    font-weight: 600;
}

.date-selector select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    background-color: white;
    cursor: pointer;
}

/* ========== Tabs ========== */
.tabs {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    border-bottom: 2px solid var(--border-color);
}

.tab-button {
    background: none;
    border: none;
    padding: var(--spacing-sm) var(--spacing-lg);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    transition: color 0.3s;
}

.tab-button:hover {
    color: var(--secondary-color);
}

.tab-button.active {
    color: var(--secondary-color);
}

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

.tab-content {
    background: var(--card-bg);
    border-radius: 8px;
    padding: var(--spacing-lg);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* ========== Ranking Table ========== */
.table-container {
    overflow-x: auto;
}

.ranking-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.ranking-table thead {
    background-color: var(--primary-color);
    color: white;
}

.ranking-table th {
    padding: var(--spacing-sm);
    text-align: left;
    font-weight: 600;
}

.ranking-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s;
}

.ranking-table tbody tr:hover {
    background-color: #f8f9fa;
}

.ranking-table td {
    padding: var(--spacing-sm);
}

.ranking-table td:first-child {
    font-weight: 600;
    color: var(--secondary-color);
}

.loading-cell {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--text-secondary);
}

/* ========== Info Notes ========== */
.info-note {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: var(--spacing-md);
    margin-top: var(--spacing-lg);
    border-radius: 4px;
}

.info-note p {
    margin-bottom: var(--spacing-sm);
    font-weight: 600;
}

.info-note ul {
    margin-left: var(--spacing-lg);
}

.info-note li {
    margin-bottom: var(--spacing-xs);
}

/* ========== Loading State ========== */
.loading {
    text-align: center;
    padding: var(--spacing-lg);
    color: var(--text-secondary);
}

.error {
    color: var(--accent-color);
    text-align: center;
    padding: var(--spacing-lg);
}

/* ========== Footer ========== */
.footer {
    background-color: var(--primary-color);
    color: white;
    padding: var(--spacing-lg) 0;
    margin-top: var(--spacing-xl);
    text-align: center;
}

.footer p {
    margin-bottom: var(--spacing-xs);
}

.disclaimer {
    font-size: 0.85rem;
    color: #bdc3c7;
}

/* ========== Software Detail Page ========== */
.software-detail {
    max-width: 1000px;
    margin: 0 auto;
}

.software-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: var(--spacing-xl) var(--spacing-lg);
    border-radius: 12px;
    margin-bottom: var(--spacing-xl);
    text-align: center;
}

.software-hero h1 {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-sm);
}

.software-hero p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.software-content {
    background: var(--card-bg);
    border-radius: 8px;
    padding: var(--spacing-xl);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: var(--spacing-lg);
}

.software-content h2 {
    font-size: 1.8rem;
    margin-bottom: var(--spacing-md);
    color: var(--primary-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: var(--spacing-sm);
}

.software-content h3 {
    font-size: 1.3rem;
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-sm);
    color: var(--primary-color);
}

.software-content ul {
    margin-left: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
}

.software-content li {
    margin-bottom: var(--spacing-xs);
    line-height: 1.8;
}

.screenshot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-md);
    margin: var(--spacing-lg) 0;
}

.screenshot {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: transform 0.3s;
    cursor: pointer;
}

.screenshot:hover {
    transform: scale(1.05);
}

.screenshot img {
    width: 100%;
    height: auto;
    display: block;
}

.screenshot-caption {
    text-align: center;
    margin-top: var(--spacing-xs);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.download-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: var(--spacing-xl);
    margin-top: var(--spacing-xl);
}

.download-buttons {
    display: flex;
    gap: var(--spacing-md);
    flex-wrap: wrap;
    justify-content: center;
    margin-top: var(--spacing-lg);
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--secondary-color);
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: background-color 0.3s, transform 0.2s;
}

.download-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
    text-decoration: none;
}

.download-btn svg {
    width: 24px;
    height: 24px;
}

.back-link {
    display: inline-block;
    margin-top: var(--spacing-lg);
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
}

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

/* ========== Image Modal ========== */
.image-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    justify-content: center;
    align-items: center;
    cursor: pointer;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
    animation: zoomIn 0.3s ease;
    cursor: default;
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: white;
    font-size: 48px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 10001;
}

.modal-close:hover,
.modal-close:focus {
    color: #bbb;
}

/* ========== Responsive Design ========== */
@media (max-width: 768px) {
    .hero h2 {
        font-size: 1.8rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .markets-grid {
        grid-template-columns: 1fr;
    }
    
    .info-section {
        grid-template-columns: 1fr;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .date-selector {
        width: 100%;
    }
    
    .date-selector select {
        flex: 1;
    }
    
    .tabs {
        overflow-x: auto;
    }
    
    .tab-content {
        padding: var(--spacing-sm);
    }
    
    .ranking-table {
        font-size: 0.85rem;
    }
    
    .ranking-table th,
    .ranking-table td {
        padding: var(--spacing-xs);
    }
    
    .lang-switcher {
        position: static;
        margin-top: var(--spacing-sm);
    }
    
    .main-nav {
        padding-top: var(--spacing-sm);
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 var(--spacing-sm);
    }
    
    .logo {
        font-size: 1.5rem;
    }
    
    .nav {
        flex-direction: column;
        gap: var(--spacing-xs);
    }
    
    .hero h2 {
        font-size: 1.5rem;
    }
    
    .market-header h3 {
        font-size: 1.2rem;
    }
    
    .page-header h2 {
        font-size: 1.5rem;
    }
    
    .modal-close {
        top: 10px;
        right: 20px;
        font-size: 36px;
    }
    
    .modal-content {
        max-width: 98%;
        max-height: 98%;
    }
}


