:root {
  --brand-orange: #ed6c00;
  --brand-orange-hover: #c05500;
  --link-hover-color: #505050; /* 品牌铁灰，内敛低调 */
  --brand-gray: #727171;
  --text-primary: #2c3e50;
  --text-secondary: #666666;
  --text-muted: #999999;
  --border-color: #e0e0e0;
  --bg-light: #f0f2f5; /* 冷调浅灰 */
  --radius-lg: 12px;
  --radius-md: 8px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.05);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.08);
  --navbar-shadow: 0 2px 4px rgba(0,0,0,0.04); /* 导航栏专用投影 */
  --transition-base: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

body {
    color: var(--text-primary);
    background-color: var(--bg-light); /* 应用全局灰色背景 */
}

/* Hero Section */
.home-hero {
  background: linear-gradient(180deg, rgba(255,255,255,0.75) 0%, rgba(245,245,244,0) 100%);
  padding: 3.75rem 1rem;
  margin-bottom: 0.5rem;
  border-bottom: none; /* 移除分割线 */
  position: relative;
  overflow: hidden;
  box-shadow: none; /* 移除阴影 */
}

.home-hero h1 {
    color: #2c3e50;
    font-weight: 700;
    margin-bottom: 1rem;
}

.home-hero .lead {
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto 2rem auto;
}

/* Search Box in Hero */
.hero-search-box {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.hero-search-form {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  border-radius: 28px;
  border: 1px solid #ddd;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  transition: var(--transition-base);
}

.hero-search-form:focus-within {
  border-color: var(--brand-orange);
  box-shadow: 0 4px 16px rgba(237, 108, 0, 0.15);
}

.hero-search-form .hero-search-input {
  flex: 1;
  height: 44px;
  padding-left: 14px;
  border: 0;
  border-radius: 22px;
  box-shadow: none;
  font-size: 1.05rem;
}

.hero-search-form .hero-search-input:focus {
  outline: none;
  box-shadow: none;
}

.hero-search-form .btn-search {
  height: 44px;
  border-radius: 22px;
  padding: 0 24px;
  background-color: var(--brand-orange);
  border-color: var(--brand-orange);
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
}

.hero-search-box .btn-search:hover {
    background-color: var(--brand-orange-hover);
}

/* Section Title */
.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    position: relative;
    padding-left: 1rem;
    border-left: 4px solid var(--text-primary);
    line-height: 1.2;
}

/* Tool Cards */
.tool-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: #fff;
  transition: var(--transition-base);
  height: 100%;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.tool-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: transparent;
}

.tool-card .card-body {
    padding: 2rem;
    flex: 1;
}

.tool-card .tool-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1.25rem;
}

.tool-card .tool-icon-wrapper {
    width: 56px;
    height: 56px;
    background: #f0f2f5;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    flex-shrink: 0;
}

.tool-card .tool-icon {
/*    width: 32px;
    height: 32px;*/
    object-fit: contain;
}

.tool-card .tool-info {
    flex: 1;
}

.tool-card .tool-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
    display: block;
}

.tool-card .card-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.4;
}

.tool-card .card-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s;
}

.tool-card:hover .card-title a {
  color: var(--link-hover-color);
}

.tool-card .card-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 0;
}

/* Card Footer Actions */
.tool-card .card-actions {
    padding: 1rem 2rem;
    background: #fafafa;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tool-card .card-link-text {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.tool-card .btn-enter {
    color: var(--brand-orange);
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    transition: color 0.2s;
}

.tool-card .btn-enter i {
    margin-left: 4px;
    transition: transform 0.2s;
}

.tool-card:hover .btn-enter {
    color: var(--link-hover-color);
}

.tool-card:hover .btn-enter i {
    transform: translateX(4px);
}

/* Stretched Link for full card clickability */
.stretched-link::after {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
    content: "";
}

/* Ads Section */
.home-ads {
    margin-top: 0.5rem;
    padding-top: 0;
    margin-bottom: 1.5rem;
}

.home-ads .home-ad-img {
  display: block;
  width: 100%;
  max-width: 360px;
  height: 112px;
  object-fit: cover;
  margin: 0 auto;
}

.home-ads .home-ad-meta {
  margin-top: 0.5rem;
}

.home-ads .home-ad-badge {
  background: #f8f9fa;
  font-weight: normal;
}

@media (max-width: 576px) {
  .home-hero {
    padding: 3rem 1rem;
  }

  .hero-search-form {
    flex-direction: column;
    align-items: stretch;
    border-radius: 16px;
    padding: 10px;
  }

  .hero-search-form .hero-search-input {
    width: 100%;
  }

  .hero-search-form .btn-search {
    width: 100%;
  }

  .home-ads .home-ad-img {
    max-width: none;
    height: 96px;
  }
}

