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

:root {
    --gold-primary: #D4A843;
    --gold-light: #F5E6B8;
    --gold-dark: #B8860B;
    --gold-gradient: linear-gradient(135deg, #D4A843, #F5E6B8, #D4A843);
    --gold-gradient-strong: linear-gradient(135deg, #B8860B, #D4A843, #F5D78A);
    --bg-dark: #1a1a2e;
    --bg-card: rgba(255, 255, 255, 0.08);
    --bg-card-hover: rgba(255, 255, 255, 0.12);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);
    --up-color: #22c55e;
    --down-color: #ef4444;
    --glass-border: rgba(255, 255, 255, 0.15);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --radius: 20px;
    --radius-sm: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

.gold-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at 20% 50%, rgba(212, 168, 67, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(212, 168, 67, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(245, 230, 184, 0.06) 0%, transparent 50%),
        linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #1a1a2e 100%);
    z-index: -1;
    pointer-events: none;
}

/* ====== 玻璃效果 ====== */
.glass-effect {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.glass-effect:hover {
    background: var(--bg-card-hover);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

/* ====== 容器 ====== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ====== 头部 ====== */
.header {
    padding: 40px 0 20px;
    text-align: center;
    position: relative;
}

.header-content {
    max-width: 800px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 8px;
}

.logo i {
    font-size: 48px;
    background: var(--gold-gradient-strong);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 8px rgba(212, 168, 67, 0.3));
    animation: pulseGlow 3s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% { filter: drop-shadow(0 2px 8px rgba(212, 168, 67, 0.3)); }
    50% { filter: drop-shadow(0 4px 16px rgba(212, 168, 67, 0.5)); }
}

.logo h1 {
    font-size: 42px;
    font-weight: 900;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 2px;
}

.subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    letter-spacing: 4px;
}

.admin-link {
    position: absolute;
    top: 20px;
    right: 20px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    padding: 8px 16px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    transition: var(--transition);
}

.admin-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--gold-primary);
}

/* ====== 主内容区 ====== */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
    padding: 20px 0 60px;
}

/* ====== 价格卡片 ====== */
.price-card {
    padding: 40px;
    text-align: center;
}

.price-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.price-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--gold-primary);
    font-weight: 500;
    font-size: 18px;
}

.price-label i {
    font-size: 20px;
}

.price-source {
    font-size: 12px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 12px;
    border-radius: 20px;
}

.price-main {
    margin-bottom: 30px;
}

.price-value {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
    margin-bottom: 12px;
}

.price-value .currency {
    font-size: 32px;
    font-weight: 300;
    color: var(--gold-primary);
    opacity: 0.8;
}

.price-value .amount {
    font-size: 80px;
    font-weight: 900;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    letter-spacing: -2px;
    animation: fadeInUp 0.6s ease-out;
}

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

.price-value .unit {
    font-size: 18px;
    color: var(--text-secondary);
    margin-left: 4px;
}

.price-change {
    font-size: 22px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 24px;
    border-radius: 30px;
    display: inline-flex;
    margin: 0 auto;
}

.price-change.up {
    color: var(--up-color);
    background: rgba(34, 197, 94, 0.1);
}

.price-change.down {
    color: var(--down-color);
    background: rgba(239, 68, 68, 0.1);
}

.price-change i {
    font-size: 18px;
}

.price-details {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 30px;
}

.detail-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    padding: 16px;
    text-align: center;
    transition: var(--transition);
}

.detail-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: scale(1.02);
}

.detail-item .label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.detail-item .value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.detail-item .value.up {
    color: var(--up-color);
}

.detail-item .value.down {
    color: var(--down-color);
}

.price-update {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 14px;
    color: var(--text-muted);
}

.btn-refresh {
    background: var(--gold-gradient);
    border: none;
    color: #1a1a2e;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-refresh:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(212, 168, 67, 0.4);
}

.btn-refresh:active {
    transform: scale(0.95);
}

/* ====== 图表区域 ====== */
.chart-section {
    padding: 30px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.section-header h2 {
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-header h2 i {
    color: var(--gold-primary);
}

.badge {
    background: var(--gold-gradient);
    color: #1a1a2e;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

.chart-container {
    position: relative;
    height: 350px;
    width: 100%;
}

.chart-container canvas {
    width: 100% !important;
    height: 100% !important;
}

/* ====== 换算工具 ====== */
.converter-section {
    padding: 30px;
}

.converter-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.converter-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    padding: 20px;
    transition: var(--transition);
}

.converter-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.converter-item label {
    display: block;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-weight: 500;
}

.input-group {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    transition: var(--transition);
}

.input-group:focus-within {
    border-color: var(--gold-primary);
    box-shadow: 0 0 0 3px rgba(212, 168, 67, 0.2);
}

.input-group input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 14px 16px;
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
    outline: none;
    font-family: inherit;
}

.input-group input::-webkit-inner-spin-button,
.input-group input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.input-group input[type=number] {
    -moz-appearance: textfield;
}

.input-suffix {
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-size: 14px;
    white-space: nowrap;
}

.result {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.result-label {
    font-size: 13px;
    color: var(--text-muted);
}

.result-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--gold-primary);
}

/* ====== 参考价格 ====== */
.reference-section {
    padding: 30px;
}

.reference-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.ref-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    padding: 20px;
    text-align: center;
    transition: var(--transition);
    cursor: default;
}

