/* 專業深藍配色系統 - 優化對比度 */
:root {
  /* 主色調 - 深藍系列 */
  --primary-dark: #1a237e;      /* 深靛藍 */
  --primary: #283593;            /* 主藍色 */
  --primary-light: #3f51b5;     /* 材質藍 */
  --primary-lighter: #5c6bc0;   /* 淺藍 */

  /* 輔助色 - 暖色系 */
  --accent: #ff6f00;            /* 琥珀橘 */
  --accent-light: #ffa726;      /* 淺橘 */
  --accent-dark: #f57c00;       /* 深橘 */

  /* 中性色 */
  --white: #ffffff;
  --off-white: #fafafa;
  --light-gray: #f5f5f5;
  --gray: #9e9e9e;
  --dark-gray: #616161;
  --black: #212121;

  /* 功能色 */
  --success: #4caf50;
  --warning: #ff9800;
  --danger: #f44336;
  --info: #2196f3;
}

/* 基礎樣式 - 簡潔淺色背景 */
body {
  background: #f5f7fa;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
  color: var(--black);
  min-height: 100vh;
  line-height: 1.6;
}

.container {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  padding: 32px;
  margin-top: 24px;
  margin-bottom: 24px;
  border: none;
}

/* 標題樣式 */
h1, h2, h3, h4, h5, h6 {
  color: var(--primary-dark);
  font-weight: 600;
  margin-top: 0;
}

h1 { font-size: 2.5rem; margin-bottom: 1rem; }
h2 { font-size: 2rem; margin-bottom: 0.875rem; }
h3 { font-size: 1.5rem; margin-bottom: 0.75rem; }

/* 導航樣式 - 深藍主題 */
.navbar {
  background: linear-gradient(135deg, #1a237e 0%, #283593 100%) !important;
  backdrop-filter: blur(10px);
  border-radius: 0;
  margin-bottom: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  border: none;
  padding: 12px 0;
  border-bottom: 3px solid var(--accent);
  position: relative;
  z-index: 1000;
}

nav#bs-navbar {
  background: transparent !important;
}

.navbar-header h1 {
  display: inline-block;
  margin: 0 !important;
}

.navbar-brand {
  font-size: 28px !important;
  font-weight: 700 !important;
  letter-spacing: 1px;
  color: var(--white) !important;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  display: inline-block;
  padding: 8px 20px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  border-radius: 10px;
  transition: all 0.3s ease;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.navbar-brand:hover {
  background: linear-gradient(135deg, var(--accent-light) 0%, var(--accent) 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 111, 0, 0.5);
  border-color: rgba(255, 255, 255, 0.4);
}

.navbar-brand .glyphicon {
  color: var(--white) !important;
  margin-right: 10px;
  font-size: 28px;
}

.navbar a {
  color: #ffffff !important;
  transition: all 0.3s ease;
  font-weight: 500;
}

.navbar a:hover {
  color: #ffd700 !important;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
  transform: translateY(-1px);
}

/* 搜尋框樣式 */
#keyword {
  background: var(--white) !important;
  color: var(--black) !important;
  font-weight: 500;
  border: 2px solid var(--accent) !important;
}

/* 搜尋框焦點效果 */
#keyword:focus {
  background: var(--white) !important;
  border-color: var(--accent-light) !important;
  box-shadow: 0 0 0 3px rgba(255, 111, 0, 0.2) !important;
  outline: none;
  color: var(--black) !important;
}

#keyword::placeholder {
  color: #7f8c8d;
  opacity: 1;
  font-weight: 400;
}

/* 手機搜尋按鈕樣式 */
.navbar-toggle {
  background: var(--accent) !important;
  border: 2px solid var(--accent-light) !important;
  border-radius: 6px;
  margin-top: 8px;
}

.navbar-toggle:hover {
  background: rgba(255,255,255,0.3) !important;
}

.navbar-toggle .glyphicon {
  color: white !important;
}