/* Animation utilities */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Helper */
.border-ccc { border-color: var(--border-color) !important; }


/* HSCN Home – Hero */
.home-hero--hscn,
.home-hero--hsus,
.home-hero--hsjp,
.home-hero--gkdm {
    --hero-accent: var(--brand-orange);
    --hero-accent-spot: rgba(255, 255, 255, 0.5);
    --hero-accent-glow: rgba(0, 0, 0, 0.03);
    --hero-accent-border-weak: rgba(0, 0, 0, 0.08);
    --hero-accent-weak: rgba(0, 0, 0, 0.03);
    --hero-accent-focus: rgba(237, 108, 0, 0.16);
    --hero-accent-pill-border: rgba(0, 0, 0, 0.15);
    --hero-accent-pill-bg: rgba(0, 0, 0, 0.05);
    --hero-accent-focus-ring: rgba(237, 108, 0, 0.14);
    --hero-accent-text: var(--text-primary);

    position: relative;
    padding: 4.5rem 0 3.5rem;
    margin-bottom: 0;
    background: var(--bg-light);
    overflow: hidden;
}

.home-hero--hscn::before,
.home-hero--hsus::before,
.home-hero--hsjp::before,
.home-hero--gkdm::before,
.home-hero--hscn::after,
.home-hero--hsus::after,
.home-hero--hsjp::after,
.home-hero--gkdm::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    filter: blur(0.2px);
    opacity: 0.9;
    pointer-events: none;
}

.home-hero--hscn::before,
.home-hero--hsus::before,
.home-hero--hsjp::before,
.home-hero--gkdm::before {
    width: 520px;
    height: 520px;
    left: -220px;
    top: -220px;
    background: radial-gradient(circle at 30% 30%, var(--hero-accent-glow), rgba(0, 0, 0, 0.00) 65%);
}

.home-hero--hscn::after,
.home-hero--hsus::after,
.home-hero--hsjp::after,
.home-hero--gkdm::after {
    width: 460px;
    height: 460px;
    right: -220px;
    top: -260px;
    background: radial-gradient(circle at 35% 35%, rgba(44, 62, 80, 0.18), rgba(44, 62, 80, 0.00) 65%);
}

.home-hero--hscn h1,
.home-hero--hsus h1,
.home-hero--hsjp h1,
.home-hero--gkdm h1 {
    letter-spacing: 0.5px;
}

.home-hero--hscn .lead,
.home-hero--hsus .lead,
.home-hero--hsjp .lead,
.home-hero--gkdm .lead {
    margin-left: 0;
    margin-right: 0;
    max-width: 42rem;
}

.home-hero--hscn .hero-points,
.home-hero--hsus .hero-points,
.home-hero--hsjp .hero-points,
.home-hero--gkdm .hero-points {
    gap: 0.5rem;
}

.home-hero--hscn .hero-point,
.home-hero--hsus .hero-point,
.home-hero--hsjp .hero-point,
.home-hero--gkdm .hero-point {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--hero-accent-border-weak);
    background: var(--hero-accent-weak);
    color: var(--hero-accent-text);
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
}

.home-hero--hscn .hero-search-box,
.home-hero--hsus .hero-search-box,
.home-hero--hsjp .hero-search-box,
.home-hero--gkdm .hero-search-box {
    max-width: 560px;
}

.home-hero--hscn .hero-search-card,
.home-hero--hsus .hero-search-card,
.home-hero--hsjp .hero-search-card,
.home-hero--gkdm .hero-search-card {
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 18px;
    background: rgba(255,255,255,0.92);
    box-shadow: 0 10px 30px rgba(0,0,0,0.06);
    backdrop-filter: blur(6px);
    padding: 18px;
}

.home-hero--hscn .hero-search-form,
.home-hero--hsus .hero-search-form,
.home-hero--hsjp .hero-search-form,
.home-hero--gkdm .hero-search-form {
    display: block;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.home-hero--hscn .hero-search-row,
.home-hero--hsus .hero-search-row,
.home-hero--hsjp .hero-search-row,
.home-hero--gkdm .hero-search-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px;
    border-radius: 28px;
    border: 1px solid #e6e6e6;
    background: #fff;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
    transition: var(--transition-base);
}

.home-hero--hscn .hero-search-row:focus-within,
.home-hero--hsus .hero-search-row:focus-within,
.home-hero--hsjp .hero-search-row:focus-within,
.home-hero--gkdm .hero-search-row:focus-within {
    border-color: var(--hero-accent);
    box-shadow: 0 8px 22px var(--hero-accent-focus);
}

.home-hero--hscn .hero-search-input,
.home-hero--hsus .hero-search-input,
.home-hero--hsjp .hero-search-input,
.home-hero--gkdm .hero-search-input {
    flex: 1;
    height: 48px;
    border: 0;
    border-radius: 22px;
    box-shadow: none;
    padding-left: 14px;
    font-size: 1.05rem;
    background: transparent;
}

