:root {
    --primary-color: #c5a47e;
    --secondary-color: #2c3e50;
    --gold-color: #d4af37;
    --up-color: #4CAF50;
    --down-color: #f44336;
    --bg-dark: #1a1a1a;
    --border-color: #333;
    --text-color: #333;
    --light-bg: #f9f9f9;
}

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

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
}

.header {
    background: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7)), url('photo-1560520653-9e0e4c89eb11.avif');
    background-size: cover;
    background-position: center;
    height: 30vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    position: relative;
    margin-top: 0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.header-content {
    max-width: 1200px;
    width: 100%;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 表格容器样式 */
.price-table-container {
    width: 100%;
    background: white;
    position: relative;
    z-index: 2;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin: 0;
    padding: 0;
}

/* 曲线图和价格变动容器样式 */
.gold-price-container {
    display: flex;
    width: 100%;
    background: white;
    position: relative;
    z-index: 2;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin: 0;
    padding: 0;
    border-top: 1px solid #eee;
    overflow: hidden; /* 防止内容溢出 */
}

.gold-price-section {
    flex: 1;
    padding: 0;
    background: white;
    position: relative;
    z-index: 2;
}

#goldChart {
    width: 100%;
    height: 450px;
    margin: 0;
    padding: 20px;
    background: white;
    box-shadow: none;
}

.time-display {
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1.5rem;
    text-align: left;
    font-size: 0.95rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.time-display i {
    color: white;
    margin-right: 0.5rem;
    font-size: 0.9rem;
}

.price-title {
    color: white;
    font-weight: bold;
    font-size: 0.95rem;
}

.price-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.price-table th {
    background: #f5f5f5;
    color: #333;
    padding: 1rem;
    text-align: center;
    border-bottom: 1px solid #eee;
    font-weight: bold;
    font-size: 1.1rem;
    height: 56px;
    box-sizing: border-box;
}

.price-table td {
    padding: 1.2rem 1rem;
    text-align: center;
    border-bottom: 1px solid #eee;
    font-size: 1.1rem;
    background: white;
    transition: color 0.3s ease;
}

.price-table .product-name {
    color: #333;
    text-align: center;
    font-weight: bold;
}

.price-up {
    color: #f44336 !important;
}

.price-down {
    color: #4CAF50 !important;
}

.price-table .high-low {
    width: 110px !important;
    min-width: 110px;
    max-width: 110px;
    border-left: 1px solid #eee;
    background: white;
    box-sizing: border-box;
}

.price-table .high-low-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0 5px;
    box-sizing: border-box;
}

.high-low-cell span {
    display: block;
    width: 100%;
    text-align: center;
}

/* 价格变动列表样式 */
.price-changes-container {
    width: 110px;
    min-width: 110px;
    max-width: 110px;
    border-left: 1px solid #eee;
    background: white;
    display: flex;
    flex-direction: column;
    box-shadow: -2px 0 5px rgba(0,0,0,0.05);
    height: 450px; /* 与曲线图容器一致 */
}

.price-changes-container::after {
    content: '点击切换动画';
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 0.6rem;
    color: #999;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.price-changes-container:hover::after {
    opacity: 1;
}

.price-changes-container.updating {
    animation: pulseUpdate 0.8s ease;
}

@keyframes pulseUpdate {
    0% {
        box-shadow: -2px 0 5px rgba(0,0,0,0.05);
    }
    50% {
        box-shadow: -2px 0 8px rgba(255, 215, 0, 0.4);
    }
    100% {
        box-shadow: -2px 0 5px rgba(0,0,0,0.05);
    }
}

.price-changes-list {
    height: 100%; /* 填充整个容器 */
    overflow-y: auto;
    padding: 0;
    scrollbar-width: none;
}

.price-changes-list::-webkit-scrollbar {
    display: none;
}