/* 麵包屑樣式 - 簡約設計 */
nav[aria-label="breadcrumb"] {
  margin: 12px 0;
  padding: 0;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.breadcrumb {
  background: #ffffff;
  padding: 12px 20px;
  margin-bottom: 20px;
  border: 1px solid #e3e7ed;
  border-radius: 8px;
  display: flex;
  align-items: center;
  font-size: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.breadcrumb-item {
  color: #6c757d !important;
  display: flex;
  align-items: center;
}

.breadcrumb-item.active {
  color: #1a237e !important;
  font-weight: 600;
}

.breadcrumb a {
  color: #283593 !important;
  text-decoration: none;
  transition: all 0.3s ease;
  padding: 4px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
}

.breadcrumb a:hover {
  color: #ff6f00 !important;
  background: rgba(255, 111, 0, 0.08);
}

.breadcrumb .glyphicon {
  margin-right: 6px;
  font-size: 12px;
  opacity: 0.7;
  color: #9e9e9e;
}

.breadcrumb-item + .breadcrumb-item::before {
  color: #bdbdbd;
  content: "\203A";
  font-size: 16px;
  padding: 0 8px;
  opacity: 0.8;
}

/* 文字內容樣式 */
p {
  color: #34495e;
  line-height: 1.6;
  font-size: 16px;
}

.intro-section p {
  font-size: 18px;
  line-height: 1.8;
  color: #2c3e50;
}

/* 強調文字 */
strong { color: #e74c3c; }
em { color: #9b59b6; }
mark {
  background: linear-gradient(120deg, #a8e6cf 0%, #dcedc8 100%);
  color: #2e7d32;
  padding: 2px 6px;
  border-radius: 4px;
}

/* 特色標籤 */
.features-highlight ul li {
  background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%) !important;
  color: white !important;
  border: none !important;
  box-shadow: 0 4px 15px rgba(116, 185, 255, 0.3);
  transition: all 0.3s ease;
}

.features-highlight ul li:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(116, 185, 255, 0.4);
}

/* 網站卡片樣式 */
.website-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease !important;
  cursor: pointer;
  border-radius: 15px !important;
}

.website-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.15) !important;
}

.website-card a {
  transition: all 0.3s ease;
}

.website-card:hover a {
  transform: scale(1.02);
}

/* 首頁網格樣式 - 專業配色 */
.panel {
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--light-gray);
  transition: all 0.3s ease;
  overflow: hidden;
  position: relative;
}

.panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform 0.3s;
}

.panel:hover::before {
  transform: scaleX(1);
}

.panel:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  border-color: var(--accent);
}

.panel-heading {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: var(--white);
  padding: 16px;
  border: none;
  border-bottom: 2px solid var(--accent);
  position: relative;
  overflow: hidden;
}

.panel-heading::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.panel:hover .panel-heading::after {
  left: 100%;
}

.panel-heading h2 {
  color: var(--white) !important;
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
  letter-spacing: 0.5px;
}

.panel-heading a {
  color: var(--white) !important;
  text-decoration: none;
}

.panel-heading a:hover h2 {
  color: var(--accent-light) !important;
  text-shadow: 0 0 10px rgba(255, 167, 38, 0.5);
}

.panel-body {
  padding: 12px;
  background: var(--off-white);
  max-height: 480px;
  overflow-y: auto;
  overflow-x: hidden;
}

.panel-body a {
  color: var(--primary);
  text-decoration: none;
  display: block;
  padding: 10px 8px;
  border-bottom: 1px solid var(--light-gray);
  transition: all 0.2s ease;
  font-weight: 500;
  position: relative;
}

.panel-body a::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background: var(--accent);
  transition: height 0.2s;
}

.panel-body a:hover {
  color: var(--accent);
  background: rgba(255, 111, 0, 0.05);
  padding-left: 15px;
}

.panel-body a:hover::before {
  height: 70%;
}

.panel-body a:last-child {
  border-bottom: none;
}

.panel-footer {
  background: var(--primary-dark);
  padding: 14px 16px;
  font-size: 14px;
  border-top: 2px solid var(--accent);
  position: relative;
  overflow: hidden;
}

.panel-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent 30%, rgba(255, 111, 0, 0.1) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.5s;
}

.panel:hover .panel-footer::before {
  transform: translateX(100%);
}

.panel-footer a {
  color: var(--accent-light);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
  position: relative;
  z-index: 1;
}

.panel-footer a:hover {
  color: var(--white);
  transform: translateX(5px);
}

/* 圖片樣式 */
.lazyimage {
  width: 20px;
  height: 20px;
  margin-right: 8px;
  border-radius: 4px;
}

