/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2c3e50;
    --secondary-color: #c9a961;
    --text-color: #333;
    --light-bg: #f8f9fa;
    --white: #ffffff;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

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

/* 背景装饰动画 */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(201, 169, 97, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: backgroundMove 60s linear infinite;
    z-index: -1;
    pointer-events: none;
}

@keyframes backgroundMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

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

/* 导航栏 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: var(--white);
    z-index: 1000;
    transition: var(--transition);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 20px;
}

.logo {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--primary-color);
    letter-spacing: 2px;
    position: relative;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color), var(--primary-color));
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease infinite;
}

/* 为不支持 background-clip 的浏览器提供回退 */
@supports not (background-clip: text) or not (-webkit-background-clip: text) {
    .logo {
        background: none;
        color: var(--primary-color);
        -webkit-text-fill-color: var(--primary-color);
    }
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% center; }
    50% { background-position: 100% center; }
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 400;
    font-size: 0.9rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.nav-menu a:hover {
    color: var(--secondary-color);
}

.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--primary-color);
    margin: 3px 0;
    transition: var(--transition);
}

/* 首页横幅 */
.hero {
    height: 100vh;
    height: calc(var(--vh, 1vh) * 100);
    background: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.3)),
                url('../images/1.jpg') center/cover;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent 30%, rgba(201, 169, 97, 0.1) 50%, transparent 70%);
    animation: shimmer 3s infinite;
    pointer-events: none;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-100%); }
    100% { transform: translateX(100%) translateY(100%); }
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    animation: fadeInUp 1s ease, textGlow 2s ease-in-out infinite alternate;
    text-shadow: 0 0 20px rgba(201, 169, 97, 0.5);
}

@keyframes textGlow {
    from { text-shadow: 0 0 20px rgba(201, 169, 97, 0.5); }
    to { text-shadow: 0 0 30px rgba(201, 169, 97, 0.8), 0 0 40px rgba(201, 169, 97, 0.4); }
}

.hero-content p {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    animation: fadeInUp 1s ease 0.2s both;
}

.cta-button {
    display: inline-block;
    padding: 1rem 2.5rem;
    background: var(--secondary-color);
    color: var(--white);
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: var(--transition);
    animation: fadeInUp 1s ease 0.4s both, pulse 2s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.cta-button:hover::before {
    width: 300px;
    height: 300px;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(201, 169, 97, 0.3);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 10px 20px rgba(201, 169, 97, 0.3); }
    50% { box-shadow: 0 10px 30px rgba(201, 169, 97, 0.5), 0 0 0 10px rgba(201, 169, 97, 0.1); }
}

/* 作品展示 */
.portfolio {
    padding: 5rem 0;
    background: var(--light-bg);
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--primary-color);
    position: relative;
    display: inline-block;
    width: 100%;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--secondary-color);
    margin: 1rem auto;
    animation: expandWidth 1.5s ease-in-out infinite alternate;
}

@keyframes expandWidth {
    from { width: 60px; }
    to { width: 100px; }
}

.filter-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.6rem 1.5rem;
    border: 2px solid var(--primary-color);
    background: transparent;
    color: var(--primary-color);
    cursor: pointer;
    border-radius: 25px;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: var(--primary-color);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s;
    z-index: -1;
}

.filter-btn:hover::before,
.filter-btn.active::before {
    width: 200%;
    height: 200%;
}

.filter-btn:hover,
.filter-btn.active {
    color: var(--white);
    transform: translateY(-2px);
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.portfolio-item {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: var(--transition);
}

.portfolio-item::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(201, 169, 97, 0.3), transparent);
    transform: rotate(45deg);
    transition: all 0.6s;
    z-index: 1;
}

.portfolio-item:hover::before {
    animation: shine 0.8s;
}

@keyframes shine {
    0% { top: -50%; left: -50%; }
    100% { top: 150%; left: 150%; }
}

.portfolio-item:hover {
    transform: translateY(-10px) rotateZ(1deg);
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
}

.portfolio-item img {
    width: 100%;
    height: 350px;
    object-fit: cover;
    transition: var(--transition);
    filter: grayscale(20%);
}

.portfolio-item:hover img {
    transform: scale(1.1) rotate(2deg);
    filter: grayscale(0%);
}

.portfolio-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    padding: 2rem;
    transform: translateY(100%);
    transition: var(--transition);
}

.portfolio-item:hover .portfolio-overlay {
    transform: translateY(0);
}