.home-hero--hscn .hero-search-input:focus,
.home-hero--hsus .hero-search-input:focus,
.home-hero--hsjp .hero-search-input:focus,
.home-hero--gkdm .hero-search-input:focus {
    outline: none;
    box-shadow: none;
}

.home-hero--hscn .btn-search,
.home-hero--hsus .btn-search,
.home-hero--hsjp .btn-search,
.home-hero--gkdm .btn-search {
    height: 48px;
    border-radius: 24px;
    padding: 0 22px;
}

.home-hero--hscn .hero-search-options {
    margin-top: 12px;
}

.home-hero--hscn .hero-search-hint,
.home-hero--hsus .hero-search-hint,
.home-hero--hsjp .hero-search-hint,
.home-hero--gkdm .hero-search-hint {
    margin-top: 10px;
    font-size: 0.85rem;
}

/* Hero radio pills */
.home-hero--hscn .hero-radio-group .custom-control {
    padding-left: 0;
    margin-right: 0.5rem;
    min-height: auto;
    display: inline-flex;
    align-items: center;
}

.home-hero--hscn .hero-radio-group .custom-control-label::before,
.home-hero--hscn .hero-radio-group .custom-control-label::after {
    display: none;
}

.home-hero--hscn .hero-radio-group .custom-control-label {
    padding: 0.42rem 0.8rem;
    border-radius: 999px;
    border: 1px solid rgba(0,0,0,0.10);
    background: rgba(255,255,255,0.90);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.2;
    transition: var(--transition-base);
}

.home-hero--hscn .hero-radio-group .custom-control-input:checked ~ .custom-control-label {
    border-color: var(--hero-accent-pill-border);
    background: var(--hero-accent-pill-bg);
    color: var(--hero-accent-text);
}

.home-hero--hscn .hero-radio-group .custom-control-input:focus ~ .custom-control-label {
    box-shadow: 0 0 0 0.2rem var(--hero-accent-focus-ring);
}

@media (max-width: 576px) {
    .home-hero--hscn,
    .home-hero--hsus,
    .home-hero--hsjp,
    .home-hero--gkdm {
        padding: 3.25rem 0 2.5rem;
    }

    .home-hero--hscn .hero-search-card,
    .home-hero--hsus .hero-search-card,
    .home-hero--hsjp .hero-search-card,
    .home-hero--gkdm .hero-search-card {
        padding: 14px;
        border-radius: 16px;
    }

    .home-hero--hscn .hero-search-row,
    .home-hero--hsus .hero-search-row,
    .home-hero--hsjp .hero-search-row,
    .home-hero--gkdm .hero-search-row {
        flex-direction: column;
        align-items: stretch;
        border-radius: 16px;
        padding: 10px;
    }

    .home-hero--hscn .btn-search,
    .home-hero--hsus .btn-search,
    .home-hero--hsjp .btn-search,
    .home-hero--gkdm .btn-search {
        width: 100%;
    }

    .home-hero--hscn .hero-radio-group {
        justify-content: center !important;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .home-hero--hscn .hero-radio-group .custom-control {
        margin-right: 0;
    }
}

.home-hero--gkdm {
    --hero-accent: #1c84c6;
    --hero-accent-spot: rgba(28, 132, 198, 0.10);
    --hero-accent-glow: rgba(28, 132, 198, 0.20);
    --hero-accent-border-weak: rgba(28, 132, 198, 0.18);
    --hero-accent-weak: rgba(28, 132, 198, 0.08);
    --hero-accent-focus: rgba(28, 132, 198, 0.16);
    --hero-accent-pill-border: rgba(28, 132, 198, 0.35);
    --hero-accent-pill-bg: rgba(28, 132, 198, 0.12);
    --hero-accent-focus-ring: rgba(28, 132, 198, 0.14);
    --hero-accent-text: #083a63;
}

.nav-tabs .nav-link {
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-weight: 500;
}
.nav-tabs .nav-link.active {
    border-color: var(--text-primary);
    color: var(--text-primary);
    background: transparent;
}
.nav-tabs .nav-link:hover:not(.active) {
    border-color: #eee;
    color: var(--link-hover-color);
}
.table thead th {
    border-top: none;
    background-color: #f8f9fa;
    color: #6c757d;
    font-weight: 600;
    font-size: 0.9rem;
}
.code-link {
    color: #2c3e50;
    font-size: 1.1rem;
    font-weight: 600;
}

.code-link:hover {
    color: var(--brand-orange);
    text-decoration: none;
}

.gkdm-home .shipping-line-card {
    transition: all 0.3s ease;
    border: 1px solid #eee;
}

.gkdm-home .shipping-line-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: #ddd;
    background-color: #f8f9fa;
}

