/* =============================================
   Unihost - Main Stylesheet (Black & White)
   ============================================= */

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

:root {
  --black:   #111111;
  --white:   #ffffff;
  --gray-1:  #f5f5f5;
  --gray-2:  #e0e0e0;
  --gray-3:  #9e9e9e;
  --gray-4:  #555555;
  --accent:  #111111;
  --radius:  4px;
  --shadow:  0 2px 12px rgba(0,0,0,0.08);
  --font:    'Noto Sans JP', 'Noto Sans', sans-serif;
  --mono:    'Courier New', monospace;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--white);
  color: var(--black);
  line-height: 1.7;
  font-size: 16px;
}

a { color: var(--black); text-decoration: none; transition: opacity .2s; }
a:hover { opacity: 0.7; }

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

/* ── Typography ── */
h1 { font-size: 2.2rem; font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: 1.6rem; font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 700; }
h4 { font-size: 1rem;   font-weight: 700; }
p  { margin-bottom: 1em; }

/* ── Layout ── */
.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

.section { padding: 60px 0; }
.section-sm { padding: 32px 0; }

/* ── Navbar ── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--black);
  color: var(--white);
  box-shadow: 0 2px 6px rgba(0,0,0,.3);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--white);
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: .05em;
}

.navbar-brand img { height: 36px; width: auto; }

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.navbar-nav a {
  color: rgba(255,255,255,.85);
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 500;
  white-space: nowrap;
}

.navbar-nav a:hover,
.navbar-nav a.active {
  background: rgba(255,255,255,.12);
  color: var(--white);
  opacity: 1;
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lang-switch {
  display: flex;
  gap: 4px;
}

.lang-switch a {
  color: rgba(255,255,255,.7);
  font-size: .8rem;
  padding: 4px 8px;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: var(--radius);
}

.lang-switch a.active,
.lang-switch a:hover {
  background: var(--white);
  color: var(--black);
  opacity: 1;
}

/* ── Hamburger (Mobile) ── */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 6px;
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.5rem;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  transition: transform .3s, opacity .3s;
}

.mobile-menu {
  display: none;
  background: var(--black);
  padding: 12px 20px 20px;
  border-top: 1px solid rgba(255,255,255,.1);
}

.mobile-menu.open { display: block; }

.mobile-menu ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mobile-menu a {
  display: block;
  color: rgba(255,255,255,.85);
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: .95rem;
}

.mobile-menu a:hover {
  background: rgba(255,255,255,.1);
  opacity: 1;
}

.mobile-menu .mobile-lang {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,.1);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all .2s;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.btn-primary {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}
.btn-primary:hover { background: #333; border-color: #333; color: var(--white); opacity: 1; }

.btn-outline {
  background: transparent;
  color: var(--black);
  border-color: var(--black);
}
.btn-outline:hover { background: var(--black); color: var(--white); opacity: 1; }

.btn-white {
  background: var(--white);
  color: var(--black);
  border-color: var(--white);
}
.btn-white:hover { background: var(--gray-1); opacity: 1; }

.btn-sm { padding: 6px 14px; font-size: .82rem; }
.btn-lg { padding: 14px 32px; font-size: 1rem; }
.btn-block { display: flex; width: 100%; justify-content: center; }

.btn-danger { background: #d32f2f; color: #fff; border-color: #d32f2f; }
.btn-danger:hover { background: #b71c1c; border-color: #b71c1c; color: #fff; opacity: 1; }

/* ── Hero ── */
.hero {
  background: var(--black);
  color: var(--white);
  padding: 90px 0;
  text-align: center;
}

.hero h1 { color: var(--white); margin-bottom: 16px; }
.hero p  { color: rgba(255,255,255,.75); font-size: 1.1rem; max-width: 600px; margin: 0 auto 32px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ── Cards ── */
.card {
  background: var(--white);
  border: 1px solid var(--gray-2);
  border-radius: 8px;
  padding: 24px;
  transition: box-shadow .2s, transform .2s;
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.card-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 8px; }
.card-meta  { font-size: .82rem; color: var(--gray-3); margin-bottom: 10px; }
.card-desc  { font-size: .9rem; color: var(--gray-4); }

/* ── Job Card ── */
.job-card { border-left: 4px solid var(--black); }
.job-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
  background: var(--black);
  color: var(--white);
  margin-bottom: 10px;
}
.job-salary { font-weight: 700; font-size: 1rem; margin-top: 8px; }
.job-loc { font-size: .85rem; color: var(--gray-4); }

/* ── Section Header ── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.section-header h2 {
  position: relative;
  padding-bottom: 10px;
}

.section-header h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 3px;
  background: var(--black);
}

/* ── Forms ── */
.form-group { margin-bottom: 20px; }

label {
  display: block;
  font-size: .88rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--gray-4);
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--gray-2);
  border-radius: var(--radius);
  font-size: .95rem;
  color: var(--black);
  background: var(--white);
  transition: border-color .2s;
  font-family: var(--font);
}

.form-control:focus {
  outline: none;
  border-color: var(--black);
}

textarea.form-control { resize: vertical; min-height: 120px; }
select.form-control { appearance: none; cursor: pointer; }

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

/* ── Auth Box ── */
.auth-wrapper {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-1);
  padding: 40px 20px;
}

