:root {
  /* --- Light Theme Colors --- */
  --md-sys-color-primary: #0061a4;
  --md-sys-color-on-primary: #ffffff;
  --md-sys-color-primary-container: #d1e4ff;
  --md-sys-color-on-primary-container: #001d36;
  
  --md-sys-color-surface: #fdfcff;
  --md-sys-color-on-surface: #1a1c1e;
  --md-sys-color-surface-container-low: #f0f4f8;
  --md-sys-color-surface-container-high: #e7ebf0;
  
  --md-sys-color-outline: #74777f;
  --md-sys-color-outline-variant: #c4c6cf;

  /* 形状 */
  --md-sys-shape-corner-large: 24px;
  --md-sys-shape-corner-medium: 12px;
  --md-sys-shape-corner-full: 9999px;

  /* フォント */
  --md-sys-typescale-body: 'Roboto', "Hiragino Kaku Gothic ProN", sans-serif;
}

/* --- Dark Theme Colors --- */
[data-theme="dark"] {
  --md-sys-color-primary: #9ecaff;
  --md-sys-color-on-primary: #003258;
  --md-sys-color-primary-container: #00497d;
  --md-sys-color-on-primary-container: #d1e4ff;
  
  --md-sys-color-surface: #1a1c1e;
  --md-sys-color-on-surface: #e2e2e6;
  --md-sys-color-surface-container-low: #1c1f22;
  --md-sys-color-surface-container-high: #282a2d;
  
  --md-sys-color-outline: #8e9099;
  --md-sys-color-outline-variant: #44474e;
}

body {
  margin: 0;
  background-color: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
  font-family: var(--md-sys-typescale-body);
  transition: background-color 0.3s, color 0.3s;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 20px;
  position: relative;
}

/* --- Theme Toggle Button --- */
.icon-button {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: var(--md-sys-color-on-surface);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: background-color 0.2s;
  z-index: 10;
}
.icon-button:hover {
  background-color: var(--md-sys-color-surface-container-high);
}

/* --- Profile Section --- */
.profile-card {
  background-color: var(--md-sys-color-surface-container-low);
  border-radius: var(--md-sys-shape-corner-large);
  padding: 40px;
  text-align: center;
  margin-bottom: 48px;
  margin-top: 40px;
}

.avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 16px;
  box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);
}

.name { font-size: 2.2rem; font-weight: 500; margin: 0; }
.role { font-size: 1rem; color: var(--md-sys-color-outline); margin: 4px 0 16px 0; font-weight: 500; }
.bio { max-width: 500px; margin: 0 auto 32px auto; line-height: 1.6; }

.social-links { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.chip-link {
  display: inline-flex; align-items: center; height: 32px; padding: 0 16px;
  border: 1px solid var(--md-sys-color-outline); border-radius: var(--md-sys-shape-corner-full);
  text-decoration: none; color: var(--md-sys-color-on-surface); font-size: 0.875rem;
  transition: 0.2s;
}
.chip-link:hover { background-color: var(--md-sys-color-surface-container-high); }
.chip-link span { font-size: 18px; margin-right: 8px; }

/* --- Dynamic Sections (List Style) --- */
.mb-section { margin-bottom: 48px; }
.section-title { font-size: 1.5rem; margin-bottom: 16px; display: flex; align-items: center; gap: 12px; }
.icon-adjust { color: var(--md-sys-color-primary); font-size: 28px; }

.list-container {
  background-color: var(--md-sys-color-surface-container-low);
  border-radius: var(--md-sys-shape-corner-medium);
  padding: 8px 0;
  overflow: hidden;
}

.list-item {
  display: flex; align-items: center; padding: 16px 24px;
  text-decoration: none; color: var(--md-sys-color-on-surface);
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  transition: background-color 0.2s;
}
.list-item:last-child { border-bottom: none; }
.list-item:hover { background-color: var(--md-sys-color-surface-container-high); }
.list-item.no-link { cursor: default; }
.list-item.no-link:hover { background-color: transparent; }

.list-date {
  font-size: 0.85rem; color: var(--md-sys-color-outline);
  width: 100px; flex-shrink: 0; font-family: monospace;
}
.list-title { font-size: 1rem; font-weight: 500; flex-grow: 1; margin-right: 16px; line-height: 1.4; }
.list-arrow { color: var(--md-sys-color-outline); font-size: 20px; }
.list-item:hover .list-arrow { color: var(--md-sys-color-primary); }

@media (max-width: 600px) {
  .list-item { flex-direction: column; align-items: flex-start; gap: 4px; position: relative; }
  .list-date { width: auto; font-size: 0.75rem; }
  .list-arrow { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); }
}

