/* ==========
   LATAM Tariff - 简约专业设计系统
   去掉花哨动画 · 专注内容呈现 · 专业大气
   ========== */

/* CSS自定义属性 - 设计令牌 */
:root {
    /* 主色调 - 专业蓝色系 */
    --primary-50: #eff6ff;
    --primary-100: #dbeafe;
    --primary-200: #bfdbfe;
    --primary-300: #93c5fd;
    --primary-400: #60a5fa;
    --primary-500: #3b82f6;
    --primary-600: #2563eb;
    --primary-700: #1d4ed8;
    --primary-800: #1e40af;
    --primary-900: #1e3a8a;
    
    /* 强调色 - 橙色 */
    --accent-500: #f97316;
    --accent-600: #ea580c;
    
    /* 灰色系 */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* 语义色 */
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;
    
    /* 排版 */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    
    --text-xs: 0.75rem;    /* 12px */
    --text-sm: 0.875rem;   /* 14px */
    --text-base: 1rem;     /* 16px */
    --text-lg: 1.125rem;   /* 18px */
    --text-xl: 1.25rem;    /* 20px */
    --text-2xl: 1.5rem;    /* 24px */
    --text-3xl: 1.875rem;  /* 30px */
    --text-4xl: 2.25rem;   /* 36px */
    --text-5xl: 3rem;      /* 48px */
    
    /* 间距 */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    
    /* 阴影 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    
    /* 布局 */
    --max-width: 1200px;
    --nav-height: 64px;
    
    /* 动画 */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --duration: 200ms;
}

/* 深色主题 */
[data-theme="dark"] {
    --primary-50: #1e3a8a;
    --primary-100: #1e40af;
    --primary-200: #1d4ed8;
    --primary-300: #2563eb;
    --primary-400: #3b82f6;
    --primary-500: #60a5fa;
    --primary-600: #93c5fd;
    --primary-700: #bfdbfe;
    --primary-800: #dbeafe;
    --primary-900: #eff6ff;
    
    --gray-50: #111827;
    --gray-100: #1f2937;
    --gray-200: #374151;
    --gray-300: #4b5563;
    --gray-400: #6b7280;
    --gray-500: #9ca3af;
    --gray-600: #d1d5db;
    --gray-700: #e5e7eb;
    --gray-800: #f3f4f6;
    --gray-900: #f9fafb;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--gray-800);
    background-color: var(--gray-50);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 跳过链接（无障碍） */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    padding: var(--space-3) var(--space-6);
    background: var(--primary-600);
    color: white;
    border-radius: 0 0 0.5rem 0.5rem;
    z-index: 100;
    transition: top var(--duration) var(--ease);
}

.skip-link:focus {
    top: 0;
}

/* ==========
   导航栏
   ========== */
.nav-bar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--gray-200);
    height: var(--nav-height);
}

[data-theme="dark"] .nav-bar {
    background: rgba(17, 24, 39, 0.95);
    border-bottom-color: var(--gray-700);
}

.nav-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-6);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-weight: 700;
    font-size: var(--text-xl);
}

.brand-logo {
    color: var(--primary-600);
}

.brand-text {
    color: var(--gray-800);
}

.brand-highlight {
    color: var(--primary-600);
}

.nav-links {
    display: flex;
    gap: var(--space-8);
}

.nav-link {
    color: var(--gray-600);
    text-decoration: none;
    font-weight: 500;
    font-size: var(--text-sm);
    padding: var(--space-2) 0;
    border-bottom: 2px solid transparent;
    transition: all var(--duration) var(--ease);
}

.nav-link:hover, .nav-link.active {
    color: var(--primary-600);
    border-bottom-color: var(--primary-600);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.lang-switch, .theme-toggle {
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--gray-300);
    border-radius: 0.375rem;
    background: transparent;
    color: var(--gray-700);
    font-size: var(--text-sm);
    cursor: pointer;
    transition: all var(--duration) var(--ease);
}

.lang-switch:hover, .theme-toggle:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
}

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    padding: var(--space-2);
}

.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

/* ==========
   Hero区域
   ========== */