.ref-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-4px);
}

.ref-icon {
    font-size: 32px;
    color: var(--gold-primary);
    margin-bottom: 12px;
}

.ref-info h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.ref-info p {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.ref-price {
    font-size: 24px;
    font-weight: 800;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ref-label {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ====== 资讯 ====== */
.news-section {
    padding: 30px;
}

.news-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.news-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    transition: var(--transition);
    cursor: pointer;
}

.news-item:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(4px);
}

.news-date {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    min-width: 48px;
    padding-top: 2px;
}

.news-content {
    flex: 1;
}

.news-content h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.news-content p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.news-tag {
    font-size: 11px;
    padding: 2px 10px;
    border-radius: 12px;
    background: rgba(212, 168, 67, 0.15);
    color: var(--gold-primary);
    white-space: nowrap;
}

/* ====== 页脚 ====== */
.footer {
    text-align: center;
    padding: 40px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-content p {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.footer-content p:first-child {
    font-size: 16px;
    color: var(--text-secondary);
    font-weight: 600;
}

.footer-content p:first-child i {
    color: var(--gold-primary);
}

.footer-note {
    margin-top: 8px;
    font-size: 12px !important;
}

/* ====== 加载动画 ====== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 26, 46, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(10px);
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid var(--gold-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay p {
    font-size: 16px;
    color: var(--text-secondary);
}

/* ====== 登录页面 ====== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-icon {
    font-size: 48px;
    color: var(--gold-primary);
    margin-bottom: 16px;
}

.login-header h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group label i {
    margin-right: 6px;
    color: var(--gold-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 16px;
    outline: none;
    transition: var(--transition);
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--gold-primary);
    box-shadow: 0 0 0 3px rgba(212, 168, 67, 0.2);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
}

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

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

.btn-primary {
    background: var(--gold-gradient-strong);
    color: #1a1a2e;
}

.btn-block {
    width: 100%;
}

.btn-success {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
}

.btn-info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

.back-link {
    display: block;
    text-align: center;
    margin-top: 20px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
}

.back-link:hover {
    color: var(--gold-primary);
}

.alert {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--down-color);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    color: var(--up-color);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

/* ====== 后台管理 ====== */
.admin-panel {
    min-height: 100vh;
}

.admin-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 30px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.admin-nav-brand {
    font-size: 20px;
    font-weight: 700;
    color: var(--gold-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-nav-links {
    display: flex;
    gap: 8px;
}

.nav-link {
    padding: 8px 16px;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.nav-link.logout {
    color: var(--down-color);
}

.admin-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

.admin-content h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-content h2 i {
    color: var(--gold-primary);
}

.admin-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 30px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.admin-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.admin-card-header h3 {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-card-header h3 i {
    color: var(--gold-primary);
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.stat-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    padding: 20px;
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
}

.stat-value.up {
    color: var(--up-color);
}

.stat-value.down {
    color: var(--down-color);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.admin-form .form-group {
    margin-bottom: 16px;
}

.admin-form .btn {
    margin-right: 12px;
    margin-top: 8px;
}

.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

table th {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

table td {
    font-size: 14px;
    color: var(--text-secondary);
}

table td strong {
    color: var(--text-primary);
}

table td.up {
    color: var(--up-color);
}

table td.down {
    color: var(--down-color);
}

table tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

.text-center {
    text-align: center;
    padding: 40px !important;
    color: var(--text-muted);
}

/* ====== 响应式设计 ====== */
@media (max-width: 1024px) {
    .price-details {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .reference-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    .header {
        padding: 24px 0 16px;
    }
    
    .logo h1 {
        font-size: 32px;
    }
    
    .logo i {
        font-size: 36px;
    }
    
    .subtitle {
        font-size: 14px;
        letter-spacing: 2px;
    }
    
    .admin-link {
        position: static;
        display: inline-block;
        margin-top: 12px;
    }
    
    .price-card {
        padding: 24px;
    }
    
    .price-value .amount {
        font-size: 56px;
    }
    
    .price-value .currency {
        font-size: 24px;
    }
    
    .price-details {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .detail-item {
        padding: 12px;
    }
    
    .detail-item .value {
        font-size: 16px;
    }
    
    .chart-container {
        height: 250px;
    }
    
    .converter-grid {
        grid-template-columns: 1fr;
    }
    
    .reference-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .news-item {
        flex-direction: column;
        gap: 8px;
    }
    
    .admin-nav {
        flex-direction: column;
        gap: 12px;
        padding: 12px 16px;
    }
    
    .admin-nav-links {
        width: 100%;
        justify-content: center;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .admin-stats {
        grid-template-columns: 1fr;
    }
    
    .admin-card {
        padding: 20px;
    }
    
    .login-card {
        padding: 24px;
    }
}

@media (max-width: 480px) {
    .price-value .amount {
        font-size: 42px;
    }
    
    .price-change {
        font-size: 18px;
        padding: 6px 16px;
    }
    
    .reference-grid {
        grid-template-columns: 1fr;
    }
    
    .price-details {
        grid-template-columns: 1fr 1fr;
    }
}

/* ====== 滚动条美化 ====== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
}

::-webkit-scrollbar-thumb {
    background: rgba(212, 168, 67, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 168, 67, 0.5);
}

/* ====== 选择文本样式 ====== */
::selection {
    background: rgba(212, 168, 67, 0.3);
    color: white;
}