.portfolio-overlay h3 {
    color: var(--white);
    margin-bottom: 0.5rem;
}

.portfolio-overlay p {
    color: var(--secondary-color);
    font-size: 0.9rem;
}

.view-detail {
    display: inline-block;
    margin-top: 0.8rem;
    padding: 0.5rem 1.2rem;
    background: var(--secondary-color);
    color: var(--white);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: var(--transition);
}

.portfolio-item:hover .view-detail {
    background: var(--white);
    color: var(--secondary-color);
}

/* 关于我们 */
.about {
    padding: 5rem 0;
    background: var(--light-bg);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.about-text h3 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.about-text p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.stat-item {
    text-align: center;
    padding: 2rem;
    background: var(--light-bg);
    border-radius: 10px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(201, 169, 97, 0.1), transparent);
    transition: left 0.5s;
}

.stat-item:hover::before {
    left: 100%;
}

.stat-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.stat-item h4 {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
    transition: var(--transition);
}

.stat-item:hover h4 {
    transform: scale(1.1);
    text-shadow: 0 0 10px rgba(201, 169, 97, 0.3);
}

/* 联系我们 */
.contact {
    padding: 5rem 0;
    background: var(--light-bg);
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.info-item h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-form input,
.contact-form textarea {
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: inherit;
    transition: var(--transition);
    position: relative;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(201, 169, 97, 0.1);
    transform: translateY(-2px);
}

.submit-btn {
    padding: 1rem;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.submit-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: var(--secondary-color);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.submit-btn:hover::after {
    width: 300%;
    height: 300%;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(44, 62, 80, 0.3);
}

.submit-btn span {
    position: relative;
    z-index: 1;
}

/* 页脚 */
.footer {
    background: transparent;
    color: #666;
    text-align: center;
    padding: 2rem 0;
}

/* 动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 漂浮动画 */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

/* 旋转动画 */
@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 装饰元素 */
.portfolio::before,
.about::before,
.contact::before {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(201, 169, 97, 0.1), transparent);
    pointer-events: none;
    animation: float 6s ease-in-out infinite;
}

.portfolio::before {
    top: 10%;
    right: -100px;
}

.about::before {
    bottom: 10%;
    left: -100px;
    animation-delay: 2s;
}

.contact::before {
    top: 20%;
    right: -150px;
    animation-delay: 4s;
}

.portfolio,
.about,
.contact {
    position: relative;
    overflow: hidden;
}

/* 响应式设计 */

/* 平板设备 (768px - 1024px) */
@media (max-width: 1024px) {
    .container {
        padding: 0 30px;
    }

    .hero-content h1 {
        font-size: 3rem;
    }

    .hero-content p {
        font-size: 1.3rem;
    }

    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .about-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }

    .stat-item {
        padding: 1.5rem;
    }

    .stat-item h4 {
        font-size: 2rem;
    }
}