.hero-section {
    padding: var(--space-16) 0;
    background: linear-gradient(135deg, var(--primary-50) 0%, white 100%);
}

[data-theme="dark"] .hero-section {
    background: linear-gradient(135deg, var(--gray-900) 0%, var(--gray-800) 100%);
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-6);
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-16);
    align-items: center;
}

.hero-title {
    font-size: var(--text-5xl);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: var(--space-6);
}

.title-main {
    display: block;
    color: var(--gray-900);
}

.title-accent {
    display: block;
    color: var(--primary-600);
}

.hero-desc {
    font-size: var(--text-lg);
    color: var(--gray-600);
    margin-bottom: var(--space-8);
    line-height: 1.7;
}

.search-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
}

.search-tag {
    padding: var(--space-2) var(--space-4);
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 0.375rem;
    font-size: var(--text-sm);
    color: var(--gray-700);
    cursor: pointer;
    transition: all var(--duration) var(--ease);
}

.search-tag:hover {
    background: var(--primary-50);
    border-color: var(--primary-300);
    color: var(--primary-700);
}

/* ==========
   搜索面板
   ========== */
.search-panel {
    background: white;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-xl);
    padding: var(--space-8);
    border: 1px solid var(--gray-100);
}

[data-theme="dark"] .search-panel {
    background: var(--gray-800);
    border-color: var(--gray-600);
}

.form-header {
    margin-bottom: var(--space-6);
}

.form-header h3 {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: var(--space-2);
}

.form-header p {
    font-size: var(--text-sm);
    color: var(--gray-500);
}

.input-group {
    margin-bottom: var(--space-5);
}

.input-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: var(--space-2);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: var(--space-3);
    color: var(--gray-400);
    pointer-events: none;
}

.form-input, .form-select {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    padding-left: calc(var(--space-3) + 20px + var(--space-2));
    border: 1px solid var(--gray-300);
    border-radius: 0.5rem;
    font-size: var(--text-base);
    color: var(--gray-800);
    background: white;
    transition: all var(--duration) var(--ease);
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-select {
    padding-left: var(--space-4);
    cursor: pointer;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: var(--space-3);
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: var(--gray-700);
    cursor: pointer;
}

.checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.search-button {
    width: 100%;
    padding: var(--space-4) var(--space-6);
    background: var(--primary-600);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: var(--text-base);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    margin-top: var(--space-4);
}

.search-button:hover {
    background: var(--primary-700);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.search-button:active {
    transform: translateY(0);
}

.btn-icon {
    flex-shrink: 0;
}

.clear-btn {
    position: absolute;
    right: var(--space-3);
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: var(--space-1);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 搜索建议 */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    max-height: 300px;
    overflow-y: auto;
    z-index: 10;
    display: none;
}

.search-suggestions.active {
    display: block;
}

.suggestion-item {
    padding: var(--space-3) var(--space-4);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background var(--duration) var(--ease);
}

.suggestion-item:hover {
    background: var(--gray-50);
}

.suggestion-name {
    font-size: var(--text-sm);
    color: var(--gray-800);
}

.suggestion-hs {
    font-size: var(--text-xs);
    color: var(--gray-500);
    font-family: var(--font-mono);
}

/* ==========
   结果区域
   ========== */
.results-section {
    padding: var(--space-12) 0;
    background: white;
}

[data-theme="dark"] .results-section {
    background: var(--gray-800);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-8);
}

.section-title {
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--gray-900);
}

.export-btn {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: 0.375rem;
    font-size: var(--text-sm);
    color: var(--gray-700);
    cursor: pointer;
    transition: all var(--duration) var(--ease);
}

.export-btn:hover {
    background: var(--gray-200);
}

/* 结果表格 */
.result-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .result-table {
    background: var(--gray-700);
}

.result-table th {
    padding: var(--space-4);
    text-align: left;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--gray-600);
    background: var(--gray-50);
    border-bottom: 2px solid var(--gray-200);
}

[data-theme="dark"] .result-table th {
    background: var(--gray-600);
    color: var(--gray-400);
    border-bottom-color: var(--gray-500);
}

