:root {
  --bg-color: #f0f2f5;
  --panel-bg: #ffffff;
  --primary-blue: #007aff;
}

body,
html {
  height: 100%;
  margin: 0;
  padding: 0;
  background: var(--bg-color);
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-y: auto;
}

#status-bar {
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 20px;
  background: #e0e0e0;
  color: #666;
  font-weight: 500;
  transition: all 0.3s;
}

#status-bar.processing {
  background: var(--primary-blue);
  color: white;
  animation: pulse 1.5s infinite;
}

#status-bar.success {
  background: #34c759;
  color: white;
}

#status-bar.error {
  background: #ff3b30;
  color: white;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  75% { transform: translateX(2px); }
}

.main-layout {
  flex: 1 0 auto;
  display: flex;
  flex-direction: row;
  padding: 15px;
  box-sizing: border-box;
  gap: 20px;
}

.left-panel {
  flex: 4;
  min-width: 420px;
  background: var(--panel-bg);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 60px - 72px);
  box-sizing: border-box;
}

.right-panel {
  flex: 6;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
  max-height: calc(100vh - 60px - 72px);
}

.poster-section,
.cover-section-wrapper {
  flex-shrink: 0;
}

#cover-section {
  margin-top: 10px;
  transition: all 0.3s ease;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: 1px solid #dee2e6;
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  max-height: 2000px;
  overflow: hidden;
}

#cover-section.hidden {
  max-height: 0;
  padding: 0;
  border: none;
  margin: 0;
  opacity: 0;
  transform: translateY(-20px);
}

#cover-section > div:first-child {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  padding: 15px 20px;
  border-radius: 10px 10px 0 0;
  border-bottom: 1px solid #dee2e6;
}

#cover-section h3 {
  color: #495057;
  margin: 0 0 20px;
  font-size: 20px;
  border-bottom: 3px solid #4dabf7;
  padding-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

#cover-section h3::before {
  content: "🎨";
  font-size: 24px;
}

.table-wrapper {
  flex: 1 1 auto;
  overflow-y: auto;
  margin-top: 15px;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 0 8px;
}

.table-wrapper input {
  width: 80%;
  padding: 4px 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  outline: none;
  transition: all 0.2s;
  text-align: center;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

th {
  background: #f8f9fa;
  position: sticky;
  top: 0;
  font-size: 12px;
  padding: 10px;
  border-bottom: 2px solid #eee;
  z-index: 10;
}

td {
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}

td textarea {
  width: 100%;
  min-height: 42px;
  border: none;
  padding: 8px;
  box-sizing: border-box;
  display: block;
  resize: none;
  font-size: 13px;
  text-align: center;
  background: transparent;
  white-space: pre-wrap;
  word-break: break-all;
  overflow: hidden;
}

.m-input {
  width: 100%;
  min-width: 120px;
  min-height: 40px;
  padding: 4px 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  resize: vertical;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.4;
  vertical-align: middle;
  box-sizing: border-box;
}

.input-error {
  border: 1px solid #ff4d4f !important;
  background-color: #fff1f0 !important;
  animation: shake 0.3s;
}

.actions-sticky {
  position: sticky;
  bottom: 0;
  background: #fff;
  border-top: 1px solid #e6e6e6;
  z-index: 10;
  padding: 8px 0;
}

.poster-container {
  background: white;
  border-radius: 25px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  padding: 40px 20px;
  width: 100% !important;
  max-width: none;
  box-sizing: border-box;
  margin: 0 auto;
}

.poster-controls {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

#toggleIcon {
  margin-right: auto;
}

.weather-title {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 10px;
  color: #333;
  position: static;
  text-align: center;
}

.weather-note {
  font-size: 12px;
  color: #888;
  margin-top: 8px;
  position: static;
  text-align: right;
}

.weather-row {
  display: flex;
  width: 100%;
}

.weather-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 0;
  padding: 5px;
}

#top-row,
#bottom-row {
  display: grid;
  width: 100%;
  gap: 12px;
}

.status-text {
  font-size: 16px;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: pre-wrap;
  line-height: 1.2;
}

.wind-text {
  font-size: 12px;
  color: #888;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: pre-wrap;
  line-height: 1.1;
}

.date-title {
  font-size: 22px;
  font-weight: bold;
  color: #333;
}

.date-sub {
  font-size: 16px;
  color: #999;
  margin-bottom: 5px;
}

.icon-box {
  height: 55px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-box img {
  width: 48px;
  height: 48px;
}

.chart {
  width: 100%;
  height: 230px;
}

.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  font-size: 13px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-small {
  padding: 4px 10px;
  font-size: 12px;
  line-height: 1.2;
}

.btn-blue {
  background: var(--primary-blue);
  color: white;
}

.btn-blue:hover {
  background: #0056cc;
}

.btn-orange {
  background: #ff9500;
  color: white;
}

.btn-orange:hover {
  background: #e68a00;
}

.btn-green {
  background: #34c759;
  color: white;
}

.btn-green:hover {
  background: #2db34d;
}

.btn-gray {
  background: #f0f0f0;
  color: #666;
}

.btn-gray:hover {
  background: #e0e0e0;
}

.btn-del {
  color: #ff3b30;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 20px;
  width: 100%;
}

.btn-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #888;
}

.btn-close:hover {
  color: #333;
}

#cover-toggle-btn {
  font-size: 13px;
  padding: 8px 16px;
}

#cover-toggle-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

