/* ========================================
   君子有财 - H5首页样式
   ======================================== */

/* CSS Variables */
:root {
    --primary-color: #D4AF37;
    --primary-dark: #C5A028;
    --secondary-color: #1B3A5C;
    --text-color: #333;
    --text-light: #666;
    --bg-color: #F5F7FA;
    --card-bg: #ffffff;
    --gold-gradient: linear-gradient(135deg, #D4AF37 0%, #C5A028 100%);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.12);
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Noto Serif SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Container */
.container {
    max-width: 100%;
    min-height: 100vh;
    padding: 0 20px 40px;
    position: relative;
    overflow: hidden;
}

/* Top Decoration */
.top-decoration {
    position: relative;
    height: 120px;
    margin-bottom: 20px;
}

.coin {
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--gold-gradient);
    opacity: 0.15;
    animation: float 6s ease-in-out infinite;
}

.coin-left {
    left: -20px;
    top: 20px;
}

.coin-right {
    right: -20px;
    top: 40px;
    width: 60px;
    height: 60px;
    animation-delay: -3s;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(5deg); }
}

/* Main Content */
.main-content {
    position: relative;
    z-index: 1;
}

/* Avatar Section */
.avatar-section {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.avatar-wrapper {
    position: relative;
    width: 100px;
    height: 100px;
}

.avatar-ring {
    position: absolute;
    inset: 0;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: pulse-ring 2s ease-out infinite;
}

.avatar-ring.delay-1 {
    animation-delay: 0.5s;
}

@keyframes pulse-ring {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }
    100% {
        transform: scale(1.4);
        opacity: 0;
    }
}

.avatar-inner {
    position: absolute;
    inset: 8px;
    background: var(--gold-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
}

.avatar-text {
    font-size: 36px;
    color: #fff;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 35px;
}

.title {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    margin-bottom: 12px;
}

.title-main {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--secondary-color);
    letter-spacing: 0.15em;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.title-sub {
    font-size: 1.4rem;
    color: var(--primary-dark);
    letter-spacing: 0.3em;
    position: relative;
}

.title-sub::before,
.title-sub::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 30px;
    height: 1px;
    background: var(--primary-color);
}

.title-sub::before {
    right: calc(100% + 15px);
}

.title-sub::after {
    left: calc(100% + 15px);
}

.subtitle {
    font-size: 1rem;
    color: var(--text-light);
    font-style: italic;
}

/* Intro Section */
.intro-section {
    margin-bottom: 30px;
}

.intro-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 25px;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.intro-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gold-gradient);
}

.intro-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.intro-icon svg {
    width: 100%;
    height: 100%;
}

.intro-text {
    font-size: 1rem;
    color: var(--text-color);
    line-height: 1.8;
    text-align: justify;
}

/* Tags Section */
.tags-section {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 40px;
}

.tag {
    background: linear-gradient(135deg, #f5f0e6 0%, #ebe5d9 100%);
    color: var(--primary-dark);
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 0.9rem;
    border: 1px solid rgba(201, 169, 98, 0.3);
    transition: all 0.3s ease;
}

.tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(201, 169, 98, 0.2);
}

/* Tool Section */
.tool-section {
    margin-bottom: 40px;
}

.tool-card {
    display: flex;
    align-items: center;
    background: var(--card-bg);
    border-radius: 16px;
    padding: 18px 20px;
    box-shadow: var(--shadow-md);
    text-decoration: none;
    transition: all 0.3s ease;
    margin-bottom: 12px;
}

.tool-card:active {
    transform: scale(0.98);
}

.tool-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tool-icon svg {
    width: 24px;
    height: 24px;
    color: #fff;
}

.tool-info {
    flex: 1;
    margin-left: 16px;
}

.tool-name {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 4px;
}

.tool-desc {
    display: block;
    font-size: 0.85rem;
    color: var(--text-light);
}

.tool-arrow {
    width: 24px;
    height: 24px;
    color: var(--text-light);
}

.tool-arrow svg {
    width: 100%;
    height: 100%;
}

/* QR Code Section */
.qrcode-section {
    margin-bottom: 40px;
}

.qrcode-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 30px 25px;
    box-shadow: var(--shadow-lg);
    text-align: center;
    position: relative;
}

.qrcode-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    padding: 2px;
    background: linear-gradient(135deg, var(--primary-color), transparent, var(--primary-color));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.5;
}

.qrcode-title {
    font-size: 1.2rem;
    color: var(--secondary-color);
    margin-bottom: 20px;
    font-weight: 600;
}

.qrcode-wrapper {
    display: inline-block;
    padding: 15px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #eee;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.03);
    position: relative;
}

.qrcode-image {
    display: block;
    width: 200px;
    height: auto;
    border-radius: 8px;
}

.qrcode-hint {
    margin-top: 15px;
    font-size: 0.85rem;
    color: var(--text-light);
}

.qrcode-loading {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.9rem;
    color: #999;
    background: rgba(255, 255, 255, 0.95);
    padding: 10px 20px;
    border-radius: 8px;
}

/* Footer */
.footer,
.qrcode-footer {
    text-align: center;
    padding-top: 20px;
}

.footer-line {
    width: 60px;
    height: 2px;
    background: var(--gold-gradient);
    margin: 0 auto 20px;
    border-radius: 1px;
}

.footer-text {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 8px;
}

.footer-brand {
    font-size: 0.9rem;
    color: var(--primary-color);
    letter-spacing: 0.2em;
}

/* 备案信息 */
.site-footer {
    text-align: center;
    padding: 30px 0 20px;
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.site-footer a {
    font-size: 0.8rem;
    color: #999;
    text-decoration: none;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.site-footer a:hover {
    color: var(--primary-color);
}

.footer-icon {
    width: 16px;
    height: 16px;
    vertical-align: middle;
}

/* Responsive Design */
@media screen and (max-width: 375px) {
    .container {
        padding: 0 15px 30px;
    }

    .title-main {
        font-size: 1.8rem;
    }

    .title-sub {
        font-size: 1.2rem;
    }

    .title-sub::before,
    .title-sub::after {
        width: 20px;
    }

    .qrcode-image {
        width: 170px;
    }

    .intro-card {
        padding: 20px;
    }
}

/* Safe Area for iPhone */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .container {
        padding-bottom: calc(40px + env(safe-area-inset-bottom));
    }
}

/* Dark Mode Support - 保持品牌色调，不跟随系统深色模式 */
@media (prefers-color-scheme: dark) {
    body {
        background: #F5F7FA;
        color: #333;
    }

    .intro-card,
    .qrcode-card {
        background: #ffffff;
    }

    .qrcode-wrapper {
        background: #fff;
        border-color: #eee;
    }

    .qrcode-title {
        color: #1B3A5C;
    }

    .title-main {
        background: linear-gradient(135deg, #D4AF37 0%, #C5A028 100%);
        -webkit-background-clip: text;
        background-clip: text;
    }
}