/* 价格变动动画效果选项 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes blindsOpen {
    from {
        opacity: 0;
        transform: scaleY(0);
        transform-origin: top;
    }
    to {
        opacity: 1;
        transform: scaleY(1);
        transform-origin: top;
    }
}

@keyframes blindsHorizontal {
    from {
        opacity: 0;
        transform: scaleX(0);
        transform-origin: left;
    }
    to {
        opacity: 1;
        transform: scaleX(1);
        transform-origin: left;
    }
}

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes glowPulse {
    0% {
        opacity: 0;
        transform: scale(0.95);
        box-shadow: 0 0 0 rgba(255, 215, 0, 0);
    }
    50% {
        opacity: 1;
        transform: scale(1.02);
        box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
    }
    100% {
        opacity: 1;
        transform: scale(1);
        box-shadow: 0 0 0 rgba(255, 215, 0, 0);
    }
}

.price-change-item {
    padding: 5px 8px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.8rem;
    background: white;
    color: #333;
    animation: blindsHorizontal 0.5s ease-out;
    transform-origin: left;
}

/* 不同的动画类 - 可以通过JavaScript切换 */
.price-change-item.animation-fade-right {
    animation: fadeInRight 0.4s ease-out;
    transform-origin: right center;
}

.price-change-item.animation-blinds {
    animation: blindsOpen 0.4s ease-out;
    transform-origin: top;
}

.price-change-item.animation-blinds-horizontal {
    animation: blindsHorizontal 0.4s ease-out;
    transform-origin: left;
}

.price-change-item.animation-slide-up {
    animation: slideInUp 0.4s ease-out;
}

.price-change-item.animation-scale {
    animation: scaleIn 0.4s ease-out;
}

.price-change-item.animation-glow {
    animation: glowPulse 0.6s ease-out;
}

.price-change-item:hover {
    background-color: #f9f9f9;
}

.price-change-item:nth-child(even) {
    background-color: #f9f9f9;
}

.price-change-item .time {
    font-size: 0.7rem;
    color: #666;
    margin-bottom: 1px;
}

.price-change-item .price-value {
    display: flex;
    justify-content: center;
    align-items: center;
    white-space: nowrap;
    font-weight: bold;
}

.price-change-item .new-price {
    font-weight: bold;
    font-size: 0.95rem;
    text-align: center;
}

.price-change-item .new-price.increase {
    color: #f44336;
}

.price-change-item .new-price.decrease {
    color: #4CAF50;
}

/* 隐藏标题栏 */
.changes-header, .real-time-title {
    display: none;
}

/* 其他样式保持不变 */
.category-label {
    color: white;
    text-align: left;
    padding: 0.5rem 2rem;
    background: #262626;
}

.main-title {
    margin-bottom: 1rem;
}

