:root {
  --font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  --primary-color: #d83b01;
  --header-bg: #fff4ed;
  --hover-bg: #fff4ed;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-family, 'Arial', sans-serif);
  background: #fff;
}

.app-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100vh;
}

.app-header {
  flex-shrink: 0;
  padding: 8px 12px;
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

@media (max-width: 320px) {
  .app-header {
    padding: 8px 6px;
  }
}

.search-box {
  margin-bottom: 8px;
}

#search {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#search:focus {
  border-color: var(--primary-color, #0078d4);
  box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.1);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
  padding: 6px 8px;
  background: #f8f9fa;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.toolbar label {
  font-size: 11px;
  color: #666;
  font-weight: 500;
}

#icon-size {
  width: 56px;
  padding: 4px 6px;
  border: 1px solid #ddd;
  border-radius: 3px;
  font-size: 12px;
  outline: none;
  transition: border-color 0.2s;
}

#icon-size:focus {
  border-color: var(--primary-color, #0078d4);
}

.size-unit {
  font-size: 11px;
  color: #999;
  margin-right: 2px;
}

.size-preset-btn {
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s;
  min-width: 36px;
}

.size-preset-btn:hover {
  background: var(--primary-color, #0078d4);
  color: #fff;
  border-color: var(--primary-color, #0078d4);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.size-preset-btn:active {
  transform: translateY(0);
}

.app-main {
  flex: 1;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

.icons-list {
  flex: 1;
  width: 100%;
  overflow-y: auto;
  padding: 0;
}

.performance-hint {
  display: none;
  padding: 8px 12px;
  background: #fff3cd;
  color: #856404;
  border-top: 1px solid #ffeaa7;
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
  flex-shrink: 0;
}

.performance-hint.show {
  display: block;
}

.source-section {
  margin-bottom: 24px;
  padding: 0 12px;
}

@media (max-width: 320px) {
  .source-section {
    padding: 0 6px;
  }
}

.source-header {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary-color, #0078d4);
  margin: 0 -12px 12px -12px;
  padding: 8px 12px;
  background: var(--header-bg, rgba(240, 248, 255, 0.75));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-left: 4px solid var(--primary-color, #0078d4);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 5;
}

@media (max-width: 320px) {
  .source-header {
    margin: 0 -6px 12px -6px;
  }
}

.source-header-title {
  flex-grow: 1;
}

.source-header-count {
  font-size: 14px;
  font-weight: 500;
  color: #666;
  margin-left: 12px;
}

.category-section {
  margin-bottom: 20px;
  padding-left: 12px;
}

@media (max-width: 320px) {
  .category-section {
    padding-left: 8px;
  }
}

.category-header {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin-bottom: 10px;
  padding-bottom: 4px;
  border-bottom: 2px solid #ddd;
}

.icon-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
  margin-bottom: 2px;
}

@media (max-width: 320px) {
  .icon-item {
    gap: 8px;
    padding: 6px 4px;
  }
}

.icon-item:hover {
  background: var(--hover-bg, #f0f8ff);
  border-left: 3px solid var(--primary-color, #0078d4);
  padding-left: 5px;
}

@media (max-width: 320px) {
  .icon-item:hover {
    padding-left: 1px;
  }
}

.icon-item-image {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-item-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.icon-item-name {
  font-size: 14px;
  color: #333;
  flex-grow: 1;
}

.loading {
  text-align: center;
  padding: 20px;
  color: #666;
}

.no-results {
  text-align: center;
  padding: 40px;
  color: #999;
}

.status-message {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 20px;
  background: #333;
  color: #fff;
  border-radius: 4px;
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 1000;
}

.status-message.show {
  opacity: 0.9;
}

.status-message.error {
  background: #d32f2f;
}

.status-message.success {
  background: #2e7d32;
}