.auth-box {
  background: var(--white);
  border: 1px solid var(--gray-2);
  border-radius: 12px;
  padding: 40px;
  width: 100%;
  max-width: 460px;
}

.auth-box h1 { font-size: 1.6rem; margin-bottom: 4px; }
.auth-box .auth-sub { color: var(--gray-3); font-size: .9rem; margin-bottom: 28px; }

.type-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

.type-option {
  border: 2px solid var(--gray-2);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
}

.type-option:hover,
.type-option.selected {
  border-color: var(--black);
  background: var(--gray-1);
}

.type-option input { display: none; }
.type-option .type-icon { font-size: 1.8rem; margin-bottom: 8px; display: block; }
.type-option .type-label { font-size: .88rem; font-weight: 600; }

/* ── Flash Messages ── */
.flash {
  padding: 12px 20px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: .9rem;
  font-weight: 500;
}
.flash-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.flash-error   { background: #ffebee; color: #c62828; border: 1px solid #ef9a9a; }

/* ── Table ── */
.table-wrap { overflow-x: auto; }

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

th, td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--gray-2);
}

th {
  background: var(--gray-1);
  font-weight: 700;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--gray-4);
}

tr:hover td { background: var(--gray-1); }

/* ── Badges ── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
}
.badge-black  { background: var(--black); color: var(--white); }
.badge-gray   { background: var(--gray-2); color: var(--gray-4); }
.badge-green  { background: #e8f5e9; color: #2e7d32; }
.badge-red    { background: #ffebee; color: #c62828; }
.badge-yellow { background: #fff8e1; color: #e65100; }

/* ── Pagination ── */
.pagination {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 40px;
  flex-wrap: wrap;
}

.pagination a,
.pagination span {
  padding: 8px 14px;
  border: 1px solid var(--gray-2);
  border-radius: var(--radius);
  font-size: .9rem;
  color: var(--black);
  transition: all .2s;
}

.pagination a:hover { background: var(--black); color: var(--white); border-color: var(--black); opacity: 1; }
.pagination span.current { background: var(--black); color: var(--white); border-color: var(--black); }

/* ── Footer ── */
footer {
  background: var(--black);
  color: rgba(255,255,255,.5);
  text-align: center;
  padding: 28px 20px;
  font-size: .85rem;
}

footer a { color: rgba(255,255,255,.5); }
footer a:hover { color: var(--white); opacity: 1; }

/* ── My Page Sidebar ── */
.mypage-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 32px;
  align-items: start;
}

.sidebar {
  background: var(--white);
  border: 1px solid var(--gray-2);
  border-radius: 8px;
  padding: 20px 0;
  position: sticky;
  top: 80px;
}

.sidebar-user {
  padding: 0 20px 20px;
  border-bottom: 1px solid var(--gray-2);
  margin-bottom: 8px;
  text-align: center;
}

.sidebar-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--gray-2);
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.sidebar-name { font-weight: 700; font-size: 1rem; }
.sidebar-type { font-size: .8rem; color: var(--gray-3); }

.sidebar-nav { list-style: none; }
.sidebar-nav a {
  display: block;
  padding: 10px 20px;
  color: var(--gray-4);
  font-size: .9rem;
  font-weight: 500;
  transition: all .2s;
  border-left: 3px solid transparent;
}
.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: var(--gray-1);
  color: var(--black);
  border-left-color: var(--black);
  opacity: 1;
}