/* --- Search & Filter Section --- */
.filter-section {
  background-color: var(--md-sys-color-surface-container-low);
  padding: 24px;
  border-radius: var(--md-sys-shape-corner-large);
  margin-bottom: 40px;
}

/* Search Bar */
.search-bar {
  display: flex; align-items: center;
  background-color: var(--md-sys-color-surface-container-high);
  border-radius: 28px; padding: 0 16px; height: 56px; margin-bottom: 20px;
}
.search-icon { color: var(--md-sys-color-on-surface); margin-right: 12px; }
#search-input {
  border: none; background: none; flex-grow: 1; height: 100%;
  font-size: 1rem; color: var(--md-sys-color-on-surface); outline: none;
}

/* Logic Switch (Material Radio) */
.logic-switch { margin-bottom: 20px; display: flex; gap: 16px; align-items: center; font-size: 0.9rem; }
.label { font-weight: bold; color: var(--md-sys-color-primary); }

.radio-label {
  display: inline-flex; align-items: center; cursor: pointer; position: relative;
  padding: 6px 12px 6px 4px; border-radius: 20px; transition: background-color 0.2s;
}
.radio-label:hover { background-color: var(--md-sys-color-surface-container-high); }
.radio-label input[type="radio"] {
  appearance: none; -webkit-appearance: none; margin: 0 8px 0 0; width: 20px; height: 20px;
  border: 2px solid var(--md-sys-color-outline); border-radius: 50%; cursor: pointer;
  position: relative; transition: all 0.2s; background-color: transparent;
}
.radio-label input[type="radio"]:checked { border-color: var(--md-sys-color-primary); }
.radio-label input[type="radio"]::after {
  content: ""; position: absolute; top: 50%; left: 50%; width: 10px; height: 10px;
  border-radius: 50%; background-color: var(--md-sys-color-primary);
  transform: translate(-50%, -50%) scale(0); transition: transform 0.2s;
}
.radio-label input[type="radio"]:checked::after { transform: translate(-50%, -50%) scale(1); }
.radio-text { color: var(--md-sys-color-on-surface); font-weight: 500; }

/* Filter Chips */
.filter-group { margin-bottom: 16px; }
.filter-title { font-size: 0.85rem; color: var(--md-sys-color-outline); margin: 0 0 8px 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.chip-container { display: flex; flex-wrap: wrap; gap: 8px; }

.filter-chip input { display: none; }
.filter-chip label {
  display: inline-flex; align-items: center; height: 32px; padding: 0 16px;
  border: 1px solid var(--md-sys-color-outline-variant); border-radius: 8px;
  color: var(--md-sys-color-on-surface); font-size: 0.875rem; cursor: pointer;
  transition: 0.2s; user-select: none; background-color: var(--md-sys-color-surface);
}
.filter-chip input:checked + label {
  background-color: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container); border-color: transparent;
}
.filter-chip input:checked + label::before {
  content: 'check'; font-family: 'Material Symbols Outlined'; font-size: 18px; margin-right: 6px;
}

/* --- App Cards --- */
.count-badge { font-size: 0.9rem; background: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container); padding: 2px 8px; border-radius: 12px; }
.grid-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }

.card {
  display: flex; flex-direction: column;
  background-color: var(--md-sys-color-surface);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: 12px; padding: 24px;
  text-decoration: none; color: inherit; transition: 0.2s;
}
.card:hover {
  background-color: var(--md-sys-color-surface-container-low);
  transform: translateY(-2px); box-shadow: 0px 4px 8px 3px rgba(0, 0, 0, 0.15);
}
.card-title { font-size: 1.25rem; font-weight: 500; margin: 0 0 8px 0; display: flex; justify-content: space-between; }
.card-desc { font-size: 0.9rem; color: var(--md-sys-color-outline); margin-bottom: 24px; flex-grow: 1; }
.arrow-icon { font-size: 20px; color: var(--md-sys-color-primary); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.tag {
  font-size: 0.75rem; padding: 4px 10px; border-radius: 6px;
  background-color: var(--md-sys-color-surface-container-high); color: var(--md-sys-color-on-surface);
}
.tag.tech { border: 1px solid var(--md-sys-color-outline-variant); }
.tag.category { background-color: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container); }

.no-results { text-align: center; color: var(--md-sys-color-outline); padding: 20px; }
.footer { text-align: center; padding: 60px 0; color: var(--md-sys-color-outline); font-size: 0.8rem; }