/* 平板竖屏 (768px - 1024px) */
@media (max-width: 768px) {
    .container {
        padding: 0 20px;
    }

    /* 导航栏 */
    .navbar .container {
        padding: 0.8rem 20px;
    }

    .logo {
        font-size: 1.5rem;
    }

    .menu-toggle {
        display: flex;
        z-index: 1001;
    }

    .menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px);
    }

    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }

    .nav-menu {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 2rem;
        gap: 2rem;
        transform: translateX(100%);
        opacity: 0;
        pointer-events: none;
        transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    }

    .nav-menu.active {
        transform: translateX(0);
        opacity: 1;
        pointer-events: all;
    }

    .nav-menu li {
        opacity: 0;
        transform: translateY(20px);
        transition: all 0.3s ease;
    }

    .nav-menu.active li {
        opacity: 1;
        transform: translateY(0);
    }

    .nav-menu.active li:nth-child(1) { transition-delay: 0.1s; }
    .nav-menu.active li:nth-child(2) { transition-delay: 0.2s; }
    .nav-menu.active li:nth-child(3) { transition-delay: 0.3s; }
    .nav-menu.active li:nth-child(4) { transition-delay: 0.4s; }

    .nav-menu a {
        font-size: 1.5rem;
    }

    /* 首页 */
    .hero {
        height: 100vh;
        padding: 0 20px;
    }

    .hero-content h1 {
        font-size: 2.2rem;
        animation: fadeInUp 1s ease, none;
        text-shadow: 0 0 15px rgba(201, 169, 97, 0.5);
    }

    .hero-content p {
        font-size: 1.1rem;
        margin-bottom: 1.5rem;
    }

    .cta-button {
        padding: 0.8rem 2rem;
        font-size: 0.9rem;
    }

    /* 区块间距 */
    .portfolio,
    .about,
    .contact {
        padding: 3rem 0;
    }

    .section-title {
        font-size: 2rem;
        margin-bottom: 2rem;
    }

    /* 作品展示 */
    .filter-buttons {
        gap: 0.8rem;
        margin-bottom: 2rem;
    }

    .filter-btn {
        padding: 0.5rem 1.2rem;
        font-size: 0.9rem;
    }

    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .portfolio-item img {
        height: 280px;
    }

    .portfolio-overlay {
        padding: 1.5rem;
    }

    /* 关于我们 */
    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .about-text h3 {
        font-size: 1.5rem;
    }

    .about-text p {
        font-size: 0.95rem;
    }

    .about-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .stat-item {
        padding: 1.5rem;
    }

    .stat-item h4 {
        font-size: 2rem;
    }

    /* 联系我们 */
    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .contact-info {
        gap: 1.5rem;
    }

    .info-item h4 {
        font-size: 1.1rem;
    }

    .info-item p {
        font-size: 0.95rem;
    }

    /* 禁用某些动画效果以提升性能 */
    .portfolio-item:hover {
        transform: translateY(-5px);
    }

    .portfolio-item:hover img {
        transform: scale(1.05);
    }

    /* 移动端显示作品信息 */
    .portfolio-overlay {
        transform: translateY(0);
        background: linear-gradient(transparent, rgba(0,0,0,0.9));
        padding: 1rem;
    }

    .portfolio-overlay h3 {
        font-size: 1.1rem;
    }

    .portfolio-overlay p {
        font-size: 0.85rem;
    }
}

/* 手机设备 (小于 480px) */
@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .logo {
        font-size: 1.3rem;
    }

    .hero-content h1 {
        font-size: 1.8rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .cta-button {
        padding: 0.7rem 1.5rem;
        font-size: 0.85rem;
    }

    .section-title {
        font-size: 1.6rem;
    }

    .filter-buttons {
        gap: 0.5rem;
    }

    .filter-btn {
        padding: 0.4rem 1rem;
        font-size: 0.85rem;
    }

    .portfolio-item img {
        height: 220px;
    }

    .about-text h3 {
        font-size: 1.3rem;
    }

    .stat-item {
        padding: 1.2rem;
    }

    .stat-item h4 {
        font-size: 1.8rem;
    }

    .stat-item p {
        font-size: 0.9rem;
    }

    .contact-form input,
    .contact-form textarea {
        padding: 0.8rem;
        font-size: 0.9rem;
    }

    .submit-btn {
        padding: 0.8rem;
        font-size: 0.9rem;
    }

    .footer {
        padding: 1.5rem 0;
        font-size: 0.85rem;
    }

    /* 减少动画以提升性能 */
    body::before {
        animation: none;
    }

    .hero::after {
        animation: none;
    }

    .cta-button {
        animation: fadeInUp 1s ease 0.4s both;
    }
}

/* 超小屏幕 (小于 360px) */
@media (max-width: 360px) {
    .hero-content h1 {
        font-size: 1.5rem;
    }

    .hero-content p {
        font-size: 0.9rem;
    }

    .section-title {
        font-size: 1.4rem;
    }

    .portfolio-item img {
        height: 200px;
    }

    .about-stats {
        gap: 0.8rem;
    }

    .stat-item {
        padding: 1rem;
    }

    .stat-item h4 {
        font-size: 1.5rem;
    }
}

/* 横屏模式优化 */
@media (max-height: 600px) and (orientation: landscape) {
    .hero {
        height: auto;
        min-height: 100vh;
        padding: 100px 20px 50px;
    }

    .hero-content h1 {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }

    .hero-content p {
        font-size: 1rem;
        margin-bottom: 1rem;
    }

    .cta-button {
        padding: 0.6rem 1.5rem;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    /* 移除hover效果，使用点击效果 */
    .portfolio-item:active {
        transform: scale(0.98);
    }

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

    .cta-button:active {
        transform: translateY(0);
    }

    .submit-btn:active {
        transform: scale(0.98);
    }

    /* 增大可点击区域 */
    .nav-menu a,
    .filter-btn,
    .cta-button,
    .submit-btn {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