/* 按鈕樣式 */
.btn {
  border-radius: 25px;
  padding: 10px 25px;
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
}

.btn-default {
  background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
  color: white;
}

.btn-default:hover {
  background: linear-gradient(135deg, #0984e3 0%, #74b9ff 100%);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(116, 185, 255, 0.4);
}

/* Alert 樣式 */
.alert {
  border-radius: 12px;
  border: none;
  font-weight: 500;
}

.alert-info {
  background: linear-gradient(135deg, #a8e6cf 0%, #dcedc8 100%);
  color: #2e7d32;
}

.alert-warning {
  background: linear-gradient(135deg, #ffd93d 0%, #ff6b6b 100%);
  color: #c0392b;
}

/* 響應式調整 */
/* 響應式佈局優化 */
@media (min-width: 1400px) {
  .col-xl-3 {
    flex: 0 0 25%;
    max-width: 25%;
  }
}

@media (max-width: 1199px) and (min-width: 992px) {
  .col-lg-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
  }
}

@media (max-width: 991px) and (min-width: 768px) {
  .col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
  }
}

@media (max-width: 768px) {
  .container {
    margin: 10px;
    padding: 20px;
    border-radius: 10px;
  }

  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }

  .website-card {
    height: 140px !important;
    padding: 20px !important;
  }

  .website-card h4 {
    font-size: 16px !important;
  }

  .website-card p {
    font-size: 13px !important;
  }


  .col-sm-6 {
    flex: 0 0 50%;
    max-width: 50%;
  }

  .website {
    font-size: 13px;
  }

  .panel-heading h2 {
    font-size: 15px;
  }
}

@media (max-width: 575px) {
  .col-12 {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .website {
    font-size: 14px;
    padding: 12px 15px;
    padding-left: 45px;
  }

  .panel-heading h2 {
    font-size: 17px;
  }

  .panel-body {
    max-height: 400px;
  }

  .footer .text-right {
    text-align: left !important;
    margin-top: 15px;
  }
}

@media (max-width: 480px) {
  .container {
    margin: 5px;
    padding: 15px;
  }

  h1 { font-size: 1.8rem; }

  .website-card {
    height: 120px !important;
    padding: 15px !important;
    margin-bottom: 15px !important;
  }

  .website-card h4 {
    font-size: 15px !important;
  }

  .website-card p {
    font-size: 12px !important;
  }

  .features-highlight ul {
    gap: 10px !important;
  }

  .features-highlight ul li {
    font-size: 13px !important;
    padding: 6px 10px !important;
  }
}

/* 佈局樣式 */
.wrap {
  min-height: 100%;
  height: auto;
  margin: 0 auto -60px;
  padding: 0 0 60px;
}

.wrap > .container {
  padding: 20px 15px;
}

.footer {
  min-height: 80px;
  background: linear-gradient(135deg, #1a237e 0%, #283593 100%);
  color: var(--white);
  border-top: 3px solid var(--accent);
  padding: 25px 0;
  margin-top: 50px;
  border-radius: 0;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
}

.footer a {
  color: var(--accent-light);
  text-decoration: none;
  transition: all 0.3s ease;
  font-weight: 500;
}

.footer a:hover {
  color: var(--white);
  text-shadow: 0 0 12px rgba(255, 167, 38, 0.6);
  transform: translateY(-1px);
}

/* 網站連結樣式 - 優化顯示以避免截斷 */
.website {
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
  padding: 10px 15px;
  padding-left: 42px !important;
  margin: 3px 0;
  border-radius: 6px;
  transition: all 0.3s ease;
  position: relative;
  min-height: 38px;
  line-height: 1.5;
  align-items: center;
}

a.website:hover {
  background: linear-gradient(90deg, rgba(255, 111, 0, 0.05) 0%, rgba(255, 167, 38, 0.05) 100%);
  transform: translateX(3px);
  color: var(--accent);
  border-left: 3px solid var(--accent);
  padding-left: 45px !important;
}

a.website:active {
  background: rgba(255, 111, 0, 0.1);
  transform: translateX(1px);
}

.website img {
  width: 20px;
  height: 20px;
  position: absolute !important;
  left: 12px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  border-radius: 3px;
  display: inline-block !important;
  vertical-align: middle;
  margin: 0 !important;
}

/* 特定分類樣式（已優化） */
#iporn .website, #chunse .website {
  margin: 3px 0;
  padding: 10px 15px;
  padding-left: 42px;
}

#qingse .website {
  background: rgba(40, 53, 147, 0.05);
  margin: 3px 0;
  padding: 10px 15px;
  padding-left: 42px;
  border-left: 3px solid var(--primary);
}

