﻿/* CBAM Self Assessment Tool Styles */
/* 与 ohesg.com 保持一致的设计风格 */

/* 基础变量 */
:root {
    /* 主色调 - 与 ohesg.com 一致的绿色 */

    /* 辅助色 */

    --accent-color: #f59e0b;

    /* 文字颜色 */
    --text-color: #1f2937;
    --text-light: #4b5563;
    --text-muted: #9ca3af;

    /* 背景色 */
    --bg-color: #f9fafb;
    --bg-white: #ffffff;
    --bg-gray: #f3f4f6;

    /* 边框 */
    --border-color: #e5e7eb;

    /* 阴影 - 更柔和 */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    /* 圆角 */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;

    /* 输入框颜色 */
    --input-red: #dc3545;
    --success-green: #28a745;

    /* 过渡 */
    --transition: all 0.2s ease;
}

/* 重置样式 */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--bg-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul,
li {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* 容器 */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===================================
   导航栏
   =================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transition: var(--transition);
    /* 覆盖 Bootstrap .navbar 的默认样式 */
    display: block;
    flex-wrap: nowrap;
    padding: 0;
}

.nav-container {
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 1.2rem;
    color: var(--primary-color);
    text-decoration: none;
}

.logo-badge {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-badge-text {
    color: white;
    font-weight: bold;
    font-size: 12px;
}

.logo-text {
    color: var(--text-color);
    font-weight: 600;
}

.logo-icon {
    font-size: 1.4rem;
}

.nav-menu {
    display: flex;
    gap: 8px;
    align-items: center;
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-menu li {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-link {
    padding: 8px 16px;
    border-radius: var(--radius-md);
    color: var(--text-color);
    font-weight: 500;
    transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
    background: var(--primary-color);
    color: var(--bg-white);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
    background: none;
    border: none;
    cursor: pointer;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-color);
    transition: var(--transition);
}

/* 页面标题区域 */
.page-title {
    text-align: center;
    margin-bottom: 24px;
}

.page-title>.page-title-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center;
    margin-bottom: 16px;
    width: 100%;
}

.page-title h1 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 8px;
}

.page-title p {
    color: var(--text-light);
    font-size: 1.1rem;
}

/* 语言切换按钮 */
.lang-switcher-container {
    display: flex;
    gap: 4px;
}

.lang-btn {
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    color: var(--text-light);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.lang-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.lang-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--bg-white);
}

/* ===================================
   面包屑导航 (继承自父级 style.css，仅覆盖差异)
   =================================== */
.breadcrumb {
    display: block;
    margin-bottom: 0;
    padding: 0;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
}

.breadcrumb-list {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 12px 0;
}

.breadcrumb-item,
.breadcrumb-separator {
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 0;
    font-size: 0.875rem;
    line-height: 1.5;
}

.breadcrumb-item a {
    color: var(--text-light);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: var(--primary-color);
}

.breadcrumb-item.active {
    color: var(--text-color);
    font-weight: 500;
}

.breadcrumb-separator {
    color: var(--primary-color);
}

/* ===================================
   页面头部 (覆盖父级 page-header，适配语言切换按钮)
   =================================== */
.page-header {
    position: relative;
    height: 100px;
    padding: 16px 0;
    background: var(--primary-color);
    color: #fff;
    box-sizing: border-box;
}

.page-header h1,
.page-header p {
    color: #fff;
}

.page-header h1 {
    margin: 0;
    font-size: 1.875rem;
    line-height: 2.25rem;
    font-weight: 600;
}

.page-header p {
    margin: 0.5rem 0 0;
    font-size: 1rem;
    line-height: 1.5rem;
}

.page-header .container {
    position: relative;
    overflow: visible;
}

.page-header .lang-switcher-container {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 0;
    position: absolute;
    top: 16px;
    right: 24px;
    z-index: 2;
}

.page-header .lang-btn {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
}

