/**
 * 自定义样式
 * 中聯合同会社
 */

/* 基础样式 */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: #f6f8fb;
    color: #1f2937;
}

.bg-soft {
    background: #f6f8fb;
}

/* 首页正式版：贸易与跨境电商主视觉 */
.homepage-hero {
    min-height: 620px;
    background: #0b1728;
}

.homepage-hero-bg {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    object-position: center;
    opacity: 0.34;
}

.homepage-hero-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(7, 19, 34, 0.96) 0%, rgba(11, 29, 52, 0.88) 48%, rgba(15, 52, 96, 0.42) 100%),
        linear-gradient(180deg, rgba(2, 6, 23, 0.22), rgba(2, 6, 23, 0.68));
}

.hero-business-card {
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    padding: 1.25rem;
    min-height: 150px;
}

.section-kicker {
    color: #1A5099;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.business-card,
.support-card {
    display: block;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
    padding: 1.5rem;
    min-height: 100%;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.business-card:hover,
.support-card:hover {
    border-color: rgba(26, 80, 153, 0.38);
    box-shadow: 0 14px 32px rgba(15, 52, 96, 0.1);
    transform: translateY(-2px);
}

.business-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: #eef5fc;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.business-tag {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    background: #f1f5f9;
    color: #334155;
    font-size: 0.78rem;
    font-weight: 600;
}

.site-logo-link {
    min-width: 0;
    max-width: calc(100% - 124px);
}

.site-logo-name {
    display: inline-block;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.15;
}

.header-actions {
    flex-shrink: 0;
}

.language-menu {
    position: relative;
    display: inline-flex;
    z-index: 60;
}

.language-menu-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
    height: 34px;
    min-width: 82px;
    padding: 0 0.55rem 0 0.62rem;
    border: 1px solid rgba(15, 52, 96, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: #0F3460;
    font-size: 0.78rem;
    font-weight: 800;
    box-shadow: 0 8px 22px rgba(15, 52, 96, 0.08);
}

.language-menu-panel {
    position: absolute;
    top: calc(100% + 0.45rem);
    right: 0;
    min-width: 118px;
    padding: 0.35rem;
    border: 1px solid rgba(15, 52, 96, 0.12);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 18px 40px rgba(15, 52, 96, 0.16);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
}

.language-menu:hover .language-menu-panel,
.language-menu:focus-within .language-menu-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-menu-panel a {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 32px;
    padding: 0.35rem 0.55rem;
    border-radius: 8px;
    color: #334155;
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1;
}

.language-menu-panel a:hover,
.language-menu-panel a.active {
    background: #eef4fb;
    color: #0F3460;
}

.language-flag {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: inset 0 0 0 1px rgba(15, 52, 96, 0.12);
}

.flag-jp {
    background: #ffffff;
}

.flag-jp::before {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: #bc002d;
}

.flag-cn {
    background-color: #de2910;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 20'%3E%3Crect width='30' height='20' fill='%23de2910'/%3E%3Cg fill='%23ffde00'%3E%3Cpath d='M5 1.45 5.9 4.2H8.78L6.45 5.9 7.35 8.65 5 6.95 2.65 8.65 3.55 5.9 1.22 4.2H4.1L5 1.45Z'/%3E%3Ccircle cx='10.8' cy='2.6' r='1.05'/%3E%3Ccircle cx='12.4' cy='5.1' r='1.05'/%3E%3Ccircle cx='12.2' cy='8.1' r='1.05'/%3E%3Ccircle cx='10.4' cy='10.4' r='1.05'/%3E%3C/g%3E%3C/svg%3E");
    background-size: cover;
    background-position: center;
}

.flag-us {
    background:
        linear-gradient(180deg,
            #b22234 0 7.69%,
            #ffffff 7.69% 15.38%,
            #b22234 15.38% 23.07%,
            #ffffff 23.07% 30.76%,
            #b22234 30.76% 38.45%,
            #ffffff 38.45% 46.14%,
            #b22234 46.14% 53.83%,
            #ffffff 53.83% 61.52%,
            #b22234 61.52% 69.21%,
            #ffffff 69.21% 76.9%,
            #b22234 76.9% 84.59%,
            #ffffff 84.59% 92.28%,
            #b22234 92.28% 100%);
}

.flag-us::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 11px;
    height: 11px;
    background: #3c3b6e;
}

.business-hours-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 28px;
    padding: 0.25rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.78rem;
    font-weight: 600;
}