#sgzhan .website {
  padding: 10px 15px;
  padding-left: 42px;
}

#fuli .website img, #grid .website img {
  display: none !important;
}

/* Jumbotron 樣式 */
.jumbotron {
  text-align: center;
  background: transparent;
  border: none;
  padding: 40px 20px;
}

.jumbotron .btn {
  font-size: 21px;
  padding: 14px 28px;
  border-radius: 30px;
  font-weight: 600;
}

/* 工具類樣式 */
.not-set {
  color: #e74c3c;
  font-style: italic;
}

/* 排序圖標樣式 */
a.asc:after, a.desc:after {
  position: relative;
  top: 1px;
  display: inline-block;
  font-family: 'Glyphicons Halflings';
  font-style: normal;
  font-weight: normal;
  line-height: 1;
  padding-left: 5px;
}

a.asc:after {
  content: "\e151";
}

a.desc:after {
  content: "\e152";
}

.sort-numerical a.asc:after {
  content: "\e153";
}

.sort-numerical a.desc:after {
  content: "\e154";
}

.sort-ordinal a.asc:after {
  content: "\e155";
}

.sort-ordinal a.desc:after {
  content: "\e156";
}

/* 表格樣式 */
.grid-view th {
  white-space: nowrap;
  background: #f8f9fa;
  font-weight: 600;
  color: #495057;
}

td, th {
  vertical-align: middle !important;
}

/* 提示和錯誤樣式 */
.hint-block {
  display: block;
  margin-top: 5px;
  color: #6c757d;
  font-size: 14px;
}

.error-summary {
  color: #721c24;
  background: linear-gradient(135deg, #f8d7da 0%, #f1b0b7 100%);
  border-left: 4px solid #dc3545;
  border-radius: 8px;
  padding: 15px 20px;
  margin: 0 0 20px 0;
}

/* 特殊文字樣式 */
.money {
  color: #28a745;
  font-size: 1.1em;
  font-weight: 600;
}

.country-name {
  color: #6c757d;
  font-size: 0.9em;
}

.iconBtn i {
  display: block;
  font-size: 180%;
  width: 25px;
  height: 25px;
}

/* 工具類樣式 */
.bottom-10 {
  margin-bottom: 10px !important;
}

.bottom-5 {
  margin-bottom: 5px !important;
}

/* 連結樣式 */
a:hover {
  text-decoration: none !important;
}

/* 格線系統調整 */
.row {
  margin-left: -10px;
  margin-right: -10px;
}

.col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2,
.col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3,
.col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5,
.col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6,
.col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8,
.col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9,
.col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11,
.col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12 {
  position: relative;
  min-height: 1px;
  padding-left: 10px;
  padding-right: 10px;
}

/* 區塊樣式（優化版本） */
.block {
  border: none;
  border-radius: 12px;
  margin-bottom: 15px;
  color: var(--black);
  background: var(--white);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: all 0.3s ease;
  border: 1px solid rgba(40, 53, 147, 0.1);
}

.block:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2);
  border-color: var(--accent);
}

.block-header {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-lighter) 100%);
  color: var(--white);
  padding: 15px;
  font-weight: 600;
}

.block-inner {
  padding: 10px;
}

.block-inner2 {
  padding: 15px;
}

.block-one-line {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.block-title {
  height: auto;
  min-height: 50px;
  overflow: hidden;
  line-height: 1.4;
  font-size: 16px;
  padding: 10px;
  font-weight: 600;
}

.block-layer img {
  width: 100%;
  border-radius: 8px;
}

/* 圖片標籤樣式 */
.imagelabel {
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 4px 8px;
  font-size: 12px;
  position: absolute;
  border-radius: 4px;
}

.imagelabel-bottom-left {
  bottom: 8px;
  left: 8px;
}

.imagelabel-bottom-right {
  right: 8px;
  bottom: 8px;
  color: #ffd700;
}

.media-image {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
}