.gkdm-home .shipping-line-link {
    display: block;
    padding: 15px;
    color: #333;
    text-decoration: none;
    font-weight: 500;
}

.gkdm-home .shipping-line-link:hover {
    text-decoration: none;
    color: #0056b3;
}


/* Variables */
:root {
  --hsc-blue-thread: #9C27B0;
  --hsc-purple-thread: #5C6BC0;
  --hsc-indigo-thread: #1c84c6;
  --hsc-teal-thread: #009688;
  --hsc-green-thread: #30b035;
  --hsc-gray-border: #E5E7EB;
  --hsc-gray-text: #374151;
  --hsc-gray-muted: #6B7280;
  --hsc-bg-header: #F9FAFB;
}

body.hs-search-page {
  --brand-orange: #ed6c00;
  --brand-orange-hover: #c05500;
  --link-hover-color: #505050;
  --brand-gray: #727171;
  --text-primary: #333333;
  --text-secondary: #666666;
  --text-muted: #999999;
  --border-color: #eeeeee;
  --bg-light: #f5f5f4;
  --radius-lg: 0;
  --radius-md: 0;
  --shadow-sm: 0 0 0 1px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --transition-base: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --section-gap: 16px;
  background-color: var(--bg-light);
  color: var(--text-primary);
}

@media (min-width: 768px) {
  body.hs-search-page {
    --section-gap: 20px;
  }
}

body.hs-search-page .search-result-count {
  margin: 0 0 var(--section-gap);
}

body.hs-search-page .search-result-count__title {
  margin: 0;
  color: var(--text-muted);
  font-size: 20px;
  font-weight: 400;
}

body.hs-search-page .search-result-count--compact {
  padding: 10px 0;
  color: var(--text-secondary);
  font-size: 14px;
}

body.hs-search-page .search-result-count__em {
  font-weight: 700;
  color: var(--text-primary);
}

body.hs-search-page .compact-hero {
  background: #fff;
  padding: 24px 0;
  box-shadow: 0 4px 20px rgba(0,0,0,0.03);
  border-bottom: 1px solid #f5f5f5;
}

body.hs-search-page .search-capsule {
  transition: all 0.3s ease;
}

body.hs-search-page .search-capsule:focus-within {
  background: #fff !important;
  box-shadow: 0 4px 12px rgba(237, 108, 0, 0.15);
  border-color: var(--brand-orange, #ed6c00) !important;
}

body.hs-search-page .custom-select:focus {
  box-shadow: none;
}

body.hs-search-page .filter-switch {
  transition: all 0.2s;
  padding: 4px 8px;
  border-radius: 4px;
}

body.hs-search-page .filter-switch:hover {
  background-color: #f8f9fa;
}

body.hs-search-page .filter-switch.active .fa-check-square {
  color: var(--brand-orange, #ed6c00) !important;
}

body.hs-search-page .filter-switch.active span {
  color: #333 !important;
}

body.hs-search-page--hsus .col-tree,
body.hs-search-page--hsjp .col-tree {
  width: 35%;
}

body.hs-search-page--hsus .col-unit,
body.hs-search-page--hsjp .col-unit {
  width: 10%;
  text-align: center;
}

body.hs-search-page--hsus .col-rate,
body.hs-search-page--hsjp .col-rate {
  width: 12%;
  text-align: center;
}

body.hs-search-page--hsus .col-action,
body.hs-search-page--hsjp .col-action {
  width: 8%;
  text-align: center;
}

/* Containers */
.result-container {
  display: flex;
  background: #fff;
  border: 1px solid var(--hsc-gray-border);
  margin-bottom: 20px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  border-radius: 4px;
  overflow: hidden;
}
[id^="instance-card-"].result-container {
  display: block;
}
[id^="instance-card-"] .instance-main-row {
  display: flex;
}
.instance-content {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
}
[id^="instance-card-"] .instance-debug-line {
  padding: 6px 12px;
  border-top: 1px solid var(--hsc-gray-border);
  text-align: left;
  word-break: break-all;
}

/* Sidebar (base) */
.instance-sidebar {
  background: #fff;
  border-right: 1px solid var(--hsc-gray-border);
  flex-shrink: 0;
}

/* Sidebar – InstanceResult scope */
[id^="instance-card-"] .instance-sidebar {
  width: 120px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
[id^="instance-card-"] .instance-name {
  font-size: 15px;
  font-weight: 700;
  color: #111827;
  line-height: 1.4;
}

/* Sidebar – CodeResult scope */
#code-result-card .instance-sidebar {
  display: flex;
  padding: 0;
}
#code-result-card .sidebar-vertical-bar {
  width: 36px;
  background-color: #06c;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  writing-mode: vertical-lr;
  padding: 20px 0;
  letter-spacing: 4px;
  font-size: 14px;
  font-weight: bold;
}
#code-result-card .sidebar-content {
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 200px;
  background-color: #f8f9fa;
}
#code-result-card .sidebar-item-code {
  font-weight: bold;
  color: #333;
  font-size: 14px;
  display: block;
}
#code-result-card .sidebar-item-name {
  color: #666;
  font-size: 12px;
  line-height: 1.4;
  margin-top: 2px;
  display: block;
}