.page-header .lang-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    border-color: rgba(255, 255, 255, 0.6);
}

.page-header .lang-btn.active {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.9);
    color: var(--primary-dark);
}

/* ===================================
   主内容区域
   =================================== */
.main-content {
    padding: 40px 0 60px;
}

/* 页面标题区域 */
.page-title {
    text-align: center;
    margin-bottom: 24px;
    position: relative;
}

.page-title h1 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 8px;
}

.page-title p {
    color: var(--text-light);
    font-size: 1.1rem;
}


/* Alert Styles */
.alert {
    border-radius: var(--radius-md);
    border: none;
    padding: 20px 24px;
}

.alert-info {
    background-color: var(--primary-bg);
    border-left: 4px solid var(--primary-color);
}

.alert-info strong {
    color: var(--primary-dark);
}

/* Card Styles */
.card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
}

.card-header.bg-primary {
    background: var(--primary-color) !important;
}

.card-header.bg-success {
    background: var(--success-green) !important;
}

.card-header.bg-warning {
    background: var(--accent-color) !important;
}

.card-header h5 {
    font-weight: 600;
    font-size: 1.1rem;
}

.card-body {
    padding: 24px;
}

/* Input Field Styles - Red border for required fields */
.input-field {
    border: 2px solid var(--input-red);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 0.95rem;
    transition: var(--transition);
}

.input-field:focus {
    border-color: var(--input-red);
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15);
    outline: none;
}

.input-field:valid {
    border-color: var(--success-green);
}

.input-field:valid:focus {
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.15);
}

.required-label::after {
    content: ' *';
    color: var(--input-red);
    font-weight: bold;
}

.form-label {
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 8px;
}

.form-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 6px;
}

.form-text a {
    color: var(--primary-color);
}

.form-text a:hover {
    text-decoration: underline;
}

/* Result Card Styles - Green theme */
.result-card .card-header {
    background-color: var(--success-green) !important;
}

.result-card .card-header h5 {
    color: white !important;
}

/* CBAM Result Styles */
.cbam-yes {
    color: var(--success-green);
    font-weight: 600;
}

.cbam-no {
    color: var(--input-red);
    font-weight: 600;
}

.cbam-maybe {
    color: var(--accent-color);
    font-weight: 600;
}

/* Search Results Dropdown */
#cnCodeSearch {
    max-height: 300px;
    overflow-y: auto;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

.search-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.search-item:hover {
    background-color: var(--primary-bg);
}

.search-item:last-child {
    border-bottom: none;
}

.search-item .cn-code {
    font-family: 'Consolas', 'Monaco', monospace;
    font-weight: 600;
    color: var(--primary-color);
}

.search-item .goods-name {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-top: 4px;
}

/* Table Styles */
.table {
    margin-bottom: 0;
}

.table th {
    font-weight: 600;
    background-color: var(--bg-gray);
    color: var(--text-color);
    padding: 12px 16px;
    border-bottom: 2px solid var(--border-color);
}

.table td {
    vertical-align: top;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-light);
}

