/* Hero Section */
.hero {
    padding: 80px 0;
}

.grid-container {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    align-items: center;
    gap: 50px;
}

.hero-content {
    animation: fade-up 0.55s ease both;
}

.hero-graphic {
    animation: fade-up 0.7s ease both;
    animation-delay: 0.08s;
}

.hero-title {
    font-size: 3.5rem;
    margin-bottom: 10px;
}

.hero-title span {
    color: var(--primary-color);
}

.hero-subtitle {
    font-size: 1.8rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
    font-weight: 500;
}

.hero-desc {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.hero-btns {
    display: flex;
    gap: 15px;
}

/* Hero Image */
.hero-img {
    width: 100%;
    height: auto;
    border-radius: 20px;
    box-shadow: var(--shadow-hover);
    transition: var(--transition);
}

.hero-img:hover {
    transform: scale(1.02);
}

/* Section Common */
.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 50px;
    position: relative;
    padding-bottom: 15px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 2px;
}

/* Services */
.services {
    padding: 80px 0;
    background: white;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

/* Bento Grid Layout - Replacing Corporate 3-Column */
.bento-section {
    padding: 80px 0;
    background: white;
}

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

.bento-item {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 30px;
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
}

.bento-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.05);
}

.bento-large {
    grid-column: span 2;
    grid-row: span 2;
    background: white;
    border: 1px solid rgba(59, 130, 246, 0.2);
    box-shadow: 0 10px 40px rgba(59, 130, 246, 0.05);
    position: relative;
}

.bento-large::after {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.05) 0%, transparent 70%);
    pointer-events: none;
}

.bento-large h3 {
    background: linear-gradient(135deg, #1e293b 0%, var(--primary-color) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 1.8rem;
}

.bento-medium {
    grid-column: span 2;
    grid-row: span 1;
}

.bento-small {
    grid-column: span 1;
    grid-row: span 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bento-tag {
    display: inline-block;
    padding: 5px 16px; /* 增加边距，让文字更有呼吸感 */
    background: white;
    border-radius: 50px;
    font-size: 0.75rem; /* 稍微放大一点字号 */
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: 1px; /* 增加字间距，解决拥挤感 */
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.core-tag {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
}

.featured-bento::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary-color);
    opacity: 0.1;
}

.bento-content h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.bento-content p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.bento-tech-stack {
    margin-top: 35px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.tech-stack-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
    position: relative; /* 为热度角标预留定位 */
}

.tech-stack-item i {
    font-size: 1.6rem;
    color: #475569;
    opacity: 0.7;
    transition: var(--transition);
}

.tech-stack-item span {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
}

.tech-stack-item:hover i {
    color: var(--primary-color);
    opacity: 1;
    transform: translateY(-5px) scale(1.2);
}

.tech-stack-item:hover span {
    color: var(--primary-color);
}

.bento-small i {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 10px;
    display: block;
    text-align: center;
}

.bento-small h4 {
    font-size: 1rem;
    text-align: center;
}

@media (max-width: 968px) {
    .bento-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }
    .bento-large, .bento-medium, .bento-small {
        grid-column: span 1;
        grid-row: span 1;
    }
}



/* Portfolio */
.portfolio {
    padding: 80px 0;
}

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

.portfolio-item {
    aspect-ratio: 16/10;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    cursor: pointer;
}

.portfolio-item:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
}

.portfolio-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.portfolio-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: 20px;
    transform: translateY(20px);
    opacity: 0;
    transition: var(--transition);
}

.portfolio-item:hover .portfolio-info {
    transform: translateY(0);
    opacity: 1;
}

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

.portfolio-info h4 {
    margin-bottom: 5px;
    font-size: 1.1rem;
}

.portfolio-info p {
    font-size: 0.85rem;
    opacity: 0.8;
}

.img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #e2e8f0;
    color: #94a3b8;
    font-weight: 500;
}

.services-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 items in a single row */
    gap: 20px;
    margin-bottom: 50px;
}

.service-item {
    background: white;
    padding: 20px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    box-shadow: var(--shadow);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    border: 1px solid transparent;
}

.service-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(59, 130, 246, 0.1);
}

.service-item i {
    font-size: 1.6rem;
    color: var(--primary-color);
}

.service-item h4 {
    font-size: 1rem;
    margin-bottom: 2px;
    color: var(--text-primary);
    font-weight: 700;
}

