/* ========================================
   本地藏文字体 - 多格式支持
   ======================================== */

/* 主字体 - 常规粗细 */
@font-face {
    font-family: 'TibetanLocal';
    src: url('fonts/tibetan-font.woff2') format('woff2'),
         url('fonts/tibetan-font.woff') format('woff'),
         url('fonts/tibetan-font.ttf') format('truetype'),
         url('fonts/tibetan-font.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* 粗体 */
@font-face {
    font-family: 'TibetanLocal';
    src: url('fonts/tibetan-font-bold.woff2') format('woff2'),
         url('fonts/tibetan-font-bold.woff') format('woff'),
         url('fonts/tibetan-font-bold.ttf') format('truetype'),
         url('fonts/tibetan-font-bold.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* 备用字体1 - Noto Sans Tibetan (推荐用于所有平台) */
@font-face {
    font-family: 'TibetanFallback1';
    src: url('fonts/NotoSansTibetan-Regular.woff2') format('woff2'),
         url('fonts/NotoSansTibetan-Regular.woff') format('woff'),
         url('fonts/NotoSansTibetan-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'TibetanFallback1';
    src: url('fonts/NotoSansTibetan-Bold.woff2') format('woff2'),
         url('fonts/NotoSansTibetan-Bold.woff') format('woff'),
         url('fonts/NotoSansTibetan-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* 备用字体2 - DDC Uchen (传统印刷体) */
@font-face {
    font-family: 'TibetanFallback2';
    src: url('fonts/DDC-Uchen.woff2') format('woff2'),
         url('fonts/DDC-Uchen.woff') format('woff'),
         url('fonts/DDC-Uchen.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* 备用字体3 - Jomolhari (美观显示) */
@font-face {
    font-family: 'TibetanFallback3';
    src: url('fonts/Jomolhari.woff2') format('woff2'),
         url('fonts/Jomolhari.woff') format('woff'),
         url('fonts/Jomolhari.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    /* 完整的字体栈 - 按优先级排列 */
    font-family: 
        /* 本地自定义字体 */
        'TibetanLocal',
        'TibetanFallback1',
        'TibetanFallback2',
        'TibetanFallback3',
        /* Windows 系统字体 */
        'Microsoft Himalaya',
        /* macOS 系统字体 */
        'Kokonor',
        'Kailasa',
        /* Linux 常见字体 */
        'Tibetan Machine Uni',
        'Noto Sans Tibetan',
        'Noto Serif Tibetan',
        /* 通用 Noto 字体 */
        'Noto Sans',
        /* 系统默认 */
        system-ui,
        -apple-system,
        /* 最后备用 */
        serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 60px 40px;
    text-align: center;
}

.header h1 {
    font-size: 3em;
    margin-bottom: 15px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
    font-size: 1.3em;
    opacity: 0.95;
    font-weight: 400;
}

.info-card {
    background: #e3f2fd;
    border-left: 5px solid #2196f3;
    padding: 30px;
    margin: 40px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.info-icon {
    font-size: 2em;
    margin-bottom: 10px;
}

.info-card p {
    margin: 5px 0;
    font-size: 1.1em;
}

.english {
    color: #666;
    font-style: italic;
}

.test-section {
    padding: 40px;
}

.test-section h2 {
    font-size: 2.2em;
    margin-bottom: 30px;
    color: #667eea;
    border-bottom: 3px solid #667eea;
    padding-bottom: 10px;
}

.small {
    font-size: 0.6em;
    color: #999;
    font-weight: 400;
}

.char-display {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 25px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.char-display:hover {
    border-color: #667eea;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
}

.char-display h3 {
    font-size: 1.5em;
    margin-bottom: 20px;
    color: #495057;
}

.main-display {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    border: 3px solid #ff8a65;
}

.tibetan-text {
    /* 藏文专用字体栈 - 优先使用本地字体 */
    font-family: 
        /* 本地自定义字体（最高优先级）*/
        'TibetanLocal',
        'TibetanFallback1',
        'TibetanFallback2',
        'TibetanFallback3',
        /* Windows 系统内置 */
        'Microsoft Himalaya',
        /* macOS 系统内置 */
        'Kokonor',
        'Kailasa',
        /* Linux 常用藏文字体 */
        'Tibetan Machine Uni',
        'DDC Uchen',
        'Jomolhari',
        /* Google Noto 系列 */
        'Noto Sans Tibetan',
        'Noto Serif Tibetan',
        /* 最后备用 */
        serif;
    font-size: 2em;
    line-height: 2;
    word-wrap: break-word;
    color: #2c3e50;
    padding: 20px;
    background: white;
    border-radius: 10px;
    text-align: justify;
    /* 优化藏文渲染 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: "liga" 1, "calt" 1;
}

.tibetan-text.large {
    font-size: 2.5em;
    line-height: 2.2;
}

.test-phrase {
    padding: 40px;
    background: #f1f3f5;
}

.test-phrase h3 {
    font-size: 1.8em;
    margin-bottom: 25px;
    color: #495057;
}

.phrase-box {
    background: white;
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.tibetan-text.phrase {
    font-size: 4em;
    color: #764ba2;
    margin-bottom: 20px;
    font-weight: 700;
}

.phrase-info {
    font-size: 1.2em;
    color: #666;
    font-style: italic;
}

.verification-section {
    padding: 40px;
}

.verification-section h2 {
    font-size: 2.2em;
    margin-bottom: 30px;
    color: #667eea;
    border-bottom: 3px solid #667eea;
    padding-bottom: 10px;
}

.verification-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    border: 2px solid #e9ecef;
}

.verification-card p {
    font-size: 1.1em;
    margin-bottom: 20px;
    font-weight: 600;
}

.verification-card ul {
    list-style: none;
    margin-bottom: 30px;
}

.verification-card li {
    padding: 12px;
    margin: 10px 0;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 1.05em;
}

.result-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin: 30px 0;
}

.btn {
    padding: 15px 40px;
    font-size: 1.2em;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.btn-success {
    background: #4caf50;
    color: white;
}

.btn-success:hover {
    background: #45a049;
}

.btn-error {
    background: #f44336;
    color: white;
}

.btn-error:hover {
    background: #da190b;
}

.result-message {
    margin-top: 20px;
    padding: 20px;
    border-radius: 10px;
    font-size: 1.1em;
    text-align: center;
    display: none;
}

.result-message.show {
    display: block;
    animation: slideIn 0.5s ease;
}

.result-message.success {
    background: #d4edda;
    color: #155724;
    border: 2px solid #c3e6cb;
}

.result-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #f5c6cb;
}

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

.help-section {
    padding: 40px;
    background: #fff3e0;
}

.help-section h3 {
    font-size: 1.8em;
    margin-bottom: 20px;
    color: #e65100;
}

.help-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    border: 2px solid #ffb74d;
}

.help-card p {
    margin-bottom: 20px;
    font-size: 1.1em;
}

.help-card ol {
    margin-left: 20px;
}

.help-card li {
    margin: 15px 0;
    font-size: 1.05em;
    line-height: 1.8;
}

.footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 30px;
}

.footer p {
    margin: 8px 0;
}

.footer-note {
    font-size: 0.9em;
    opacity: 0.8;
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 2em;
    }
    
    .subtitle {
        font-size: 1em;
    }
    
    .tibetan-text {
        font-size: 1.5em;
    }
    
    .tibetan-text.large {
        font-size: 1.8em;
    }
    
    .tibetan-text.phrase {
        font-size: 2.5em;
    }
    
    .result-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .container {
        margin: 10px;
    }
    
    .info-card, .test-section, .verification-section, .help-section {
        padding: 20px;
    }
}
