@charset "UTF-8";

/* ベース設定 */
:root {
  --primary-color: #3b82f6; /* Tech Blue */
  --bg-color: #f3f4f6;
  --card-bg: #ffffff;
  --text-main: #1f2937;
  --text-sub: #6b7280;
  --border-color: #e5e7eb;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  margin: 0;
  padding: 20px;
  line-height: 1.5;
}

.tool-wrapper {
  max-width: 800px;
  margin: 0 auto;
  background: var(--card-bg);
  border-radius: 16px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  padding: 40px;
  box-sizing: border-box;
}

/* ヘッダー周り */
.tool-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 40px;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 20px;
  flex-wrap: wrap;
  gap: 20px;
}
.app-title {
  font-size: 1.8rem;
  font-weight: 800;
  margin: 0 0 5px 0;
  letter-spacing: -0.02em;
}
.app-title .accent { color: var(--primary-color); }
.app-desc { margin: 0; color: var(--text-sub); font-size: 0.9rem; }

/* 基準値設定 */
.root-setting {
  background: #eff6ff;
  padding: 10px 15px;
  border-radius: 8px;
  border: 1px solid #bfdbfe;
}
.root-setting label {
  font-size: 0.85rem;
  font-weight: bold;
  color: #1e40af;
  display: block;
  margin-bottom: 5px;
}
.root-input-group {
  display: flex;
  align-items: center;
  gap: 5px;
}
#rootBase {
  width: 60px;
  padding: 5px;
  border: 1px solid #93c5fd;
  border-radius: 4px;
  font-weight: bold;
  text-align: center;
}
.root-setting .note {
  display: block;
  font-size: 0.75rem;
  color: #60a5fa;
  margin-top: 5px;
}

/* メイン変換パネル */
.converter-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 40px;
  background: #f9fafb;
  padding: 30px;
  border-radius: 12px;
}
.input-card {
  flex: 1;
}
.input-card label {
  display: block;
  font-size: 0.9rem;
  font-weight: bold;
  margin-bottom: 8px;
  color: var(--text-sub);
}
.input-row {
  position: relative;
  display: flex;
  align-items: center;
}
.input-row input {
  width: 100%;
  padding: 15px 40px 15px 15px;
  font-size: 1.5rem;
  font-family: 'Monaco', monospace;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.input-row input:focus {
  outline: none;
  border-color: var(--primary-color);
}
.unit-label {
  position: absolute;
  right: 15px;
  color: var(--text-sub);
  font-weight: bold;
}
.exchange-icon {
  font-size: 1.5rem;
  color: var(--text-sub);
  font-weight: bold;
}

/* プレビューエリア */
.preview-area { margin-bottom: 40px; }
.sub-title {
  font-size: 1.1rem;
  border-left: 4px solid var(--primary-color);
  padding-left: 10px;
  margin-bottom: 15px;
}
.preview-box {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-image: radial-gradient(#e5e7eb 1px, transparent 1px);
  background-size: 20px 20px;
}
.preview-content {
  margin: 0 0 15px 0;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  transition: font-size 0.2s ease;
}
.preview-info {
  background: #fff;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  border: 1px solid var(--border-color);
  font-family: monospace;
}

/* 早見表エリア */
.list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}
.btn-secondary {
  background: #fff;
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: bold;
  color: var(--text-main);
  transition: all 0.2s;
}
.btn-secondary:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}
.btn-secondary:active { transform: translateY(1px); }

.table-container {
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: 8px;
}
.conversion-table {
  width: 100%;
  border-collapse: collapse;
  font-family: monospace;
}
.conversion-table th {
  background: #f3f4f6;
  position: sticky;
  top: 0;
  text-align: left;
  padding: 12px;
  font-size: 0.85rem;
  color: var(--text-sub);
  border-bottom: 1px solid var(--border-color);
}
.conversion-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.95rem;
}
.conversion-table tr:hover { background: #f9fafb; }
.sample-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
  display: block;
}

/* 記事エリア */
.article-content {
  margin-top: 50px;
  border-top: 1px solid var(--border-color);
  padding-top: 30px;
}
.code-block {
  background: #2d3748;
  color: #fff;
  padding: 15px;
  border-radius: 6px;
  font-family: monospace;
  margin: 15px 0;
}
.ad-placeholder {
  margin: 30px 0;
  background: #f9fafb;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}
.ad-label { font-size: 0.7rem; color: #ccc; }

/* スマホ対応 */
@media (max-width: 600px) {
  .tool-wrapper { padding: 20px; }
  .converter-panel { flex-direction: column; gap: 10px; padding: 20px; }
  .exchange-icon { transform: rotate(90deg); }
  .tool-header { flex-direction: column; gap: 15px; }
  .root-setting { width: 100%; box-sizing: border-box; }
}