/* ============================================
   仮想通貨税金計算ツール - COIN TECH
   ============================================ */

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: "游ゴシック体", "Yu Gothic", YuGothic, "ヒラギノ角ゴ Pro", "Hiragino Kaku Gothic Pro", "メイリオ", Meiryo, sans-serif;
  color: #333;
  background: #f5f5f5;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

a {
  color: #1176d4;
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: #0d5ba8;
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ============================================
   Header (.l-header) - cointech.jp準拠
   ============================================ */
.l-header {
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(0,0,0,.12);
  position: sticky;
  top: 0;
  z-index: 100;
}

.l-header__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.l-header__logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.l-header__logo img {
  height: 40px;
  width: auto;
}

.c-gnavWrap {
  margin-left: auto;
}

.c-gnav {
  display: flex;
  list-style: none;
  gap: 0;
}

.c-gnav > li > a {
  display: block;
  padding: 20px 16px;
  color: #000;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  position: relative;
  transition: color 0.3s;
}

.c-gnav > li > a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: #04384c;
  transform: scaleX(0);
  transition: transform 0.3s;
}

.c-gnav > li:hover > a::after {
  transform: scaleX(1);
}

.c-gnav > li > a:hover {
  text-decoration: none;
  color: #04384c;
}

.l-header__menuBtn {
  display: none;
  background: #ff9000;
  color: #fff;
  border: none;
  cursor: pointer;
  padding: 8px 16px;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: 0.1em;
  border-radius: 3px;
  transition: opacity 0.3s;
}

.l-header__menuBtn:hover {
  opacity: 0.8;
}

/* ============================================
   Breadcrumb
   ============================================ */
.breadcrumb {
  background: #fff;
  border-bottom: 1px solid #eee;
  padding: 10px 0;
}

.breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 0.85rem;
  color: #666;
}

.breadcrumb li:not(:last-child)::after {
  content: ">";
  margin-left: 4px;
  color: #999;
}

.breadcrumb a {
  color: #1176d4;
}

/* ============================================
   Article Content
   ============================================ */