.business-hours-dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: #38d68b;
    box-shadow: 0 0 0 3px rgba(56, 214, 139, 0.18);
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .site-logo-link {
        max-width: calc(100% - 104px);
        gap: 0.35rem !important;
    }

    .site-logo-image {
        height: 2.25rem !important;
        max-width: 7.6rem;
    }

    .site-logo-name {
        font-size: 0.88rem !important;
        max-width: 7.2rem;
    }

    .header-actions {
        gap: 0.35rem !important;
    }

    .language-menu + button {
        margin-left: 0.35rem !important;
    }

    .language-menu-trigger {
        min-width: 68px;
        height: 32px;
        padding: 0 0.45rem;
        gap: 0.28rem;
    }

    .language-flag {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 380px) {
    .site-logo-image {
        max-width: 6.5rem;
    }

    .site-logo-name {
        font-size: 0.8rem !important;
        max-width: 5.9rem;
    }

    .language-menu + button {
        margin-left: 0.35rem !important;
    }

    .language-menu-trigger {
        min-width: 62px;
    }
}

.flag-us::after {
    content: "";
    position: absolute;
    left: 2px;
    top: 2px;
    width: 2px;
    height: 2px;
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 4px 0 0 #ffffff, 2px 3px 0 #ffffff, 6px 3px 0 #ffffff;
}

/* 统一页面标题区域 */
.page-hero {
    background:
        linear-gradient(90deg, rgba(7, 19, 34, 0.97), rgba(15, 52, 96, 0.88)),
        #0b1728;
    color: #ffffff;
    padding: 4.5rem 0;
}

.page-hero h1 {
    font-size: clamp(2rem, 4vw, 3.75rem);
    line-height: 1.15;
    font-weight: 800;
    margin: 0 0 1rem;
}

.page-hero p {
    max-width: 760px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 1.08rem;
    line-height: 1.8;
}

.page-kicker {
    color: rgba(255, 255, 255, 0.68) !important;
    font-size: 0.82rem !important;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 1rem !important;
}

.section-heading {
    max-width: 760px;
    margin-bottom: 2.25rem;
}

.section-heading h2,
.about-lead h2,
.company-profile-layout h2 {
    color: #0F3460;
    font-size: clamp(1.75rem, 3vw, 2.55rem);
    line-height: 1.25;
    font-weight: 800;
    margin: 0;
}

/* 服务页 */
.service-matrix {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.service-panel {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
    padding: 1.5rem;
    min-height: 210px;
    position: relative;
}

.service-panel-primary {
    min-height: 280px;
    border-top: 4px solid #1A5099;
}

.service-panel-number {
    color: #cbd5e1;
    font-size: 2.5rem;
    line-height: 1;
    font-weight: 800;
    margin-bottom: 1.5rem;
}

.service-panel h3 {
    color: #0F3460;
    font-size: 1.18rem;
    font-weight: 800;
    margin-bottom: 0.85rem;
}

.service-panel p {
    color: #5b6575;
    font-size: 0.95rem;
    line-height: 1.75;
}

.service-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.2rem;
}

.service-chip-row span {
    border: 1px solid #dbeafe;
    background: #f8fafc;
    color: #334155;
    border-radius: 999px;
    padding: 0.28rem 0.65rem;
    font-size: 0.78rem;
    font-weight: 600;
}

.operation-list {
    border-top: 1px solid #e5e7eb;
}

.operation-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.25rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.operation-row h3 {
    color: #111827;
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 0.35rem;
}

.operation-row p {
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.65;
}

.operation-row span {
    flex-shrink: 0;
    color: #1A5099;
    font-size: 0.88rem;
    font-weight: 700;
}

