:root {
    --primary-color: #1a237e;
    --secondary-color: #304ffe;
    --background-color: #f5f6fa;
    --text-color: #2c3e50;
    --border-radius: 12px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --hover-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    background: var(--background-color);
    color: var(--text-color);
    min-height: 100vh;
    padding: 2rem 0;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e7eb 100%);
    -webkit-text-size-adjust: 100%;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

h1 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 2rem;
    font-size: 2.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    letter-spacing: -0.5px;
}

h1 + p {
    color: #666;
    font-size: 1.15rem;
    line-height: 1.7;
    max-width: 900px;
    margin: 0.8rem auto 2.5rem;
    text-align: center;
    padding: 0 1.5rem;
    font-weight: 400;
    letter-spacing: 0.2px;
    opacity: 0.9;
}

@media (max-width: 768px) {
    h1 + p {
        font-size: 1rem;
        line-height: 1.6;
        margin: 0.6rem auto 2rem;
        padding: 0 1rem;
    }
}

.calculator-section {
    background: white;
    padding: 2.5rem 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    contain: content;
}

.calculator-section:hover {
    box-shadow: var(--hover-shadow);
}

.calculator-section h2 {
    color: var(--primary-color);
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.symbol-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
    text-align: center;
}

.symbol-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.label-with-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.label-with-preview h3 {
    font-weight: 600;
    font-size: 1.4rem;
    color: var(--primary-color);
    margin: 0;
}

.selected-preview {
    width: 35px;
    height: 35px;
    border: 2px solid var(--primary-color);
    border-radius: var(--border-radius);
    background: url('image/bg.webp') center/cover no-repeat;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 4px;
    transition: all 0.3s ease;
}

.selected-preview.has-symbol {
    display: flex;
}

.selected-preview img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    filter: brightness(0) sepia(100%) saturate(2000%) hue-rotate(190deg);
}

.symbol-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin: 0 auto;
    max-width: 200px;
}