/* Controls */
.thread-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--hsc-gray-border);
  background: var(--hsc-bg-header);
  flex-wrap: wrap;
}
.thread-controls .control-btn {
  display: inline-flex;
  align-items: center;
}
.control-btn {
  font-size: 12px;
  padding: 4px 8px;
  border: 1px solid #D1D5DB;
  background: #fff;
  color: #374151;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}
.control-btn:hover { background: #F9FAFB; }
.btn-level-1 { color: var(--hsc-blue-thread); border-color: var(--hsc-blue-thread); }
.btn-level-1:hover { background-color: rgba(156, 39, 176, 0.1); }
.btn-level-2 { color: var(--hsc-purple-thread); border-color: var(--hsc-purple-thread); }
.btn-level-2:hover { background-color: rgba(92, 107, 192, 0.1); }
.btn-level-3 { color: var(--hsc-indigo-thread); border-color: var(--hsc-indigo-thread); }
.btn-level-3:hover { background-color: rgba(28, 132, 198, 0.1); }
.btn-level-4 { color: var(--hsc-teal-thread); border-color: var(--hsc-teal-thread); }
.btn-level-4:hover { background-color: rgba(0, 150, 136, 0.1); }

.instance-viewmode-controls {
  background: transparent !important;
  border-bottom: 0 !important;
  padding: 0 !important;
}

.global-thread-controls {
  overflow: hidden;
  max-height: 260px;
  opacity: 1;
  transform: translateY(0);
}

body.hscn-instance-anim-ready .global-thread-controls {
  transition: max-height 220ms ease, opacity 180ms ease, transform 220ms ease, margin-bottom 220ms ease, padding 220ms ease, border-width 220ms ease;
}

body.hscn-instance-simple-view .global-thread-controls {
  max-height: 0;
  opacity: 0;
  transform: translateY(-4px);
  margin-bottom: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  border-width: 0 !important;
}

body.hscn-instance-simple-view .instance-thread-controls {
  display: none !important;
}

body.hscn-instance-simple-view .instance-quick-nav {
  display: none !important;
}

body.hscn-instance-simple-view .thread-row[data-level="1"],
body.hscn-instance-simple-view .thread-row[data-level="2"],
body.hscn-instance-simple-view .thread-row[data-level="3"],
body.hscn-instance-simple-view .thread-row[data-level="4"] {
  display: none;
}

body.hscn-instance-simple-view .result-container {
  display: none;
}

body.hscn-instance-simple-view .instance-flat-table {
  display: table;
}

body.hscn-instance-simple-view .level-leaf.indent-4 {
  padding-left: 12px;
}

body.hscn-instance-simple-view .level-leaf .desc-text {
  display: none;
}

body.hscn-instance-simple-view #hideCatalogControl {
  display: none !important;
}

body.hscn-instance-hide-catalog .level-leaf.indent-4 {
  padding-left: 12px;
}

body.hscn-instance-hide-catalog .level-leaf .thread-toggle.hidden-toggle {
  width: 0 !important;
  max-width: 0 !important;
  min-width: 0 !important;
  flex-basis: 0 !important;
  margin-right: 0 !important;
  padding: 0 !important;
  border-width: 0 !important;
  opacity: 0 !important;
}

.result-container tr.thread-row[data-level="1"] .thread-cell,
.result-container tr.thread-row[data-level="2"] .thread-cell,
.result-container tr.thread-row[data-level="3"] .thread-cell,
.result-container tr.thread-row[data-level="4"] .thread-cell {
  overflow: hidden;
  max-height: 80px;
  opacity: 1;
  transform: translateY(0);
  transition: max-height 220ms ease, padding-top 220ms ease, padding-bottom 220ms ease, opacity 180ms ease, transform 220ms ease;
}

.result-container tr.thread-row.hscn-hide-row .thread-cell {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
  transform: translateY(-4px);
}

.instance-flat-table {
  display: none;
}

.flat-instance-cell {
  justify-content: flex-start;
  text-align: left;
}

.flat-instance-cell .instance-name {
  font-weight: 600;
  color: #111827;
}

body.hscn-code-simple-view #code-result-card .instance-sidebar {
  display: none;
}

