/* Commons */
header {
  display: flex;
}

[data-theme='dark'] header {
  color: #fff;
  background-color: #222;
}

[data-theme='dark'] header #toggleBtn,
[data-theme='dark'] header #alarmBtn a {
  color: rgba(255, 255, 255, 0.7);
}

@media (min-width: 1281px) {
  header #toggleBtn {
    display: none;
  }

  header #alarmBtn {
    display: none;
  }
}

@media (max-width: 1280px) {
  header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 5;
  }

  main {
    margin-top: 90px;
  }

  header #toggleBtn,
  header #alarmBtn {
    position: absolute;
    width: 70px;
    height: 70px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #888;
    cursor: pointer;
    z-index: 10;
  }

  header #toggleBtn {
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
  }

  header #alarmBtn {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
  }

  header #toggleBtn svg,
  header #alarmBtn svg {
    width: 24px;
  }

  header #alarmBtn .count {
    position: absolute;
    top: 20px;
    right: 10px;
    font-size: 0.7em;
    color: #fff;
    background-color: red;
    padding: 4px 6px;
    border-radius: 12px;
  }
}

/* Sub */
@media (min-width: 1280px) {
  header #sub {
    width: 100%;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.9em;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  }
  
  [data-theme='dark'] header #sub {
    border-bottom: 1px solid rgba(0, 0, 0, 0);
    /* border-bottom: 1px solid rgba(255, 255, 255, 0.1); */
  }
  
  header #sub .wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  header #sub ul {
    display: flex;
    justify-content: center;
    align-items: center;
  }
  
  header #sub ul li a {
    display: flex;
    color: #444;
    padding: 10px;
  }
  
  header #sub ul li a:hover {
    color: #000;
  }
  
  header #sub ul .slash {
    color: rgba(0, 0, 0, 0.2);
    font-size: 0.6em;
  }
  
  [data-theme='dark'] header #sub ul li a {
    color: rgba(255, 255, 255, 0.3);
  }
  
  [data-theme='dark'] header #sub ul li a:hover {
    color: rgba(255, 255, 255, 0.5);
  }
  
  [data-theme='dark'] header #sub ul .slash {
    color: rgba(255, 255, 255, 0.1);
  }
}

@media (max-width: 1280px) {
  header #sub {
    display: none;
  }
}

[data-theme='dark'] header #main .logo a {
  color: rgba(255, 255, 255, 0.7);
}

/* Main */
@media (min-width: 1281px) {
  header #main {
    width: 100%;
    height: 70px;
    min-height: 70px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
  }
  
  [data-theme='dark'] header #main {
    background-color: #181818;
  }

  header #main.hover {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 5;
  }
  
  header #main .wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  header #main .logo {
    font-size: 1.6em;
    font-weight: bold;
  }

  header #main .logo img {
    max-width: 640px;
    max-height: 68px;
    object-fit: contain;
  }
  
  header #main nav {
    height: 100%;
    flex: 1;
  }

  header #main nav > .mypage {
    display: none;
  }
  
  header #main nav > .main {
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
  }
  
  header #main nav > .main > li {
    position: relative;
    height: 100%;
  }
  
  header #main nav > .main > li > a {
    height: 70px;
    display: flex;
    align-items: center;
    font-size: 1.2em;
    font-weight: bold;
  }
  
  [data-theme='dark'] header #main nav > .main > li > a {
    color: rgba(255, 255, 255, 0.8);
  }
  
  header #main nav > .main > li > ul {
    position: absolute;
    top: 60px;
    left: 50%;
    width: 100%;
    min-width: 300px;
    transform: translate(-50%, 0);
    display: none;
    flex-direction: column;
    box-shadow: 0 2px 8px 0 rgba(0,0,0,0.1),0 0 2px 0 rgba(0,0,0,0.05);
    border-radius: 8px;
    z-index: 5;
  }
  
  header #main nav > .main > li:hover ul {
    display: flex;
  }
  
  header #main nav > .main > li > ul > li > a {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 14px 20px;
    background-color: #fff;
    border-bottom: 1px solid #eee;
  }

  [data-theme='dark'] header #main nav > .main > li > ul > li > a {
    color: rgba(255, 255, 255, 0.5);
    background-color: #222;
    border: unset;
  }

  header #main nav > .main > li > ul > li:first-child > a {
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
  }
  
  header #main nav > .main > li > ul > li:last-child > a {
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
    border-bottom: unset;
  }

  [data-theme='dark'] header #main nav > .main > li > ul > li:last-child > a {
    border-bottom: unset;
  }
  
  header #main nav > .main > li > ul > li > a:hover {
    background-color: #eee;
  }

  [data-theme='dark'] header #main nav > .main > li > ul > li > a:hover {
    color: rgba(255, 255, 255, 0.7);
    background-color: #000;
  }
}

@media (max-width: 1280px) {
  header #main {
    width: 100%;
  }

  header #main .logo {
    width: 100%;
    height: 70px;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  [data-theme='dark'] header #main .logo {
    background-color: #111;
  }

  header #main .logo img {
    max-height: 70px;
    object-fit: contain;
  }

  header #main nav {
    width: 100%;
    height: calc(100vh - 70px);
    display: none;
    flex-direction: column;
    overflow-y: scroll;
  }

  [data-theme='dark'] header #main nav {
    background-color: #111;
  }

  header #main nav.active {
    display: flex;
  }

  header #main nav > .main {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
  }

  header #main nav > .main > li {
    width: 100%;
  }

  header #main nav > .main > li > a {
    width: 100%;
    display: flex;
    font-weight: bold;
    padding: 14px;
    background-color: rgba(245, 245, 245);
    border-radius: 8px;
  }

  header #main nav > .main > li > ul {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  header #main nav > .main > li > ul > li > a {
    display: flex;
    padding: 14px;
    background-color: rgba(245, 245, 245);
    padding-left: 30px;
    border-radius: 8px;
  }

  [data-theme='dark'] header #main nav > .main > li > a,
  [data-theme='dark'] header #main nav > .main > li > ul > li > a {
    color: rgba(255, 255, 255, 0.7);
    background-color: #222;
  }

  header #main nav > .main > li > ul > li:first-child > a {
    margin-top: 10px;
  }

  header #main nav > .main > li > a:hover,
  header #main nav > .main > li > ul > li > a:hover {
    color: #fff;
    background-color: #222;
  }

  [data-theme='dark'] header #main nav > .main > li > a:hover,
  [data-theme='dark'] header #main nav > .main > li > ul > li > a:hover {
    color: #fff;
    background-color: #444;
  }

  header #main nav > .mypage {
    display: flex;
    justify-content: center;
    align-items: center;
  }
  
  header #main nav > .mypage li a {
    display: flex;
    color: #444;
    padding: 10px;
  }
  
  header #main nav > .mypage li a:hover {
    color: #000;
  }
  
  header #main nav > .mypage .slash {
    color: rgba(0, 0, 0, 0.2);
    font-size: 0.6em;
  }
}