.symbol {
    width: 70px;
    height: 70px;
    border: 2px solid var(--primary-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    background: url('image/bg.webp') center/cover no-repeat;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    transform: translate3d(0, 0, 0);
    will-change: transform;
    contain: layout style paint;
}

.symbol img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: brightness(0);
    transition: all 0.3s ease;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.symbol:hover {
    transform: scale(1.05);
    -webkit-transform: scale(1.05);
    border-color: var(--secondary-color);
    box-shadow: 0 4px 12px rgba(48, 79, 254, 0.2);
}

.symbol.selected {
    border: 3px solid var(--secondary-color);
    box-shadow: 0 0 20px rgba(48, 79, 254, 0.3);
    transform: scale(1.1);
    -webkit-transform: scale(1.1);
    background-color: rgba(48, 79, 254, 0.05);
}

.symbol.selected img {
    filter: brightness(0) sepia(100%) saturate(2000%) hue-rotate(190deg);
}

.results {
    text-align: center;
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 2px solid rgba(0, 0, 0, 0.05);
}

.results h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

.result-numbers {
    display: flex;
    justify-content: center;
    gap: 2rem;
    font-size: 2.2rem;
    flex-wrap: wrap;
}

.result-item {
    background: linear-gradient(135deg, rgba(48, 79, 254, 0.1) 0%, rgba(26, 35, 126, 0.1) 100%);
    padding: 0.8rem 2rem;
    border-radius: var(--border-radius);
    min-width: 100px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(48, 79, 254, 0.2);
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.result-item span {
    font-weight: 700;
    color: var(--secondary-color);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.how-to {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.how-to h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

.how-to ol {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.how-to li {
    margin-bottom: 0.5rem;
}

.how-to p {
    color: var(--secondary-color);
    font-weight: 500;
}

@media (min-width: 768px) {
    .symbol-selector {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .calculator-section {
        padding: 3rem;
    }
    
    .calculator-section h2 {
        font-size: 2.2rem;
        margin-bottom: 2.5rem;
    }
    
    .how-to, .video-guide {
        padding: 3rem;
    }
}

.algorithm-guide {
    background: white;
    padding: 3rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-top: 2rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.algorithm-guide h2 {
    color: var(--primary-color);
    margin-bottom: 2rem;
    font-size: 1.8rem;
}

.example-calculation {
    background: rgba(245, 246, 250, 0.5);
    padding: 2rem;
    border-radius: var(--border-radius);
    margin-top: 1rem;
}

.example-calculation h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
}

.example-calculation ul {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}

.example-calculation li {
    margin-bottom: 0.8rem;
    padding-left: 1.5rem;
    position: relative;
}

.example-calculation li strong {
    color: var(--primary-color);
    margin-right: 0.5rem;
}

.formula-explanation {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    margin: 2rem 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.formula-explanation h4 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.formula-explanation ol {
    list-style: none;
    counter-reset: formula-counter;
    padding: 0;
}

.formula-explanation ol li {
    counter-increment: formula-counter;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(245, 246, 250, 0.5);
    border-radius: var(--border-radius);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.formula-explanation ol li::before {
    content: counter(formula-counter);
    background: var(--primary-color);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    font-size: 0.9rem;
    font-weight: bold;
}

.formula {
    font-family: monospace;
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.calculation {
    color: var(--secondary-color);
    font-family: monospace;
    font-size: 1.1rem;
    margin-left: 2rem;
}

.note {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
}

.pro-tip {
    background: linear-gradient(135deg, rgba(48, 79, 254, 0.1) 0%, rgba(26, 35, 126, 0.1) 100%);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-top: 2rem;
    border: 1px solid rgba(48, 79, 254, 0.2);
}

.pro-tip h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.2rem;
}

.pro-tip p {
    color: var(--text-color);
    margin: 0;
    line-height: 1.6;
}

.symbol-values {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.symbol-values h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
    text-align: left;
}

.symbol-table {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    background: rgba(245, 246, 250, 0.5);
    padding: 2rem;
    border-radius: var(--border-radius);
}

.symbol-row {
    display: flex;
    justify-content: center;
    gap: 3rem;
}

.symbol-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 100px;
}

.symbol-cell img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    background: url('image/bg.webp') center/cover no-repeat;
    border-radius: var(--border-radius);
    padding: 6px;
}

.symbol-cell .value {
    font-family: monospace;
    font-size: 1.2rem;
    color: var(--primary-color);
    font-weight: bold;
}

.example-symbols {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin: 2rem 0;
    background: rgba(245, 246, 250, 0.5);
    padding: 1.5rem;
    border-radius: var(--border-radius);
}

.example-symbol {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.example-symbol span {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.example-symbol img {
    width: 45px;
    height: 45px;
    object-fit: contain;
    background: url('image/bg.webp') center/cover no-repeat;
    border-radius: var(--border-radius);
    padding: 6px;
}

.example-symbol .value {
    font-family: monospace;
    color: var(--secondary-color);
}

.video-guide {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    background: var(--bg-color);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.video-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.video-placeholder:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.play-button {
    width: 80px;
    height: 80px;
    background: #FF0000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 32px;
    margin-bottom: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease;
}

.video-placeholder:hover .play-button {
    transform: scale(1.1);
}

.video-placeholder p {
    color: white;
    font-weight: 500;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    display: none;
}

@media (max-width: 768px) {
    .symbol {
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    
    .symbol:hover {
        transform: none;
    }
    
    .symbol.selected {
        transform: scale(1.05);
    }
    
    /* Disable hover effects on mobile */
    @media (hover: none) {
        .symbol:hover {
            transform: none;
        }
    }
}

/* Footer Styles */
.footer-links {
    text-align: center;
    padding: 1.5rem 0;
    margin-top: 2rem;
}

.footer-links a {
    color: var(--text-color);
    text-decoration: none;
    margin: 0 0.5rem;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--secondary-color);
}

.steps-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin: 2rem 0;
}

.step-item {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    text-align: center;
    position: relative;
}

.step-number {
    background: var(--primary-color);
    color: white;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-weight: bold;
}

.step-item h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.step-item p {
    color: #666;
    line-height: 1.5;
    font-size: 0.95rem;
}

.bonus-tip {
    text-align: center;
    margin-top: 2rem;
    color: #444;
}

@media (max-width: 768px) {
    .steps-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

.faq-section {
    background: white;
    padding: 3rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-top: 2rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.faq-section h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}


.faq-item {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.faq-item summary {
    padding: 1rem 1.5rem;
    cursor: pointer;
    font-weight: 600;
    color: #333;
    position: relative;
    list-style: none;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    transition: transform 0.2s ease;
}

.faq-item[open] summary::after {
    content: '-';
}

.faq-content {
    padding: 0 1.5rem 1.5rem;
    color: #666;
    line-height: 1.6;
}

.faq-item:hover {
    background: #f9fafb;
    transition: background-color 0.2s ease;
}