.result-table td {
    padding: var(--space-4);
    font-size: var(--text-sm);
    color: var(--gray-800);
    border-bottom: 1px solid var(--gray-100);
}

[data-theme="dark"] .result-table td {
    color: var(--gray-300);
    border-bottom-color: var(--gray-600);
}

.result-table tr:last-child td {
    border-bottom: none;
}

.result-table tr:hover td {
    background: var(--gray-50);
}

[data-theme="dark"] .result-table tr:hover td {
    background: var(--gray-600);
}

/* 认证徽章 */
.cert-badge {
    display: inline-block;
    padding: var(--space-1) var(--space-3);
    background: var(--primary-50);
    color: var(--primary-700);
    border-radius: 0.25rem;
    font-size: var(--text-xs);
    font-weight: 500;
    margin: 2px;
}

/* 价格标签 */
.price-tag {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: #fef3c7;
    color: #92400e;
    border-radius: 0.25rem;
    font-size: var(--text-xs);
    font-weight: 500;
}

[data-theme="dark"] .price-tag {
    background: #78350f;
    color: #fbbf24;
}

.price-tag::before {
    content: "¥";
}

/* ==========
   计算器区域
   ========== */
.calculator-section {
    padding: var(--space-12) 0;
    background: var(--gray-50);
}

[data-theme="dark"] .calculator-section {
    background: var(--gray-900);
}

.calculator-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
}

.calc-form {
    background: white;
    padding: var(--space-8);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-md);
}

[data-theme="dark"] .calc-form {
    background: var(--gray-700);
}

.calc-results {
    background: white;
    padding: var(--space-8);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-md);
}

[data-theme="dark"] .calc-results {
    background: var(--gray-700);
}

/* ==========
   历史记录
   ========== */
.history-section {
    padding: var(--space-12) 0;
    background: white;
}

[data-theme="dark"] .history-section {
    background: var(--gray-800);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.history-item {
    padding: var(--space-4);
    background: var(--gray-50);
    border-radius: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all var(--duration) var(--ease);
}

[data-theme="dark"] .history-item {
    background: var(--gray-700);
}

.history-item:hover {
    background: var(--gray-100);
    box-shadow: var(--shadow-sm);
}

.history-redo-btn {
    padding: var(--space-2) var(--space-4);
    background: var(--primary-600);
    color: white;
    border: none;
    border-radius: 0.375rem;
    font-size: var(--text-sm);
    cursor: pointer;
    transition: all var(--duration) var(--ease);
}

.history-redo-btn:hover {
    background: var(--primary-700);
}

.clear-btn-text {
    padding: var(--space-2) var(--space-4);
    background: none;
    border: 1px solid var(--gray-300);
    border-radius: 0.375rem;
    font-size: var(--text-sm);
    color: var(--gray-600);
    cursor: pointer;
    transition: all var(--duration) var(--ease);
}

.clear-btn-text:hover {
    background: var(--error);
    color: white;
    border-color: var(--error);
}

/* ==========
   通知
   ========== */
.notification-container {
    position: fixed;
    top: calc(var(--nav-height) + var(--space-4));
    right: var(--space-4);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.notification {
    padding: var(--space-4) var(--space-6);
    background: white;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--primary-500);
    font-size: var(--text-sm);
    animation: slideIn 0.3s var(--ease);
}

.notification-success { border-left-color: var(--success); }
.notification-warning { border-left-color: var(--warning); }
.notification-error { border-left-color: var(--error); }

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ==========
   页脚
   ========== */
.site-footer {
    padding: var(--space-8) 0;
    background: var(--gray-900);
    color: var(--gray-400);
    text-align: center;
    font-size: var(--text-sm);
}

[data-theme="dark"] .site-footer {
    background: black;
}

/* ==========
   响应式
   ========== */
@media (max-width: 1024px) {
    .hero-grid {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }
    
    .hero-title {
        font-size: var(--text-4xl);
    }
    
    .calculator-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    
    .hero-title {
        font-size: var(--text-3xl);
    }
    
    .search-tags {
        flex-direction: column;
    }
    
    .checkbox-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==========
   动画（简约版）
   ========== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.4s var(--ease);
}
