* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f3f3f3;
  color: #222;
}

.header {
  height: 64px;
  background: white;
  border-bottom: 1px solid #ddd;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 190px;
}

.brand-icon {
  width: 34px;
  height: 34px;
  background: #e5322d;
  color: white;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
}

.top-tools {
  display: flex;
  align-items: center;
  gap: 7px;
}

button {
  cursor: pointer;
}

.top-tools button,
.upload-btn {
  height: 36px;
  border: 1px solid #ccc;
  background: white;
  border-radius: 6px;
  padding: 0 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
}

.top-tools button:hover,
.upload-btn:hover {
  background: #f3f3f3;
}

.top-tools button.active {
  background: #ffe9e8;
  color: #e5322d;
  border-color: #e5322d;
}

#colorPicker {
  width: 38px;
  height: 36px;
  border: none;
  background: transparent;
}

#fontSize {
  width: 64px;
  height: 36px;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding-left: 8px;
}

.right-tools {
  display: flex;
  gap: 10px;
  width: 260px;
  justify-content: flex-end;
}

.apply-btn {
  height: 38px;
  border: none;
  background: #e5322d;
  color: white;
  border-radius: 6px;
  padding: 0 16px;
  font-weight: 700;
}

.apply-btn:hover {
  background: #c92723;
}

.main {
  display: flex;
  min-height: calc(100vh - 64px);
}

.sidebar {
  width: 210px;
  background: white;
  border-right: 1px solid #ddd;
  padding: 14px 10px;
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
}

.side {
  width: 100%;
  height: 42px;
  background: white;
  border: none;
  text-align: left;
  padding: 0 12px;
  border-radius: 7px;
  font-size: 15px;
  margin-bottom: 5px;
}

.side:hover,
.side.active {
  background: #ffe9e8;
  color: #e5322d;
  font-weight: 700;
}

.sidebar hr {
  border: none;
  border-top: 1px solid #eee;
  margin: 14px 0;
}

#pageInfo {
  margin-top: 14px;
  padding: 10px;
  background: #f7f7f7;
  border-radius: 7px;
  color: #666;
  font-size: 13px;
}

.workspace {
  flex: 1;
  padding: 34px 20px;
  overflow: auto;
}

.empty {
  width: 460px;
  margin: 90px auto;
  background: white;
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 36px;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.empty h1 {
  margin: 0 0 10px;
}

.empty p {
  color: #666;
}

.big-upload {
  margin-top: 16px;
  display: inline-flex;
  height: 48px;
  align-items: center;
  background: #e5322d;
  color: white;
  padding: 0 24px;
  border-radius: 7px;
  font-weight: 700;
  cursor: pointer;
}

#pagesContainer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 38px;
}

.page-wrapper {
  background: white;
  box-shadow: 0 2px 14px rgba(0,0,0,0.22);
}

.page-inner {
  position: relative;
  background: white;
  overflow: hidden;
}

.page-inner canvas {
  position: absolute;
  left: 0;
  top: 0;
}

.pdf-layer {
  z-index: 1;
}

.edit-layer {
  z-index: 2;
}

.page-label {
  text-align: center;
  color: #666;
  font-size: 13px;
  padding: 8px 0;
  background: #f7f7f7;
}

.canvas-container {
  position: absolute !important;
  left: 0 !important;
  top: 0 !important;
  z-index: 2;
}

@media (max-width: 1000px) {
  .top-tools {
    display: none;
  }

  .brand {
    width: auto;
  }

  .right-tools {
    width: auto;
  }

  .sidebar {
    width: 170px;
  }
}
.page-wrapper {
  position: relative;
}

.page-floating-toolbar {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  height: 38px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #ddd;
  box-shadow: 0 4px 14px rgba(0,0,0,0.16);
  border-radius: 8px;
  display: none;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  z-index: 30;
}

.page-wrapper:hover .page-floating-toolbar {
  display: flex;
}

.page-floating-toolbar button {
  height: 28px;
  border: 1px solid #ddd;
  background: white;
  border-radius: 5px;
  padding: 0 8px;
  font-size: 12px;
  cursor: pointer;
}

.page-floating-toolbar button:hover {
  background: #ffe9e8;
  color: #e5322d;
  border-color: #e5322d;
}

.page-floating-toolbar .page-mini-label {
  font-size: 12px;
  color: #666;
  padding: 0 6px;
}
.image-btn {
  height: 36px;
  border: 1px solid #ccc;
  background: white;
  border-radius: 6px;
  padding: 0 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.image-side {
  cursor: pointer;
  display: flex;
  align-items: center;
}
.lang-select {
  height: 38px;
  border: 1px solid #ccc;
  background: white;
  border-radius: 6px;
  padding: 0 8px;
  font-weight: 600;
  cursor: pointer;
}

.result-lang {
  position: fixed;
  top: 18px;
  right: 22px;
  z-index: 20;
}