body.hscn-code-simple-view #code-result-card .thread-row[data-level="1"],
body.hscn-code-simple-view #code-result-card .thread-row[data-level="2"],
body.hscn-code-simple-view #code-result-card .thread-row[data-level="3"],
body.hscn-code-simple-view #code-result-card .thread-row[data-level="4"] {
  display: none;
}

body.hscn-code-simple-view #code-result-card .level-leaf.indent-4 {
  padding-left: 12px;
}

body.hscn-code-simple-view #code-result-card .node-link {
  align-items: flex-start;
}

body.hscn-code-simple-view #code-result-card .desc-text {
  font-size: 13px;
  line-height: 1.4;
}

.simple-view-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #374151;
  user-select: none;
}
.thread-controls .simple-view-label {
  font-size: 12px;
}

/* Table */
.thread-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.thread-table th {
  background: var(--hsc-bg-header);
  color: var(--hsc-gray-muted);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--hsc-gray-border);
  white-space: nowrap;
}
.thread-table th.center { text-align: center; }
.thread-table th.flat-instance-header { padding-left: 8px; }
/* CodeResult header tweaks */
#code-result-card .thread-table th {
  font-size: 12px;
  padding: 10px 8px;
}

/* Column widths */
.col-tree { width: 65%; }
/* InstanceResult columns */
.col-data { width: 10%; }
.col-action { width: 15%; }
/* CodeResult columns */
.col-unit { width: 6%; }
.col-tax { width: 5%; }
.col-reg { width: 7%; }
.col-insp { width: 7%; }

/* Rows */
.thread-row td {
  padding: 0;
  border-bottom: 1px solid var(--hsc-gray-border);
  vertical-align: middle;
  font-size: 14px;
  color: var(--hsc-gray-text);
  background: #fff;
}