.table-hover tbody tr:hover {
    background-color: var(--primary-bg);
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary-color);
    color: var(--bg-white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-outline-primary {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: var(--bg-white);
}

.btn-outline-secondary {
    background: transparent;
    color: var(--text-light);
    border: 1px solid var(--border-color);
}

.btn-outline-secondary:hover {
    background: var(--bg-gray);
    border-color: var(--text-muted);
}

.btn-outline-secondary.active {
    background: var(--primary-color);
    color: var(--bg-white);
    border-color: var(--primary-color);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.85rem;
}

.btn-group {
    display: flex;
    gap: 0;
}

.btn-group .btn {
    border-radius: 0;
}

.btn-group .btn:first-child {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.btn-group .btn:last-child {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* Category Badge */
.category-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.category-cement {
    background-color: #d4edda;
    color: #155724;
}

.category-steel {
    background-color: #cce5ff;
    color: #004085;
}

.category-electricity {
    background-color: #fff3cd;
    color: #856404;
}

.category-fertilisers {
    background-color: #f8d7da;
    color: #721c24;
}

.category-hydrogen {
    background-color: #e2d5f1;
    color: #563d7c;
}

.category-aluminium {
    background-color: #d1ecf1;
    color: #0c5460;
}

/* Special Provisions Card */
#specialProvisionsCard .card-header {
    background-color: var(--accent-color) !important;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Highlight animation */
@keyframes highlight {
    0% {
        background-color: #fff3cd;
    }

    100% {
        background-color: transparent;
    }
}

.highlight {
    animation: highlight 2s ease-out;
}

/* ===================================
   页脚
   =================================== */
.footer {
    background: #f5f7f9;
    color: #333333;
    padding: 50px 0 20px;
    margin-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 32px;
}

.footer-brand {
    max-width: 300px;
}

.footer-brand-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    text-decoration: none;
    color: inherit;
}

.footer-brand .logo-badge {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-brand .logo-badge-text {
    color: white;
    font-weight: bold;
    font-size: 12px;
}

.footer-brand .logo-text {
    font-size: 1.15rem;
    font-weight: 600;
    color: #222222;
}

.footer-brand p {
    margin-top: 12px;
    color: #666666;
    font-size: 0.85rem;
    line-height: 1.6;
}

.footer-brand .brand-note {
    margin-top: 16px;
    color: #718096;
    font-size: 12px;
}

.footer-brand .brand-note a {
    color: var(--primary-color);
}

.footer-brand .brand-note a:hover {
    text-decoration: underline;
}

.footer-links h4,
.footer-external h4 {
    font-size: 0.95rem;
    margin-bottom: 14px;
    font-weight: 600;
    color: #222222;
}

.footer-links ul li,
.footer-external ul li {
    margin-bottom: 6px;
    list-style: none;
}

.footer-links a,
.footer-external a {
    color: #333333;
    font-size: 0.85rem;
    transition: var(--transition);
}

.footer-links a:hover,
.footer-external a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    text-align: center;
    color: #666666;
    font-size: 0.8rem;
}

/* ===================================
   响应式设计
   =================================== */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--bg-white);
        flex-direction: column;
        padding: 24px;
        gap: 8px;
        box-shadow: var(--shadow-md);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: var(--transition);
    }

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

    .nav-toggle {
        display: flex;
    }

    /* 移动端页面头部语言切换按钮 - 独占一行居中 */
    .page-header {
        height: auto;
        min-height: 100px;
        padding: 24px 0 20px;
    }

    .page-header .lang-switcher-container {
        position: relative;
        top: 0;
        right: 0;
        justify-content: center;
        margin-bottom: 16px;
    }

    /* 移动端标题头部调整 */
    .page-title-header {
        flex-wrap: wrap;
        gap: 12px;
        justify-content: center;
    }

    .lang-switcher-container {
        width: 100%;
        justify-content: center;
    }

    header h1 {
        font-size: 1.5rem !important;
    }

    .card-body {
        padding: 16px;
    }

    .btn {
        font-size: 0.875rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    body {
        padding-top: 56px;
    }

    .nav-container {
        height: 56px;
        padding: 0 16px;
    }

    .page-title h1 {
        font-size: 1.5rem;
    }

    .hero-title {
        font-size: 1.75rem;
    }
}

/* ===================================
   动画
   =================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

/* Bootstrap 覆盖 - 保持一致的圆角 */
.form-control,
.form-select {
    border-radius: var(--radius-sm);
    border-color: var(--border-color);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
}

/* 输入框保持红色边框 */
.input-field.form-control:focus,
.input-field.form-select:focus {
    border-color: var(--input-red);
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15);
}

/* Dropdown menu */
.dropdown-menu {
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    padding: 8px;
}