/* 
 * style.css
 * 川普政策對台股影響分析報告網站樣式
 */

/* 基本設置 */
:root {
  --primary-color: #2c3e50;
  --secondary-color: #3498db;
  --accent-color: #e74c3c;
  --light-color: #ecf0f1;
  --dark-color: #2c3e50;
  --text-color: #333;
  --link-color: #3498db;
  --link-hover-color: #2980b9;
  --header-bg: #2c3e50;
  --header-text: #fff;
  --footer-bg: #2c3e50;
  --footer-text: #ecf0f1;
  --border-radius: 5px;
  --box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Noto Sans TC', 'Microsoft JhengHei', sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: #f9f9f9;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

/* 排版 */
h1, h2, h3, h4, h5, h6 {
  margin-bottom: 1rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--primary-color);
}

h1 {
  font-size: 2.5rem;
}

h2 {
  font-size: 2rem;
  border-bottom: 2px solid var(--secondary-color);
  padding-bottom: 0.5rem;
  margin-top: 2rem;
}

h3 {
  font-size: 1.5rem;
  margin-top: 1.5rem;
  color: var(--secondary-color);
}

h4 {
  font-size: 1.25rem;
  margin-top: 1.25rem;
}

p {
  margin-bottom: 1.2rem;
}

a {
  color: var(--link-color);
  text-decoration: none;
  transition: color 0.3s;
}

a:hover {
  color: var(--link-hover-color);
  text-decoration: underline;
}

ul, ol {
  margin-bottom: 1.2rem;
  padding-left: 2rem;
}

li {
  margin-bottom: 0.5rem;
}

/* 頁首 */
header {
  background-color: var(--header-bg);
  color: var(--header-text);
  padding: 2rem 0;
  text-align: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

header h1 {
  color: white;
  margin-bottom: 0.5rem;
}

header .subtitle {
  font-size: 1.2rem;
  opacity: 0.9;
}

/* 導航 */
#main-nav {
  background-color: #fff;
  box-shadow: var(--box-shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
}

#main-nav .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}

#menu li {
  margin: 0;
}

#menu a {
  display: block;
  padding: 1rem;
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s;
}

#menu a:hover, #menu a.active {
  color: var(--secondary-color);
  background-color: rgba(52, 152, 219, 0.1);
}

#menu a.active {
  border-bottom: 3px solid var(--secondary-color);
}

#menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--primary-color);
  cursor: pointer;
}

/* 主要內容 */
main {
  padding: 2rem 0;
  min-height: calc(100vh - 200px);
}

.chapter {
  background-color: #fff;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  padding: 2rem;
  margin-bottom: 2rem;
}

.chapter-content {
  margin-bottom: 2rem;
}

.chapter-navigation {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid #eee;
}

.prev-link, .next-link {
  padding: 0.5rem 1rem;
  background-color: var(--light-color);
  border-radius: var(--border-radius);
  transition: all 0.3s;
}

.prev-link:hover, .next-link:hover {
  background-color: var(--secondary-color);
  color: white;
  text-decoration: none;
}

/* 首頁特殊樣式 */
.hero {
  display: flex;
  align-items: center;
  margin-bottom: 3rem;
  background-color: #fff;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  overflow: hidden;
}

.hero-content {
  flex: 1;
  padding: 2rem;
}

.hero-image {
  flex: 1;
  padding: 1rem;
}

.hero-image img {
  width: 100%;
  height: auto;
  border-radius: var(--border-radius);
}

.btn {
  display: inline-block;
  padding: 0.8rem 1.5rem;
  background-color: var(--secondary-color);
  color: white;
  border-radius: var(--border-radius);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s;
  margin-top: 1rem;
}

.btn:hover {
  background-color: var(--link-hover-color);
  transform: translateY(-2px);
  text-decoration: none;
  color: white;
}

.card-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.card {
  background-color: #fff;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  padding: 1.5rem;
  transition: all 0.3s;
  border: 1px solid #eee;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.card-icon {
  font-size: 2rem;
  color: var(--secondary-color);
  margin-bottom: 1rem;
  text-align: center;
}

.card h3 {
  text-align: center;
  margin-top: 0;
}

.read-more {
  display: block;
  text-align: center;
  margin-top: 1rem;
  font-weight: 500;
}

.findings-container {
  margin-top: 1.5rem;
}

.finding {
  background-color: #f9f9f9;
  border-left: 4px solid var(--secondary-color);
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

.finding h3 {
  margin-top: 0;
  font-size: 1.2rem;
}

/* 表格樣式 */
.data-table {
  overflow-x: auto;
  margin: 1.5rem 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}

th, td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

th {
  background-color: var(--light-color);
  font-weight: 600;
}

tr:nth-child(even) {
  background-color: #f9f9f9;
}

tr:hover {
  background-color: #f1f1f1;
}

/* 特殊元素 */
.recommendation-box, .conclusion-box, .strategy-box, .policy-timeline, .strategy-highlight {
  background-color: #f9f9f9;
  border-radius: var(--border-radius);
  padding: 1.5rem;
  margin: 1.5rem 0;
  border-left: 4px solid var(--secondary-color);
}

.recommendation-box h4, .conclusion-box h4, .strategy-box h4, .policy-timeline h4, .strategy-highlight h4 {
  color: var(--secondary-color);
  margin-top: 0;
}

.chart-container {
  margin: 1.5rem 0;
  text-align: center;
}

.chart-placeholder {
  background-color: #f9f9f9;
  border: 1px dashed #ccc;
  border-radius: var(--border-radius);
  padding: 2rem;
  text-align: center;
}

.chart-note {
  font-size: 0.9rem;
  color: #777;
  margin-top: 0.5rem;
}

/* 頁尾 */
footer {
  background-color: var(--footer-bg);
  color: var(--footer-text);
  padding: 1.5rem 0;
  text-align: center;
}

/* 響應式設計 */
@media (max-width: 992px) {
  .hero {
    flex-direction: column;
  }
  
  .hero-content, .hero-image {
    flex: none;
    width: 100%;
  }
}

@media (max-width: 768px) {
  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.75rem;
  }
  
  h3 {
    font-size: 1.3rem;
  }
  
  #menu {
    display: none;
    flex-direction: column;
    width: 100%;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: white;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
  }
  
  #menu.show {
    display: flex;
  }
  
  #menu-toggle {
    display: block;
  }
  
  #main-nav .container {
    padding: 0.5rem 15px;
  }
  
  .chapter {
    padding: 1.5rem;
  }
  
  .card-container {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 576px) {
  .container {
    width: 95%;
    padding: 0 10px;
  }
  
  header {
    padding: 1.5rem 0;
  }
  
  h1 {
    font-size: 1.75rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  .chapter-navigation {
    flex-direction: column;
    gap: 1rem;
  }
  
  .prev-link, .next-link {
    text-align: center;
  }
}
