/* WzSLinker 通用样式 */

* {
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 14px;
  margin: 0;
  padding: 0;
  background-color: #f4f4f4;
  color: #333;
  line-height: 1.4;
}

.container {
  padding: 15px;
}

h1, h2, h3 {
  color: #0056b3;
  margin-top: 0;
  margin-bottom: 15px;
}

h1 {
  font-size: 1.4em;
  text-align: center;
}

h2 {
  font-size: 1.1em;
  border-bottom: 1px solid #eee;
  padding-bottom: 5px;
}

h3 {
  font-size: 1em;
  color: #555;
}

button {
  background-color: #007bff;
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s ease;
  font-family: inherit;
}

button:hover {
  background-color: #0056b3;
}

button:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
}

button.danger {
  background-color: #dc3545;
}

button.danger:hover {
  background-color: #c82333;
}

button.success {
  background-color: #28a745;
}

button.success:hover {
  background-color: #218838;
}

input[type="text"],
input[type="number"],
input[type="file"],
textarea,
select {
  border: 1px solid #ccc;
  padding: 8px;
  border-radius: 4px;
  width: 100%;
  box-sizing: border-box;
  margin-top: 5px;
  margin-bottom: 10px;
  font-family: inherit;
  font-size: 14px;
}

input[type="color"] {
  width: 50px;
  height: 35px;
  border: none;
  padding: 0;
  cursor: pointer;
  background: none;
}

label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  color: #555;
}

.section {
  background-color: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 15px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.flex-container {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.flex-container.column {
  flex-direction: column;
  align-items: flex-start;
}

.flex-container.space-between {
  justify-content: space-between;
}

.message {
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 10px;
  font-weight: bold;
  text-align: center;
}

.message.success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.message.error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.message.info {
  background-color: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 20px;
  margin: 0 10px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 20px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #007bff;
}

input:focus + .slider {
  box-shadow: 0 0 1px #007bff;
}

input:checked + .slider:before {
  transform: translateX(14px);
}

/* 滚动条样式 */
.scrollable {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid #eee;
  border-radius: 5px;
  background-color: #fdfdfd;
}

.scrollable::-webkit-scrollbar {
  width: 8px;
}

.scrollable::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.scrollable::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

.scrollable::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* 列表样式 */
.list-item {
  padding: 8px 10px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.list-item:hover {
  background-color: #f8f9fa;
}

.list-item .content {
  flex-grow: 1;
  margin-right: 10px;
}

.list-item .actions {
  display: flex;
  gap: 5px;
}

.list-item .actions button {
  padding: 3px 8px;
  font-size: 0.8em;
}

/* 工具提示 */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip .tooltiptext {
  visibility: hidden;
  width: 200px;
  background-color: #555;
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 5px;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  margin-left: -100px;
  opacity: 0;
  transition: opacity 0.3s;
  font-size: 12px;
}

.tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}

/* 个股全情悬浮窗样式 */
.wzslinker-float-window {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90vw;
  max-width: 1400px;
  height: 85vh;
  max-height: 900px;
  min-width: 600px;
  min-height: 400px;
  background: #0a0a0a;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
  z-index: 999999;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.wzslinker-float-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
  border-bottom: 1px solid #333;
  cursor: move;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.wzslinker-float-title {
  color: #fff;
  font-size: 16px;
  font-weight: bold;
  flex-grow: 1;
}

.wzslinker-float-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.wzslinker-float-close:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: rotate(90deg);
}

.wzslinker-float-content {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.wzslinker-float-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 16px;
  z-index: 10;
  background: rgba(0, 0, 0, 0.7);
  padding: 15px 30px;
  border-radius: 8px;
  display: none;
}

.wzslinker-float-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  background: #000;
}

/* 响应式设计 */
@media (max-width: 400px) {
  .container {
    padding: 10px;
  }
  
  .flex-container {
    flex-direction: column;
    align-items: stretch;
  }
  
  button {
    width: 100%;
    margin-bottom: 5px;
  }
  
  .wzslinker-float-window {
    width: 95vw;
    height: 90vh;
    min-width: 320px;
  }
}