/* Tree cell */
.thread-cell {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  min-height: 42px;
  border-left-width: 4px;
  border-left-style: solid;
  transition: background-color 0.1s, padding-left 180ms ease;
}
.thread-row:hover .thread-cell { background-color: #F9FAFB; }
.level-1 { border-left-color: var(--hsc-blue-thread); background: #F8FAFC; }
.level-2 { border-left-color: var(--hsc-purple-thread); }
.level-3 { border-left-color: var(--hsc-indigo-thread); }
.level-4 { border-left-color: var(--hsc-teal-thread); }
.level-leaf { border-left-color: var(--hsc-green-thread); }
.level-leaf.thread-cell { align-items: flex-start; padding-top: 10px; padding-bottom: 10px; }
.indent-0 { padding-left: 12px; }
.indent-1 { padding-left: 24px; }
.indent-2 { padding-left: 36px; }
.indent-3 { padding-left: 48px; }
.indent-4 { padding-left: 60px; }

/* Toggle */
.thread-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-right: 8px;
  border: 1px solid #D1D5DB;
  background: #fff;
  border-radius: 2px;
  color: #6B7280;
  font-size: 10px;
  cursor: pointer;
  line-height: 1;
  user-select: none;
  flex-shrink: 0;
  margin-top: 3px;
  transition: width 180ms ease, max-width 180ms ease, margin-right 180ms ease, opacity 180ms ease, border-width 180ms ease;
}
.thread-toggle:hover { border-color: #9CA3AF; color: #111827; }
.hidden-toggle { visibility: hidden; }

/* Content */
.code-pill {
  color: #111827;
/*  font-weight: 600;*/
  margin-right: 8px;
  font-size: 14px;
  white-space: nowrap;
  flex-shrink: 0;
}

.code-pill del{
    color: gray;
/*    font-weight: 0;*/
    font-size: 14px;
    white-space: nowrap;
    flex-shrink: 0;
}

.level-leaf .code-pill { color: #2563EB; }
.desc-text {
  color: #374151;
  line-height: 1.4;
  word-break: break-all;
}
.node-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: center;
  flex: 1;
}
#code-result-card .node-link { align-items: flex-start; }
.node-link:hover .code-pill { text-decoration: underline; }
.expired { opacity: 0.6; text-decoration: line-through; }

/* Data cells */
.data-cell-content {
  padding: 8px;
  text-align: center;
  display: flex;
  justify-content: center;
  gap: 4px;
}
#code-result-card .data-cell-content { padding: 8px 4px; gap: 2px; flex-wrap: wrap; }
.data-cell-content.flat-instance-cell {
  justify-content: flex-start;
  text-align: left;
}
.data-badge {
  font-size: 12px;
  padding: 1px 5px;
  border: 1px solid #E5E7EB;
  border-radius: 4px;
  background: #F9FAFB;
  color: #6B7280;
}
.tax-text { font-weight: 600; color: #111827; }
.badge-tax { font-size: 12px; font-weight: 700; color: #1c84c6; }
.badge-char {
  display: inline-block;
  width: 18px;
  height: 18px;
  line-height: 18px;
  text-align: center;
  background: #f0f2f5;
  border: 1px solid #d9d9d9;
  border-radius: 3px;
  font-size: 11px;
  color: #555;
  cursor: help;
}

.badge-char:hover { border-color: #1c84c6; color: #1c84c6; background: #fff; }
.btn-detail {
  color: #2563EB;
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 4px;
}
.btn-detail:hover { background: #EFF6FF; }
#code-result-card .btn-detail { white-space: nowrap; }
.btn-copy {
  font-size: 12px;
  color: #1c84c6;
  cursor: pointer;
  margin-left: 8px;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.btn-copy:hover { text-decoration: underline; }

/* Utilities */
.d-none { display: none; }

/* Mobile */
@media (max-width: 768px) {
  .result-container { flex-direction: column; }
  .instance-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--hsc-gray-border); padding: 10px; }
  /* InstanceResult table */
  .col-data, .col-action { display: none; }
  /* CodeResult table */
  .col-unit, .col-tax, .col-reg, .col-insp, .col-action { display: none; }
  .thread-cell { padding-right: 12px; }
  .indent-1, .indent-2, .indent-3, .indent-4 { padding-left: 12px; }
  /* CodeResult sidebar vertical writing on mobile */
  #code-result-card .sidebar-vertical-bar {
    writing-mode: horizontal-tb;
    width: 100%;
    padding: 8px;
    letter-spacing: 2px;
    height: auto;
  }
  #code-result-card .sidebar-content {
    flex-direction: row;
    flex-wrap: wrap;
    max-width: 100%;
  }
}

/* Instance quick nav (Index) */
.instance-quick-nav {
  position: fixed;
  top: 160px;
  left: 20px;
  width: 220px;
  z-index: 999;
  max-height: calc(100vh - 200px);
  display: flex;
  flex-direction: column;
  background: transparent;
  overflow: hidden;
}
.nav-header {
  padding: 0 0 12px 16px;
  color: #999;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}
.nav-body { overflow-y: auto; padding: 0; flex-grow: 1; }
.nav-item-row {
  display: flex;
  align-items: baseline;
  padding: 6px 16px;
  text-decoration: none !important;
  color: #666;
  font-size: 13px;
  line-height: 1.5;
  border-left: 2px solid #e5e5e5;
  transition: all 0.2s;
}
.nav-item-row:hover {
  color: var(--brand-orange, #ed6c00);
  border-left-color: var(--brand-orange, #ed6c00);
  background: rgba(237, 108, 0, 0.05);
}
.nav-index {
  font-size: 11px;
  color: #999;
  min-width: 22px;
  flex-shrink: 0;
}

.nav-text {
  flex: 1;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.custom-scrollbar::-webkit-scrollbar { width: 3px; }
.custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: #ddd; border-radius: 3px; }
@media (min-width: 1700px) {
  .instance-quick-nav {
    left: calc(50% - 820px);
    text-align: left;
  }
}
@media (max-width: 1399px) {
  .instance-quick-nav { left: 10px; width: 180px; }
}

/* Search toolbar filter switches (Index) */
.filter-switch {
  color: var(--hsc-gray-muted);
}

.filter-switch.active {
  color: var(--brand-orange, #ed6c00);
}

.filter-switch.active i,
.filter-switch.active span {
  color: inherit !important;
}

/* Search Feedback Component */
.search-feedback-container {
  background-color: #fff !important;
  border-radius: var(--radius-md) !important;
  padding: 12px 20px !important;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color) !important;
  transition: var(--transition-base);
}

.feedback-question {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

.feedback-buttons .btn {
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  transition: var(--transition-base);
}

.feedback-btn-yes {
  color: #28a745 !important;
  border-color: #28a745 !important;
}

.feedback-btn-yes:hover {
  background-color: #28a745 !important;
  color: #fff !important;
}

.feedback-btn-no {
  color: #6c757d !important;
  border-color: #6c757d !important;
}

.feedback-btn-no:hover {
  background-color: #6c757d !important;
  color: #fff !important;
}

#search-feedback-detail {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border-color: var(--border-color);
  overflow: hidden;
}

#search-feedback-detail .card-body {
  background-color: #fff;
}

.hscn-search-triple-card .search-feedback-container {
  background-color: transparent !important;
  border-radius: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
  border: 0 !important;
}

.hscn-search-triple-card--feedback #search-feedback-host > .alert {
  background-color: transparent !important;
  border: 0 !important;
  padding: 0 !important;
}

.hscn-search-triple-card--feedback #search-feedback-host > .alert.alert-success {
  color: #28a745;
}

.hscn-search-triple-card {
  background-color: #fff;
  border: 1px solid var(--border-color);
  border-radius: 0 !important;
  box-shadow: var(--shadow-sm);
  padding: 16px;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 100px;
  transition: var(--transition-base);
}

.hscn-search-triple-card:hover {
  box-shadow: 0 0 0 1px var(--brand-orange), 0 4px 12px rgba(0,0,0,0.05);
}

.hscn-search-triple-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hscn-search-triple-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}

.hscn-search-triple-card--feedback .hscn-search-triple-body {
  justify-content: center;
}

.hscn-search-triple-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.hscn-feedback-actions,
.hscn-quick-guide-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.hscn-feedback-actions .btn,
.hscn-quick-guide-actions .btn {
  width: 100%;
  margin: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  height: 36px;
  white-space: nowrap;
  border-radius: 0 !important;
  border: 1px solid #eee !important;
  background-color: #fcfcfc !important;
  padding: 0 10px !important;
  font-size: 13px;
  transition: all 0.2s;
}

.hscn-quick-guide-actions .btn:hover {
  border-color: var(--brand-orange) !important;
  background-color: #fff !important;
  color: var(--brand-orange) !important;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  transform: translateY(-1px);
}

.hscn-quick-guide-actions .btn i {
  width: 16px;
  text-align: center;
}

.hscn-feedback-actions .btn {
  justify-content: center;
}

.hscn-search-triple-card--company .hscn-search-triple-body {
  justify-content: center;
}

.hscn-search-triple-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hscn-quick-guide-divider {
  width: 100%;
  height: 1px;
  background-color: #eee;
  align-self: center;
  flex: 0 0 auto;
}

.hscn-search-feedback-placeholder .btn[disabled] {
  cursor: not-allowed;
}

.hscn-company-showcase-logo {
  width: 52px;
  height: 52px;
  border-radius: 0;
  border: 1px solid #eee;
  background-color: #fcfcfc;
  overflow: hidden;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-base);
}

.hscn-search-triple-card--company:hover .hscn-company-showcase-logo {
  border-color: var(--brand-orange);
}

.hscn-search-triple-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: #fafafa;
  border: 1px dashed #ddd;
  padding: 15px;
  color: #999;
}

.hscn-search-triple-empty i {
  font-size: 24px;
  margin-bottom: 8px;
  opacity: 0.5;
}

.hscn-company-showcase-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.hscn-company-showcase-name {
  line-height: 1.2;
}

.hscn-company-showcase-intro,
.hscn-company-showcase-website {
  line-height: 1.2;
  margin-top: 4px;
}

@media (max-width: 575px) {
  .hscn-feedback-actions,
  .hscn-quick-guide-actions {
    grid-template-columns: 1fr;
  }
}

.code-hero-content h1 {
    letter-spacing: 1px;
    color: var(--brand-orange);
    font-size: 3rem;
    font-weight: 700;
}


.info-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 0;
    box-shadow: var(--shadow-sm);
    height: 100%;
    overflow: hidden;
}