.service-item p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.project-showcase {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 40px;
    box-shadow: var(--shadow);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.project-showcase:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.showcase-header {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.projectName {
    font-weight: 700;
    font-size: 1.1rem;
}

.project-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.project-images {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* Updated to 4 items in a row */
    gap: 15px;
}

.img-box {
    aspect-ratio: 16/9;
    background: #f1f5f9;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.img-box:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.img-box:hover img {
    opacity: 1;
}

.process-section {
    background: white;
    border-radius: 15px;
    overflow: hidden;
}

.process-steps {
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* 5 items in one row */
}

.step {
    padding: 25px 15px;
    text-align: center;
    border-right: 1px solid var(--border-color);
    font-weight: 700;
    font-size: 0.85rem;
    position: relative;
    background: #fff;
    transition: background 0.3s ease;
}

.step:nth-child(even) {
    background: #fcfdfe;
}

.step i {
    font-size: 1.4rem; /* 放大图标尺寸 */
    display: block;
    margin-bottom: 12px;
    color: var(--primary-color);
}

.step:hover {
    background: #f8fafc;
}

.step:last-child {
    border-right: none;
}

.standalone-footer {
    text-align: center;
    background: #f8fafc;
    padding: 16px;
    border-radius: 10px;
    font-size: 0.85rem;
    color: #64748b;
    border: 1px solid #f1f5f9;
    margin-top: 40px;
    margin-bottom: 10px;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.standalone-footer i {
    color: #10b981;
    font-size: 1rem;
}

/* Hero Mini Stats - Majestic Redesign */
.hero-stats-mini {
    display: flex;
    gap: 60px;
    margin-top: 50px;
}

.stat-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    transition: transform 0.2s ease;
}

.stat-block:hover {
    transform: translateY(-3px);
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1;
}

.stat-value sup {
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-left: 2px;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 10px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* --- Portfolio Detail Pages (New) --- */
.portfolio-item-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.detail-page {
    background: #f8fafc;
}

.back-home {
    position: fixed;
    top: 30px;
    left: 30px;
    z-index: 1000;
    padding: 10px 20px;
    background: white;
    border-radius: 50px;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.back-home:hover {
    transform: translateX(-5px);
    box-shadow: var(--shadow-hover);
}

.portfolio-detail-hero {
    padding: 120px 0 60px;
    background: white;
    border-bottom: 1px solid var(--border-color);
}

.detail-header {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.detail-category {
    color: var(--primary-color);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.8rem;
    margin-bottom: 15px;
    display: block;
}

.detail-title {
    font-size: 3rem;
    margin-bottom: 20px;
    color: #030712;
}

.tech-tags {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.tech-tag {
    background: #f1f5f9;
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    border: 1px solid #e2e8f0;
}

.detail-main-img {
    max-width: 1000px;
    margin: 60px auto -180px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.12);
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    z-index: 2;
    background: #eee;
}

.detail-main-img img {
    width: 100%;
    display: block;
}

.detail-content-section {
    padding: 260px 0 100px;
}

.detail-grid {
    display: grid;
    grid-template-columns: 2.2fr 1fr;
    gap: 60px;
}

.detail-card {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    margin-bottom: 30px;
}

.detail-card h3 {
    margin-bottom: 25px;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.detail-card h3 i {
    color: var(--primary-color);
}

.feature-list {
    list-style: none;
}

.feature-list li {
    margin-bottom: 18px;
    padding-left: 30px;
    position: relative;
    color: var(--text-secondary);
    line-height: 1.6;
}
/* Hacker Terminal Component */
.hacker-terminal {
    background: #0f172a;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    font-family: 'Fira Code', 'Courier New', monospace;
    width: 100%;
    max-width: 550px;
    margin: 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.terminal-header {
    background: rgba(255, 255, 255, 0.05);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.terminal-dots {
    display: flex;
    gap: 8px;
}

.terminal-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.terminal-dots span:nth-child(1) { background: #ff5f56; }
.terminal-dots span:nth-child(2) { background: #ffbd2e; }
.terminal-dots span:nth-child(3) { background: #27c93f; }

.terminal-title {
    margin-left: 20px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
}

.terminal-body {
    padding: 25px;
    font-size: 0.9rem;
    line-height: 1.8;
}

.code-line {
    color: #94a3b8;
}

.c-1 { color: #f472b6; } /* keyword */
.c-2 { color: #38bdf8; } /* function */
.c-3 { color: #64748b; } /* comment */
.c-4 { color: #fbbf24; } /* method/constant */
.c-5 { color: #4ade80; } /* string */

.terminal-cursor {
    width: 8px;
    height: 16px;
    background: var(--primary-color);
    display: inline-block;
    vertical-align: middle;
    margin-top: -2px;
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

@media (max-width: 768px) {
    .hacker-terminal { width: 100%; }
}
.feature-list li i {
    position: absolute;
    left: 0;
    top: 4px;
    color: var(--primary-color);
    font-size: 0.9rem;
}

.sidebar-info-box {
    background: #030712;
    color: white;
    padding: 35px;
    border-radius: 24px;
    position: sticky;
    top: 100px;
}

.sidebar-info-box h4 {
    color: #94a3b8;
    margin-bottom: 25px;
    font-size: 0.8rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.info-item {
    margin-bottom: 25px;
}

.info-label {
    display: block;
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 6px;
}

.info-value {
    font-weight: 600;
    font-size: 1rem;
}

@media (max-width: 992px) {
    .detail-grid { grid-template-columns: 1fr; }
    .detail-title { font-size: 2.2rem; }
    .portfolio-detail-hero { padding-top: 80px; }
    .detail-main-img { margin-bottom: -100px; }
    .detail-content-section { padding-top: 150px; }
}

