*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  margin: 0;
  height: 100vh;
  overflow: hidden;
}

#logout {
  position: fixed;
  z-index: 1000;
  top: 10px;
  right: 10px;
  color: #007bba;
  padding: 5px 20px;
  cursor: pointer;
}

.navbar {
  height: 50px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  user-select: none;
  overflow-x: auto;
}

.navbar .logo{
  font-size: 20px;
  font-style: italic;
  margin-right: 20px;
  color: #777;
}
#main-view{
  display: flex;
  flex-direction: column;
  height: 100vh;
}

#main-view .tab-list{
  display: flex;
  align-self: flex-end;
  height: 100%;
}

#main-view .tab-list .tab-item{
  padding: 10px 20px;
  cursor: pointer;
  user-select: none;
  min-width: 150px;
  white-space: nowrap;
  text-align: center;
  line-height: 25px;
}

#main-view .tab-list .tab-item:hover{
  background-color: #fafafa;
}
#main-view .tab-list .tab-item.active{
  border-bottom: 2px solid #007bba;
  border-top: none;
}
#main-view .tab-view{
  background-color: #f5f5f5;
}
#main-view .tab-view,
#main-view .tab-frame{
  display: flex;
  flex: 1;
}
#main-view .tab-frame:not(.active),
#main-view .tab-view:not(.active){
  display: none;
}

#main-view .tab-frame {
  background-color: #f5f5f5;
}

#main-view .tab-frame iframe {
  border: none;
  width: 100%;
  height: 100%;
  visibility: hidden;
}

.iframe-loaded #main-view .tab-frame iframe {
  visibility: visible;
}


#main-view .right-menu{
  display: flex;
  align-self: flex-end;
  height: 100%;
  margin-left: auto;
}

#main-view .right-menu a{
  display: flex;
  align-items: center;
  padding: 10px 20px;
  text-decoration: none;
  cursor: pointer;
  color: #007bba;
  font-size: 14px;
}

@media screen and (max-width: 768px) {
  .navbar .logo{
    display: none;
  }
  #main-view .tab-list{
    width: 100%;
  }
  #main-view .tab-list .tab-item{
    width: 100%;
  }
}



.login-container,
.success-message {
  background: #fff;
  padding: 2rem;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  width: 300px;
  text-align: center;
}

.login-container input {
  width: 100%;
  padding: 0.5rem;
  margin-bottom: 1rem;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.login-container button {
  width: 100%;
  padding: 0.75rem;
  background-color: #007bba;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
}

.error {
  color: red;
  margin-top: 1rem;
}

.success-message {
  display: none;
  background-color: #e0ffe0;
  color: #2d7a2d;
  font-size: 2rem;
}


/* 通用 header */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 50px;
  background: #fff;
  display: flex;
  align-items: center;
  padding: 0 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  z-index: 10;
}

header h1 {
  flex: 1;
  text-align: center;
  font-size: 24px;
  margin: 0;
  color: #333;
}

header .back-arrow {
  cursor: pointer;
  font-size: 24px;
  user-select: none;
}

/* 主畫面 */
.stock-search {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 20vh;
  height: 100%;
  background: #f5f5f5;
}

.stock-search h1 {
  font-size: 32px;
  color: #333;
  margin-bottom: 20px;
}

.search-container {
  position: relative;
  width: 500px;
  max-width: 90vw;
}

.search-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 14px 50px 14px 50px;
  font-size: 18px;
  border: 1px solid #ddd;
  border-radius: 24px;
  outline: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.search-input:focus {
  border-color: #4285f4;
  box-shadow: 0 1px 3px rgba(66, 133, 244, 0.5);
}

.favorites-list {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 100%;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: none;
  max-height: 50vh;
  overflow-y: auto;
  padding: 0;
  margin: 0;
  list-style: none;
}

.favorites-list li {
  padding: 12px;
  border-bottom: 1px solid #eee;
  display: flex;
  align-items: center;
}

.favorites-list li.item {
  cursor: pointer;
}

.favorites-list li.item:hover {
  background-color: #f9f9f9;
}

.favorites-list li:last-child {
  border-bottom: none;
}

.favorites-list li a {
  text-decoration: none;
  color: #333;
  margin-left: 8px;
}

.favorites-list .favorites-title {
  font-size: 12px;
  color: #888;
}

.code {
  font-weight: bold;
  min-width: 90px;
}

.favorites-title {
  font-weight: bold;
  padding: 12px;
  border-bottom: 1px solid #eee;
  background-color: #f9f9f9;
}

.favorites-list li.odd {
  background-color: #F5F5F5;
}

.no-results {
  padding: 12px;
  color: #999;
}

body.stage-login .stock-search,
body.stage-login #main-view,
body.stage-login #iframe-view,
body.stage-login header,
body.stage-init #loginContainer,
body.stage-init .stock-search,
body.stage-init #main-view,
body.stage-init #iframe-view,
body.stage-init header {
  display: none;
}

body.stage-login #loginContainer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: fixed;
  margin: auto;
  left: calc(50vw - 150px);
  top: 35vh;
}

body.stage-intro #iframe-view,
body.stage-intro #loginContainer,
body.stage-intro header {
  display: none;
}

body.stage-intro .stock-search {
  display: flex;
}

body.stage-iframe #iframe-view {
  display: flex;
}

body.stage-iframe .stock-search,
body.stage-iframe #loginContainer {
  display: none;
}

.loader-02 {
  border: 0.2em solid transparent;
  border-left-color: currentcolor;
  border-right-color: currentcolor;
  border-radius: 50%;
  -webkit-animation: 1s loader-02 linear infinite;
  animation: 1s loader-02 linear infinite;

  position: fixed;
  left: calc(50vw - 50px);
  top: 45vh;
}

.loader-02 {
  width: 100px;
  height: 100px;
}

body.iframe-loaded .loader-02 {
  display: none;
}

@-webkit-keyframes loader-02 {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

@keyframes loader-02 {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}