/* 会社概要 */
.about-hero {
    background:
        linear-gradient(90deg, rgba(7, 19, 34, 0.97), rgba(15, 52, 96, 0.82)),
        #0b1728;
}

.about-lead {
    display: grid;
    grid-template-columns: 0.82fr 1.18fr;
    gap: 3rem;
    align-items: start;
    background: #ffffff;
    border: 1px solid #e8edf3;
    border-radius: 8px;
    padding: 2rem;
}

.about-lead > p,
.company-profile-layout > div:first-child p {
    color: #5b6575;
    line-height: 1.9;
    font-size: 1rem;
}

.about-domain-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.about-domain-grid article {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.35rem;
    min-height: 180px;
}

.about-domain-grid span {
    display: block;
    color: #1A5099;
    font-size: 0.85rem;
    font-weight: 800;
    margin-bottom: 1.2rem;
}

.about-domain-grid h3 {
    color: #0F3460;
    font-size: 1.08rem;
    font-weight: 800;
    margin-bottom: 0.7rem;
}

.about-domain-grid p {
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.7;
}

.company-profile-layout {
    display: grid;
    grid-template-columns: 0.75fr 1.25fr;
    gap: 3rem;
    align-items: start;
}

.company-profile-table {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 18px 40px rgba(15, 52, 96, 0.06);
}

.company-profile-row {
    display: grid;
    grid-template-columns: 160px 1fr;
    border-bottom: 1px solid #e5e7eb;
}

.company-profile-row:last-child {
    border-bottom: none;
}

.company-profile-row dt,
.company-profile-row dd {
    padding: 1rem 1.1rem;
    font-size: 0.94rem;
    line-height: 1.65;
}

.company-profile-row dt {
    background: #f8fafc;
    color: #334155;
    font-weight: 800;
}

.company-profile-row dd {
    color: #111827;
}

/* 中日文排版优化 */
:lang(ja), :lang(zh-CN) {
    word-break: normal;
    overflow-wrap: break-word;
    line-break: strict;
}

/* 图片自适应 */
img {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

/* 富文本内容样式 */
.prose {
    color: #374151;
    line-height: 1.8;
}

.prose h1, .prose h2, .prose h3, .prose h4 {
    color: #0F3460;
    font-weight: 700;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

.prose h1 { font-size: 2em; }
.prose h2 { font-size: 1.5em; }
.prose h3 { font-size: 1.25em; }

.prose p {
    margin-bottom: 1em;
}

.prose ul, .prose ol {
    margin-bottom: 1em;
    padding-left: 1.5em;
}

.prose ul { list-style-type: disc; }
.prose ol { list-style-type: decimal; }

.prose li {
    margin-bottom: 0.5em;
}

.prose a {
    color: #1A5099;
    text-decoration: underline;
}

.prose a:hover {
    color: #0F3460;
}

.prose img {
    border-radius: 0.75rem;
    margin: 1.5em 0;
}

.prose blockquote {
    border-left: 4px solid #1A5099;
    padding-left: 1em;
    margin: 1.5em 0;
    color: #6b7280;
    font-style: italic;
}

.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
}

.prose th, .prose td {
    border: 1px solid #e5e7eb;
    padding: 0.75em 1em;
    text-align: left;
}

.prose th {
    background: #f9fafb;
    font-weight: 600;
}

.prose pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1em;
    border-radius: 0.75rem;
    overflow-x: auto;
    margin: 1.5em 0;
}

.prose code {
    background: #f1f5f9;
    padding: 0.2em 0.4em;
    border-radius: 0.25rem;
    font-size: 0.9em;
}

.prose pre code {
    background: transparent;
    padding: 0;
}

/* 服务卡片缩略图 - 固定尺寸防失真 */
.svc-card-img {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f3f4f6;
    position: relative;
}

.svc-card-img img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
}

/* 服务详情页顶部大图 - 固定高度防失真 */
.svc-detail-img {
    width: 100%;
    height: 360px;
    overflow: hidden;
    background: #f3f4f6;
    position: relative;
}

.svc-detail-img img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
}