.main-title h1 {
    font-size: 3.5rem;
    margin-bottom: 0.3rem;
    animation: fadeInUp 1s ease;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.main-title .subtitle {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: 300;
    animation: fadeInUp 1s ease 0.3s;
}

.intro-text {
    width: 75%;
    margin: 0 auto 1rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    animation: fadeInUp 1s ease 0.4s;
}

.header-buttons {
    display: flex;
    gap: 0.6rem;
    justify-content: center;
    animation: fadeInUp 1s ease 0.6s;
}

.cta-button {
    display: inline-block;
    padding: 0.6rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s;
    font-size: 0.9rem;
    border: 2px solid var(--primary-color);
}

.cta-button.secondary {
    background-color: transparent;
    border: 2px solid white;
}

.cta-button:hover {
    background-color: #b08d5f;
    transform: translateY(-3px);
}

.cta-button.secondary:hover {
    background-color: white;
    color: var(--secondary-color);
}

section {
    padding: 5rem 2rem;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title h2 {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.section-title p {
    color: #666;
}

.about {
    background-color: var(--light-bg);
    position: relative;
    z-index: 1;
    border-radius: 20px 20px 0 0;
    margin-top: 2rem;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.1);
}

.about-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.about-card {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    text-align: center;
}

.about-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.services {
    background-color: white;
}

.services-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.service-card {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    transition: transform 0.3s;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.service-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.service-card h3 {
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.service-card p {
    color: #666;
    font-size: 0.9rem;
}

.contact {
    background: linear-gradient(rgba(0,0,0,0.8), rgba(0,0,0,0.8)), url('photo-1560520653-9e0e4c89eb11.avif');
    background-size: cover;
    background-position: center;
    color: white;
}

.contact-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    padding: 0 1rem;
}

.contact-info {
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 2rem;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    transition: transform 0.3s;
}

.contact-info:hover {
    transform: translateY(-5px);
}

.contact-info i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.contact-info h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.contact-info p {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.qr-code {
    width: 150px;
    height: 150px;
    margin: 1rem auto;
    background: white;
    padding: 0.5rem;
    border-radius: 10px;
}

.qr-code img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

footer {
    background-color: var(--secondary-color);
    color: white;
    text-align: center;
    padding: 2rem;
}

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

.error-message {
    color: #f44336;
    font-style: italic;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 20px;
    width: 80%;
    max-width: 800px;
    border-radius: 10px;
    position: relative;
}

.close {
    position: absolute;
    right: 20px;
    top: 10px;
    font-size: 28px;
    font-weight: bold;
    color: #666;
    cursor: pointer;
}

.close:hover {
    color: #333;
}

.chart-container {
    width: 100%;
    height: 450px;
}

.product-name {
    cursor: pointer;
    transition: color 0.3s;
}

.product-name:hover {
    color: var(--primary-color);
}

.product-name i {
    margin-left: 8px;
    font-size: 0.9em;
}

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

.marquee-wrapper {
    width: 100%;
    overflow: hidden;
    position: relative;
    height: 2.2em;
}

.marquee {
    display: flex;
    width: fit-content;
    animation: marquee 15s linear infinite;
}

.marquee-content {
    display: flex;
    white-space: nowrap;
}

.marquee-content span {
    padding-right: 60px;
    display: inline-block;
    white-space: nowrap;
    font-size: 26px;
    color: white;
}

@keyframes marquee {
    0% {
        transform: translateX(0%);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* 移动端样式调整 */
@media (max-width: 768px) {
    .header {
        height: 40vh;
    }
    
    .main-title h1 {
        font-size: 1.8rem;
    }
    
    .main-title .subtitle {
        font-size: 0.9rem;
    }
    
    section {
        padding: 3rem 1rem;
    }
    
    .about {
        margin-top: 3rem;
    }
    
    .price-table th {
        height: 50px;
        padding: 0.6rem;
        font-size: 0.9rem;
    }
    
    /* 图表和价格列表的移动端调整 */
    .gold-price-container {
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: hidden;
    }
    
    .gold-price-section {
        flex: 1;
        min-width: 0;
    }
    
    .price-table th:last-child, 
    .price-table td:last-child {
        width: 110px !important;
        min-width: 110px;
        max-width: 110px;
    }
    
    .price-changes-container {
        width: 110px;
        min-width: 110px;
        max-width: 110px;
        border-left: 1px solid #eee;
        border-top: none;
        position: relative;
        height: 398px; /* 移动端图表高度 */
    }
    
    #goldChart {
        height: 398px !important;
        margin: 0 !important;
        padding: 10px !important;
        background: white !important;
    }
    
    .price-change-item {
        padding: 4px 6px;
        font-size: 0.7rem;
    }
    
    .price-change-item .time {
        font-size: 0.65rem;
        margin-bottom: 0;
    }
    
    .price-change-item .new-price {
        font-size: 0.75rem;
    }
}

/* 确保表格最后一列宽度固定 */
.price-table th[style*="width: 25%"]:last-child {
    width: 110px !important;
}

/* 为ipad和平板设备添加额外样式 */
@media (min-width: 769px) and (max-width: 1024px) {
    .price-table th:last-child, 
    .price-table td:last-child {
        width: 110px !important;
        min-width: 110px;
        max-width: 110px;
    }
}
