:root {
    --bg: #F4F1EA;
    --surface: #FFFFFF;
    --border: #E3DFD3;
    --text-primary: #2B2822;
    --text-secondary: #6B665B;
    --accent: #D97757;
    --accent-dark: #B85E42;
    --mono: 'SF Mono', 'Consolas', 'Menlo', monospace;

    --header-bg: #0B0D18;
    --header-border: #4C3B8F;
    --header-text: #F4F1EA;
    --header-text-dim: #8B8FA3;
    --header-accent: #E91E8C;
  }
  html {
    scroll-behavior: smooth;
  }
  * { box-sizing: border-box; }
  body {
    margin: 0;
    padding: 0 0 32px;
    background: var(--bg);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Yu Gothic', sans-serif;
  }
  .site-header {
    background: var(--header-bg);
    border-top: 3px solid var(--header-border);
    border-bottom: 1px solid var(--header-border);
    padding: 22px 24px;
    margin-bottom: 32px;
  }
  .site-header-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
  }
  .site-header-brand {
    display: flex;
    align-items: baseline;
    gap: 10px;
  }
  .site-header-brand a {
    color: var(--header-text);
    text-decoration: none;
    font-weight: 700;
    font-size: 22px;
    letter-spacing: -0.01em;
  }
  .site-header-brand a:hover {
    opacity: 0.85;
  }
  .site-header-brand .brand-accent {
    color: var(--header-accent);
  }
  .site-header-tag {
    font-size: 11px;
    color: var(--header-text-dim);
    font-family: var(--mono);
  }
  .site-header-nav {
    display: flex;
    gap: 28px;
  }
  .site-header-nav a {
    color: var(--header-text-dim);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
  }
  .site-header-nav a:hover {
    color: var(--header-accent);
  }
  .lang-switch {
    display: flex;
    gap: 4px;
    margin-left: 8px;
    padding-left: 12px;
    border-left: 1px solid var(--header-border);
  }
  .lang-btn {
    padding: 4px 9px;
    border-radius: 5px;
    border: 1px solid var(--header-border);
    background: transparent;
    color: var(--header-text-dim);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
  }
  .lang-btn:hover {
    color: var(--header-text);
    border-color: var(--header-accent);
  }
  .lang-btn.active {
    background: var(--header-accent);
    border-color: var(--header-accent);
    color: #ffffff;
  }
  .wrap {
    max-width: 820px;
    margin: 0 auto;
    padding: 0 16px;
  }
  h1 {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 20px;
    font-family: var(--mono);
    letter-spacing: -0.02em;
    line-height: 1.3;
  }
  .card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 16px;
  }
  fieldset {
    border: none;
    margin: 0 0 14px;
    padding: 0;
  }
  fieldset:last-child { margin-bottom: 0; }
  legend {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 0 0 8px;
    width: 100%;
  }
  .options {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
  }
  .radio-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
  }
  .radio-item input[type="radio"],
  .radio-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
    margin: 0;
  }
  input[type="text"].inline-custom {
    width: 68px;
    padding: 5px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    font-family: var(--mono);
    background: var(--bg);
    color: var(--text-primary);
  }
  input[type="text"].inline-custom:focus {
    outline: none;
    border-color: var(--accent);
  }
  .divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 14px 0;
  }
  textarea {
    width: 100%;
    min-height: 240px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: var(--mono);
    font-size: 14px;
    line-height: 1.7;
    resize: vertical;
    background: var(--bg);
    color: var(--text-primary);
  }
  textarea:focus {
    outline: none;
    border-color: var(--accent);
  }
  .code-editor {
    display: flex;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg);
  }
  .code-editor:focus-within {
    border-color: var(--accent);
  }
  .code-editor .line-numbers {
    flex-shrink: 0;
    width: 46px;
    padding: 14px 8px 14px 0;
    text-align: right;
    font-family: var(--mono);
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-secondary);
    background: var(--surface);
    border-right: 1px solid var(--border);
    overflow-y: hidden;
    overflow-x: hidden;
    user-select: none;
    white-space: pre;
  }
  .code-editor textarea {
    flex: 1;
    min-width: 0;
    border: none;
    border-radius: 0;
    resize: vertical;
  }
  .code-editor textarea:focus {
    border: none;
    outline: none;
  }
  .textarea-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
  }
  .textarea-label span.title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
  }
  .arrow-divider {
    text-align: center;
    color: var(--text-secondary);
    font-size: 18px;
    margin: -4px 0 12px;
  }
  button {
    padding: 8px 15px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }
  button svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
  }
  button:hover {
    border-color: var(--accent);
    color: var(--accent);
  }
  button.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
  }
  button.primary:hover {
    background: var(--accent-dark);
    color: white;
  }
  .share-x {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    text-decoration: none;
    background: #000000;
    border: 1px solid #000000;
    color: #ffffff;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
  }
  .share-x::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -60%;
    width: 40%;
    height: 200%;
    background: linear-gradient(
      115deg,
      transparent 0%,
      rgba(255, 255, 255, 0.55) 45%,
      rgba(255, 255, 255, 0.55) 55%,
      transparent 100%
    );
    transform: rotate(0deg);
    animation: share-x-sheen 3s linear infinite;
    pointer-events: none;
  }
  @keyframes share-x-sheen {
    0% { left: -60%; }
    18% { left: 140%; }
    100% { left: 140%; }
  }
  .share-x:hover {
    background: #ffffff;
    border-color: #000000;
    color: #000000;
  }
  .share-x svg {
    width: 17px;
    height: 17px;
    fill: currentColor;
    position: relative;
    z-index: 1;
  }
  .share-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin: 32px 0;
    padding: 20px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
  }
  .share-block-label {
    font-size: 12px;
    color: var(--text-secondary);
  }
  .toast {
    font-size: 12px;
    color: var(--accent);
    margin-left: 8px;
    opacity: 0;
    transition: opacity 0.2s;
  }
  .toast.show { opacity: 1; }
  .stats {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
  }
  .stats b {
    color: var(--text-primary);
    font-family: var(--mono);
  }
  .error-panel {
    margin-top: 10px;
    padding: 12px 14px;
    background: #FBEAE7;
    border: 1px solid #E8B4AA;
    border-radius: 8px;
    display: none;
  }
  .error-panel.show {
    display: block;
  }
  .error-panel-title {
    font-size: 13px;
    font-weight: 700;
    color: #B85E42;
    margin: 0 0 8px;
  }
  .error-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .error-list li {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.6;
  }
  .error-list .error-loc {
    font-family: var(--mono);
    font-weight: 700;
    color: #B85E42;
    margin-right: 6px;
  }
  .error-ok {
    font-size: 13px;
    color: #4A7A5E;
    margin-top: 10px;
    display: none;
  }
  .error-ok.show {
    display: block;
  }
  .actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    justify-content: flex-end;
    flex-wrap: wrap;
  }
  .file-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
  }
  .seo-section {
    margin-top: 40px;
    padding-top: 28px;
    border-top: 1px solid var(--border);
  }
  .seo-section h2 {
    font-size: 21px;
    font-weight: 700;
    margin: 0 0 12px;
    scroll-margin-top: 76px;
  }
  .seo-section + .seo-section {
    margin-top: 28px;
    padding-top: 24px;
  }
  .seo-section p {
    font-size: 15px;
    line-height: 1.9;
    color: var(--text-secondary);
    margin: 0 0 10px;
  }
  .seo-section ol,
  .seo-section ul {
    font-size: 15px;
    line-height: 1.9;
    color: var(--text-secondary);
    margin: 0 0 10px;
    padding-left: 20px;
  }
  .seo-section code {
    font-family: var(--mono);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 14px;
    color: var(--text-primary);
  }
  .faq-item {
    margin-bottom: 18px;
  }
  .faq-item h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 6px;
  }
  .faq-item p {
    margin: 0;
  }
  .site-footer {
    margin-top: 40px;
    padding: 20px 16px;
    background: var(--header-bg);
    border-top: 1px solid var(--header-border);
    text-align: center;
  }
  .site-footer p {
    margin: 0;
    font-size: 12px;
    color: var(--header-text-dim);
  }
  .site-footer a {
    color: var(--header-text-dim);
    text-decoration: none;
  }
  .site-footer a:hover {
    color: var(--header-accent);
  }
  .ad-slot {
    max-width: 820px;
    margin: 24px auto 0;
    padding: 0 16px;
    text-align: center;
  }
  .howto-link {
    font-size: 14px;
    margin: 0 0 20px;
  }
  .howto-link a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
  }
  .no-margin-bottom {
    margin-bottom: 0;
  }
  .exclude-note {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 10px 0 0;
  }
  .file-row-margin {
    margin-top: 10px;
  }
  .visually-hidden-input {
    display: none;
  }
  .encoding-label {
    font-weight: 600;
    color: var(--text-secondary);
  }
  .encoding-select {
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    background: var(--bg);
    color: var(--text-primary);
    margin-left: 4px;
  }
  .input-warning {
    font-size: 13px;
    color: var(--accent-dark);
    margin: 8px 0 0;
    display: none;
  }
  .encoding-note {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 8px 0 0;
  }
  .encoding-note .encoding-current {
    font-family: var(--mono);
    font-weight: 700;
    color: var(--text-primary);
  }
  .btn-hidden {
    display: none;
  }
  .ad-slot-inner {
    display: block;
  }