/* 文章卡片缩略图 - 固定尺寸防失真 */
.article-card-img {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f3f4f6;
    position: relative;
}

.article-card-img img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
}

/* 文章详情页大图 */
.article-detail-img {
    width: 100%;
    height: 360px;
    overflow: hidden;
    background: #f3f4f6;
    position: relative;
}

.article-detail-img img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
}

@media (max-width: 768px) {
    .homepage-hero {
        min-height: auto;
    }

    .homepage-hero-overlay {
        background:
            linear-gradient(180deg, rgba(7, 19, 34, 0.95) 0%, rgba(11, 29, 52, 0.9) 58%, rgba(15, 52, 96, 0.78) 100%);
    }

    .hero-business-card {
        min-height: auto;
    }

    .page-hero {
        padding: 3.25rem 0;
    }

    .service-matrix,
    .about-domain-grid,
    .about-lead,
    .company-profile-layout {
        grid-template-columns: 1fr;
    }

    .service-panel,
    .service-panel-primary {
        min-height: auto;
    }

    .operation-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.75rem;
    }

    .company-profile-row {
        grid-template-columns: 1fr;
    }

    .company-profile-row dt {
        padding-bottom: 0.35rem;
    }

    .company-profile-row dd {
        padding-top: 0.35rem;
    }

    .svc-card-img {
        height: 180px;
    }
    .svc-detail-img {
        height: 220px;
    }
    .article-card-img {
        height: 180px;
    }
    .article-detail-img {
        height: 220px;
    }
}

/* 新闻列表缩略图 - 左图右文布局 */
.news-card-img {
    width: 280px;
    height: 190px;
    overflow: hidden;
    background: #f3f4f6;
    border-radius: 0.75rem;
    position: relative;
    flex-shrink: 0;
}

.news-card-img img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
}

@media (max-width: 640px) {
    .news-card-img {
        width: 100%;
        height: 220px;
        border-radius: 0.5rem;
    }
}

/* 卡片悬浮效果 */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* 按钮渐变 */
.btn-gradient {
    background: linear-gradient(135deg, #0F3460, #1A5099);
    transition: all 0.3s ease;
}

.btn-gradient:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* 文字截断 */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* 表单输入框统一高度 */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
textarea,
select {
    min-height: 44px;
}

/* 移动端优化 */
@media (max-width: 768px) {
    body {
        font-size: 16px;
    }

    .prose {
        font-size: 16px;
    }

    .prose h1 { font-size: 1.75em; }
    .prose h2 { font-size: 1.375em; }
    .prose h3 { font-size: 1.125em; }
}

/* 打印样式 */
@media print {
    nav, footer, .no-print {
        display: none !important;
    }

    body {
        font-size: 12pt;
        color: #000;
    }

    a {
        color: #000;
        text-decoration: underline;
    }
}

/* Emergency layout fix: keep hero media as background layer */
.homepage-hero {
    position: relative !important;
    min-height: auto !important;
    background: #0b1728 !important;
}
.homepage-hero-bg {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    object-fit: cover !important;
    object-position: center !important;
    opacity: 0.34 !important;
    z-index: 0 !important;
}
.homepage-hero-overlay {
    position: absolute !important;
    inset: 0 !important;
    height: 100% !important;
    z-index: 1 !important;
}
.homepage-hero > .relative {
    position: relative !important;
    z-index: 2 !important;
}
@media (min-width: 768px) {
    .homepage-hero { min-height: 640px !important; }
}

/* Emergency layout fix: keep hero media as background layer */
.homepage-hero {
    position: relative !important;
    min-height: auto !important;
    background: #0b1728 !important;
}
.homepage-hero-bg {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    object-fit: cover !important;
    object-position: center !important;
    opacity: 0.34 !important;
    z-index: 0 !important;
}
.homepage-hero-overlay {
    position: absolute !important;
    inset: 0 !important;
    height: 100% !important;
    z-index: 1 !important;
}
.homepage-hero > .relative {
    position: relative !important;
    z-index: 2 !important;
}
@media (min-width: 768px) {
    .homepage-hero { min-height: 640px !important; }
}
