* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #fafafa;
}
.container { max-width: 1000px; margin: 0 auto; padding: 0 20px; }
header {
    padding: 80px 0 60px;
    text-align: center;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4edff 100%);
}
h1 {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 16px;
    background: linear-gradient(90deg, #1a73e8, #4285f4);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.subtitle {
    font-size: 1.2rem;
    color: #5f6368;
    max-width: 600px;
    margin: 0 auto 5px;
}
.tagline {
    display: inline-block;
    background: #e8f0fe;
    color: #1a73e8;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.95rem;
    margin-top: 10px;
}

section {
    padding: 60px 0;
}
h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 40px;
    color: #202124;
}
.services {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}
.card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.2s;
}
.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}
.card h3 {
    margin-bottom: 12px;
    color: #1a73e8;
}

.portfolio {
    background: #f8f9fa;
}
.portfolio-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}
.project {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.project img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: #eee;
}
.project .desc {
    padding: 16px;
}

/* 新增：联系区域 */
.contact-section {
    background: white;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    text-align: center;
}
.contact-item img {
    width: 150px;
    height: 150px;
    object-fit: contain;
    background: #f9f9f9;
    padding: 10px;
    border-radius: 8px;
    margin: 10px auto;
    border: 1px dashed #ddd;
}
.contact-item p {
    color: #666;
}

/* AI 聊天框 */
.ai-chat {
    background: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    /*max-width: 95%;*/
    margin: 0 auto;
}
.chat-header {
    text-align: center;
    margin-bottom: 20px;
    color: #1a73e8;
    font-weight: 600;
}
.chat-messages {
    height: 300px;
    overflow-y: auto;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 10px;
    margin-bottom: 15px;
    font-size: 0.95rem;
}
.message {
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 12px;
}
.user { background: #e3f2fd; margin-left: auto; text-align: right; }
.bot { background: #f1f8e9; }

.chat-input {
    display: flex;
    gap: 10px;
    align-items: flex-end; /* 让按钮底部与 textarea 底部对齐 */
}

.chat-input textarea {
    flex: 1;
    min-height: 40px; /* 最小高度 */
    max-height: 120px;
    padding: 10px 16px;
    border: 1px solid #ddd;
    border-radius: 20px;
    outline: none;
    resize: none;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.4;
}

.chat-input button {
    background: #1a73e8;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 0 20px;
    cursor: pointer;
    height: 40px; /* 与 textarea 高度协调 */
    align-self: flex-end; /* 确保靠下对齐 */
}

.chat-input button:hover {
    background: #1765c4;
}

footer {
    text-align: center;
    padding: 30px 0;
    color: #70757a;
    font-size: 0.95rem;
    line-height: 1.6;
}
.beian {
    margin-top: 10px;
    color: #999;
    font-size: 0.9rem;
}
.contact-btn {
    display: inline-block;
    margin-top: 20px;
    background: #1a73e8;
    color: white;
    padding: 12px 32px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.3s;
}
.contact-btn:hover {
    background: #1765c4;
}

@media (max-width: 600px) {
    h1 { font-size: 2.2rem; }
    .subtitle { font-size: 1rem; }
    .ai-chat { padding: 20px 15px; }
    .brand-header {
        flex-direction: column;
        gap: 12px;
    }
    .brand-main {
        font-size: 1.8rem;
    }
    .brand-domain {
        font-size: 1rem;
    }
}
/* 品牌头部：Logo + 文字并排 */
.brand-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px; /* 图片与文字间距 */
    margin-bottom: 15px;
}

.logo img {
    object-fit: contain;
    border-radius: 8px;
}

.brand-text {
    text-align: left;
    margin-left: 20px;
}

.brand-main {
    font-size: 3.6rem;
    font-weight: 800;
    color: #1a73e8;
    line-height: 1.2;
    letter-spacing: 10px;
}

.brand-domain {
    font-size: 2.8rem;
    color: #5f6368;
    font-weight: 760;
    line-height: 1.3;
    letter-spacing: 2px;
    padding-left: 10px;
}
/*聊天等等的动画加载*/
.typing-indicator {
    display: flex;
    padding: 6px 0;
}
.typing-indicator span {
    height: 8px;
    width: 8px;
    background: #999;
    border-radius: 50%;
    margin: 0 3px;
    animation: typing 1.4s infinite ease-in-out;
}
.typing-indicator span:nth-child(1) { animation-delay: 0s; }
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-5px); }
}

.clear-btn {
    background: none;
    border: none;
    color: #1a73e8;
    font-size: 0.9rem;
    cursor: pointer;
    margin-left: 10px;
}
.clear-btn:hover {
    text-decoration: underline;
}
pre {
    background: #f6f8fa;
    border-radius: 6px;
    padding: 12px 16px;
    margin: 10px 0;
    overflow-x: auto;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.95rem;
    line-height: 1.4;
}

code {
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.95em;
}
h1, h2, h3, h4, h5, h6 {
    margin: 16px 0 12px 0;
    font-weight: 600;
    line-height: 1.25;
    color: #202124;
}

h1 { font-size: 1.8em; }
h2 { font-size: 1.5em; }
h3 { font-size: 1.3em; }
h4 { font-size: 1.1em; }

/* 为逆向板块添加深色卡片样式（若全局未定义） */
.reverse-section {
    background: linear-gradient(135deg, #1a1c2c 0%, #2d3250 100%);
    color: white;
    padding: 60px 0;
    position: relative;
    overflow: hidden;
}

.reverse-section h2 {
    color: white;
    text-align: center;
    margin-bottom: 30px;
}

.reverse-section p {
    color: rgba(255, 255, 255, 0.85) !important;
}

.reverse-card {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.reverse-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(66, 133, 244, 0.4);
}

.reverse-card h3 {
    color: #4285f4;
}

.reverse-card p {
    color: rgba(255, 255, 255, 0.8) !important;
}
.tag-container {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    margin-top: auto;
}

.tech-tag, .project-tag {
    background: rgba(26, 115, 232, 0.1);
    color: #1a73e8;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    border: 1px solid rgba(26, 115, 232, 0.2);
}