/* Light (Bright) Theme Colors */
:root {
  --bg-color: #dbeafe;      /* Light blue background */
  --box-color: #ffffff;     /* White rounded cards */
  --text-color: #111827;    /* Dark black text */
  --muted-color: #4b5563;   /* Grey description text */
  --border-color: #93c5fd;  /* Soft blue border */
  --accent-color: #2563eb;  /* Highlight blue */
}

/* Dark Theme Colors */
body.dark {
  --bg-color: #1f2937;      /* Dark grey background */
  --box-color: #374151;     /* Medium-dark cards */
  --text-color: #e5e7eb;    /* Light grey text */
  --muted-color: #9ca3af;   /* Muted grey text */
  --border-color: #4b5563;  /* Dark border */
  --accent-color: #60a5fa;  /* Soft blue highlight */
}

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

body {
  font-family: Arial, "Microsoft JhengHei", sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  padding: 20px;
}

.page-wrapper {
  max-width: 960px;
  margin: 0 auto;
}

/* Rounded Box Style (from your sketch) */
.box {
  background-color: var(--box-color);
  border: 2px solid var(--border-color);
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 20px;
}

/* Header Top Bar */
.top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.logo-link {
  text-decoration: none;
  color: var(--text-color);
  font-size: 20px;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-circle {
  width: 32px;
  height: 32px;
  border: 2px solid var(--text-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.top-buttons button {
  background-color: var(--bg-color);
  color: var(--text-color);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 6px 12px;
  margin-left: 6px;
  cursor: pointer;
  font-weight: bold;
}

/* Navigation Links */
.nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  padding-top: 12px;
  gap: 10px;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-color);
  font-weight: bold;
  padding: 6px 10px;
  border-radius: 10px;
}

.nav-links a:hover,
.nav-links a.active {
  background-color: var(--accent-color);
  color: #ffffff;
}

/* Hero Section */
.hero {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.portrait {
  width: 150px;
  height: 170px;
  border: 2px solid var(--border-color);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-color);
  font-weight: bold;
}

/* Project Cards */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 12px;
}

.card {
  background-color: var(--bg-color);
  border: 1.5px solid var(--border-color);
  border-radius: 16px;
  padding: 15px;
}

.card h3 {
  margin-bottom: 6px;
}

.card p {
  color: var(--muted-color);
  font-size: 14px;
}

/* Code Snippet Box */
pre {
  background-color: #111827;
  color: #f9fafb;
  padding: 12px;
  border-radius: 12px;
  overflow-x: auto;
  margin-top: 10px;
  font-size: 13px;
}

/* Form Elements */
input, textarea {
  width: 100%;
  padding: 10px;
  margin-top: 6px;
  margin-bottom: 14px;
  border-radius: 10px;
  border: 1.5px solid var(--border-color);
  background-color: var(--bg-color);
  color: var(--text-color);
}

.btn {
  background-color: var(--accent-color);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-weight: bold;
  cursor: pointer;
}

footer {
  text-align: center;
  font-size: 14px;
  color: var(--muted-color);
}

/* Language & Font State Rules */
.zh { display: none; }
body.lang-zh .en { display: none; }
body.lang-zh .zh { display: inline; }
body.font-large { font-size: 19px; }