.info-card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background-color: #fcfcfc;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.info-card-body {
    padding: 0;
}

/* Table styles specific to detail cards */
.detail-table {
    width: 100%;
    margin-bottom: 0;
}

.detail-table td {
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.detail-table tr:last-child td {
    border-bottom: none;
}

.detail-table .label-cell {
    width: 35%;
    color: var(--text-secondary);
    font-weight: 500;
    background-color: #fafafa;
}

.detail-table .value-cell {
    color: var(--text-primary);
    font-weight: 500;
}

.rate-value {
    color: #000;
    font-weight: 700;
    font-size: 1.1em;
}

/* Agreement Tax Table */
.agreement-table-wrapper {
    overflow-x: auto;
}

.agreement-table th {
    background-color: #fafafa;
    color: var(--text-secondary);
    font-weight: 600;
    text-align: center;
    padding: 0.75rem;
    white-space: nowrap;
}

.agreement-table td {
    text-align: center;
    padding: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.chapter-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background-color: #fff4e6;
    color: var(--brand-orange);
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-right: 0.5rem;
}

.req-badge {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
}

.reference-table-card {
    border: 1px solid var(--border-color);
    border-radius: 0;
    background: #fff;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    padding: 0; /* Let table fill the card */
}
    margin-bottom: 0;
    width: 100%;
}

.reference-table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid var(--border-color);
    border-top: none;
    color: var(--text-primary);
    font-weight: 600;
    padding: 1rem 1.5rem;
    white-space: nowrap;
}

.reference-table tbody td {
    padding: 1rem 1.5rem;
    vertical-align: middle;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.reference-table tbody tr:hover {
    background-color: #fff9f5; /* Light orange tint on hover */
}

.reference-table tbody tr:last-child td {
    border-bottom: none;
}

.code-cell {
    font-weight: 600;
    color: var(--brand-orange);
    font-size: 1.1em;
    width: 15%;
}


.name-cell {
    font-weight: 500;
}