.modal-content {
  background-color: white;
  padding: 20px;
  border-radius: 8px;
  min-width: 500px;
  max-width: 80%;
  max-height: 90%;
  overflow-y: auto;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.modal-content > div {
  max-height: 70vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #eee;
}

.modal-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

#cover-canvas {
  width: 100%;
  height: auto;
  border: 1px solid #ced4da;
  border-radius: 4px;
  background: #fff;
}

#cover-section label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
  color: #495057;
  font-size: 14px;
}

#cover-section input[type="text"],
#cover-section input[type="file"] {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ced4da;
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 15px;
}

#cover-section input[type="color"] {
  cursor: pointer;
  border: 1px solid #ced4da;
  border-radius: 4px;
  padding: 2px;
  background: white;
}

#cover-preview-container {
  background: white;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border: 2px solid #e9ecef;
}

#cover-preview-container h4 {
  color: #495057;
  font-size: 16px;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

#cover-preview-container h4::before {
  content: "👁️";
}

.cover-info {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 15px;
  color: #6c757d;
  font-size: 13px;
}

.cover-info span {
  background: #f8f9fa;
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid #dee2e6;
}

.cover-control-group {
  margin-bottom: 15px;
}

.cover-control-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  color: #333;
}

.cover-control-group input[type="range"] {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #e9ecef;
  outline: none;
}

.cover-control-group input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #3682e0;
  cursor: pointer;
}

.cover-control-group input[type="number"] {
  width: 100%;
  padding: 5px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.cover-control-group textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  resize: vertical;
  font-family: inherit;
}

.cover-control-row {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 12px;
}

.cover-control-row label {
  min-width: 120px;
  margin-bottom: 0;
  white-space: nowrap;
}

.cover-control-row input[type="range"] {
  flex: 1;
}

.cover-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.cover-close-btn {
  background: #f0f0f0;
  border: 1px solid #ccc;
  color: #666;
  padding: 2px 8px;
  font-size: 12px;
  line-height: 1.5;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cover-close-btn:hover {
  background: #e0e0e0;
  border-color: #bbb;
  color: #333;
}

.cover-close-btn:active {
  background: #d0d0d0;
}

.close-preview-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.btn-group {
  display: flex;
  gap: 10px;
  margin-top: 15px;
  flex-wrap: wrap;
}

.cover-preview-img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid #dee2e6;
  display: block;
  margin: 0 auto;
}

.slider-value {
  display: inline-block;
  min-width: 40px;
  text-align: center;
  font-weight: 600;
  color: var(--primary-blue);
  background: #e8f4ff;
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 8px;
  font-size: 12px;
  border: 1px solid #c2e0ff;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
  transition: all 0.3s;
}

.table-wrapper::-webkit-scrollbar,
.modal-content::-webkit-scrollbar,
.modal-content > div::-webkit-scrollbar {
  width: 6px;
}

.table-wrapper::-webkit-scrollbar-track,
.modal-content::-webkit-scrollbar-track,
.modal-content > div::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.table-wrapper::-webkit-scrollbar-thumb,
.modal-content::-webkit-scrollbar-thumb,
.modal-content > div::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.table-wrapper::-webkit-scrollbar-thumb:hover,
.modal-content::-webkit-scrollbar-thumb:hover,
.modal-content > div::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

tr:nth-child(even) {
  background-color: #f9f9f9;
}

tr:hover {
  background-color: #f5f5f5;
  transition: background-color 0.2s;
}

th:nth-child(1),
td:nth-child(1) {
  width: 15%;
  min-width: 60px;
}

th:nth-child(2),
td:nth-child(2) {
  width: 15%;
  min-width: 60px;
}

th:nth-child(3),
td:nth-child(3) {
  width: 15%;
  min-width: 60px;
}

th:nth-child(4),
td:nth-child(4) {
  width: 35%;
  min-width: 100px;
}

th:nth-child(5),
td:nth-child(5) {
  width: 10%;
  min-width: 40px;
}

th:nth-child(6),
td:nth-child(6) {
  width: 10%;
  min-width: 40px;
}

@media (max-width: 1024px) {
  .main-layout {
    gap: 15px;
    padding: 10px;
  }

  .left-panel,
  .right-panel {
    min-width: 300px;
  }
}

@media (max-width: 768px) {
  .main-layout {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
  }

  .left-panel,
  .right-panel {
    width: 100%;
    min-width: 100%;
  }

  .poster-container {
    padding: 20px 10px;
    margin: 10px 0;
  }

  .weather-column {
    flex: 1 0 25%;
    padding: 3px;
  }

  .cover-control-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }

  .cover-control-row label {
    min-width: auto;
  }

  #cover-section {
    scroll-margin-top: 72px;
    padding: 15px;
  }
}

@media (max-width: 480px) {
  .btn {
    padding: 6px 12px;
    font-size: 12px;
  }

  .modal-content {
    min-width: 90%;
    padding: 15px;
  }

  .table-wrapper {
    font-size: 12px;
  }

  .m-input {
    font-size: 12px;
    padding: 3px 6px;
  }
}

@media print {
  .left-panel,
  #cover-section,
  .btn:not(.btn-print) {
    display: none !important;
  }

  .poster-container {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
  }

  .footer {
    display: none !important;
  }
}

.footer {
  background: #2c3e50;
  color: white;
  text-align: center;
  padding: 1.5rem;
  width: 100%;
  flex-shrink: 0;
}

.footer-content {
  margin: 0 auto;
}

.footer-content p {
  margin: 0;
}

.footer-sub {
  margin-top: 8px;
  font-size: 0.9rem;
  opacity: 0.8;
}