.article-content {
  max-width: 900px;
  margin: 0 auto;
  background: #fff;
  padding: 40px;
  border-radius: 8px;
  margin-top: 24px;
  margin-bottom: 40px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

h1 {
  font-size: 1.75rem;
  color: #04384c;
  line-height: 1.4;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 3px solid #ff9000;
}

h2 {
  font-size: 1.4rem;
  color: #04384c;
  margin-top: 48px;
  margin-bottom: 20px;
  padding: 12px 16px;
  border-left: 4px solid #ff9000;
  background: #fafafa;
}

h3 {
  font-size: 1.15rem;
  color: #04384c;
  margin-top: 32px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e0e0e0;
}

h4 {
  font-size: 1.05rem;
  color: #04384c;
  margin-top: 24px;
  margin-bottom: 12px;
}

.article-lead {
  font-size: 1.05rem;
  line-height: 1.9;
  margin-bottom: 24px;
}

.content-section {
  margin-top: 48px;
}

.content-section p {
  margin-bottom: 16px;
}

.content-section ul,
.content-section ol {
  margin-bottom: 16px;
  padding-left: 24px;
}

.content-section li {
  margin-bottom: 8px;
}

.caution-text {
  color: #d32f2f;
  font-weight: 600;
}

/* Info Box */
.info-box {
  background: #e8f4fd;
  border: 1px solid #b3d9f2;
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 32px;
  font-size: 0.9rem;
  line-height: 1.7;
}

.info-box p {
  margin: 0;
}

/* ============================================
   Calculator Section
   ============================================ */
.calculator-section {
  margin-top: 32px;
}

.calculator-section h2 {
  margin-top: 0;
}

/* Mode Toggle */
.mode-toggle {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  border-radius: 80px;
  overflow: hidden;
  border: 2px solid #04384c;
  width: fit-content;
}

.mode-btn {
  padding: 10px 28px;
  border: none;
  background: #fff;
  color: #04384c;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  font-family: inherit;
}

.mode-btn.active {
  background: #04384c;
  color: #fff;
}

.mode-btn:hover:not(.active) {
  background: #f0f0f0;
}

/* Form */
.form-section {
  margin-bottom: 24px;
}

.form-section h3 {
  font-size: 1.05rem;
  margin-top: 16px;
  margin-bottom: 16px;
  border-bottom: 2px solid #04384c;
  padding-bottom: 8px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 6px;
  color: #04384c;
}

.required {
  background: #d32f2f;
  color: #fff;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 3px;
  margin-left: 6px;
  font-weight: 400;
  vertical-align: middle;
}

.input-with-unit {
  display: flex;
  align-items: center;
  gap: 8px;
}

.input-with-unit input {
  flex: 1;
}

.unit {
  font-weight: 600;
  color: #666;
  font-size: 0.95rem;
  white-space: nowrap;
}

input[type="text"],
input[type="number"],
select {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid #ddd;
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s;
  background: #fff;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
  border-color: #1176d4;
  outline: none;
  box-shadow: 0 0 0 3px rgba(17, 118, 212, 0.12);
}

input[type="number"] {
  -moz-appearance: textfield;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.form-hint {
  font-size: 0.8rem;
  color: #888;
  margin-top: 4px;
}

.form-row {
  display: flex;
  gap: 16px;
}

.form-group-half {
  flex: 1;
}

.form-fieldset {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 24px;
}

.form-fieldset legend {
  font-weight: 600;
  color: #04384c;
  font-size: 0.95rem;
  padding: 0 8px;
}

/* Buttons */
.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 32px;
  margin-bottom: 32px;
}

.btn-calculate {
  padding: 14px 48px;
  background: #ff9000;
  color: #fff;
  border: none;
  border-radius: 80px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
  font-family: inherit;
  box-shadow: 0 2px 8px rgba(255, 144, 0, 0.3);
}

.btn-calculate:hover {
  background: #e68200;
  box-shadow: 0 4px 12px rgba(255, 144, 0, 0.4);
  transform: translateY(-1px);
}

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

.btn-reset {
  padding: 14px 28px;
  background: #fff;
  color: #666;
  border: 2px solid #ddd;
  border-radius: 80px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-reset:hover {
  border-color: #999;
  color: #333;
}

/* ============================================
   Results
   ============================================ */
.result-section {
  margin-top: 32px;
  padding-top: 32px;
  border-top: 2px solid #e0e0e0;
}

.result-section h3 {
  border-bottom: none;
  font-size: 1.3rem;
  margin-top: 0;
}

.result-highlight {
  background: linear-gradient(135deg, #04384c, #065a7a);
  color: #fff;
  border-radius: 12px;
  padding: 32px;
  margin-bottom: 24px;
  text-align: center;
}

.result-main {
  margin-bottom: 16px;
}

.result-main .result-label {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 8px;
  opacity: 0.9;
}

.result-main .result-value {
  display: block;
  font-size: 2.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.result-sub {
  display: inline-block;
  background: rgba(255, 255, 255, 0.15);
  padding: 8px 24px;
  border-radius: 80px;
}

.result-sub .result-label {
  font-size: 0.85rem;
  margin-right: 8px;
  opacity: 0.9;
}

.result-sub .result-value-sub {
  font-size: 1.3rem;
  font-weight: 700;
}

/* Result Breakdown Table */
.result-breakdown {
  margin-bottom: 24px;
}

.result-breakdown h4 {
  margin-top: 0;
}

.result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.result-table th,
.result-table td {
  padding: 10px 12px;
  text-align: right;
  border-bottom: 1px solid #eee;
}

.result-table th:first-child,
.result-table td:first-child {
  text-align: left;
  font-weight: 600;
}

.result-table thead th {
  background: #f8f8f8;
  color: #04384c;
  font-weight: 600;
  border-bottom: 2px solid #ddd;
  font-size: 0.85rem;
}

.result-table .row-total td {
  font-weight: 700;
  border-top: 2px solid #04384c;
  color: #04384c;
  font-size: 1rem;
}

/* Summary */
.result-summary {
  margin-bottom: 24px;
}

.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

.summary-item {
  background: #f8f8f8;
  padding: 16px;
  border-radius: 8px;
  text-align: center;
}

.summary-item-highlight {
  background: #fff8e1;
  border: 2px solid #ff9000;
}

.summary-label {
  display: block;
  font-size: 0.8rem;
  color: #666;
  margin-bottom: 6px;
}

.summary-value {
  display: block;
  font-size: 1.3rem;
  font-weight: 700;
  color: #04384c;
}

/* Bar Chart */
.result-chart {
  margin-bottom: 24px;
}

.result-chart h4 {
  margin-top: 0;
}

.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bar-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bar-label {
  width: 60px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #04384c;
  text-align: right;
  flex-shrink: 0;
}

.bar-track {
  flex: 1;
  height: 28px;
  background: #f0f0f0;
  border-radius: 4px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
  min-width: 2px;
}

.bar-income-tax {
  background: #1176d4;
}

.bar-reconstruction {
  background: #04384c;
}

.bar-resident-tax {
  background: #ff9000;
}

.bar-value {
  width: 100px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #333;
  flex-shrink: 0;
}

.result-note {
  font-size: 0.8rem;
  color: #888;
  margin-top: 16px;
}

/* ============================================
   Data Tables (Content)
   ============================================ */
.table-responsive {
  overflow-x: auto;
  margin-bottom: 16px;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  white-space: nowrap;
}

.data-table th,
.data-table td {
  padding: 10px 14px;
  border: 1px solid #e0e0e0;
  text-align: center;
}

.data-table th {
  background: #04384c;
  color: #fff;
  font-weight: 600;
}

.data-table tbody tr:nth-child(even) {
  background: #f8f8f8;
}

.data-table-compact th,
.data-table-compact td {
  padding: 8px 10px;
  font-size: 0.85rem;
}

.table-note {
  font-size: 0.8rem;
  color: #888;
}

/* ============================================
   FAQ
   ============================================ */
.faq-section {
  margin-bottom: 0;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.faq-item {
  border: 1px solid #e0e0e0;
  border-radius: 0;
  overflow: hidden;
}

.faq-item:first-child {
  border-radius: 8px 8px 0 0;
}

.faq-item:last-child {
  border-radius: 0 0 8px 8px;
}

.faq-item + .faq-item {
  border-top: none;
}

.faq-item summary {
  padding: 16px 48px 16px 20px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  color: #04384c;
  position: relative;
  list-style: none;
  background: #fff;
  transition: background 0.2s;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.3rem;
  color: #999;
  transition: transform 0.3s;
}

.faq-item[open] summary::after {
  content: "\2212";
}

.faq-item summary:hover {
  background: #f8f8f8;
}

.faq-answer {
  padding: 0 20px 20px;
  font-size: 0.9rem;
  line-height: 1.8;
}

.faq-answer p {
  margin-bottom: 12px;
}

.faq-answer ul,
.faq-answer ol {
  margin-bottom: 12px;
  padding-left: 24px;
}

.faq-answer li {
  margin-bottom: 4px;
}

/* ============================================
   Footer (.l-footer) - cointech.jp準拠
   ============================================ */
.l-footer {
  background: #202020;
  color: #fff;
  margin-top: 0;
}

.l-footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px 24px;
}

.l-footer__nav {
  display: flex;
  gap: 48px;
}

.l-footer__widget {
  min-width: 160px;
}

.c-widget__title {
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 16px;
  margin-top: 0;
  padding-bottom: 8px;
  border-bottom: none;
}

.c-widget__list {
  list-style: none;
}

.c-widget__list li {
  margin-bottom: 10px;
}

.c-widget__list a {
  color: rgba(255,255,255,.7);
  font-size: 0.85rem;
  transition: color 0.2s;
  text-decoration: none;
}

.c-widget__list a:hover {
  color: #fff;
  text-decoration: none;
}

.l-footer__bottom {
  border-top: 1px solid rgba(255,255,255,.15);
  padding: 20px 0;
  text-align: center;
}

.c-copyright {
  font-size: 0.8rem;
  color: rgba(255,255,255,.5);
  margin: 0;
}

/* ============================================
   Error States
   ============================================ */
.form-group.has-error input,
.form-group.has-error select {
  border-color: #d32f2f;
}

.form-group .error-message {
  color: #d32f2f;
  font-size: 0.8rem;
  margin-top: 4px;
  display: none;
}

.form-group.has-error .error-message {
  display: block;
}

/* ============================================
   Responsive: Tablet (959px)
   ============================================ */
@media (max-width: 959px) {
  .l-header__logo {
    margin-right: auto;
  }

  .l-header__inner {
    justify-content: flex-end;
  }

  .c-gnavWrap {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    padding: 0;
    z-index: 99;
  }

  .c-gnavWrap.is-open {
    display: block;
  }

  .c-gnav {
    flex-direction: column;
    gap: 0;
  }

  .c-gnav > li {
    border-bottom: 1px solid #eee;
  }

  .c-gnav > li > a {
    padding: 14px 20px;
  }

  .c-gnav > li > a::after {
    display: none;
  }

  .l-header__menuBtn {
    display: block;
  }

  .article-content {
    padding: 28px;
  }

  h1 {
    font-size: 1.5rem;
  }

  .summary-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .l-footer__nav {
    gap: 32px;
  }
}

/* ============================================
   Responsive: Mobile (600px)
   ============================================ */
@media (max-width: 600px) {
  .l-header__inner {
    height: 56px;
  }

  .l-header__logo img {
    height: 32px;
  }

  .c-gnavWrap {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    padding: 0;
    z-index: 99;
  }

  .c-gnavWrap.is-open {
    display: block;
  }

  .c-gnav {
    flex-direction: column;
    gap: 0;
  }

  .c-gnav > li {
    border-bottom: 1px solid #eee;
  }

  .c-gnav > li > a {
    padding: 14px 20px;
  }

  .c-gnav > li > a::after {
    display: none;
  }

  .l-header__menuBtn {
    display: block;
  }

  .article-content {
    padding: 20px 16px;
    margin-top: 16px;
    border-radius: 0;
  }

  h1 {
    font-size: 1.3rem;
  }

  h2 {
    font-size: 1.15rem;
    margin-top: 36px;
  }

  .mode-toggle {
    width: 100%;
  }

  .mode-btn {
    flex: 1;
    padding: 10px 16px;
    font-size: 0.9rem;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .form-actions {
    flex-direction: column;
  }

  .btn-calculate {
    width: 100%;
    padding: 16px;
  }

  .btn-reset {
    width: 100%;
    padding: 14px;
  }

  .result-highlight {
    padding: 24px 16px;
  }

  .result-main .result-value {
    font-size: 2rem;
  }

  .result-table {
    font-size: 0.8rem;
  }

  .result-table th,
  .result-table td {
    padding: 8px 6px;
  }

  .bar-item {
    flex-wrap: wrap;
  }

  .bar-label {
    width: 50px;
    font-size: 0.8rem;
  }

  .bar-value {
    width: 80px;
    font-size: 0.8rem;
  }

  .l-footer__nav {
    flex-direction: column;
    gap: 24px;
  }

  .data-table th,
  .data-table td {
    padding: 6px 8px;
    font-size: 0.8rem;
  }
}

/* ============================================
   Print
   ============================================ */
@media print {
  .l-header,
  .l-footer,
  .mode-toggle,
  .form-actions,
  .breadcrumb {
    display: none;
  }

  .article-content {
    box-shadow: none;
    padding: 0;
  }

  .result-highlight {
    background: #eee !important;
    color: #000 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.result-section[style*="display: block"],
.result-section:not([style*="display: none"]):not([style=""]) {
  animation: fadeIn 0.4s ease;
}
