* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #667eea;
  --primary-dark: #5a6fd6;
  --secondary-color: #f0f0f5;
  --text-color: #333;
  --text-light: #666;
  --border-color: #e0e0e0;
  --success-color: #52c41a;
  --error-color: #ff4d4f;
  --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-gradient);
  min-height: 100vh;
  color: var(--text-color);
}

.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
  padding-bottom: 80px;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-info #currentUser {
  font-size: 14px;
  color: var(--text-light);
}

.profile-btn {
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-light);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.profile-btn:hover {
  border-color: var(--primary-color);
  background: rgba(102, 126, 234, 0.05);
}

.logo svg {
  background: linear-gradient(135deg, var(--primary-color) 0%, #764ba2 100%);
  border-radius: 8px;
}

.logo h1 {
  font-size: 24px;
  font-weight: 600;
  background: linear-gradient(135deg, var(--primary-color) 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.intro {
  text-align: center;
  padding: 20px 0 30px;
}

.intro p {
  font-size: 18px;
  color: var(--text-color);
  margin-bottom: 8px;
}

.intro .sub-text {
  font-size: 14px;
  color: var(--text-light);
}

.input-section {
  background: white;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  margin-bottom: 20px;
}

.input-section textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  font-size: 15px;
  resize: none;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
  font-family: inherit;
}

.input-section textarea:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-section textarea::placeholder {
  color: #999;
}

.btn-primary {
  width: 100%;
  margin-top: 16px;
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--primary-color) 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn-icon {
  font-size: 18px;
}

.result-section {
  background: white;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.result-loading {
  text-align: center;
  padding: 30px 0;
}

.loader {
  width: 48px;
  height: 48px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.result-loading p {
  font-size: 16px;
  color: var(--text-color);
  margin-bottom: 8px;
}

.loading-hint {
  font-size: 14px !important;
  color: var(--text-light) !important;
}

.result-success .success-header,
.result-error .error-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.success-icon, .error-icon {
  font-size: 24px;
}

.result-success h2 {
  color: var(--success-color);
  font-size: 20px;
}

.result-error h2 {
  color: var(--error-color);
  font-size: 20px;
}

.result-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.result-item {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
}

.result-item img {
  width: 100%;
  display: block;
}

.result-item video {
  width: 100%;
  display: block;
}

.result-item-info {
  padding: 12px;
  background: #fafafa;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.result-item-info span {
  font-size: 14px;
  color: var(--text-light);
}

.result-item-info button {
  padding: 6px 12px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s;
}

.result-item-info button:hover {
  background: var(--primary-dark);
}

.result-error {
  text-align: center;
}

.result-error p {
  font-size: 15px;
  color: var(--text-light);
  margin-bottom: 20px;
}

.btn-secondary {
  padding: 12px 24px;
  background: white;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
  border-radius: 10px;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-secondary:hover {
  background: rgba(102, 126, 234, 0.05);
}

.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 15px 20px;
  background: white;
  border-top: 1px solid var(--border-color);
}

.config-btn {
  width: 100%;
  padding: 12px;
  background: transparent;
  border: 1px dashed var(--border-color);
  border-radius: 10px;
  font-size: 14px;
  color: var(--text-light);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.config-btn:hover {
  border-color: var(--primary-color);
  background: rgba(102, 126, 234, 0.05);
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}

.modal {
  background: white;
  border-radius: 16px;
  width: 100%;
  max-width: 450px;
  overflow: hidden;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 600;
}

.close-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-light);
  border-radius: 8px;
  transition: background 0.2s;
}

.close-btn:hover {
  background: var(--secondary-color);
}

.modal-body {
  padding: 24px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-color);
}

.form-group input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.3s;
}

.form-group input:focus {
  border-color: var(--primary-color);
}

.form-group input::placeholder {
  color: #999;
}

.modal-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--border-color);
}

.modal-footer .btn-primary {
  margin-top: 0;
}

.copy-success {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 12px 24px;
  border-radius: 20px;
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.3s;
}

.copy-success.show {
  opacity: 1;
}

.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.login-card {
  background: white;
  border-radius: 20px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.login-card .logo {
  justify-content: center;
  margin-bottom: 30px;
}

.login-card h2 {
  text-align: center;
  font-size: 24px;
  margin-bottom: 30px;
  color: var(--text-color);
}

.login-card .form-group {
  margin-bottom: 20px;
}

.login-card .btn-primary {
  margin-top: 20px;
}

.forgot-link {
  text-align: center;
  margin-top: 16px;
}

.forgot-link a {
  color: var(--primary-color);
  font-size: 14px;
  text-decoration: none;
}

.forgot-link a:hover {
  text-decoration: underline;
}

.default-info {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.default-info p {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 4px;
}

.profile-card {
  background: white;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.profile-card h2 {
  font-size: 20px;
  margin-bottom: 20px;
  color: var(--text-color);
}

.profile-card h3 {
  font-size: 16px;
  margin: 24px 0 16px;
  color: var(--text-color);
}

.current-user {
  padding: 16px;
  background: var(--secondary-color);
  border-radius: 12px;
  margin-bottom: 20px;
}

.current-user .label {
  font-size: 14px;
  color: var(--text-light);
}

.current-user .value {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary-color);
}

.profile-card .actions {
  margin-top: 24px;
  display: flex;
  gap: 12px;
}

.profile-card .actions button {
  flex: 1;
}

@media (max-width: 480px) {
  .container {
    padding: 15px;
  }

  .input-section,
  .result-section {
    padding: 20px;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 16px 20px;
  }
}