/* ── Category Filter ── */
.cat-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

.cat-btn {
  padding: 6px 16px;
  border: 1px solid var(--gray-2);
  border-radius: 20px;
  font-size: .85rem;
  cursor: pointer;
  background: var(--white);
  color: var(--gray-4);
  transition: all .2s;
}

.cat-btn:hover,
.cat-btn.active {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}

/* ── Job Detail ── */
.job-detail-header {
  border-bottom: 2px solid var(--black);
  padding-bottom: 24px;
  margin-bottom: 32px;
}

.job-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 16px;
  font-size: .9rem;
  color: var(--gray-4);
}

.job-detail-meta span { display: flex; align-items: center; gap: 4px; }

/* ── Apply Modal ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active { display: flex; }

.modal-box {
  background: var(--white);
  border-radius: 12px;
  padding: 36px;
  width: 90%;
  max-width: 520px;
  box-shadow: 0 16px 48px rgba(0,0,0,.2);
}

.modal-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 20px; }
.modal-close { float: right; cursor: pointer; font-size: 1.2rem; color: var(--gray-3); }

/* ── Breadcrumb ── */
.breadcrumb {
  font-size: .85rem;
  color: var(--gray-3);
  margin-bottom: 24px;
  display: flex;
  gap: 6px;
  align-items: center;
}
.breadcrumb a { color: var(--gray-3); }
.breadcrumb a:hover { color: var(--black); opacity: 1; }
.breadcrumb .sep { color: var(--gray-2); }

/* ── Article ── */
.article-content { font-size: .97rem; line-height: 1.9; }
.article-content h2, .article-content h3 { margin: 1.6em 0 .6em; }
.article-content ul, .article-content ol { padding-left: 1.5em; margin-bottom: 1em; }
.article-content img { border-radius: 8px; margin: 1.2em 0; }

/* ── Page Header ── */
.page-header {
  background: var(--black);
  color: var(--white);
  padding: 48px 0;
  margin-bottom: 48px;
}
.page-header h1 { color: var(--white); margin-bottom: 8px; }
.page-header p  { color: rgba(255,255,255,.7); }

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-3);
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 16px; display: block; }

/* ── Loading ── */
.spinner {
  display: inline-block;
  width: 20px; height: 20px;
  border: 2px solid var(--gray-2);
  border-top-color: var(--black);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Mobile Responsive ── */
@media (max-width: 768px) {
  h1 { font-size: 1.7rem; }
  h2 { font-size: 1.3rem; }

  .navbar-nav, .navbar-right .lang-switch, .navbar-right .btn { display: none; }
  .hamburger { display: flex; }

  .hero { padding: 60px 0; }
  .section { padding: 40px 0; }

  .card-grid { grid-template-columns: 1fr; }

  .form-row { grid-template-columns: 1fr; }

  .auth-box { padding: 28px 20px; }

  .mypage-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }

  .type-selector { grid-template-columns: 1fr; }

  .section-header { flex-direction: column; align-items: flex-start; gap: 12px; }

  .hero-actions { flex-direction: column; align-items: center; }
}

@media (max-width: 480px) {
  .container { padding: 0 14px; }
  .card { padding: 18px; }
  .modal-box { padding: 24px 18px; }
}

/* ── Utilities ── */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--gray-3); }
.text-small  { font-size: .85rem; }
.fw-bold     { font-weight: 700; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.flex-wrap { flex-wrap: wrap; }
.w-100 { width: 100%; }
.divider { border: none; border-top: 1px solid var(--gray-2); margin: 24px 0; }

/* ── 右侧悬浮客服 ── */
.float-cs {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 12px 10px 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  text-decoration: none;
  transition: box-shadow .25s, transform .25s;
  cursor: pointer;
}

.float-cs:hover {
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  transform: translateY(calc(-50% - 3px));
  opacity: 1;
}

.float-cs img {
  width: 48px;
  height: 48px;
  display: block;
  border-radius: 8px;
}

.float-cs-label {
  font-size: .72rem;
  font-weight: 600;
  color: #06c755;
  letter-spacing: .04em;
  line-height: 1;
}

@media (max-width: 768px) {
  .float-cs {
    right: 12px;
    padding: 10px 8px 6px;
  }
  .float-cs img {
    width: 40px;
    height: 40px;
  }
}
